-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtriangle.html
112 lines (100 loc) · 2.56 KB
/
triangle.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
<!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>Document</title>
<style type="text/css">
.container {
display: inline-block;
position: relative;
animation: turn 2s linear forwards 1s;
transform: rotateX(180deg);
overflow: hidden;
height: 180px;
width: 245px;
}
.container .triangle {
position: absolute;
top: 0;
left: 0;
width: 0;
height: 0;
}
.container .triangle.triangle-1 {
border-left: 105px solid transparent;
border-right: 105px solid transparent;
border-bottom: 180px solid #41b883;
}
.container .triangle.triangle-2 {
top: 30px;
left: 35px;
animation: goright 0.5s linear forwards 3.5s;
border-left: 87.5px solid transparent;
border-right: 87.5px solid transparent;
border-bottom: 150px solid #3b8070;
}
.container .triangle.triangle-3 {
top: 60px;
left: 35px;
animation: goright 0.5s linear forwards 3.5s;
border-left: 70px solid transparent;
border-right: 70px solid transparent;
border-bottom: 120px solid #35495e;
}
.container .triangle.triangle-4 {
top: 120px;
left: 70px;
animation: godown 0.5s linear forwards 3s;
border-left: 35px solid transparent;
border-right: 35px solid transparent;
border-bottom: 60px solid #fff;
}
@keyframes turn {
100% {
transform: rotateX(0deg);
}
}
@keyframes godown {
100% {
top: 180px;
}
}
@keyframes goright {
100% {
left: 70px;
}
}
#box {
width: 500px;
height: 500px;
box-sizing: border-box;
border: 10px solid #ccc;
position: relative;
}
#box .content {
position: absolute;
left: 0;
top: 0;
width: 100%;
/* width: 200px; */
height: 200px;
background: orange;
}
</style>
</head>
<body>
<div class="container">
<div class="triangle triangle-1"></div>
<div class="triangle triangle-2"></div>
<div class="triangle triangle-3"></div>
<div class="triangle triangle-4"></div>
</div>
<div id="box">
<div class="content">
11
</div>
</div>
</body>
</html>