-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
443 lines (406 loc) · 16 KB
/
index.html
File metadata and controls
443 lines (406 loc) · 16 KB
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
434
435
436
437
438
439
440
441
442
443
<!DOCTYPE html>
<html lang="zh-hans">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>我的网页</title>
<script src="//at.alicdn.com/t/font_712003_5g0we9cxa0g.js"></script>
<script src="//cdn.jsdelivr.net/npm/leancloud-storage@3.10.0/dist/av-min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.1.0/css/swiper.min.css">
<link rel="stylesheet" href="./css/style.css">
<link rel="stylesheet" href="./css/loading.css">
</head>
<body>
<div class="wrapper active">
<div class="loading"></div>
</div>
<header class="header clearfix" id="header">
<a href="" style="float: left;">
<span class="rs">RS</span>
<span class="card">card</span>
</a>
<nav class="menu" style="float: right">
<ul class="clearfix">
<li>
<a href="#about">关于</a>
</li>
<li>
<a href="#skills">技能</a>
</li>
<li>
<a href="#works"><span>作品</span></a>
<ul class="submenu">
<li>作品1</li>
<li>作品2</li>
<li>作品3</li>
</ul>
</li>
<li>
<a href="#blogs">博客</a>
<ul class="submenu">
<li>博客1</li>
<li>博客2</li>
<li>博客3</li>
</ul>
</li>
<li>
<a href="#message">留言</a>
</li>
<li>
<a href="#mobile">联系方式</a>
</li>
<li>
<a href="#others">其他</a>
</li>
</ul>
</nav>
</header>
<div class="banner">
<div class="mask"></div>
</div>
<section id="about" class="about">
<div class="user-card">
<div class="picture-and-text clearfix">
<div class="picture">
<img src="./img/avatar.png" alt="头像" style="width: 300px">
</div>
<div class="text">
<span class="welcome">
HELLO
<span class="triangle"></span>
</span>
<h1>张玉萍</h1>
<p>前端开发工程师</p>
<hr>
<dl class="clearfix">
<dt>年龄</dt>
<dd>18</dd>
<dt>所在城市</dt>
<dd>马鞍山</dd>
<dt>邮箱</dt>
<dd>xuebi2013@yeah.net</dd>
<dt>手机</dt>
<dd>18119942920</dd>
</dl>
</div>
</div>
<footer>
<a href="">
<svg class="icon" aria-hidden="true">
<use xlink:href="#icon-GitHub"></use>
</svg>
</a>
<a href="">
<svg class="icon" aria-hidden="true">
<use xlink:href="#icon-csdn"></use>
</svg>
</a>
</footer>
</div>
<p class="download-resume-wrapper">
<a class="download-resume" href="./新建 Microsoft Excel 工作表.pdf" target="_blank" download>下载PDF简历</a>
</p>
<p class="self-introduction">
张玉萍,前端开发工程师。<br>
技能:前端开发。
</p>
</section>
<section data-section class="skills" id="skills">
<h2>技能</h2>
<ul class="clearfix">
<li>
<h3>
HTML 5& CSS 3
</h3>
<div class="progress-bar">
<div class="progress">
</div>
</div>
</li>
<li>
<h3>
JavaScript
</h3>
<div class="progress-bar">
<div class="progress">
</div>
</div>
</li>
<li>
<h3>
jQuery
</h3>
<div class="progress-bar">
<div class="progress">
</div>
</div>
</li>
<li>
<h3>
Vue
</h3>
<div class="progress-bar">
<div class="progress">
</div>
</div>
</li>
<li>
<h3>
HTTP
</h3>
<div class="progress-bar">
<div class="progress">
</div>
</div>
</li>
</ul>
</section>
<section data-section class="portfolio" id="works">
<h2>作品集</h2>
<nav>
<ul class="clearfix">
<li id="portfolioAll">所用</li>
<li id="portfolioFrameWork">框架</li>
<li id="portfolioNative">原生JS&CSS</li>
</ul>
<div id="portfolioBar" class="bar state-1">
<div class="bar-inner"></div>
</div>
</nav>
<!-- Slider main container -->
<div class="swiper-container">
<!-- Additional required wrapper -->
<div class="swiper-wrapper">
<!-- Slides -->
<a class="swiper-slide" href="https://xuebi2017.github.io/kbd/index.html" target="_blank">
<img class="swiper-slide" src="./img/nav-page.jpg">
</a>
<!-- style="width: 100%;display: inline-block" -->
<a class="swiper-slide" href="https://xuebi2017.github.io/draw-board/index.html" target="_blank">
<img class="swiper-slide" src="./img/canvas.jpg">
</a>
<a class="swiper-slide" href="https://xuebi2017.github.io/normal-seamless/index.html" target="_blank">
<img class="swiper-slide" src="./img/slider.jpg">
</a>
</div>
<!-- If we need pagination -->
<div class="swiper-pagination"></div>
<!-- If we need scrollbar -->
<!-- <div class="swiper-scrollbar"></div> -->
</div>
<!-- If we need navigation buttons -->
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div>
</section>
<section data-section class="slide-in" id="blogs">
<div class="img-wrap img1"><img src="./img/1.png" alt="作品1"></div>
<div class="img-wrap img2"><img src="./img/2.png" alt="作品2"></div>
<div class="img-wrap img3"><img src="./img/3.png" alt="作品3"></div>
</section>
<section class="message" id="message">
<h2>留言</h2>
<ul id="messageList"></ul>
<form action="" id="postMessageForm" class="postMessageForm">
<label for="name">姓名:</label>
<input type="text" name="name" id="name">
<label for="content">内容:</label>
<input type="text" name="content" id="content">
<input type="submit" value="提交">
</form>
</section>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tween.js/17.2.0/Tween.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.3.5/js/swiper.min.js"></script>
<script src="./js/base/View.js"></script>
<script src="./js/base/Model.js"></script>
<script src="./js/base/Controller.js"></script>
<script src="./js/message.js"></script>
<script>
// loading()
document.getElementsByClassName('wrapper')[0].classList.remove('active');
initPosition()
setTimeout(function() {
scrollHighlight()
scrollMove()
}, 300)
portfolioAll.onclick = function() {
portfolioBar.className = 'bar state-1';
}
portfolioFrameWork.onclick = function() {
portfolioBar.className = 'bar state-2';
}
portfolioNative.onclick = function() {
portfolioBar.className = 'bar state-3';
}
function loading() {
setTimeout(function() {
document.getElementsByClassName('wrapper')[0].classList.remove('active');
}, 1000)
}
var preScrollY = 0, diff = 0;
window.addEventListener('scroll', throttle(function(event) {
scrollHighlight()
scrollMove()
diff = window.scrollY - preScrollY
preScrollY = window.scrollY
if(window.scrollY) {
header.classList.add('sticky')
}else {
header.classList.remove('sticky')
}
}, 50))
// window.onscroll = function(event) {
// scrollHighlight()
// scrollMove()
// diff = window.scrollY - preScrollY
// preScrollY = window.scrollY
// if(window.scrollY) {
// header.classList.add('sticky')
// }else {
// header.classList.remove('sticky')
// }
// }
var liTags = document.querySelectorAll('nav.menu > ul > li');
for(var i = 0; i < liTags.length; i++) {
liTags[i].onmouseenter = function(event) {
event.currentTarget.classList.add('active')
}
liTags[i].onmouseleave = function(event) {
event.currentTarget.classList.remove('active')
}
}
// Setup the animation loop.
function animate(time) {
requestAnimationFrame(animate);
TWEEN.update(time);
}
requestAnimationFrame(animate);
let aTags = document.querySelectorAll('nav.menu > ul > li > a')
for(let i = 0; i < aTags.length; i++) {
aTags[i].onclick = function(event) {
event.preventDefault()
let a = event.currentTarget
let href = a.getAttribute('href')
let element = document.querySelector(href)
let top = element.offsetTop
// let n = 25
// let duration = 500/n
// let currentTop = window.scrollY
// let targetTop = top - 80
// let distance = (targetTop - currentTop)/n
// let k = 0
// let intervalId = setInterval(() => {
// if(k === 25) {
// clearInterval(intervalId)
// return
// }
// k++;
// scrollTo(0, currentTop + distance*k)
// }, duration)
let currentTop = window.scrollY
let targetTop = top - 80
var coords = { y: currentTop };
// var tween = new TWEEN.Tween(coords)
// .to({ y: targetTop }, Math.min(Math.abs((targetTop - currentTop)/100*200), 500))
// .easing(TWEEN.Easing.Quadratic.Out)
// .onUpdate(function() {
// scrollTo(0, coords.y)
// })
// .start();
//可以将以上的补间动画改成下面浏览器自带的动画
scrollTo({
top: targetTop,
behavior: "smooth"
});
}
}
//上边缘离可视窗口最近的data-section
function nearWindow() {
let special = document.querySelectorAll('[data-section]')
let minIndex = 0
let clientHeight = document.documentElement.clientHeight || document.body.clientHeight;
//找到距离窗口的下边缘最近的data-section
for(let i = 0; i < special.length; i ++) {
if(Math.abs(special[i].offsetTop-window.scrollY-clientHeight) < Math.abs(special[minIndex].offsetTop-window.scrollY-clientHeight)) {
minIndex = i
}
}
return {
minIndex: minIndex,
special: special
}
}
//是否是向下滚动
function ifScrollDown() {
if(diff > 0) {
return true
}else {
return false
}
}
function initPosition() {
let obj = nearWindow()
for(let i = 0; i < obj.special.length; i++) {
obj.special[i].classList.add('offset')
}
}
function scrollMove() {
let obj = nearWindow()
let clientHeight = document.documentElement.clientHeight || document.body.clientHeight;
if(ifScrollDown()) {
console.log('向下滚动')
console.log("TCL: scrollMove -> obj.minIndex", obj.minIndex)
if((obj.special[obj.minIndex].offsetTop - window.scrollY - clientHeight) < -100) {
obj.special[obj.minIndex].classList.remove('offset')
}
}else {
console.log('向上滚动')
console.log("TCL: scrollMove -> obj.minIndex", obj.minIndex)
console.log("TCL: scrollMove -> obj.special[obj.minIndex].offsetTop - window.scrollY - clientHeight", obj.special[obj.minIndex].offsetTop - window.scrollY - clientHeight)
if((obj.special[obj.minIndex].offsetTop - window.scrollY - clientHeight) > -100) {
obj.special[obj.minIndex].classList.add('offset')
}
}
}
function scrollHighlight() {
let obj = nearWindow()
let specialId = obj.special[obj.minIndex].id
let targetSection = document.querySelector('[href="#' + specialId + '"]')
let specialSections = targetSection.parentNode.parentNode.children
for(let i = 0; i < specialSections.length; i ++) {
specialSections[i].classList.remove('highlight')
}
targetSection.parentNode.classList.add('highlight')
}
function throttle(fn, interval = 300) {
let canRun = true;
return function () {
if (!canRun) return;
canRun = false;
setTimeout(() => {
fn.apply(this, arguments);
canRun = true;
}, interval);
};
}
var mySwiper = new Swiper ('.swiper-container', {
// Optional parameters
direction: 'horizontal',
loop: true,
// If we need pagination
pagination: {
el: '.swiper-pagination',
},
// Navigation arrows
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
// And if we need scrollbar
// scrollbar: {
// el: '.swiper-scrollbar',
// },
})
</script>
</body>
</html>