forked from kombai/freewall
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcss-animate.html
96 lines (84 loc) · 2.25 KB
/
css-animate.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
<!DOCTYPE html>
<html>
<head>
<title>CSS Animation</title>
<meta content="text/html; charset=utf-8" http-equiv="content-type">
<meta name="description" content="CSS Animation" />
<meta name="keywords" content="javascript, dynamic, grid, layout, css animate"/>
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="../freewall.js"></script>
<style type="text/css">
html {
height: 100%;
}
body {
height: 100%;
}
.free-wall {
height: 102%;
margin: 15px;
}
@keyframes start {
from {
transform: scale(0);
}
to {
transform: scale(1);
}
}
@-webkit-keyframes start {
from {
-webkit-transform: scale(0);
}
to {
-webkit-transform: scale(1);
}
}
.free-wall .cell[data-state="init"] {
display: none;
}
.free-wall .cell[data-state="start"] {
display: block;
animation: start 0.5s;
-webkit-animation: start 0.5s;
}
.free-wall .cell[data-state="move"] {
transition: top 0.5s, left 0.5s, width 0.5s, height 0.5s;
-webkit-transition: top 0.5s, left 0.5s, width 0.5s, height 0.5s;
}
</style>
</head>
<body>
<div class='header'>
<div class="clearfix">
<div class="float-left">
<h1><a href="http://vnjs.net/www/project/freewall/">Free Wall</a></h1>
<div class='target'>Creating dynamic grid layout.</div>
</div>
</div>
</div>
<div id="freewall" class="free-wall"></div>
<script type="text/javascript">
var temp = "<div class='cell' style='width:{width}px; height: {height}px; background-image: url(i/photo/{index}.jpg)'></div>";
var w = 200, h = 200, html = '', limitItem = 49;
for (var i = 0; i < limitItem; ++i) {
html += temp.replace(/\{height\}/g, h).replace(/\{width\}/g, w).replace("{index}", i + 1);
}
$("#freewall").html(html);
var wall = new freewall("#freewall");
wall.reset({
selector: '.cell',
animate: false,
cellW: 200,
cellH: 200,
delay: 50,
onResize: function() {
ewall.fitWidth();
}
});
wall.fitWidth();
</script>
</body>
</html>