Repository navigation
Expand file tree
/
Copy pathpostion.html
More file actions
193 lines (174 loc) · 5.19 KB
/
Copy pathpostion.html
File metadata and controls
193 lines (174 loc) · 5.19 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
<!DOCTYPE html>
<html lang="en">
<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>
</head>
<style type="text/css">
@font-face {
font-family: 'KH';
src: url('./font/FZZJ-LongYTJW.ttf');
}
@keyframes tracking-in-contract-bck-bottom {
0% {
letter-spacing: 1em;
-webkit-transform: translateZ(400px) translateY(300px);
transform: translateZ(400px) translateY(300px);
opacity: 0;
}
40% {
opacity: 0.6;
}
100% {
-webkit-transform: translateZ(0) translateY(0);
transform: translateZ(0) translateY(0);
opacity: 1;
}
}
@keyframes text-pop-up-top {
0% {
-webkit-transform: translateY(0);
transform: translateY(0);
-webkit-transform-origin: 50% 50%;
transform-origin: 50% 50%;
text-shadow: none;
}
100% {
-webkit-transform: translateY(-50px);
transform: translateY(-50px);
-webkit-transform-origin: 50% 50%;
transform-origin: 50% 50%;
text-shadow: 0 1px 0 #cccccc, 0 2px 0 #cccccc, 0 3px 0 #cccccc, 0 4px 0 #cccccc, 0 5px 0 #cccccc, 0 6px 0 #cccccc, 0 7px 0 #cccccc, 0 8px 0 #cccccc, 0 9px 0 #cccccc, 0 50px 30px rgba(0, 0, 0, 0.3);
}
}
* {
margin: 0;
padding: 0;
}
html,
body {
width: 100%;
height: 100%;
font-family: 'KH';
}
.contentBox {
width: 100%;
}
.setFont {
width: 200px;
height: 200px;
font-size: 60px;
text-align: center;
line-height: 200px;
}
.relative {
position: relative;
top: 30px;
left: 30px;
background-color: #f5f5dcb0;
}
.absolute {
position: absolute;
top: 30px;
left: 30px;
background-color: rgba(255, 228, 196, .4);
}
.fixed {
position: fixed;
top: 300px;
left: 300px;
background-color: #deb8877a;
}
/* sticky生效的前提是,必须搭配top、bottom、left、right这四个属性一起使用,不能省略,否则等同于relative定位,不产生"动态固定"的效果。
原因是这四个属性用来定义"偏移距离",浏览器把它当作sticky的生效门槛。
它的具体规则是,当页面滚动,父元素开始脱离视口时(即部分不可见),
只要与sticky元素的距离达到生效门槛,
relative定位自动切换为fixed定位;
等到父元素完全脱离视口时(即完全不可见),
fixed定位自动切换回relative定位 */
.sticky {
position: sticky;
top: 0px;
width: 100%;
background-color: #f6f6f6;
transition: all .8s;
animation: text-pop-up-top 1s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
}
.headText {
width: 100%;
height: 200px;
text-align: center;
line-height: 200px;
font-size: 60px;
background-color: #faebd7d1;
animation: text-pop-up-top 1s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
}
.contentText {
position: sticky;
top: 200px;
width: 100%;
height: 500px;
text-align: center;
line-height: 500px;
font-size: 60px;
background-color: #ffe2e2;
animation: text-pop-up-top 1s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
}
.footerText {
position: sticky;
top: 700px;
width: 100%;
height: 200px;
text-align: center;
line-height: 200px;
font-size: 60px;
background-color: #aaaaaa;
animation: text-pop-up-top 1s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
}
</style>
<body>
<!-- 所以暂时将你眼睛闭了起来
黑暗之中漂浮我的期待
平静脸孔映着缤纷色彩
让人好不疼爱
你可以随着我的步伐
轻轻柔柔的踩
将美丽的回忆慢慢重来
突然之间浪漫无法释怀
明天我要离开
你给的爱
无助的等待
是否我一个人走
想听见你的挽留
春风秋雨 飘飘落落 只为寂寞
你给的爱
甜美的伤害
深深的锁住了我
隐藏不住的脆弱
泛滥河水将我冲向你的心头
不停流 -->
<div class="contentBox">
<div class="sticky setFont"> Last Dance </div>
<div class="headText"> 伍佰 </div>
<div class="contentText"> 所以暂时将你眼睛闭了起来 </div>
<div class="contentText"> 黑暗之中漂浮我的期待 </div>
<div class="contentText"> 平静脸孔映着缤纷色彩 </div>
<div class="contentText"> 让人好不疼爱 </div>
<div class="contentText"> 你可以随着我的步伐 </div>
<div class="contentText"> 轻轻柔柔的踩 </div>
<div class="contentText"> 将美丽的回忆慢慢重来 </div>
<div class="contentText"> 突然之间浪漫无法释怀 </div>
<div class="contentText"> 明天我要离开 </div>
<div class="contentText"> 你给的爱 </div>
<div class="contentText"> 甜美的伤害 </div>
<div class="contentText"> 深深的锁住了我 </div>
<div class="contentText"> 隐藏不住的脆弱 </div>
<div class="contentText"> 泛滥河水将我冲向你的心头 </div>
<div class="footerText"> 不停流 </div>
<!-- <div class="relative setFont"> relative <div class="absolute setFont"> absolute </div></div> -->
<!-- <div class="fixed setFont"> fixed </div> -->
</div>
</body>
</html>