-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanimation.html
127 lines (111 loc) · 3.69 KB
/
animation.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.9.1/css/bulma.min.css">
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"
integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css2?family=Merriweather&display=swap" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.1/vue.js"></script>
<style>
.shake {
animation: shake 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
transform: translate3d(0, 0, 0);
}
@keyframes shake {
10%,
90% {
transform: translate3d(-1px, 0, 0);
}
20%,
80% {
transform: translate3d(2px, 0, 0);
}
30%,
50%,
70% {
transform: translate3d(-4px, 0, 0);
}
40%,
60% {
transform: translate3d(4px, 0, 0);
}
}
.v-enter-active,
.v-leave-active {
transition: opacity 0.5s ease;
}
.v-enter-from,
.v-leave-to {
opacity: 0;
}
</style>
</head>
<body>
<nav class="navbar" role="navigation" aria-label="main navigation">
<div class="navbar-brand">
<a class="navbar-item" href="https://bulma.io">
<img src="https://upload.wikimedia.org/wikipedia/commons/9/95/Vue.js_Logo_2.svg" width="148"
height="36">
</a>
</div>
<div class="navbar-menu">
<div class="navbar-end">
<a class="navbar-item" href="/index.html">
HOME
</a>
<a class="navbar-item" href="/pokemon.html">
POKEMON
</a>
<a class="navbar-item" href="/about.html">
ABOUT
</a>
<a class="navbar-item" href="/animation.html">
ANIMATION
</a>
<a class="navbar-item" href="/conditional.html">
CONDITION
</a>
</div>
</div>
</nav>
<!-- Hero del producto -->
<section class="hero is-white" id="app">
<div v-if="isOpened" class="hero-body" :class="{ shake: isOpened }">
<p class="has-text-primary">
Lorem ipsum dolor sit amet consectetur adipisicing elit. Consequatur, eius.
</p>
</div>
<div class="container">
<button class="button is-dark" @click="isOpened = !isOpened">
{{ isOpened ? 'Close' : 'Open' }}
</button>
</div>
<Transition>
<div v-if="show" class="hero-body">
<p class="has-text-primary">
Lorem ipsum dolor sit amet consectetur adipisicing elit. Consequatur, eius.
</p>
</div>
</Transition>
<div class="container">
<button class="button is-light" @click="show = !show">
{{ show ? 'Close' : 'Open' }}
</button>
</div>
</section>
<script>
let app = new Vue({
el: "#app",
data() {
return {
isOpened: false,
show: false
}
},
});
</script>
</body>
</html>