郁郁青青 长过千寻

lovE you

   

  1. have this dream over and over again
  2. 纹理阴影
  3. 微软的四个方块
  4. 层次感
  5. 滑动的效果显示
  6. 事件线条
  7. cubic-bezier
  8. 随着滚动目录与内容相对应||jqueryjs
  9. focus on one
  10. 一种展示菜单的方式
  11. CSS enhance effect
  12. 一种搭配
  13. 海の見える駅
  14. Strawberry Fields Forever

the Secret Place

Drawing by Alena Aenami.

2022年12月25日 星期日 14时36分09秒 CST - 这儿存放了初学 web 时的一些实现。

have this dream over and over again

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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>miss</title>
<style type="text/css">
*,*::after,*::before{
margin:0;
padding:0;
}
html{
height:100%;
}
body{
background:black;
height:100%;
}
.keypoint{
position:relative;
width:0px;
height:0px;
left:50%;
top:43%;
transform:translate(-50%,-50%);
}
.classicwhite{
position:absolute;
width:157px;
height:157px;
background-color:white;
border-radius:50%;
transform:translate(-50%,-50%) scale(1);
animation:follow 1.7s infinite;
}
.classicblack{
position:absolute;
width:157px;
height:157px;
background-color:black;
border-radius:50%;
transform:translate(-50%,-50%) scale(.75);
animation:go 1.7s infinite;
}
@keyframes go{
from{
transform:translate(-50%,-50%) scale(.75);
box-shadow:inset 0 0 23px 0 white;
}42%{
box-shadow:inset 0 0 0 0 black;
}43%{
transform:translate(-50%,-50%) scale(1.01);
box-shadow:inset 0 0 0 0 black;
}57%{
transform:translate(-50%,-50%) scale(1.01);
box-shadow:inset 0 0 0 0 black;
}57.1%{
transform:translate(-50%,-50%) scale(.75);
box-shadow:inset 0 0 0 0 white;
}to{
transform:translate(-50%,-50%) scale(.75);
box-shadow:inset 0 0 23px 0 white;
}
}
@keyframes follow{
from{
transform:translate(-50%,-50%) scale(1);
box-shadow:0 0 23px 0 white;
}43%{
transform:translate(-50%,-50%) scale(1);
box-shadow:0 0 0 0 white;
}57%{
transform:translate(-50%,-50%) scale(1);
}57.1%{
transform:translate(-50%,-50%) scale(.73);
box-shadow:0 0 0 0 white;
}to{
transform:translate(-50%,-50%) scale(1);
box-shadow:0 0 23px 0 white;
}
}
</style>
</head>
<body>
<div class="keypoint">
<div class="classicwhite"></div>
<div class="classicblack"></div>
</div>
</body>
</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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style>
*{
margin:0;
padding:0;
/* box-sizing: border-box; */
font-size: 62.5%;
font-family: sans-serif
}

