-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
49 lines (44 loc) · 1.19 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>CSS3 Coverflow (OS X like) - works in Webkit only</title>
<link rel="stylesheet" href="styles/css/reset.css">
<link rel="stylesheet" href="styles/css/styles.css">
</head>
<body>
<article class="coverflow"></article>
<script src="js/utils/requestAnimFrame.js"></script>
<script src="js/coverflow.js"></script>
<script>
// 50 max is sensible
var numItems = 50;
var types = [
'food',
'animals',
'abstract',
'city',
'nightlife',
'fashion',
'people',
'nature',
'sports',
'technics',
'transport'
];
for (var i = 0, markup = ''; i < numItems; i++)
{
markup += '<li><a href="#"><img data-id="' + i + '" src="http://lorempixel.com/150/150/'
+ types[Math.floor(Math.random() * types.length)]
+ '?' + Math.floor(Math.random() * 10000)
+ '"></a></li>';
}
var wrapper = document.createElement('div');
wrapper.classList.add('wrapper');
wrapper.innerHTML = '<ul>' + markup + '</ul>';
var coverflowDOM = document.querySelectorAll('.coverflow')[0];
coverflowDOM.appendChild(wrapper);
coverflow.bind(coverflowDOM);
</script>
</body>
</html>