-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.html
180 lines (180 loc) · 5.16 KB
/
index.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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<title>Vue Aos</title>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/magic/1.1.0/magic.min.css"
/>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.2/animate.min.css"
/>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/0.7.4/tailwind.min.css"
/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.10/vue.min.js"></script>
<style>
.list li {
list-style: none;
transition: transform 0.5s ease-in-out;
transform: scale(calc(0.25 + (var(--isIntersecting, 1) * 0.75)));
}
</style>
</head>
<body>
<div id="app" class="container mx-auto pt-10">
<h2
class="text-center mb-32"
v-vue-aos.once="{'animationClass': 'bounceInLeft animated'}"
>
Vue AOS
</h2>
<div
v-vue-aos.once="{'animationClass': 'bounceInRight animated'}"
class="mb-32 text-center"
>
A Vue component to add Animation on scroll to a Vue component or HTML
element.
</div>
<div
class="mb-32 py-32 text-center text-blue"
v-vue-aos.once='{animationClass:"infinite animated tada"}'
>
Scroll down
<div>
<img
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAAG0lEQVR42mNgwAfKy8v/48I4FeA0AacVDFQBAP9wJkE/KhUMAAAAAElFTkSuQmCC"
/>
</div>
</div>
<h2 class="mb-10">
Use with
<a href="https://github.com/daneden/animate.css" target="_blank"
>Animatecss Effect</a
>
</h2>
<div class="flex flex-wrap -mx-16">
<div class="w-full md:w-1/2 my-24 px-16" v-for="item in animateCss">
<div
class="bg-red px-10 py-16 text-center"
v-vue-aos="{'animationClass': `${item.class} animated`, threshold: item.threshold}"
>
{{item.class}} threshold: {{item.threshold}}
</div>
</div>
</div>
<h2 class="mb-10">
Use with
<a href="https://github.com/miniMAC/magic">Magic Effect</a>
</h2>
<div class="flex flex-wrap -mx-16">
<div class="w-full md:w-1/2 px-16 my-24" v-for="item in magicCss">
<div
class="bg-red px-10 py-16 text-center"
v-vue-aos="{'animationClass': `${item.class} magictime`, threshold: item.threshold}"
>
{{item.class}} threshold: {{item.threshold}}
</div>
</div>
</div>
<h2 class="mb-10">
Use with css variable --isIntersecting with selector. I use
v-vue-aos="{selector: 'li'}" in ul html element
</h2>
<ul class="flex flex-wrap -mx-16 list" v-vue-aos="{selector: 'li'}">
<li class="w-full md:w-1/2 px-16 my-24" v-for="i in 20">
<div class="bg-red px-10 py-16 text-center">
transition: transform 0.5s ease-in-out;<br>
transform: scale(calc(0.25 + (var(--isIntersecting, 1) * 0.75)));
</div>
</li>
</ul>
</div>
<script type="module">
import VueAos from './dist/vue-aos.js'
Vue.use(VueAos)
new Vue({
el: '#app',
data: function() {
return {
animateCss: [
{
class: 'fadeInDownBig',
threshold: 0,
},
{
class: 'fadeInUpBig',
threshold: 0,
},
{
class: 'rotateInDownLeft',
threshold: 0,
},
{
class: 'rotateInDownRight',
threshold: 0,
},
{
class: 'zoomInLeft',
threshold: 0,
},
{
class: 'zoomInRight',
threshold: 0,
},
],
magicCss: [
{
class: 'twisterInDown',
threshold: 0,
},
{
class: 'twisterInUp',
threshold: 0,
},
{
class: 'puffIn',
threshold: 0,
},
{
class: 'vanishIn',
threshold: 0,
},
{
class: 'openDownLeftRetourn',
threshold: 0,
},
{
class: 'openDownRightRetourn',
threshold: 0,
},
{
class: 'perspectiveLeftRetourn',
threshold: 0,
},
{
class: 'perspectiveRightRetourn',
threshold: 0,
},
{
class: 'swashIn',
threshold: 0,
},
{
class: 'foolishIn',
threshold: 0,
},
],
}
},
})
</script>
</body>
</html>