-
Notifications
You must be signed in to change notification settings - Fork 70
/
Copy pathfullFeatured.html
433 lines (387 loc) · 9.58 KB
/
fullFeatured.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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<title>fullFeatured - slidePage.js</title>
<link rel="stylesheet" type="text/css" href="../dist/slidePage.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/animate.css@3.5.2/animate.min.css">
<style type="text/css">
html,
body {
width: 100%;
height: 100%;
}
body {
margin: 0;
padding: 0;
background: #000;
}
ul {
list-style: none;
}
.slide-page h2 {
margin: 0;
padding: 20px 0;
text-align: center;
}
.slide-page p {
box-sizing: border-box;
padding: 10px 20px;
text-align: center;
}
.prev-page,
.next-page {
display: block;
width: 25px;
height: 25px;
line-height: 26px;
position: absolute;
right: 2px;
z-index: 9999;
background: rgba(255, 255, 255, .5);
border-radius: 50%;
font-size: 14px;
color: #666;
text-align: center;
}
.prev-page {
top: 0;
}
.next-page {
bottom: 0;
}
.prev-page:active {
background: rgba(155, 155, 155, .5);
}
.next-page:active {
background: rgba(155, 155, 155, .5);
}
.pagination {
width: 30px;
height: auto;
position: fixed;
top: 50%;
right: 5px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 40px 0;
z-index: 1;
transform: translate(0, -50%);
}
.pagination a {
width: 25px;
height: 25px;
display: block;
line-height: 28px;
text-align: center;
padding-left: 3px;
}
.pagination a:after {
content: "";
width: 15px;
height: 15px;
border-radius: 50%;
display: inline-block;
background: rgba(0, 0, 0, .5);
-webkit-transition: background .3s ease;
-moz-transition: background .3s ease;
-ms-transition: background .3s ease;
-o-transition: background .3s ease;
transition: background .3s ease;
}
.pagination a.active:after {
background: rgba(255, 255, 255, .5);
}
.add,
.remove,
.play {
display: block;
position: absolute;
top: 50%;
left: 50%;
margin-top: -20px;
margin-left: -50px;
width: 100px;
height: 100px;
webkit-border-radius: 50%;
-moz-border-radius: 50%;
padding: 38px 0;
box-sizing: border-box;
border-radius: 50%;
background-color: rgb(47, 95, 178);
color: #fff;
text-align: center;
font-size: 14px;
text-decoration: none;
}
.play {
background-color: rgb(178, 79, 65);
}
.play:hover {
background-color: rgb(189, 80, 66);
}
.play:active {
background-color: rgb(141, 60, 50);
}
.add:hover {
background-color: rgb(57, 123, 219);
}
.add:active {
background-color: rgb(31, 79, 134);
}
.remove {
background-color: rgb(151, 43, 43);
}
.remove:hover {
background-color: rgb(151, 43, 43);
}
.remove:active {
background-color: rgb(151, 43, 43);
}
.page1 {
background-color: #99CC33;
}
.page2 {
background-color: #99CC66;
}
.page3 {
background-color: #99CCCC;
}
.page4 {
background-color: #CCCC33;
}
.page5 {
background-color: #CCCC66;
}
.page6 {
background-color: rgb(204, 177, 102);
}
.page1 .step1 {
position: absolute;
top: 100px;
left: 19%;
text-align: center;
width: 100px;
height: 100px;
background-color: rgb(178, 116, 57);
border-radius: 50%;
}
.page1 .step2 {
position: absolute;
bottom: 100px;
right: 19%;
text-align: center;
width: 100px;
height: 100px;
background-color: rgb(116, 178, 9);
}
.page2 .step1 {
position: absolute;
top: 100px;
right: 5%;
text-align: center;
width: 100px;
height: 100px;
background-color: rgb(82, 110, 178);
border-radius: 50%;
}
.page2 .step3 {
position: absolute;
bottom: 60px;
left: 19%;
text-align: center;
width: 150px;
height: 150px;
background-color: rgb(178, 79, 54);
}
.page2 .step2 {
position: absolute;
top: 100px;
left: 19%;
text-align: center;
width: 100px;
height: 100px;
background-color: rgb(116, 178, 9);
}
.page3 .step1 {
position: absolute;
top: 100px;
left: 19%;
text-align: center;
width: 100px;
height: 100px;
background-color: rgb(178, 79, 65);
border-radius: 50%;
}
.page3 .step2 {
position: absolute;
bottom: 100px;
right: 19%;
text-align: center;
width: 100px;
height: 100px;
background-color: rgb(52, 178, 89);
}
.page4 .container {
padding-bottom: 20px;
}
.page4 ul {
margin: 0;
padding: 0;
width: 90%;
margin-left: 5%;
}
.page4 ul li {
width: 100%;
padding: 100px 10px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
border-bottom: 1px solid rgb(83, 83, 83);
background: rgba(255, 255, 255, .5);
text-align: center;
}
.page5 .step2 {
position: absolute;
top: 100px;
left: 19%;
text-align: center;
width: 150px;
height: 100px;
background-color: rgb(178, 159, 44);
}
.page5 .step1 {
position: absolute;
bottom: 100px;
left: 19%;
text-align: center;
width: 100px;
height: 100px;
background-color: rgb(178, 72, 91);
}
.page5 .step3 {
position: absolute;
bottom: 100px;
left: 60%;
text-align: center;
width: 100px;
height: 100px;
border-radius: 50%;
background-color: rgb(93, 163, 178);
}
</style>
</head>
<body ontouchstart="">
<div class="slide-container" id="slidePage-container">
<div class="slide-page page1">
<div class="container">
<h2>Page1 - 动画效果</h2>
<div class="step step1 animated fadeIn" data-delay="1000"></div>
<div class="step step2 animated fadeIn"></div>
</div>
</div>
<div class="slide-page page2">
<div class="container">
<h2>Page2 - 延迟播放动画</h2>
<div class="step step1 animated bounceIn" data-delay="1000"></div>
<div class="step step2 animated flipInX" data-delay="1500"></div>
<div class="step step3 animated flipInY" data-delay="2000"></div>
</div>
</div>
<div class="slide-page page3">
<div class="container">
<h2>Page3 - 手动播放动画</h2>
<a class="play" href="javascript:slide.slideFire(3)">点击播放动画</a>
<div class="lazy step1 animated zoomInDown"></div>
<div class="lazy step2 animated rollIn"></div>
</div>
</div>
<div class="slide-page page4">
<div class="container">
<h2>Page4 - 滚动条滚动</h2>
<p>当内容长度超过屏幕<br/>会自动变成原生滚动条方式</p>
<ul>
<li>滚动内容 - 第1条</li>
<li>滚动内容 - 第2条</li>
<li>滚动内容 - 第3条</li>
<li>滚动内容 - 第4条</li>
<li>滚动内容 - 最后1条内容</li>
</ul>
</div>
</div>
<div class="slide-page page5">
<div class="container">
<h2>Page5 - 动态添加page</h2>
<a href="javascript:appendpage()" class="add">添加Page</a>
</div>
</div>
<nav class="pagination" id="pagination">
<div class="prev-page" onclick="slide.slidePrev()">Λ</div>
<div class="pagination-page"></div>
<div class="next-page" onclick="slide.slideNext()">V</div>
</nav>
</div>
<script type="text/javascript" src="../dist/slidePage.min.js"></script>
<script type="text/javascript">
function GetQueryString(name){
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if(r!=null)return unescape(r[2]); return null;
}
pageParams = GetQueryString('page') * 1;
renderPagination()
var initPage = pageParams || 1
var currentPage = initPage
var slide = new slidePage({
slidePages: '.slide-page',
slideContainer: '#slidePage-container',
refresh: true,
page: initPage,
before: function (origin, diraction, target) {
pagepages = document.querySelectorAll('#pagination a')
pagepages[origin - 1].classList.remove('active')
pagepages[target - 1].classList.add('active')
currentPage = target
},
after: function (origin, diraction, target) {
},
})
window.slide = slide
// -- 由于slidePage不提供分页组件,所以以下是当前示例的分页器逻辑
pagination.querySelectorAll('a')[initPage - 1].classList.add('active')
function renderPagination() {
var pagination = document.querySelector('#pagination');
var len = document.querySelectorAll('.slide-page').length;
var paginationContent = ''
// 渲染页码
for (var i = 1; i <= len; i++) {
paginationContent += '<a onclick="slide.slideTo(' + i + ')"></a>';
}
pagination.querySelector('.pagination-page').innerHTML = paginationContent;
}
function appendpage() {
var len = document.querySelectorAll('.slide-page').length;
el = document.createElement('div');
el.innerHTML = '<div class="slide-page page6"> <h2>Page' + (len + 1) + ' - 删除Page</h2> <a href="javascript:removepage()" class="remove">删除Page' + (len + 1) + '</a> </div>'
document.querySelector('#slidePage-container').appendChild(el.children[0])
// 增加节点后更新页码
renderPagination()
pagination.querySelectorAll('a')[currentPage - 1].classList.add('active')
slide.update()
}
function removepage() {
var len = document.querySelectorAll('.slide-page').length;
var page6 = document.querySelectorAll('.slide-page')[len - 1];
document.querySelector('#slidePage-container').removeChild(page6)
// 删除节点后更新页码
renderPagination()
pagination.querySelectorAll('a')[currentPage === len ? 0 : currentPage - 1].classList.add('active')
slide.update()
}
</script>
</body>
</html>