-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
355 lines (346 loc) · 12.1 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
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
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title></title>
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<script type="text/javascript">
// rem实现适配
document.querySelector('html').style.fontSize = window.screen.width / 20 + 'px';
window.onresize = function () {
document.querySelector('html').style.fontSize = window.screen.width / 20 + 'px';
}
</script>
<!--<link rel="stylesheet" type="text/css" href="lib/swiper/swiper.min.scss">-->
<link rel="stylesheet" type="text/css" href="sass/index.css">
</head>
<body>
<!--切换的页面-->
<!--loading页面-->
<div class="loading">
<div class="rider"></div>
<div class="progress">
<div class="step"></div>
</div>
<div class="info"></div>
<!--外卖的logo-->
<div class="logo"></div>
<!--版权信息-->
<div class="copyright">
@ 2017 BaiDU Waimai Produced
</div>
</div>
<!--欢迎页-->
<div class="welcome">
<div class="info">
<div class="hello"></div>
</div>
<!--云-->
<div class="cloud"></div>
<!--草地-->
<div class="grass1"></div>
<!--熊盒子-->
<div class="bear-box">
<div class="bear"></div>
<div class="smoke"></div>
</div>
<div class="trees"></div>
<!--草地2-->
<div class="grass2"></div>
<!--旋转的按钮-->
<div class="rotate-btn-box">
<div class="btn"></div>
<div class="circle1"></div>
<div class="circle2"></div>
</div>
</div>
<div class="waimai-container">
<div class="swiper-wrapper">
<!--轮播页面1-->
<div class="swiper-slide page1">
<div class="title">
<h3>生活中,</h3>
<p>经常有这种时候...</p>
<div class="line"></div>
</div>
<!--轮播盒子1-->
<div class="scroll-page1">
<div class="bg"></div>
<div class="person">
<!--一沓纸-->
<div class="files">
<div class="paper1"></div>
<div class="paper2"></div>
</div>
</div>
<div class="message-container">
<div class="info"></div>
</div>
</div>
<!--轮播盒子2-->
<div class="scroll-page2">
<div class="bg"></div>
<div class="person">
<div class="leg1"></div>
<div class="leg2"></div>
</div>
<div class="message-container">
<div class="info"></div>
</div>
</div>
<!--轮播盒子3-->
<div class="scroll-page3">
<div class="bg"></div>
<div class="person">
<div class="word1"></div>
<div class="word2"></div>
<div class="word3"></div>
<div class="word4"></div>
</div>
<div class="message-container">
<div class="info"></div>
</div>
</div>
<!--星球-->
<div class="sphere"></div>
<!--熊-->
<div class="bear"></div>
</div>
<!--轮播页面2-->
<div class="swiper-slide page2">
<div class="title">
<h3>这时候</h3>
<p>如果有一份美味外卖...<br>正好出现...</p>
<div class="line"></div>
</div>
<div class="bg"></div>
<div class="bear">
<div class="face1"></div>
<div class="face2"></div>
<!--熊掌-->
<div class="hand-left"></div>
<div class="hand-right"></div>
</div>
<div class="sphere"></div>
<div class="table"></div>
<div class="food"></div>
</div>
<!--轮播页面3-->
<div class="swiper-slide page3">
<div class="title">
<h3>这时候</h3>
<p>如果有一份美味外卖...<br>正好出现...</p>
<div class="line"></div>
</div>
<div class="bg"></div>
<div class="bear"></div>
<!--t牌子的熊-->
<div class="animation-bear-box">
<div class="animate-bear1"></div>
<div class="animate-bear2"></div>
<div class="animate-bear3"></div>
</div>
<!--星球-->
<div class="sphere"></div>
<div class="normal-card">
<div class="license"></div>
<div class="oil"></div>
<div class="evil"></div>
</div>
<!--t后的三块牌子-->
<div class="hit-card-box">
<div class="card1"></div>
<div class="card2"></div>
<div class="card3"></div>
</div>
</div>
<!--轮播页面4-->
<div class="swiper-slide page4">
<div class="title">
<h3>百度外卖</h3>
<p>只做有品质的外卖...<br>操作快捷...</p>
<div class="line"></div>
</div>
<div class="bg"></div>
<div class="bear"></div>
<div class="sphere"></div>
<div class="card1"></div>
<div class="card2"></div>
<div class="card3"></div>
</div>
<!--轮播页面5-->
<div class="swiper-slide page5">
<div class="title">
<h3>无论前方</h3>
<p>狂风,大雨,还是飘雪...<br>始终坚持在路上...</p>
<div class="line"></div>
</div>
<div class="bg"></div>
<div class="bear">
<div class="smoke"></div>
</div>
<div class="sphere"></div>
<div class="cloud">
<div class="snow"></div>
<div class="snow"></div>
<div class="snow"></div>
<div class="snow"></div>
<div class="snow"></div>
<div class="snow"></div>
</div>
</div>
<!--轮播页面6-->
<div class="swiper-slide page6">
<div class="title">
<h3>丰富礼品</h3>
<p>让你边吃,边省钱...</p>
<div class="line"></div>
</div>
<div class="bg"></div>
<div class="bear">
<div class="gift-box">
<div>
<div class="gift1"></div>
</div>
<div>
<div class="gift2"></div>
</div>
<div>
<div class="gift3"></div>
</div>
<div>
<div class="gift4"></div>
</div>
<div>
<div class="gift5"></div>
</div>
<div>
<div class="gift6"></div>
</div>
<div>
<div class="gift7"></div>
</div>
<div>
<div class="gift8"></div>
</div>
<div>
<div class="gift9"></div>
</div>
<div>
<div class="gift10"></div>
</div>
<div>
<div class="gift11"></div>
</div>
<div>
<div class="gift12"></div>
</div>
</div>
</div>
<div class="sphere"></div>
</div>
<!--轮播页面7-->
<div class="swiper-slide page7">
<div class="title">
<h3>所有的努力</h3>
<p>就是为了健康美味的外卖...<br>呈现给你...</p>
<div class="line"></div>
</div>
<div class="streetlight">
<div class="light"></div>
</div>
<div class="motobike"></div>
<div class="sphere"></div>
<div class="bear"></div>
<div class="share"></div>
<div class="info">waimai.baidu.com</div>
</div>
</div>
</div>
<!--音频播放按钮-->
<audio src="music/hlw.mp3" loop></audio>
<input type="button" class="audioControl">
<script src="lib/swiper/swiper.min.js"></script>
<script src="lib/zepto/zepto.js"></script>
<script src="lib/zepto/event.js"></script>
<script src="lib/zepto/fx.js"></script>
<script src="lib/zepto/fx_methods.js"></script>
<script src="lib/zepto/touch.js"></script>
<script type="text/javascript">
// 设置swiper
var swiper = new Swiper('.waimai-container', {
direction: 'vertical',
onSlideChangeEnd: function (swiper) {
// 在获取当前页索引并添加animate
$('.swiper-slide').eq(swiper.activeIndex).addClass('animate').siblings().removeClass('animate');
if (swiper.activeIndex === 2) {
$('.swiper-slide').eq(2).addClass('swiper-no-swiping');
}
if (swiper.previousIndex === 2) {
// 还原所有的行内样式
$('.swiper-slide').eq(2).find('.bear').attr('style', '');
$('.animation-bear-box div').attr('style', '');
$('.normal-card div').attr('style', '');
$('.hit-card-box div').attr('style', '');
}
}
});
$(function () {
// 第一页的js效果
setTimeout(function () {
$('.loading').addClass('animate');
$('.loading .step').on('animationend', function () {
$('.loading').fadeOut(1000, function () {
$('.welcome').addClass('animate');
});
});
}, 1000);
// 第二页的长按效果
$('.welcome .rotate-btn-box').longTap(function () {
$('.bear-box').css('animation', 'bearDisappear 1s forwards');
setTimeout(function () {
$('.welcome').fadeOut(1000, function () {
$('.page1').addClass('animate');
});
}, 1000);
});
// 第三页 点击移除不可切换
$('.swiper-slide').eq(2).click(function () {
// 无法清除的原因是动画
setTimeout(function () {
$('.swiper-slide').eq(2).children('.bear').css('animation', 'none');
}, 1000);
var index = 0;
var interId = setInterval(function () {
$('.animation-bear-box div').css('opacity', 0);
$('.animation-bear-box div').eq(index).css('opacity', 1);
// t的同时隐藏原来那块
$('.normal-card div').eq(index).css('animation', 'none');
$('.hit-card-box div').eq(index).css('opacity', 1);
if (index === 2) {
clearInterval(interId);
// 牌子掉下来动画
$('.hit-card-box div').css('animation', 'bearDisappear 1s forwards');
setTimeout(function () {
$('.swiper-slide').eq(2).removeClass('swiper-no-swiping');
}, 1000);
}
index++;
}, 1000);
});
});
// 为按钮绑定点击事件,控制音频播放
var audioDom = document.querySelector('audio');
$('.audioControl').click(function () {
if (audioDom.paused) {
audioDom.play();
$(this).css('background-image', 'url("images/play.png")');
} else {
audioDom.pause();
$(this).css('background-image', 'url("images/pause.png")');
}
})
</script>
</body>
</html>