-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
128 lines (100 loc) · 3.07 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
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/riot/2.2.2/riot+compiler.min.js"></script>
<script src="riotAnimate.min.js"></script>
<link rel="stylesheet" href="demo/animate.css">
<script>
/**
* Provides requestAnimationFrame in a cross browser way.
* @author paulirish / http://paulirish.com/
*/
if (!window.requestAnimationFrame) {
window.requestAnimationFrame = (function() {
return window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function( /* function FrameRequestCallback */ callback, /* DOMElement Element */ element) {
window.setTimeout(callback, 1000 / 60);
};
})();
}
</script>
</head>
<body>
<style>
body {
background: #EAEAEA;
font-family: sans-serif;
}
.card, .card-main {
box-shadow: 0 2px 2px rgba(0,0,0,0.3);
padding: 1rem;
background: white;
margin: 1rem;
}
.card {
max-width: 300px;
display: inline-block;
float:left;
}
.card-fade {
max-width:100%;
float: none;
}
.card-fade:after{
content: '';
clear: both;
}
code {
font-family: sans-serif;
font-size: 1rem;
font-weight: 300;
}
.fade.riot-animate {
transition:0.5s linear all;
}
.fade.riot-enter,
.fade.riot-leave.riot-leave-active {
opacity:0;
}
.fade.riot-enter.riot-enter-active ,
.fade.riot-leave {
opacity:1;
}
</style>
<div class="card-main">
<code>
These cards are being animated by animate.css. You can easily use animate.css to have the attributes animate, animate-enter, and animate-leave, along with adding animate-delay and animate-duration. <br /><br />
In addition, you can have an animation CSS class and use an ngAnimate style system, linking animations to 'riot-enter', 'riot-enter-active', 'riot-leave', and 'riot-leave-active'
</code>
</div>
<timer></timer>
<script type="riot/tag">
<timer>
<div class="card card-fade" animate="fade" animate-duration="300ms" animate-delay="1000ms">
<p class="">Using ngAnimate style classes</p>
</div>
<div class="card" each="{item, i in items}" animate="zoomIn" animate-leave="zoomOut" animate-duration="300ms" animate-delay="{i*20}ms">
<p class="">Using animate.css</p>
</div>
this.items = opts.items;
setTimeout(function(){
this.animatedUnmount();
}.bind(this),3000);
this.mixin(riotAnimate);
</timer>
</script>
<script>
var items = [];
for(var x=0;x<100;x++) {
items.push({time: 'time'})
}
riot.mount('timer', {
items: items
});
</script>
</body>
</html>