forked from opt-luo/DemoHouse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex3.html
240 lines (233 loc) · 9.98 KB
/
index3.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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Image Grid Effects | Demo 3 | Codrops</title>
<meta name="description" content="Effect inspiration for opening an image grid item." />
<meta name="keywords" content="image grid, effect, inspiration, css, javascript, animation, masonry" />
<meta name="author" content="Codrops" />
<link rel="shortcut icon" href="favicon.ico">
<link rel="stylesheet" type="text/css" href="css/normalize.css" />
<link rel="stylesheet" type="text/css" href="fonts/font-awesome-4.3.0/css/font-awesome.min.css" />
<link rel="stylesheet" type="text/css" href="css/demo.css" />
<link rel="stylesheet" type="text/css" href="css/style3.css" />
<script src="js/modernizr-custom.js"></script>
</head>
<body class="demo-3">
<div class="container">
<header class="codrops-header">
<div class="codrops-links">
<a class="codrops-icon codrops-icon--prev" href="http://tympanus.net/Tutorials/CSSProgress/" title="Previous Demo"><span>Previous Demo</span></a>
<a class="codrops-icon codrops-icon--drop" href="http://tympanus.net/codrops/?p=25256" title="Back to the article"><span>Back to the Codrops article</span></a>
</div>
<h1>Image Grid Effects <span>Animations for photography grids</span></h1>
<nav class="codrops-demos">
<a href="index.html">Demo 1</a>
<a href="index2.html">Demo 2</a>
<a class="current-demo" href="index3.html">Demo 3</a>
<a href="index4.html">Demo 4</a>
<a href="index5.html">Demo 5</a>
<a href="index6.html">Demo 6</a>
</nav>
</header>
<div class="content">
<div class="grid">
<div class="grid__item" data-size="1280x853">
<a href="img/original/1.jpg" class="img-wrap"><img src="img/thumbs/1.jpg" alt="img01" />
<div class="description description--grid">Assemblage</div>
</a>
</div>
<div class="grid__item" data-size="958x1280">
<a href="img/original/2.jpg" class="img-wrap"><img src="img/thumbs/2.jpg" alt="img02" />
<div class="description description--grid">Demesne</div>
</a>
</div>
<div class="grid__item" data-size="837x1280">
<a href="img/original/3.jpg" class="img-wrap"><img src="img/thumbs/3.jpg" alt="img03" />
<div class="description description--grid">Felicity</div>
</a>
</div>
<div class="grid__item" data-size="1280x961">
<a href="img/original/4.jpg" class="img-wrap"><img src="img/thumbs/4.jpg" alt="img04" />
<div class="description description--grid">Propinquity</div>
</a>
</div>
<div class="grid__item" data-size="1280x1131">
<a href="img/original/5.jpg" class="img-wrap"><img src="img/thumbs/5.jpg" alt="img05" />
<div class="description description--grid">Ephemeral</div>
</a>
</div>
<div class="grid__item" data-size="1280x857">
<a href="img/original/6.jpg" class="img-wrap"><img src="img/thumbs/6.jpg" alt="img06" />
<div class="description description--grid">Surreptitious</div>
</a>
</div>
<div class="grid__item" data-size="1280x1280">
<a href="img/original/7.jpg" class="img-wrap"><img src="img/thumbs/7.jpg" alt="img07" />
<div class="description description--grid">Scintilla</div>
</a>
</div>
<div class="grid__item" data-size="1280x853">
<a href="img/original/8.jpg" class="img-wrap"><img src="img/thumbs/8.jpg" alt="img08" />
<div class="description description--grid">Vestigial</div>
</a>
</div>
<div class="grid__item" data-size="865x1280">
<a href="img/original/9.jpg" class="img-wrap"><img src="img/thumbs/9.jpg" alt="img09" />
<div class="description description--grid">Zephyr</div>
</a>
</div>
<div class="grid__item" data-size="1280x1280">
<a href="img/original/10.jpg" class="img-wrap"><img src="img/thumbs/10.jpg" alt="img10" />
<div class="description description--grid">Desideratum</div>
</a>
</div>
<div class="grid__item" data-size="1280x850">
<a href="img/original/11.jpg" class="img-wrap"><img src="img/thumbs/11.jpg" alt="img11" />
<div class="description description--grid">Quixotic</div>
</a>
</div>
<div class="grid__item" data-size="1280x853">
<a href="img/original/1.jpg" class="img-wrap"><img src="img/thumbs/1.jpg" alt="img01" />
<div class="description description--grid">Assemblage</div>
</a>
</div>
<div class="grid__item" data-size="958x1280">
<a href="img/original/2.jpg" class="img-wrap"><img src="img/thumbs/2.jpg" alt="img02" />
<div class="description description--grid">Demesne</div>
</a>
</div>
<div class="grid__item" data-size="837x1280">
<a href="img/original/3.jpg" class="img-wrap"><img src="img/thumbs/3.jpg" alt="img03" />
<div class="description description--grid">Felicity</div>
</a>
</div>
<div class="grid__item" data-size="1280x961">
<a href="img/original/4.jpg" class="img-wrap"><img src="img/thumbs/4.jpg" alt="img04" />
<div class="description description--grid">Propinquity</div>
</a>
</div>
<div class="grid__item" data-size="1280x1131">
<a href="img/original/5.jpg" class="img-wrap"><img src="img/thumbs/5.jpg" alt="img05" />
<div class="description description--grid">Ephemeral</div>
</a>
</div>
<div class="grid__item" data-size="1280x857">
<a href="img/original/6.jpg" class="img-wrap"><img src="img/thumbs/6.jpg" alt="img06" />
<div class="description description--grid">Surreptitious</div>
</a>
</div>
<div class="grid__item" data-size="1280x1280">
<a href="img/original/7.jpg" class="img-wrap"><img src="img/thumbs/7.jpg" alt="img07" />
<div class="description description--grid">Scintilla</div>
</a>
</div>
<div class="grid__item" data-size="1280x853">
<a href="img/original/8.jpg" class="img-wrap"><img src="img/thumbs/8.jpg" alt="img08" />
<div class="description description--grid">Vestigial</div>
</a>
</div>
<div class="grid__item" data-size="865x1280">
<a href="img/original/9.jpg" class="img-wrap"><img src="img/thumbs/9.jpg" alt="img09" />
<div class="description description--grid">Zephyr</div>
</a>
</div>
<div class="grid__item" data-size="1280x1280">
<a href="img/original/10.jpg" class="img-wrap"><img src="img/thumbs/10.jpg" alt="img10" />
<div class="description description--grid">Desideratum</div>
</a>
</div>
<div class="grid__item" data-size="1280x850">
<a href="img/original/11.jpg" class="img-wrap"><img src="img/thumbs/11.jpg" alt="img11" />
<div class="description description--grid">Quixotic</div>
</a>
</div>
</div>
<!-- /grid -->
<div class="preview">
<button class="action action--close"><i class="fa fa-times"></i><span class="text-hidden">Close</span></button>
<div class="description description--preview"></div>
</div>
<!-- /preview -->
</div>
<!-- /content -->
<!-- Related demos -->
<section class="content content--related">
<p>Images from <a href="http://www.unsplash.com">Unsplash.com</a></p>
<p>If you enjoyed this demo you might also like:</p>
<a class="media-item" href="http://tympanus.net/Development/AnimatedGridLayout/">
<img class="media-item__img" src="img/related/GridItemAnimation.jpg">
<h3 class="media-item__title">Grid Item Animation Layout</h3>
</a>
<a class="media-item" href="http://tympanus.net/Tutorials/ShapeHoverEffectSVG/">
<img class="media-item__img" src="img/related/ShapeHoverEffect.png">
<h3 class="media-item__title">Shape Hover Effect with SVG</h3>
</a>
</section>
</div>
<!-- /container -->
<script src="js/imagesloaded.pkgd.min.js"></script>
<script src="js/masonry.pkgd.min.js"></script>
<script src="js/classie.js"></script>
<script src="js/main.js"></script>
<script>
(function() {
var support = { transitions: Modernizr.csstransitions },
// transition end event name
transEndEventNames = { 'WebkitTransition': 'webkitTransitionEnd', 'MozTransition': 'transitionend', 'OTransition': 'oTransitionEnd', 'msTransition': 'MSTransitionEnd', 'transition': 'transitionend' },
transEndEventName = transEndEventNames[ Modernizr.prefixed( 'transition' ) ],
onEndTransition = function( el, callback ) {
var onEndCallbackFn = function( ev ) {
if( support.transitions ) {
if( ev.target != this ) return;
this.removeEventListener( transEndEventName, onEndCallbackFn );
}
if( callback && typeof callback === 'function' ) { callback.call(this); }
};
if( support.transitions ) {
el.addEventListener( transEndEventName, onEndCallbackFn );
}
else {
onEndCallbackFn();
}
};
new GridFx(document.querySelector('.grid'), {
imgPosition : {
x : 1,
y : 0.75
},
pagemargin : 50,
onOpenItem : function(instance, item) {
instance.items.forEach(function(el) {
if(item != el) {
var delay = Math.floor(Math.random() * 150);
el.style.WebkitTransition = 'opacity .4s ' + delay + 'ms cubic-bezier(.7,0,.3,1), -webkit-transform .4s ' + delay + 'ms cubic-bezier(.7,0,.3,1)';
el.style.transition = 'opacity .4s ' + delay + 'ms cubic-bezier(.7,0,.3,1), transform .4s ' + delay + 'ms cubic-bezier(.7,0,.3,1)';
el.style.WebkitTransform = 'translate3d(0,400px,0)';
el.style.transform = 'translate3d(0,400px,0)';
el.style.opacity = 0;
}
});
},
onCloseItem : function(instance, item) {
instance.items.forEach(function(el) {
if(item != el) {
el.style.WebkitTransition = 'opacity .3s, -webkit-transform .3s';
el.style.transition = 'opacity .3s, transform .3s';
el.style.WebkitTransform = 'translate3d(0,0,0)';
el.style.transform = 'translate3d(0,0,0)';
el.style.opacity = 1;
onEndTransition(el, function() {
el.style.transition = 'none';
el.style.WebkitTransform = 'none';
});
}
});
}
});
})();
</script>
</body>
</html>