-
Notifications
You must be signed in to change notification settings - Fork 39
/
demo.html
240 lines (205 loc) · 9.82 KB
/
demo.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>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>jQuery Coverflow</title>
<!-- jQuery/jQueryUI (hosted) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.js"></script>
<!-- Optional: Reflection -->
<script type="text/javascript" src="reflection.js"></script>
<!-- interpolate, depends on jQ 1.8.0+ -->
<script src="jquery.interpolate.min.js"></script>
<!-- Coverflow -->
<script src="jquery.coverflow.js"></script>
<style>
body {
font-family: "Segoe UI", Verdana, Helvetica, Arial, sans-serif;
font-size: 11px;
}
.coverflow {
height: 100px;
border-bottom: solid 2px black;
}
.coverflow .cover {
width: 100px;
height: 100px;
cursor: pointer;
font-size: 500%;
border: solid 2px black;
text-align: center;
background: #e2e2e2; /* Old browsers */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2UyZTJlMiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjUwJSIgc3RvcC1jb2xvcj0iI2RiZGJkYiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjUxJSIgc3RvcC1jb2xvcj0iI2QxZDFkMSIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNmZWZlZmUiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
background: -moz-linear-gradient(top, #e2e2e2 0%, #dbdbdb 50%, #d1d1d1 51%, #fefefe 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#e2e2e2), color-stop(50%,#dbdbdb), color-stop(51%,#d1d1d1), color-stop(100%,#fefefe)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #e2e2e2 0%,#dbdbdb 50%,#d1d1d1 51%,#fefefe 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #e2e2e2 0%,#dbdbdb 50%,#d1d1d1 51%,#fefefe 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #e2e2e2 0%,#dbdbdb 50%,#d1d1d1 51%,#fefefe 100%); /* IE10+ */
background: linear-gradient(to bottom, #e2e2e2 0%,#dbdbdb 50%,#d1d1d1 51%,#fefefe 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e2e2e2', endColorstr='#fefefe',GradientType=0 ); /* IE6-8 */
}
.coverflow .cover.current {
opacity: 1;
border-bottom: none;
box-shadow: 0 0 16px rgba(0,0,0,.5);
background: #ffffff; /* Old browsers */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjUwJSIgc3RvcC1jb2xvcj0iI2YzZjNmMyIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjUxJSIgc3RvcC1jb2xvcj0iI2VkZWRlZCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNmZmZmZmYiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
background: -moz-linear-gradient(top, #ffffff 0%, #f3f3f3 50%, #ededed 51%, #ffffff 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(50%,#f3f3f3), color-stop(51%,#ededed), color-stop(100%,#ffffff)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #ffffff 0%,#f3f3f3 50%,#ededed 51%,#ffffff 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #ffffff 0%,#f3f3f3 50%,#ededed 51%,#ffffff 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #ffffff 0%,#f3f3f3 50%,#ededed 51%,#ffffff 100%); /* IE10+ */
background: linear-gradient(to bottom, #ffffff 0%,#f3f3f3 50%,#ededed 51%,#ffffff 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#ffffff',GradientType=0 ); /* IE6-8 */
}
.coverflow .cover.current:after {
content: ' ';
background-color: white;
display: block;
position: absolute;
width: 132px;
height: 16px;
left: -16px;
bottom: -16px;
}
/* CD covers */
.photos .cover {
cursor: pointer;
/*-webkit-box-reflect: below 0px -webkit-gradient(linear, left top, left bottom, from(transparent), color-stop(50%, transparent), to(rgba(255, 255, 255, .5)));*/
}
#photos-info {
position: relative;
text-align: center;
z-index: 1000;
text-shadow: 0 0 8px white;
}
#photos-name {
font-size: 200%;
font-weight: bold;
}
.clearfix {
clear: both;
}
</style>
<script>
$(function() {
// Alphabet
$('.coverflow').coverflow();
$('#first').click(function() {
$('.coverflow').coverflow('index', 0);
});
$('#last').click(function() {
$('.coverflow').coverflow('index', -1);
});
$('#goto6').click(function() {
$('.coverflow').coverflow('index', 6-1); // zero-based index!
});
$('#keyboard').click(function() {
$('.coverflow').coverflow('option', 'enableKeyboard', $(this).is(':checked'));
});
$('#wheel').click(function() {
$('.coverflow').coverflow('option', 'enableWheel', $(this).is(':checked'));
});
$('#click').click(function() {
$('.coverflow').coverflow('option', 'enableClick', $(this).is(':checked'));
});
/* CD covers */
if ($.fn.reflect) {
$('.photos .cover').reflect();
}
$('.photos').coverflow({
easing: 'easeOutElastic',
duration: 1000,
index: 3,
width: 320,
height: 240,
visible: 'density',
selectedCss: { opacity: 1 },
outerCss: { opacity: .1 },
confirm: function() {
console.log('Confirm');
},
before: function() {
$('#photos-name').stop(true).fadeOut('fast');
},
select: function(event, cover) {
var img = $(cover).children().andSelf().filter('img').last();
$('#photos-name').text(img.data('name') || 'unknown').stop(true).fadeIn('fast');
},
});
$('#leakdetect').click(function() {
$('#leakbucket').empty();
for (var i = 0; i < 100; ++i) {
$('<div><div>test</div></div>').appendTo('#leakbucket').coverflow();
}
});
});
</script>
</head>
<body>
<h1>Coverflow</h1>
jQuery Coverflow effect with luxurious transformations (CSS3!) support for reflections and gracefull(ish) degradation.
<h2>Examples</h2>
<h3>Alphabet selector</h3>
<div style="position:absolute;background:rgba(255,255,255,.75);z-index:1000;padding:10px">
<button id="first">first</button>
<button id="goto6">Go to #6</button>
<button id="last">last</button>
<br/><label for="keyboard"><input type="checkbox" id="keyboard" checked/>Keyboard</label>
<br/><label for="click"><input type="checkbox" id="click" checked/>Click/tap</label>
<br/><label for="wheel"><input type="checkbox" id="wheel" checked/>Scroll wheel</label>
</div>
<div class="coverflow">
<div class="cover">A</div>
<div class="cover">B</div>
<div class="cover">C</div>
<div class="cover">D</div>
<div class="cover">E</div>
<div class="cover">F</div>
<div class="cover">G</div>
<div class="cover">H</div>
<div class="cover">I</div>
<div class="cover">J</div>
<div class="cover">K</div>
<div class="cover">L</div>
<div class="cover">M</div>
<div class="cover">N</div>
<div class="cover">O</div>
<div class="cover">P</div>
<div class="cover">Q</div>
<div class="cover">R</div>
<div class="cover">S</div>
<div class="cover">T</div>
<div class="cover">U</div>
<div class="cover">V</div>
<div class="cover">W</div>
<div class="cover">X</div>
<div class="cover">Y</div>
<div class="cover">Z</div>
</div>
<h3>CD Covers</h3>
<div class="photos" autofocus>
<img class="cover" data-name="Attic" src="demo/attic.jpg"/>
<img class="cover" data-name="Aurora Borealis" src="demo/aurora.jpg"/>
<img class="cover" data-name="Barbecued steak" src="demo/barbecue.jpg"/>
<img class="cover" data-name="Black swan" src="demo/blackswan.jpg"/>
<img class="cover" data-name="Chess" src="demo/chess.jpg"/>
<img class="cover" data-name="Fire" src="demo/fire.jpg"/>
<img class="cover" data-name="Keyboard" src="demo/keyboard.jpg"/>
<img class="cover" data-name="Locomotive" src="demo/locomotive.jpg"/>
<img class="cover" data-name="Novo-Diveevo monastery" src="demo/diveevo.jpg"/>
<img class="cover" data-name="Person" src="demo/person.jpg"/>
<img class="cover" data-name="Rose" src="demo/rose.jpg"/>
<img class="cover" data-name="Seagull" src="demo/seagull.jpg"/>
<img class="cover" data-name="Solar power" src="demo/solarpower.jpg"/>
</div>
<div id="photos-info">
<div id="photos-name"></div>
</div>
<div class="clearfix"></div>
<button id="leakdetect">LeakDetect</button>
<div id="leakbucket"></div>
</body>
</html>