.ws-header{
position:relative;
height: 99px;
margin:0 auto;
background: #FFF;
border-bottom: 1px #D2D2D2 solid;
box-shadow: rgba(0,0,0,.05) 0 1px 2px;
}
.ws-header::before{
content: "";
position: absolute;
opacity: .04;
background: linear-gradient(#fff,#000);
background: -webkit-linear-gradient(top,#fff,#000);
top: 0;
left: 0;
bottom: 0;
right: 0;
height: 100%;
width:100%;
}
.ws-header::after{
content:"";
display: table;
clear:both;
}
.white{
background-image: url("iae/white.jpg");
position: absolute;
left: 0;
right: 0;
top: 0px;
height: 50%;
z-index: -1;
}
.wrap{
position: absolute;
left: 0;
right: 0;
top: 0px;
height: 100%;
}
.calendar{
position: relative;
width:157px;
height: 157px;
/* margin:0 auto; */
left:50%;
top:50%;
transform: translateX(-100%) translateY(-50%);
border-radius: 3px;
border:1px solid #C7C7C7;
background-color:#FFF;
display: inline-block;
}
.calendar::after{
content:'';
position: absolute;
opacity: .04;
background: linear-gradient(#fff,#000);
background: -webkit-linear-gradient(top,#fff,#000);
/* height:50%;
width:100%; */
height:77px;
width:155px;
border-radius: 2px 2px 0 0;
top: 1px;
left: 1px;
bottom: auto;
right: auto;
}
.mirror{
background-color:#222;
}
.calendar::before{
content:'';
position: absolute;
opacity: .04;
background: linear-gradient(#fff,#000);
background: -webkit-linear-gradient(top,#fff,#000);
/* height:50%;
width:100%; */
height:77px;
width:155px;
border-radius: 0 0 2px 2px;
top: 79px;
left: 1px;
bottom: auto;
right: auto;
}
.day{
/* color:#D17371; */
/* color:#C95B59; */
color:#D45D5B;
display: block;
position: relative;
text-align: center;
top:50%;
-webkit-transform: translateY(-50%);
-moz-transform: translateY(-50%);
-ms-transform: translateY(-50%);
-o-transform: translateY(-50%);
transform: translateY(-50%);
font-size: 11.3rem;
font-weight: 550;
}
.black{
background-image: url("iae/black.png");
position: absolute;
left: 0;
right: 0;
bottom:0;
height:50%;
z-index: -1;
}
.ws-heel{
background: linear-gradient(#333,#111);
position: absolute;
left: 0;
right: 0;
margin-left: 0;
padding-top: 0;
bottom: 0px;
height: 99px;
}
</style>
</head>
<body>
<nav class="ws-header"></nav>
<div class="white"></div>
<div class="wrap">
<div class="calendar">
<div class="day">0</div>
</div>
<div class="calendar mirror">
<div class="day">0</div>
</div>
</div>
<div class="black"></div>
<footer class="ws-heel"></footer>
</body>
</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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style>
.box{
width:200px;
height:200px;
/* border-radius:50%; */
/* overflow: hidden; */
position:relative;
/* background:yellow; */
margin:5em auto;
}
.box div{
width:100px;
height:100px;
transform-origin:left top;
position:absolute;
left:100px;
top:100px;
border:1px solid white;
box-sizing:border-box;
background:black;
}
</style>
</head>
<body>
<div class="box"></div>
<div class="box"></div>
</body>
<script src="js/jquery-2.1.1.js"></script>
<script>
for(var i=0;i<12;++i){
$('<div></div>').appendTo('.box:eq(0)')
.css({'transform':'rotate('+30*i+'deg)skewX(60deg)','border':'0px'});
}
$('.box:eq(0)').css({'overflow':'hidden','border-radius':'50%'});
for(var i=0;i<12;++i){
var red = parseInt(Math.random()*257).toString(16);
var blue = parseInt(Math.random()*257).toString(16);
var green= parseInt(Math.random()*257).toString(16);
var color = '#'+red+blue+green;
var secret=String(i+1);
var z="div.box:eq(0) :nth-child("+secret+")";
$(z).css({'background':color});
}

for(var i=0;i<4;++i){
$('<div></div>').appendTo('.box:eq(1)')
.css({'transform':'rotate('+90*i+'deg)skewX(0deg)'});
}
$("div.box:eq(1) :nth-child(1)").css({'background':'#ffb910'});
$("div.box:eq(1) :nth-child(2)").css({'background':'#08a6f0'});
$("div.box:eq(1) :nth-child(3)").css({'background':'#80bc10'});
$("div.box:eq(1) :nth-child(4)").css({'background':'#f35326'});
</script>
</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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>miss</title>
<style>
*,*::after,*::before{
box-sizing:border-box;
margin:0;
padding:0;
}
.slide{
position:absolute;
top:0;
left:0;
display:-webkit-flex;
display:flex;
-webkit-flex-direction:column;
flex-direction:column;
-webkit-justify-content:center;
justify-content:center;
-webkit-align-items:center;
align-items:center;
width:100vw;
height:100vh;
pointer-events:none;
-webkit-perspective:1857px;
perspective:1857px;
}
.scene{
height:573px;
margin:0 auto;

-webkit-transform-style:preserve-3d;
transform-style:preserve-3d;
box-shadow:0 0 43px 9px rgba(187,190,197,0.34);
-webkit-transition:-webkit-transform 0.1s;
transition:transform 0.1s;
}
.view{
z-index:1;
-webkit-flex:none;
flex:none;
height:100%;
-webkit-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
user-select:none;
-webkit-transform-style:preserve-3d;
transform-style:preserve-3d;
}
.view__img{
height:100%;
}
.item{
position:absolute;
z-index:1;
pointer-events:none;
-webkit-transform-style:preserve-3d;
transform-style:preserve-3d;
}
.item__img{
position:relative;
display:block;
max-height:100%;
margin:0 auto;
pointer-events:auto;
transition:transform .3s,box-shadow .3s;
}

.item--pink{
top:141px;
left:31px;
}
.item--pink .item__img{
height:61px;
box-shadow:0 0 11px rgba(247,182,176,.6);
}
.item--green{
top:364px;
left:281px;
}
.item--green .item__img{
height:71px;
box-shadow:0 0 11px rgba(204,247,177,.6);
}
.item--she{
top:213px;
left:416px;
}

.item--she .item__img{
height:91px;
box-shadow:0 0 9px rgba(117,190,246,.57);
}
.item--popup{
z-index:998;
pointer-events:auto;
}
.item::before{
content:'';
position:absolute;
width:100%;
height:100%;
opacity:0;
background-color:rgb(255,255,255);
box-shadow:0 0 0 40px rgb(255,255,255),0 0 0 45px rgb(35,195,242);
-webkit-transform:scale3d(0.7,0.7,1);
transform:scale3d(0.7,0.7,1);
-webkit-transform-origin:100% 0%;
transform-origin:100% 0%;
-webkit-transition:-webkit-transform .3s,opacity .3s;
transition:transform .3s,opacity .3s;
}
.item.item--popup::before{
opacity:1;
-webkit-transform:scale3d(1,1,1);
transform:scale3d(1,1,1);
-webkit-transition-duration:.3s;
transition-duration:.3s;
}
.button{
border:none;
background:none;
-webkit-font-smoothing:antialiased;
-moz-osx-font-smoothing:grayscale;
}
.buttonclose{
position:absolute;
top:-35px;
right:-35px;
pointer-events:none;
opacity:0;
color:rgb(35,195,242);
font-weight:bold;
}
.item--popup .item__img{
box-shadow:none;
}
.item--popup .buttonclose{
pointer-events:auto;
opacity:1;
-webkit-transition:opacity .3s .33s;
transition:opacity .3s .33s;
}
.wantu{
position:relative;
text-align:center;
color:rgb(213,71,57);
opacity:0;
-webkit-transform:translate3d(0,-15px,0);
transform:translate3d(0,-15px,0);
}
.item--popup .wantu{
opacity:1;
-webkit-transform:translate3d(0,23px,0);
transform:translate3d(0,23px,0);
-webkit-transition:-webkit-transform .3s,opacity .3s;
transition:transform .3s,opacity .3s;
}
</style>
</head>
<body>
<div id="slide" class="slide">
<div class="scene">
<div class="view">
<img class="view__img" src="image/bg.jpg" alt="peace" />
<div class="item item--pink">
<img class="item__img" src="image/lollipop_pink.jpg" alt="she" data-transform-z="57" />
<button class="button buttonclose"><i class="icon iconclose"></i><span class="">close</span></button>
</div>
<div class="item item--green">
<img class="item__img" src="image/lollipop_green.jpg" alt="she" data-transform-z="75" />
<button class="button buttonclose"><i class="icon iconclose"></i><span class="">close</span></button>
</div>
<div class="item item--she">
<img class="item__img" src="image/i.jpg" alt="she" data-transform-z="101" />
<div class="wantu">i miss you girl</div>
<button class="button buttonclose"><i class="icon iconclose"></i><span class="">close</span></button>
</div>
</div>
</div>
</div>
</body>
<script>
(function(window){
function classreg(classname){
return new RegExp("(^|\\s+)"+classname+"(\\s+|$)");
}
var hasclass,addclass,removeclass;
if('classList' in document.documentElement){
hasclass=function(e,c){
return e.classList.contains(c);
};
addclass=function(e,c){
e.classList.add(c);
};
removeclass=function(e,c){
e.classList.remove(c);
};
}else{
hasclass=function(e,c){
return classreg(c).test(e.className);
};
addclass=function(e,c){
if(!hasclass(e,c)){
e.className=e.className+' '+c;
}
};
removeclass=function(e,c){
e.className=e.className.replace(classreg(c),' ');
};
}
function toggleclass(e,c){
var fn=hasclass(e,c)?removeclass:addclass;
fn(e,c);
}
var co={
hasclass:hasclass,
addclass:addclass,
removeclass:removeclass,
toggleclass:toggleclass
};
window.co=co;
})(window);
</script>
<script>
(function(window){
var repeat=false;
function getmouseposition(e){
var px=0,py=0;
if(!e)
var e=window.event;
if(e.pageX||e.pageY){
px=e.pageX;
py=e.pageY;
}else if(e.clientX||e.clientY){
px=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;
py=e.clientY+document.body.scrollTop+document.documentElement.scrollTop;
}
return {
x:px,
y:py
}
}
function extend(x,y){
for(var key in y){
if(y.hasOwnProperty(key)){
x[key]=y[key];
}
}
return x;
}
function ghostcard(e,options){
this.e=e;
this.options=extend({},this.options);
extend(this.options,options);
this.init();
}
ghostcard.prototype.options={
movement:{
rotateX:3,
rotateY:5
}
};
ghostcard.prototype.init=function(){
this.items=[].slice.call(this.e.querySelectorAll('.item'));
this.card=this.e.querySelector('.scene');
this.screen=this.e;
var me=this;
this.screensize={width:this.screen.offsetWidth,
height:this.screen.offsetHeight};
this.initevents();
}
ghostcard.prototype.initevents=function(){
var me=this;
me.items.forEach(function(item){
var itemimg=item.querySelector('img');
itemimg.style.WebkitTransform=itemimg.style.transform='translate3d(0,0,'+itemimg.getAttribute('data-transform-z')+'px)';
})
document.addEventListener('mousemove',function(e){
if(me.locked)
return false;
if(repeat)
return;
repeat=true;
requestAnimationFrame(function(){
repeat=false;
var mouseposition=getmouseposition(e);
me.movementcard(mouseposition);
})
})
me.items.forEach(function(item){
item.querySelector('img').addEventListener('click',function(){
me.openi(item);
});
item.querySelector('.buttonclose').addEventListener('click',function(){
me.closei(item);
});
})
}
ghostcard.prototype.movementcard=function(p){
var mx=this.options.movement.rotateX?2*this.options.movement.rotateX/this.screensize.height*p.y-this.options.movement.rotateX:0;
var my=this.options.movement.rotateY?2*this.options.movement.rotateY/this.screensize.width*p.x-this.options.movement.rotateY:0;
this.card.style.WebkitTransform=this.card.style.transform='rotate3d(1,0,0,'+mx+'deg) rotate3d(0,1,0,'+my+'deg';
}
ghostcard.prototype.openi=function(item){
if(this.isitemopen)
return false;
this.isitemopen=true;
var view=item.parentNode;
view.style.zIndex=10;
this.locked=true;
this.card.style.WebkitTransform=this.card.style.transform='rotate3d(1,1,0,0deg)';
co.addclass(item,'item--popup');
var itemimg=item.querySelector('img');
itemimg.style.WebkitTransform=itemimg.style.transform='translate3d(0,0,0) scale3d(1.3,1.3,1)';
this.currentopenitem=item;
}
ghostcard.prototype.closei=function(item){
var item=item||this.currentopenitem;
this.isitemopen=false;
var view=item.parentNode;
co.removeclass(item,'item--popup');
var itemimg=item.querySelector('img');
var me=this;
setTimeout(function(){
itemimg.style.WebkitTransform=itemimg.style.transform='translate3d(0,0,'+itemimg.getAttribute('data-transform-z')+'px)';
view.style.zIndex=1;
me.locked=false;
},60);
}
window.ghostcard=ghostcard;
})(window);
</script>
<script>
(function(){
var z=new ghostcard(document.getElementById('slide'));
})();
</script>
</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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title></title>
<style>
*,*::after,*::before{
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
box-sizing:border-box;
}
html{
font-size:62.5%;
}
body{
font-size:1.6rem;
font-family:sans-serif;
color:#c00000;
background-color:#f8f9fc;
}
b{
font:inherit;
}
.ws-intro{
width:90%;
max-width:768px;
text-align:left;
}
.ws-intro{
margin:4em auto;
}
@media only screen and (min-width:768px){
.ws-intro{
margin:5em auto;
}
}
@media only screen and (min-width:1170px){
.ws-intro{
margin:6em auto;
}
}
.ws-headline{
font-size:3rem;
line-height:1.2;
font-weight:300;
}
@media only screen and (min-width:768px){
.ws-headline{
font-size:4.4rem;
}
}
@media only screen and (min-width:1170px){
.ws-headline{
font-size:10rem;
}
}

.ws-headline.clip span{
display:inline-block;
padding:.2em 0;
}
.ws-headline.clip .ws-words-wrapper{
overflow:hidden;
vertical-align:top;
display:inline-block;
position:relative;
text-align:left;
}
.ws-headline.clip .ws-words-wrapper::after{
content:'';
position:absolute;
top:0;
right:0;
width:2px;
height:100%;
background-color:#c00000;
}
.ws-headline.clip b{
opacity:0;
display:inline-block;
position:absolute;
white-space:nowrap;
left:0;
top:0;
}
.ws-headline.clip b.is-visible{
opacity:1;
position:relative;
}
</style>
</head>
<body>
<section class="ws-intro">
<h1 class="ws-headline clip is-full-width">
<span>peace</span>
<span class="ws-words-wrapper">
<b class="is-visible">你好~</b>
<b>笨蛋~</b>
</span>
</h1>
</section>
</body>
<script src="js/jquery-2.1.1.js"></script>
<script>
jQuery(document).ready(function($){
initHeadline();
function initHeadline(){
var headline=$('.ws-headline');
var spanWrapper=headline.find('.ws-words-wrapper'),
newWidth=spanWrapper.width()+9;
spanWrapper.css('width',newWidth);
setTimeout(function(){
hideWord(headline.find('.is-visible'));
},1057);
}

function hideWord($word){
var nextWord=(!$word.is(':last-child'))?$word.next():$word.parent().children().eq(0);
$word.parents('.ws-words-wrapper').animate({width:'2px'},$word.width()*3,function(){
switchWord($word,nextWord);
showWord(nextWord);
})
}
function showWord($word){
$word.parents('.ws-words-wrapper').animate({'width':$word.width()+9},$word.width()*3,function(){
setTimeout(function(){
hideWord($word);
},1057);
})
}
function switchWord($oldWord,$newWord){
$oldWord.removeClass('is-visible');
$newWord.addClass('is-visible');
}
})
</script>
</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
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>miss</title>
<style>
*,*::after,*::before{
box-sizing:border-box;
margin:0;
padding:0;
}
html{
font-size:62.5%;
}
body{
font-size:16px;
color:#383838;
background-color:#F8F8F8;
line-height: 1;
}
ol,ul{
list-style:none;
}
a{
color:#7B9D6F;
text-decoration: none;
}
/*
Main Components
*/
.horizontaltimeline{
opacity: 0;
margin:27px auto;
-webkit-transition:opacity 0.2s;
-moz-transition:opacity 0.2s;
transition:opacity 0.2s;
}
.horizontaltimeline::before{
/*never visible-this is used in jQuery to check the current MQ*/
content:'mobile';
display:none;
}
.horizontaltimeline.loaded{
/*show the timeline after events position has been set (using JS)*/
opacity:1;
}
.horizontaltimeline .timeline{
position:relative;
height:100px;
width:90%;
max-width:800px;
margin:0 auto;
}
.horizontaltimeline .events-wrapper{
position:relative;
height:100%;
margin:0 43px;
overflow:hidden;
}
.horizontaltimeline .events-wrapper::after,.horizontaltimeline .events-wrapper::before{
/*these are used to create a shadow effect at the sides of the timeline*/
content:'';
position:absolute;
z-index:2;
top:0;
height:100%;
width:20px;
}
.horizontaltimeline .events-wrapper::before{
left:0;
background-image:-webkit-linear-gradient(left,#F8F8F8,rgba(248,248,248,0));
background-image:linear-gradient(to right,#F8F8F8,rgba(248,248,248,0));
}
.horizontaltimeline .events-wrapper::after{
right:0;
background-image:-webkit-linear-gradient(right,#F8F8F8,rgba(248,248,248,0));
background-image:linear-gradient(to left,#F8F8F8,rgba(248,248,248,0));
}
.horizontaltimeline .events{
/*this is the gray line*/
position:absolute;
z-index:1;
left:0;
top:49px;
height:2px;
/*width will be set using JS*/
background:#DFDFDF;
-webkit-transition:-webkit-transform .4s;
-moz-transition:-moz-transform .4s;
transition:transform .4s;
}
.horizontaltimeline .fillingline{
/*this is used to create the green line filling the timeline*/
position:absolute;
z-index:1;
left:0;
top:0;
height:100%;
width:100%;
background-color:#7B9D6F;
-webkit-transform:scaleX(0);
-moz-transform:scaleX(0);
-ms-transform:scaleX(0);
-o-transform:scaleX(0);
transform:scaleX(0);
-webkit-transform-origin:left center;
-moz-transform-origin:left center;
-ms-transform-origin:left center;
-o-transform-origin:left center;
transform-origin:left center;
-webkit-transition:-webkit-transform .3s;
-moz-transition:-moz-transform .3s;
transition:transform .3s;
}
.horizontaltimeline .events a{
position:absolute;
bottom:0;
z-index:2;
text-align:center;
font-size:13px;
padding-bottom:15px;
color:#383838;
-webkit-transform:translateZ(0);
-moz-transform:translateZ(0);
-ms-transform:translateZ(0);
-o-transform:translateZ(0);
transform:translateZ(0);
}
.horizontaltimeline .events a::after{
/*this is used to create the event spot*/
content:'';
position:absolute;
left:50%;
right:auto;
-webkit-transform:translateX(-50%);
-moz-transform:translateX(-50%);
-ms-transform:translateX(-50%);
-o-transform:translateX(-50%);
transform:translateX(-50%);
bottom:-5px;
height:12px;
width:12px;
border-radius:50%;
border:2px solid #DFDFDF;
background-color:#F8F8F8;
-webkit-transition:background-color 0.3s,border-color 0.3s;
-moz-transition:background-color 0.3s,border-color 0.3s;
transition:background-color 0.3s,border-color 0.3s;
}
.no-touch .horizontaltimeline .events a:hover::after{
background-color:#7B9D6F;
border-color:#7B9D6F;
}
.horizontaltimeline .events a.selected{
pointer-events:none;
}
.horizontaltimeline .events a.selected::after{
background-color:#7B9D6F;
border-color:#7B9D6F;
}
.horizontaltimeline .events a.older-event::after{
border-color:#7B9D6F;
}
@media only screen and (min-width:1100px){
.horizontaltimeline{
margin:57px auto;
}
.horizontaltimeline::before{
/*never visible-this is used in jQuery to check the current MQ*/
content:'desktop';
}
}
.timelinenavigation a{
/*these are the left/right arrows to navigate the timeline*/
position:absolute;
z-index:1;
top:50%;
bottom:auto;
-webkit-transform:translateY(-50%);
-moz-transform:translateY(-50%);
-ms-transform:translateY(-50%);
-o-transform:translateY(-50%);
transform:translateY(-50%);
height:34px;
width:34px;
border-radius:50%;
border:2px solid #DFDFDF;
/*replace text with an icon*/
overflow:hidden;
color:transparent;
text-indent:100%;
white-space:nowrap;
-webkit-transition:border-color .3s;
-moz-transition:border-color .3s;
transition:border-color .3s;
}
.timelinenavigation a::after{
/*arrow icon*/
content:'';
position:absolute;
height:16px;
width:16px;
left:50%;
top:50%;
bottom:auto;
right:auto;
-webkit-transform:translateX(-50%)translateY(-50%);
-moz-transform:translateX(-50%)translateY(-50%);
-ms-transform:translateX(-50%)translateY(-50%);
-o-transform:translateX(-50%)translateY(-50%);
transform:translateX(-50%)translateY(-50%);
background:url(../ws-arrow.svg) no-repeat 0 0;
}
.timelinenavigation a.prev{
left:0;
-webkit-transform:translateY(-50%) rotate(180deg);
-moz-transform:translateY(-50%) rotate(180deg);
-ms-transform:translateY(-50%) rotate(180deg);
-o-transform:translateY(-50%) rotate(180deg);
transform:translateY(-50%) rotate(180deg);
}
.timelinenavigation a.next{
right:0;
}
.no-touch .timelinenavigation a:hover{
border-color:#7B9D6F;
}
.timelinenavigation a.inactive{
cursor:not-allowed;
}
.timelinenavigation a.inactive::after{
background-position: 0 -16px;
}
.no-touch .timelinenavigation a.inactive:hover{
border-color:#DFDFDF;
}

.horizontaltimeline .eventscontent{
position:relative;
width:100%;
margin:27px 0;
overflow:hidden;
-webkit-transition:height .4s;
-moz-transition:height .4s;
transition:height .4s;
}
.horizontaltimeline .eventscontent li{
position:absolute;
z-index:1;
width:100%;
left:0;
top:0;
-webkit-transform:translateX(-100%);
-moz-transform:translateX(-100%);
-ms-transform:translateX(-100%);
-o-transform:translateX(-100%);
transform:translateX(-100%);
padding:0 5%;
opacity:0;
-webkit-animation-duration:.4s;
-moz-animation-duration:.4s;
animation-duration:.4s;
-webkit-animation-timing-function:ease-in-out;
-moz-animation-timing-function:ease-in-out;
animation-timing-function:ease-in-out;
}
.horizontaltimeline .eventscontent li.selected{
/*visible event content*/
position:relative;
z-index:2;
opacity:1;
-webkit-transform:translateX(0);
-moz-transform:translateX(0);
-ms-transform:translateX(0);
-o-transform:translateX(0);
transform:translateX(0);
}
.horizontaltimeline .eventscontent li.enterright,.horizontaltimeline .eventscontent li.leaveright{
-webkit-animation-name:enterright;
-moz-animation-name:enterright;
animation-name:enterright;
}
.horizontaltimeline .eventscontent li.enterleft,.horizontaltimeline .eventscontent li.leaveleft{
-webkit-animation-name:enterleft;
-moz-animation-name:enterleft;
animation-name:enterleft;
}
.horizontaltimeline .eventscontent li.leaveright,.horizontaltimeline .eventscontent li.leaveleft{
-webkit-animation-direction: reverse;
-moz-animation-direction: reverse;
animation-direction: reverse;
}
.horizontaltimeline .eventscontent li>*{
max-width:800px;
margin:0 auto;
}
.horizontaltimeline .eventscontent h2{
font-weight:bold;
font-size:26px;
font-weight:700;
line-height:1.2;
}
.horizontaltimeline .eventscontent em{
display:block;
font-style:italic;
margin:10px auto;
}
.horizontaltimeline .eventscontent em::before{
content:'-';
}
.horizontaltimeline .eventscontent p{
font-size:14px;
color:#959595;
}
.horizontaltimeline .eventscontent em,.horizontaltimeline .eventscontent p{
line-height: 1.6;
}
@media only screen and (min-width:768px){
.horizontaltimeline .eventscontent h2{
font-size:70px;
}
.horizontaltimeline .eventscontent em{
font-size:20px;
}
.horizontaltimeline .eventscontent p{
font-size:18px;
}
}
@-webkit-keyframes enterright{
0%{
opacity:0;
-webkit-transform:translateX(100%);
}
100%{
opacity:1;
-webkit-transform:translateX(0%);
}
}
@-moz-keyframes enterright{
0%{
opacity:0;
-moz-transform:translateX(100%);
}
100%{
opacity:1;
-moz-transform:translateX(0%);
}
}
@keyframes enterright{
0%{
opacity:0;
-webkit-transform:translateX(100%);
-moz-transform:translateX(100%);
-ms-transform:translateX(100%);
-o-transform:translateX(100%);
transform:translateX(100%);
}
100%{
opacity:1;
-webkit-transform:translateX(0%);
-moz-transform:translateX(0%);
-ms-transform:translateX(0%);
-o-transform:translateX(0%);
transform:translateX(0%);
}
}
@-webkit-keyframes enterleft{
0%{
opacity:0;
-webkit-transform:translateX(-100%);
}
100%{
opacity:1;
-webkit-transform:translateX(0%);
}
}
@-moz-keyframes enterleft{
0%{
opacity:0;
-moz-transform:translateX(-100%);
}
100%{
opacity:1;
-moz-transform:translateX(0%);
}
}
@keyframes enterleft{
0%{
opacity:0;
-webkit-transform:translateX(-100%);
-moz-transform:translateX(-100%);
-ms-transform:translateX(-100%);
-o-transform:translateX(-100%);
transform:translateX(-100%);
}
100%{
opacity:1;
-webkit-transform:translateX(0%);
-moz-transform:translateX(0%);
-ms-transform:translateX(0%);
-o-transform:translateX(0%);
transform:translateX(0%);
}
}
</style>
</head>
<body>
<section class="horizontaltimeline">
<div class="timeline">
<div class="events-wrapper">
<div class="events">
<ol>
<li><a href="#0" data-date="22/06/2018" class="selected">22 Jun</a></li>
<li><a href="#0" data-date="29/06/2018">29 Jun</a></li>
<li><a href="#0" data-date="16/07/2018">16 Jul</a></li>
<li><a href="#0" data-date="25/07/2018">25 Jul</a></li>
<li><a href="#0" data-date="01/10/2018">1 Oct</a></li>
</ol>
<span class="fillingline" aria-hidden="true"></span>
</div><!--.events-->
</div><!--.events-wrapper-->
<ul class="timelinenavigation">
<li><a href="#0" class="prev inactive">Prev</a></li>
<li><a href="#0" class="next">Next</a></li>
</ul>
</div>
<div class="eventscontent">
<ol>
<li class="selected" data-date="22/06/2018">
<h2>how</h2>
<em>June 22th, 2018</em>
<p>
how can i go forward when i don't know,which way i'm facing,how can i go forward when i don't know,which way to turn,how can i go forward into,something i'm not sure of,oh no,oh no,how can i have feeling,when i don't know if it's a feeling,how can i feel something,if i just don't know how to feel,how can i have feelings,when my feelings have always been denied,oh no,oh no,how can i give love,when i don't know what it is i'm giving,how can i give love,when i just don't know how to give,oh no,oh no,nooo.........
</p>
</li>
<li data-date="29/06/2018">
<h2>starting over</h2>
<em>June 29th, 2018</em>
<p>
our life together is so precious together,we have grown,we have grown,why can't we be makin' love nice and easy,it's time to spread our wings and fly,it's been too long since we took the time,no-ones to blame,i know time files so quickly,starting over,starting over,starting over........
</p>
</li>
<li data-date="16/07/2018">
<h2>oh yoka</h2>
<em>July 16th, 2018</em>
<p>
in the middle of the night,i call your name,oh yoka,oh yoka,my love will turn you on,in the middle of shave,i call your name,oh yoka,oh yoka,in the middle of dream,i call your name,oh yoka,oh yoka,my love will turn you on,in the middle of a cloud,i call your name,oh yoka,oh yoka,my love will turn you on,oh yoka,oh yoka,oh yoka,oh yoka.........
</p>
</li>
<li data-date="25/07/2018">
<h2>don't let me down</h2>
<em>July 25th, 2018</em>
<p>
don't let me down,don't let me down,don't let me down,don't let me down,nobody ever loved me like she dose,oh,she dose,yeh,she dose,and if somebody loved me like she do me,oo,she do me,yes,she dose,don't let me down,don't let me down,don't let me down,don't let me down,i'm in love for the first time,don't you know it's gonna last,it's a love that lasts forever,it's a love that had no past,and frome the first time that she really done me,oo,she done me,she done me good,i guess nobody ever really done me,oo,she done me,she done me good,don't let me done,don't let me done.........
</p>
</li>
<li data-date="01/10/2018">
<h2>remember love</h2>
<em>October 1th, 2018</em>
<p>
remember love,remember love,love is what it takes to sing,remember love,remember love,love is what it takes to meet,remember love,remember love,love is what it takes to live,remember love,remember love,love is what it takes to dream,remember love,remember love,love is what it takes to see,remember love,remember love,love is what it takes to meet,remember love,remember love,love is that it takes to live,remember love,remember love,love is what it takes to tie,remember love,remember love, love is what it takes to live,remember love,remember love,love is what it takes to tie,remember love,remember love,love,remember love,love...........
</p>
</li>
</ol>
</div><!--.eventscontent-->
</section>
<script src="../jquery.min.js"></script>
<script src="../jquery.mobile.custom.min.js"></script>
<script>
jQuery(document).ready(function($){
var timelines=$('.horizontaltimeline'),eventsMinDistance=57;
(timelines.length>0)&&initTimeline(timelines);
function initTimeline(timelines){
timelines.each(function(){
var timeline=$(this),timelineComponents={};
timelineComponents['timelineWrapper']=timeline.find('.events-wrapper');
timelineComponents['eventsWrapper']=timelineComponents['timelineWrapper'].children('.events');
timelineComponents['fillingLine']=timelineComponents['eventsWrapper'].children('.fillingline');
timelineComponents['timelineEvents']=timelineComponents['eventsWrapper'].find('a');
timelineComponents['timelineDates']=parseDate(timelineComponents['timelineEvents']);
timelineComponents['eventsMinLapse']=minLapse(timelineComponents['timelineDates']);
timelineComponents['timelineNavigation']=timeline.find('.timelinenavigation');
timelineComponents['eventsContent']=timeline.children('.eventscontent');

//assign a left position to the single events along the timeline
setDatePosition(timelineComponents,eventsMinDistance);
//assign a width to the timeline
var timelineTotWidth=setTimelineWidth(timelineComponents,eventsMinDistance);
//the timeline has been initialize-show it
timeline.addClass('loaded');

//detect click on the next arrow
timelineComponents['timelineNavigation'].on('click','.next',function(event){
event.preventDefault();
updateSlide(timelineComponents,timelineTotWidth,'next');
})
timelineComponents['timelineNavigation'].on('click','.prev',function(event){
event.preventDefault();
updateSlide(timelineComponents,timelineTotWidth,'prev');
})
//detect click on the a single event-show new event content
timelineComponents['eventsWrapper'].on('click','a',function(event){
event.preventDefault();
timelineComponents['timelineEvents'].removeClass('selected');
$(this).addClass('selected');
updateOlderEvents($(this));
updateFilling($(this),timelineComponents['fillingLine'],timelineTotWidth);
updateVisibleContent($(this),timelineComponents['eventsContent']);
})
//on swipe,show next/prev event content
timelineComponents['eventsContent'].on('swipeleft',function(){
var mq=checkMQ();
(mq=='mobile')&&showNewContent(timelineComponents,timelineTotWidth,'next');
});
timelineComponents['eventsContent'].on('swiperight',function(){
var mq=checkMQ();
(mq=='mobile')&&showNewContent(timelineComponents,timelineTotWidth,'prev');
});
$(document).keyup(function(event){
if(event.which=='37'&&elementInViewport(timeline.get(0))){
showNewContent(timelineComponents,timelineTotWidth,'prev');
}else if(event.which=='39'&&elementInViewport(timeline.get(0))){
showNewContent(timelineComponents,timelineTotWidth,'next');
}
});
});
}

function parseDate(events){
var dateArrays=[];
events.each(function(){
var dateComp=$(this).data('date').split('/'),
newDate=new Date(dateComp[2],dateComp[1]-1,dateComp[0]);
dateArrays.push(newDate);
});
return dateArrays;
}
function minLapse(dates){
//determine the minimum distance among events
var dateDistances=[];
for(i=1;i<dates.length;++i){
var distance=daydiff(dates[i-1],dates[i]);
dateDistances.push(distance);
}
return Math.min.apply(null,dateDistances);
}
function daydiff(first,second){
return Math.round(second-first);
}
function setDatePosition(timelineComponents,min){
for(i=0;i<timelineComponents['timelineDates'].length;++i){
var distance=daydiff(timelineComponents['timelineDates'][0],timelineComponents['timelineDates'][i]),
distanceNorm=Math.round(distance/timelineComponents['eventsMinLapse'])+2;
timelineComponents['timelineEvents'].eq(i).css('left',distanceNorm*min+'px');
}
}
function setTimelineWidth(timelineComponents,width){
var timeSpan=daydiff(timelineComponents['timelineDates'][0],timelineComponents['timelineDates'][timelineComponents['timelineDates'].length-1]),
timeSpanNorm=timeSpan/timelineComponents['eventsMinLapse'],
timeSpanNorm=Math.round(timeSpanNorm)+4,
totalWidth=timeSpanNorm*width;
timelineComponents['eventsWrapper'].css('width',totalWidth+'px');
updateFilling(timelineComponents['timelineEvents'].eq(0),timelineComponents['fillingLine'],totalWidth);
return totalWidth;
}
function updateFilling(selectedEvent,filling,totWidth){
//change .fillingline length according to the selected event
var eventStyle=window.getComputedStyle(selectedEvent.get(0),null),
eventLeft=eventStyle.getPropertyValue("left"),
eventWidth=eventStyle.getPropertyValue("width");
eventLeft=Number(eventLeft.replace('px',''))+Number(eventWidth.replace('px',''))/2;
var scaleValue=eventLeft/totWidth;
setTransformValue(filling.get(0),'scaleX',scaleValue);
}
function setTransformValue(element,property,value){
element.style["-webkit-transform"]=property+"("+value+")";
element.style["-moz-transform"]=property+"("+value+")";
element.style["-ms-transform"]=property+"("+value+")";
element.style["-o-transform"]=property+"("+value+")";
element.style["transform"]=property+"("+value+")";
}
function updateSlide(timelineComponents,timelineTotWidth,string){
//retrieve translateX value of timelineComponents['eventsWrapper']
var translateValue=getTranslateValue(timelineComponents['eventsWrapper']),
wrapperWidth=Number(timelineComponents['timelineWrapper'].css('width').replace('px',''));
//translate the timeline to the left/right
(string=='next')
?translateTimeline(timelineComponents,translateValue-wrapperWidth+eventsMinDistance,wrapperWidth-timelineTotWidth)
:translateTimeline(timelineComponents,translateValue+wrapperWidth-eventsMinDistance);
}
function getTranslateValue(timeline){
var timelineStyle=window.getComputedStyle(timeline.get(0),null),
timelineTranslate=timelineStyle.getPropertyValue("-webkit-transform")||
timelineStyle.getPropertyValue("-moz-transform")||
timelineStyle.getPropertyValue("-ms-transform")||
timelineStyle.getPropertyValue("-o-transform")||
timelineStyle.getPropertyValue("transform");
if(timelineTranslate.indexOf('(')>=0){
var timelineTranslate=timelineTranslate.split('(')[1];
timelineTranslate=timelineTranslate.split(')')[0];
timelineTranslate=timelineTranslate.split(',');
var translateValue=timelineTranslate[4];
}else{
var translateValue=0;
}
return Number(translateValue);
}
function translateTimeline(timelineComponents,value,totWidth){
// alert(value+","+totWidth);
var eventsWrapper=timelineComponents['eventsWrapper'].get(0);
value=(value>0)?0:value;
value=(!(typeof totWidth==='undefined')&&value<totWidth)?totWidth:value;
setTransformValue(eventsWrapper,'translateX',value+'px');
//update navigation arrows visibility
(value==0)?timelineComponents['timelineNavigation'].find('.prev').addClass('inactive'):timelineComponents['timelineNavigation'].find('.prev').removeClass('inactive');
(value==totWidth)?timelineComponents['timelineNavigation'].find('.next').addClass('inactive'):timelineComponents['timelineNavigation'].find('.next').removeClass('inactive');
}
function updateOlderEvents(event){
event.parent('li').prevAll('li').children('a').addClass('older-event').end().end().nextAll('li').children('a').removeClass('older-event');
}
function updateVisibleContent(event,eventsContent){
var eventDate=event.data('date'),
visibleContent=eventsContent.find('.selected'),
selectedContent=eventsContent.find('[data-date="'+eventDate+'"]'),
selectedContentHeight=selectedContent.height();
if(selectedContent.index()>visibleContent.index()){
var classEntering='selected enterright',
classLeaving='leaveleft';
}else{
var classEntering='selected enterleft',
classLeaving='leaveright';
}
selectedContent.attr('class',classEntering);
visibleContent.attr('class', classLeaving).one('webkitAnimationEnd oanimationend msAnimationEnd animationend', function(){
visibleContent.removeClass('leaveright leaveleft');
selectedContent.removeClass('enterleft enterright');
});
eventsContent.css('height',selectedContentHeight+'px');
}
function checkMQ(){
return window.getComputedStyle(document.querySelector('.horizontaltimeline'), '::before').getPropertyValue('content').replace(/'/g, "").replace(/"/g, "");
}
function showNewContent(timelineComponents,timelineTotWidth,string){
var visibleContent=timelineComponents['eventsContent'].find('.selected'),
newContent=(string=='next')?visibleContent.next():visibleContent.prev();
if(newContent.length>0){
var selectedDate=timelineComponents['eventsWrapper'].find('.selected'),
newEvent=(string=='next')?selectedDate.parent('li').next('li').children('a'):selectedDate.parent('li').prev('li').children('a');
// alert(newEvent);
updateFilling(newEvent,timelineComponents['fillingLine'],timelineTotWidth);
updateVisibleContent(newEvent,timelineComponents['eventsContent']);
newEvent.addClass('selected');
selectedDate.removeClass('selected');
updateOlderEvents(newEvent);
updateTimelinePosition(string,newEvent,timelineComponents,timelineTotWidth);
}
}
function updateTimelinePosition(string,event,timelineComponents,timelineTotWidth){
var eventStyle=window.getComputedStyle(event.get(0),null),
eventLeft=Number(eventStyle.getPropertyValue("left").replace('px','')), //点距左端的距离
timelineWidth=Number(timelineComponents['timelineWrapper'].css('width').replace('px','')), //线的显示区域宽度
timelineTotWidth=Number(timelineComponents['eventsWrapper'].css('width').replace('px','')); //整条线的长度
var timelineTranslate=getTranslateValue(timelineComponents['eventsWrapper']); //整条线的偏移量
if((string=='next'&&eventLeft>timelineWidth-timelineTranslate)||(string=='prev'&&eventLeft<-timelineTranslate)){
translateTimeline(timelineComponents,-eventLeft+timelineWidth/2,timelineWidth-timelineTotWidth);
}
}
function elementInViewport(el){
var top=el.offsetTop;
var left=el.offsetLeft;
var width=el.offsetWidth;
var height=el.offsetHeight;
while(el.offsetParent){
el=el.offsetParent;
top=el.offsetTop;
left+=el.offsetLeft;
}
return (top<(window.pageYOffset+window.innerHeight)&&
left<(window.pageXOffset+window.innerWidth)&&
(top+height)>window.pageYOffset&&
(left+width)>window.pageXOffset);
}
})
</script>
</body>
</html>

cubic-bezier

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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style>
body{
background-image: url("iae/white.jpg");
margin:0;
padding:0;
}
.ws-header{
position: relative;
height: 89px;
border-bottom: 1px #D2D2D2 solid;
background: #FFF;
z-index: 3;
box-shadow: rgba(0,0,0,.05) 0 1px 2px;
}
.ws-header::after{
content:"";
display: table;
clear:both;
}
.ws-header .bg {
position: absolute;
opacity: .04;
background: linear-gradient(#fff,#000);
background: -webkit-linear-gradient(top,#fff,#000);
top: 0;
left: 0;
bottom: 0;
right: 0;
}
.ws-3d-nav-trigger{
display: block;
position:relative;
height: 45px;
width:45px;
left:50%;
top:50%;
-webkit-transform: translateX(-50%) translateY(-50%);
-moz-transform: translateX(-50%) translateY(-50%);
transform: translateX(-50%) translateY(-50%);
overflow: hidden;
text-indent:100%;
white-space:nowrap;
color:transparent;
background: linear-gradient(#5da4ff,#417bff);
border-radius: 5px;
box-shadow: rgba(0,0,0,0.3) 0 1px 2px,inset rgba(255,255,255,0.88) 0px 1px 3px -1px;
z-index: 1;
}
.ws-3d-nav-trigger:active{
box-shadow: inset 0px 3px 3px rgba(0,0,0,0.29);
}
.ws-3d-nav-trigger span{
top:21px;
left:8px;
position: absolute;
background: #fff;
width: 28px;
height: 3px;
z-index: 1;
-webkit-transition: background .3s cubic-bezier(.23,1,.32,1) .1s;
-moz-transition: background .3s cubic-bezier(.23,1,.32,1) .1s;
transition: background .3s cubic-bezier(.23,1,.32,1) .1s;
}
.ws-3d-nav-trigger span::after,.ws-3d-nav-trigger span::before {
content: "";
position: absolute;
left: 0;
background: #fff;
width: 28px;
height: 3px
}
.ws-3d-nav-trigger span::before {
bottom: 8px;
transition: bottom .3s cubic-bezier(.23, 1, .32, 1) .3s, transform .3s cubic-bezier(.23, 1, .32, 1)
}
.ws-3d-nav-trigger span::after {
top: 8px;
transition: top .3s cubic-bezier(.23, 1, .32, 1) .3s, transform .3s cubic-bezier(.23, 1, .32, 1)
}
.nav-is-visible .ws-3d-nav-trigger span {
background: hsla(0, 0%, 100%, 0);
-webkit-transition: background .3s cubic-bezier(.23,1,.32,1) .1s;
-moz-transition: background .3s cubic-bezier(.23,1,.32,1) .1s;
transition: background .3s cubic-bezier(.23,1,.32,1) .1s;
}
.nav-is-visible .ws-3d-nav-trigger span::before {
bottom: 0;
transform: rotate(-45deg);
transition: bottom .3s cubic-bezier(.23, 1, .32, 1), transform .3s cubic-bezier(.23, 1, .32, 1) .3s
}
.nav-is-visible .ws-3d-nav-trigger span::after {
top: 0;
transform: rotate(45deg);
transition: top .3s cubic-bezier(.23, 1, .32, 1), transform .3s cubic-bezier(.23, 1, .32, 1) .3s
}
.smile{
width:100%;
}
.smile img{
display: block;
margin:97px auto;
}
.grayline {
position: absolute;
width: 100%;
left: 0;
right: 0;
margin-left: 0;
padding-top: 0;
bottom: 0px;
height: 89px;
border-top: 1px solid #D5D5D5;
box-shadow: inset rgba(255,255,255,.8) 0 1px 0;
}
</style>
</head>
<body>
<header class="ws-header">
<a href="#0" class="ws-3d-nav-trigger">
MENU
<span></span>
</a>
<div class="bg"></div>
</header>
<main class="smile">
<span class="decorative"><span class="g"></span><span class="z"></span><span class="x"></span><span class="y"></span></span><img src="iae/desk_nosign_small_c131cc2fa9.png" />
</main>
<div class="grayline"></div>
</body>
<script src="sj/jquery-2.1.1.js"></script>
<script>
jQuery(document).ready(function($){
//toggle 3d navigation
$('.ws-3d-nav-trigger').on('click',function(){
$('.ws-header').toggleClass('nav-is-visible');
});
})
</script>
</html>

随着滚动目录与内容相对应||jqueryjs

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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>miss</title>
<style>
*,*::after,*::before{
margin:0;
box-sizing:border-box;
}
html{
font-size:62.5%;
height:100%;
font-family:athelas,sans-serif;
}
body{
height:100%;
overflow:hidden;
}
ul{
list-style:none;
}
a{
text-decoration:none;
color:#009688;
}
h2{
padding:19px 0;
}
p{
line-height:1.57;
}
.secondarynav{
position:fixed;
height:100%;
width:297px;
top:0;
right:0;
background-color:#434343;
background-image:url(sidebar-bg.png);
background-size:34%;
transform:translate3d(297px,0,0);
transition:transform .24s;
z-index:3;
}
.secondarynav.navisopen{
transform:translate3d(0,0,0);
}
.secnavtrigger{
position:absolute;
width:34px;
height:34px;
background-color:#414141;
left:-9%;
top:34px;
transform:translateX(-100%);
transition:background-color .24s;
}
.secnavtrigger:hover{
background-color:#000;
}
.secondarynav.navisopen .secnavtrigger{
background-color:#000;
}
.secondarynav.navisopen .secnavtrigger:hover{
background-color:#414141;
}
.secondarynav nav ul{
position:relative;
width:83%;
margin:34px auto;
list-style:decimal;
color:#E6E6E6;
font-size:17px;
background:rgba(0,0,0,.1);
border:1px solid #262626;
transition:background .24s,border-color .24s;
}
.secondarynav nav ul:hover{
background:rgba(0,0,0,.2);
border-color:#1a1a1a;
}
.secondarynav nav ul li{
margin:17px;
transition:color .17s;
}
.secondarynav nav ul li a{
color:#E6E6E6;
transition:color .17s;
}
.secondarynav nav ul li.hignlight{
color:#009688;
}
.secondarynav nav ul li.hignlight a{
color:#009688;
}
main.maincontent{
position:relative;
display:block;
font-size:17px;
width:100%;
height:100%;
overflow-y:scroll;
background-color:rgb(230,230,230);
transform:translate3d(0,0,0);
transition:transform .24s;
}
main.maincontent.navisopen{
transform:translate3d(-297px,0,0);
}
main.maincontent .sectionwrapper{
position:relative;
padding:57px;
box-shadow:0 3px 17px 0 rgb(175,175,175);
background-color:rgb(255,255,255);
width:665px;
margin:34px auto;
}
main.maincontent section{
position:relative;
margin:0 auto;
width:100%;
}
main.maincontent section+section{
margin-top:57px;
}
@media only screen and (max-width:665px){
.secondarynav{
width:237px;
transform:translate3d(237px,0,0);
}
.secnavtrigger{
left:-6%;
}
.secondarynav nav ul{
width:87%;
}
main.maincontent .sectionwrapper{
box-shadow:0 0 0 0 white;
width:100%;
margin:0;
}
}
</style>
</head>
<body>
<div class="secondarynav">
<span class="secnavtrigger"></span>
<nav>
<ul>
<li>
<a href="#placeholder">
<b>lovemedo</b>
</a>
</li>
<li>
<a href="#placeholder2">
<b>yaya</b>
</a>
</li>
<li>
<a href="#placeholder3">
<b>aintthatashame</b>
</a>
</li>
<li>
<a href="#placeholder4">
<b>peggysue</b>
</a>
</li>
<li>
<a href="#placeholder5">
<b>dearyoko</b>
</a>
</li>
</ul>
</nav>
</div>
<main class="maincontent">
<div class="sectionwrapper">
<section id="placeholder" class="section">
<h2><a href="https://music.163.com/#/song?id=503561326">lovemedo</a></h2>
<p>
Love, love me do. <br />
You know I love you, <br />
I'll always be true, <br />
So please, love me do. <br />
Whoa, love me do. <br />
Love, love me do. <br />
You know I love you, <br />
I'll always be true, <br />
So please, love me do. <br />
Whoa, love me do. <br />
Someone to love, <br />
Somebody new. <br />
Someone to love, <br />
Someone like you. <br />
Love, love me do. <br />
You know I love you, <br />
I'll always be true, <br />
So please, love me do. <br />
Whoa, love me do. <br />
Love, love me do. <br />
You know I love you, <br />
I'll always be true, <br />
So please, love me do. <br />
Whoa, love me do. <br />
Yeah, love me do. <br />
Whoa, oh, love me do.
</p>
</section>
<section id="placeholder2" class="section">
<h2><a href="https://music.163.com/#/song?id=22598717">yaya</a></h2>
<p>
I'm sittin'in the la la <br />
Waitin'for my ya ya ah ha <br />
I'm sittin'in the la la <br />
Waitin'for the ya ya ah ha <br />
It may sound funny <br />
But I don't believe she's comin'no no <br />
Hey baby hurry <br />
Don't make me worry no <br />
Hey baby hurry <br />
Don't make me worry ah ah ah <br />
You know that I love you <br />
Yes I love you ah ah <br />
Well I'm sittin'in the la la <br />
Waitin'for my ya ya ah ha <br />
I'm sittin'in the la la <br />
Waitin'forthe ya ya ah ah ah <br />
It may sound funny <br />
But I don't believe she's comin' no no <br />
Uh now one time oh <br />
Hey baby hurry <br />
Don't make me worry no no <br />
Hey baby hurry <br />
Don't make me worry no no <br />
You know that I love you <br />
Always thinkin'of you yeah yeah <br />
Hey hey rock
</p>
</section>
<section id="placeholder3" class="section">
<h2><a href="https://music.163.com/song?id=22598710">aintthatashame</a></h2>
<p>
You made me cry when you said goodbye. <br />
Ain’t that a shame? <br />
My tears fell like rain. <br />
Ain’t that a shame? <br />
You’re the one to blame. <br />
You broke my heart when you said we’re part. <br />
Ain’t that a shame? <br />
My tears fell like rain. <br />
Ain’t that a shame? <br />
You’re the one to blame. <br />
Boogie, babe! <br />
Ain’t that a shame? <br />
Ain’t that a shame? <br />
Look out! <br />
Farewell, goodbye, although I’ll cry. <br />
Ain’t that a shame? <br />
My tears fell like rain. <br />
Ain’t that a shame? <br />
You’re the one to blame. <br />
Boggie, babe! <br />
Ain’t that a shame? <br />
Ain’t that a shame? <br />
You made me cry when you said goodbye. <br />
Ain’t that a shame? <br />
My tears fell like rain. <br />
Ain’t that a shame? <br />
You’re the one to blame.
</p>
</section>
<section id="placeholder4" class="section">
<h2><a href="https://music.163.com/song?id=22598102">peggysue</a></h2>
<p>
If you knew peggy sue, <br />
Then you know why i feel blue without peggy, <br />
My peggy sue-ue-ue-ue. <br />
Oh, well, i love you, gal, <br />
Yes, i love you, peggy sue. <br />
Peggy sue, peggy sue, <br />
Pretty, pretty, pretty, pretty peggy sue. <br />
Oh ho, peggy, <br />
My peggy sue-ue-ue-ue-ue. <br />
Oh, well, i love you, girl, <br />
And i need you, peggy sue. <br />
I love you, peggy sue, <br />
With that love so rare and true, <br />
Oh ho, peggy, <br />
My peggy sue-ue-ue-ue-ue. <br />
Oh, yes, i love you, girl, <br />
And i want you, peggy sue. <br />
Look out! <br />
Peggy sue, peggy sue, <br />
Oh, how my heart yearns for you, <br />
Oh ho, peggy, <br />
My peggy sue-ue-ue-ue-ue. <br />
Oh, well, i love you, girl, <br />
And i want you, peggy sue. <br />
Oh, yes, i love you, girl, <br />
And i want you, peggy sue. <br />
Oh!
</p>
</section>
<section id="placeholder5" class="section">
<h2><a href="https://music.163.com/song?id=1475276">dearyoko</a></h2>
<p>
Even after all these years<br />
I miss you when you're not here<br />
I wish you were here my dear Yoko<br />
Even if it's just a day<br />
I miss you when you're away<br />
I wish you were here today dear Yoko<br />
Even if it's just one night<br />
I miss you and it don't feel right<br />
I wish you were here tonight dear Yoko<br />
Even if it's just one hour<br />
I wilt just like a fading flower<br />
Ain't nothing in the world like our love dear Yoko<br />
Oh Yoko<br />
I'll never, ever, ever, ever, ever gonna let you go<br />
Oh Yoko<br />
I'll never, ever, ever, ever, ever gonna let you go<br />
Even when I'm miles at sea<br />
And nowhere is the place to be<br />
Your spirit's watching over me dear Yoko<br />
Even when I watch T.V.<br />
There's a hole where you're supposed to be<br />
There's nobody lying next to me dear Yoko<br />
Oh Yoko<br />
I'll never, ever, ever, ever, ever gonna let you go<br />
Oh Yoko<br />
I'll never, ever, ever, ever, ever gonna let you go<br />
Even after all this time<br />
I miss you like the sun don't shine<br />
Without I'm a one track mind dear Yoko<br />
After all is really said and done<br />
The two of us are really one<br />
The goddess really smiled upon our love dear Yoko
</p>
</section>
</div>
</main>
</body>
<script src="js/jquery-2.1.1.js"></script>
<script>
jQuery(document).ready(function($){
var navtrigger=$('.secnavtrigger'),
secondarynav=$('.secondarynav'),
maincontent=$('.maincontent'),
contentsections=$('main section.section');
navtrigger.on('click',function(e){
secondarynav.toggleClass('navisopen');
maincontent.toggleClass('navisopen');
})
maincontent.on('scroll',function(){
updatesecnavtitle();
})
function updatesecnavtitle(){
contentsections.each(function(){
var actual=$(this),
actualheight=actual.height(),
actualanchor=secondarynav.find('a[href="#'+actual.attr('id')+'"]');
if((actual.offset().top+actualheight>$(window).scrollTop())&&(actual.offset().top<=$(window).scrollTop())){
actualanchor.parent().addClass('hignlight');
}else{
actualanchor.parent().removeClass('hignlight');
}
})
}
// secondarynav.find('ul a').on('click',function(e){
// e.preventDefault();
// var target=$(this.hash);
// maincontent.animate({
// 'scrollTop':target.offset().top+1
// },399);
// })
})
</script>
</html>

focus on one

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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>miss</title>
<style type="text/css">
*,*::after,*::before{
box-sizing:border-box;
margin:0;
padding:0;
}
html{
font-size:62.5%;
height:100%;
overflow:hidden;
}
body{
height:100%;
transition:background-color .3s;
}
body.section1{
background-color:rgb(77,78,80);
}
body.section2{
background-color:rgb(249,250,251);
}
.content{
position:relative;
height:100%;
}
.content section{
position:absolute;
width:743px;
height:453px;
left:50%;
top:43%;
visibility:hidden;
opacity:0;
transform:translate(-50%,-17%);
z-index:1;
box-shadow:0 61px 81px 7px rgb(25,25,28);
}
section.isvisible{
visibility:visible;
opacity:1;
transform:translate(-50%,-50%);
z-index:2;
transition:transform .57s,opacity .23s,visibility 0s;
}
section.ishidden{
visibility:hidden;
transform:translate(-50%,-69%);
opacity:0;
z-index:1;
transition:transform .57s,opacity .57s,visibility 0s .57s;
}
section div.options{
position:relative;
width:233px;
top:50%;
left:50%;
transform:translate(-50%,-57%);
}
section div.shadow::after{
content:'';
position:absolute;
width:100%;
top:100%;
left:0;
height:57px;
background-color:rgb(12,26,53);
transform-origin:top;
transform:skewX(-60deg);
}
section img{
display:block;
width:100%;
/* border:3px solid rgb(241,87,53); */
}
section.section1{
background-color:rgb(43,43,52);
background-image:radial-gradient(rgb(53,53,64),rgb(32,32,41));
box-shadow:0 61px 81px 7px rgb(25,25,28);
}
section.section2{
background-image:rgb(243,246,247);
background-image:linear-gradient(to top,rgb(242,243,244),rgb(248,249,250));
box-shadow:0 27px 81px 1px rgb(216,217,218);
}
.section1 img{
border:3px solid #5DF18F;
}
.section2 img{
/* border:1px solid rgb(239, 234, 246); */
}
</style>
</head>
<body>
<div class="content">
<a href="">
<section id="section1" class="section1">
<div class="options"><span class="decorative"><span class="g"></span><span class="z"></span><span class="x"></span><span class="y"></span></span><img src="aaaskull.jpg" alt="world"></div>
</section>
</a>
<a href="">
<section id="section2" class="section2">
<div class="options shadow"><span class="decorative"><span class="g"></span><span class="z"></span><span class="x"></span><span class="y"></span></span><img src="shadow5-2.png" alt="world"></div>
</section>
</a>
</div>
</body>
<script>
(function(window){
function extend(x,y){
for(var key in y)
if(y.hasOwnProperty(key))
x[key]=y[key];
return x;
}
function wsw(e,options){
this.e=e;
this.options=extend({},this.options);
extend(this.options,options);
this.init();
}
wsw.prototype.options={
nav:'section',
start:0,
skip:[]
};
wsw.prototype.init=function(){
this.tabs=[].slice.call(this.e.querySelectorAll(this.options.nav));
this.current=0;
this.show(this.options.start<this.tabs.length&&this.options.start>-1?this.options.start:0);
this.initevents();
}
wsw.prototype.show=function(index){
var z=this.tabs[this.current];
var lastbackground="section"+parseInt(index==0?this.tabs.length:index);
var background="section"+parseInt(index==this.tabs.length?1:index+1);
this.tabs[this.current].className=this.tabs[this.current].className.replace(new RegExp("isvisible","g"),"ishidden");
this.tabs[this.current].addEventListener("transitionend",function(){
z.className=z.className.replace(new RegExp('ishidden','g'),'');
},true);
document.getElementsByTagName("body")[0].className=document.getElementsByTagName("body")[0].className.replace(new RegExp("(^|\\s)*"+lastbackground+"(\\s|$)*","g"),"");
this.current=index<this.tabs.length?index:0;
this.tabs[this.current].className+=(this.tabs[this.current].className?" ":"")+"isvisible";
document.getElementsByTagName("body")[0].className+=(document.getElementsByTagName("body")[0].className?" ":"")+background;
}
wsw.prototype.initevents=function(){
var me=this;
var skip=this.options.skip;
this.tabs.forEach(function(tab,index){
if(skip.indexOf(index)==-1){
tab.addEventListener("click",function(envent){
event.preventDefault();
me.show(index+1);
});
}
});
};
new wsw(document.getElementsByClassName("content")[0]);
})(window);
</script>
</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
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>miss</title>
<style type="text/css">
*,*:after,*:before{
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
box-sizing:border-box;
margin:0;
padding:0;
}
html{
font-size:62.5%;
}
body{
font-family:"Haas Grot Text R Web","Helvetica Neue",Helvetica,Arial,sans-serif;
color:#777;
background:#FFF;
}
@media screen and (max-width:1295px){
body{
display:none;
}
}
ol,ul{
list-style: none;
}
a{
color:#777;
text-decoration:none;
}
#header{
height:56px;
background-color:rgba(47,47,47,.98);
}
#headerinner{
height:100%;
padding:0 10px 0 30px;
}
#icon{
float:left;
padding:0 20px 0 0;
}
#icon a{
display:block;
height:56px;
width:76px;
background-image:url(logo-small-2x-9fe74d2ad7b25fba0f50168523c15fda4c35534f9ea0b1011179275383035439.png);
background-size:76px 19px;
background-position:0 50%;
background-repeat:no-repeat;
}
/*-----------------------------------------------------*/
#nav li{
float:left;
font-size:14px;
}
#nav li a{
color:#999;
display:block;
line-height:56px;
text-decoration:none;
padding:0 10px;
}
#nav li#more span{
display:block;
background-image:url(icon-more-dots-2x-457f0525bcc2cff9d60847a8b550b960c0b9ed83dfd84211133070dc732b40da.png);
background-size:22px 16px;
background-repeat:no-repeat;
background-position:0 50%;
padding-left:22px;
text-indent:-9999px;
opacity:.5;
}
.isfixed #nav{
position:fixed;
width:399px;
right:45px;
bottom:70px;
background-color:rgba(47,47,47,.98);
box-shadow:0 0 3px rgba(0,0,0,.1);
border-radius:2px 2px 0 2px;
overflow:hidden;
visibility:hidden;
-webkit-transform:scale(0);
-moz-transform:scale(0);
-ms-transform:scale(0);
-o-transform:scale(0);
transform:scale(0);
-webkit-transform-origin:right bottom;
-moz-transform-origin:right bottom;
-ms-transform-origin:right bottom;
-o-transform-origin:right bottom;
transform-origin:right bottom;
z-index:1;
}
.isfixed #nav.isvisible li+li{
border-top:1px solid rgba(255,255,255,0.08);
}
.isfixed #nav li{
display:block;
float:none;
}
.isfixed #nav li a{
display:block;
line-height:56px;
padding-left:28px;
font-size:14px;
margin-left:0;
}
.isfixed #nav.hastransitions{
-webkit-transition:-webkit-transform .3s, visibility 0s .3s;
-moz-transition:-moz-transform .3s, visibility 0s .3s;
transition:transform .3s, visibility 0s .3s;
}
.isfixed #nav.isvisible{
visibility:visible;
-webkit-transform:scale(1);
-moz-transform:scale(1);
-ms-transform:scale(1);
-o-transform:scale(1);
transform:scale(1);
-webkit-transition:-webkit-transform .3s,visibility 0s 0s;
-moz-transition:-moz-transform .3s,visibility 0s 0s;
transition:transform .3s,visibility 0s 0s;
}
.isfixed #nav.ishidden{
visibility:hidden;
-webkit-transform:scale(0);
-moz-transform:scale(0);
-ms-transform:scale(0);
-o-transform:scale(0);
transform:scale(0);
-webkit-transition:-webkit-transform .3s,visibility 0s .3s;
-moz-transition:-moz-transform .3s,visibility 0s .3s;
transition:transform .3s,visibility 0s .3s;
}
.navtrigger{
background-color:rgba(47,47,47,.98);
position:fixed;
right:45px;
bottom:70px;
width:44px;
height:44px;
border-radius:2px 2px 0 2px;
box-shadow:0 0 3px rgba(0, 0, 0, .1);
overflow:hidden;
visibility:hidden;
z-index:2;
-webkit-transform:-webkit-translateY(114px);
-moz-transform:-moz-translateY(114px);
-ms-transform:-ms-translateY(114px);
-o-transform:-o-translateY(114px);
transform:translateY(114px);
-webkit-transition:-webkit-transform .3s,visibility 0s .3s;
-moz-transition:-moz-transform .3s,visibility 0s .3s;
transition:transform .3s,visibility 0s .3s;
}
.isfixed .navtrigger{
visibility:visible;
-webkit-transform:-webkit-translateY(0px);
-moz-transform:-moz-translateY(0px);
-ms-transform:-ms-translateY(0px);
-o-transform:-o-translateY(0px);
transform:translateY(0px);
-webkit-transition:-webkit-transform .3s;
-moz-transition:-moz-transform .3s;
transition:transform .3s;
}
/*-----------------------------------------------------*/
.describe{
padding:30px;
text-align:center;
background-color:#252525;
}
.describe h1{
color:#BBB;
font-size:18px;
font-weight:normal;
}
#wrapinner{
position:relative;
background-color:#F4F4F4;
padding:30px 30px 40px 30px;
}
#wrapinner #content{
position:relative;
margin:0 auto;
}
#content ul{
position:relative;
max-width:1250px;
margin:0 auto;
}
#content ul::after{
content:'';
clear:both;
display:table;
height:0;
}
#content ul li{
float:left;
width:calc(100% / 5 - 30px);
margin:0 15px 30px 15px;
}
#content ul li .dribble{
position:relative;
clear:left;
background-color:#FFF;
border-radius:2;
box-shadow:0 1px 2px rgba(0,0,0,.07);
}
#content ul li .dribble>.dribbleshot{
padding:10px;
}
#content ul li .dribble>.dribbleshot>.dribbleimg{
max-width:100%;
height:0;
padding-bottom:75%;
overflow:hidden;
}
#content ul li .dribble>.dribbleshot>.dribbleimg>img{
max-width:100%;
}
</style>
<body>
<div id="header">
<div id="headerinner">
<div id="icon"><a href="#0"></a></div>
<div id="navwrapper">
<ul id="nav" class="">
<li><a href="#0">Shots</a></li>
<li><a href="#0">Designers</a></li>
<li><a href="#0">Teams</a></li>
<li><a href="#0">Community</a></li>
<li><a href="#0">Jobs</a></li>
<li><a href="#0">Hiring</a></li>
<li id="more"><a href="#0"><span>More</span></a></li>
</ul>
<a class="navtrigger" href="#0"><span></span></a>
</div>
</div>
</div>
<div class="describe">
<h1>cool illustration</h1>
</div>
<div id="wrapinner">
<div id="content">
<ul>
<li>
<div class="dribble">
<div class="dribbleshot"><div class="dribbleimg"><span class="decorative"><span class="g"></span><span class="z"></span><span class="x"></span><span class="y"></span></span><img src="turtle.png"></div></div>
</div>
</li>
<li class="group">
<div class="dribble">
<div class="dribbleshot"><div class="dribbleimg"><span class="decorative"><span class="g"></span><span class="z"></span><span class="x"></span><span class="y"></span></span><img src="old2.png"></div></div>
</div>
</li>
<li class="group">
<div class="dribble">
<div class="dribbleshot"><div class="dribbleimg"><span class="decorative"><span class="g"></span><span class="z"></span><span class="x"></span><span class="y"></span></span><img src="rfwsa.jpg"></div></div>
</div>
</li>
<li class="group">
<div class="dribble">
<div class="dribbleshot"><div class="dribbleimg"><span class="decorative"><span class="g"></span><span class="z"></span><span class="x"></span><span class="y"></span></span><img src="__-__.gif"></div></div>
</div>
</li>
<li class="group">
<div class="dribble">
<div class="dribbleshot"><div class="dribbleimg"><span class="decorative"><span class="g"></span><span class="z"></span><span class="x"></span><span class="y"></span></span><img src="open___close.gif"></div></div>
</div>
</li>
<li class="group">
<div class="dribble">
<div class="dribbleshot"><div class="dribbleimg"><span class="decorative"><span class="g"></span><span class="z"></span><span class="x"></span><span class="y"></span></span><img src="login11.gif"></div></div>
</div>
</li>
<li class="group">
<div class="dribble">
<div class="dribbleshot"><div class="dribbleimg"><span class="decorative"><span class="g"></span><span class="z"></span><span class="x"></span><span class="y"></span></span><img src="1.png"></div></div>
</div>
</li>
<li class="group">
<div class="dribble">
<div class="dribbleshot"><div class="dribbleimg"><span class="decorative"><span class="g"></span><span class="z"></span><span class="x"></span><span class="y"></span></span><img src="___-1.png"></div></div>
</div>
</li>
<li class="group">
<div class="dribble">
<div class="dribbleshot"><div class="dribbleimg"><span class="decorative"><span class="g"></span><span class="z"></span><span class="x"></span><span class="y"></span></span><img src="3a78e933025071.569d49f6334ce.jpg"></div></div>
</div>
</li>
<li class="group">
<div class="dribble">
<div class="dribbleshot"><div class="dribbleimg"><span class="decorative"><span class="g"></span><span class="z"></span><span class="x"></span><span class="y"></span></span><img src="16.switch.png"></div></div>
</div>
</li>
<li class="group">
<div class="dribble">
<div class="dribbleshot"><div class="dribbleimg"><span class="decorative"><span class="g"></span><span class="z"></span><span class="x"></span><span class="y"></span></span><img src="__.png"></div></div>
</div>
</li>
<li class="group">
<div class="dribble">
<div class="dribbleshot"><div class="dribbleimg"><span class="decorative"><span class="g"></span><span class="z"></span><span class="x"></span><span class="y"></span></span><img src="___-1-1.png"></div></div>
</div>
</li>
<li class="group">
<div class="dribble">
<div class="dribbleshot"><div class="dribbleimg"><span class="decorative"><span class="g"></span><span class="z"></span><span class="x"></span><span class="y"></span></span><img src="miniclip5_final.gif"></div></div>
</div>
</li>
<li class="group">
<div class="dribble">
<div class="dribbleshot"><div class="dribbleimg"><span class="decorative"><span class="g"></span><span class="z"></span><span class="x"></span><span class="y"></span></span><img src="mixpanel_segmentation_dribbble.png"></div></div>
</div>
</li>
<li class="group">
<div class="dribble">
<div class="dribbleshot"><div class="dribbleimg"><span class="decorative"><span class="g"></span><span class="z"></span><span class="x"></span><span class="y"></span></span><img src="___1.gif"></div></div>
</div>
</li>
<li class="group">
<div class="dribble">
<div class="dribbleshot"><div class="dribbleimg"><span class="decorative"><span class="g"></span><span class="z"></span><span class="x"></span><span class="y"></span></span><img src="time_00001.gif"></div></div>
</div>
</li>
</ul>
</div>
</div>
</body>
<script src="../jquery.min.js"></script>
<script>
$(document).ready(function(){
var $offset=65;
var navwrapper=$("#navwrapper");
var navigation=navwrapper.find("#nav");
var navtrigger=navwrapper.find(".navtrigger");
checkmenu();
$(window).scroll(function(){
checkmenu();
});
navtrigger.on("click",function(){
navigation.toggleClass("isvisible");
})
function checkmenu(){
if($(window).scrollTop()>$offset){

navwrapper.addClass("isfixed").find(".navtrigger").one("webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend",function(){
navigation.addClass("hastransitions");
});
}else if($(window).scrollTop()<=$offset){
if(navigation.hasClass("isvisible")){
navigation.addClass("ishidden").one("webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend",function(){
navigation.removeClass("isvisible hastransitions ishidden");
navwrapper.removeClass("isfixed");
});
}else{
navigation.removeClass("hastransitions");
navwrapper.removeClass("isfixed");
}
}
}
})
</script>
</html>

