-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
66 lines (65 loc) · 1.48 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>欢迎光临</title>
</head>
<body>
<div class="container">
<div class="pic"></div>
<div class="text">
<p>如果生活中有什么使你感到快乐,那就去做吧</p>
<br />
<p>不要管别人说什么</p>
</div>
</div>
</body>
<style>
html,
body {
margin: 0;
padding: 0;
}
.pic {
box-sizing: border-box;
height: 100%;
width: 100%;
position: absolute;
background: url("./wallpaper.jpg") no-repeat;
background-size: cover;
animation: fade-away 2.5s linear forwards; //forwards当动画完成后,保持最后一帧的状态
}
.text {
position: absolute;
line-height: 55px;
color: #fff;
font-size: 36px;
text-align: center;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
opacity: 0;
animation: show 2s cubic-bezier(0.74, -0.1, 0.86, 0.83) forwards;
}
@keyframes fade-away {
//背景图的明暗度动画
30% {
filter: brightness(1);
}
100% {
filter: brightness(0);
}
}
@keyframes show {
//文字的透明度动画
20% {
opacity: 0;
}
100% {
opacity: 1;
}
}
</style>
</html>