⚡️⚡️⚡️⚡️⚡️⚡️⚡️

CSS enhance effect

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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>miss</title>
<style type="text/css">
body{
background:#C7EEFF;
}
.about{
margin:57px auto;
padding:8px;
width:260px;
font:10px;
color:#666;
text-align:center;
text-shadow:0 1px rgba(255,255,255,.25);
border-radius:7px;
box-shadow:0 1px 3px rgba(0,0,0,.8),0 57px 0 rgba(255,255,255,.23) inset;
background:#F7F7F7;
background:-webkit-linear-gradient(top,#F7F7F7 0%,#C7C7C7 100%);
background:-moz-linear-gradient(top,#F7F7F7 0%,#C7C7C7 100%);
background:-o-linear-gradient(top,#F7F7F7 0%,#C7C7C7 100%);
background:linear-gradient(to bottom,#F7F7F7,#C7C7C7);
}
.about a{
color:#333;
text-decoration:none;
border-radius:2px;
transition:background .1s;
}
.about a:hover{
text-decoration:none;
background:#FAFAFA;
background:rgba(255,255,255,.7);
}
.aboutlinks{
height:29px;
}
.aboutlinks>a{
float:left;
width:50%;
line-height:29px;
font-size:12px;
}
.aboutauther{
margin-top:5px;
}
.aboutauther>a{
padding:1px 3px;
margin:0 -1px;
}
</style>
</head>
<body>
<section class="about">
<p class="aboutlinks">
<a href="#0">GREEN LAND</a>
<a href="#0">CLEAN AIR</a>
</p>
<p class="aboutauther">
&copy; 1998&ndash;2222 <a href="#0" target="_blank">www.dreamisover.com</a> - All Rights Reserved<br>
built with ❤️ by <a href="#0" target="_blank">WsWmsWord</a>
</p>
</section>
</body>
</html>

一种搭配

背景
颜色 #333745

大字>
字体 首选Yesteryear,而后cursive
字体颜色 #EA2E49
字体阴影 1px 1px 0 #DAEDE2,2px 2px 0 #DAEDE2,3px 3px 0 #DAEDE2,4px 4px 0 #DAEDE2

大字
字体 首选Lato,而后Verdana,其他Arial,Helvetica,sans-serif

<大字
字体颜色 #DAEDE2
字体阴影 1px 1px 0 rgba(234,46,73,0.35),2px 2px 0 rgba(234,46,73,0.35),3px 3px 0 rgba(234,46,73,0.35)

大部分超链接字
字体颜色 #EA2E49

其他字
颜色#DAEDE2
字体 sans-serif

分割线
底边框 1px dashed rgba(218,237,226,0.1)

情景背景
背景色 #2C303C
圆角 3px
边框阴影 inset 0 1px 3px -1px #1D2028, 0 1px 0 #494E62

海の見える駅

我喜欢的一个网页,风格简约清爽,主题是可以看见海的电车站,作者仍在维护。

Strawberry Fields Forever

使用 PS 制作的一张海报。

页阅读量:  ・  站访问量:  ・  站访客数: