forked from GeekNerds/Hacktoberfest-2022
-
Notifications
You must be signed in to change notification settings - Fork 0
/
3D_Text_Rotation_Animation.html
115 lines (101 loc) · 3.1 KB
/
3D_Text_Rotation_Animation.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
<!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>3D Text Rotation Animation</title>
</head>
<body>
<div class="box">
<div>
<span style="--i:1;"></span>
<span style="--i:2;"></span>
<span style="--i:3;"></span>
<span style="--i:4;"></span>
<span style="--i:5;"></span>
<span style="--i:6;"></span>
<span style="--i:7;"></span>
<span style="--i:8;"></span>
<span style="--i:9;"></span>
<span style="--i:10;"></span>
<span style="--i:11;"></span>
<span style="--i:12;"></span>
<span style="--i:13;"></span>
<span style="--i:14;"></span>
<span style="--i:15;"></span>
<span style="--i:16;"></span>
<span style="--i:17;"></span>
<span style="--i:18;"></span>
<span style="--i:19;"></span>
<span style="--i:20;"></span>
<span style="--i:21;"></span>
<span style="--i:22;"></span>
<span style="--i:23;"></span>
<span style="--i:24;"></span>
</div>
</div>
<style>
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Poppins', sans-serif;
}
body {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: #333;
overflow: hidden;
}
.box {
position: relative;
width: 100%;
height: 350px;
transform-style: preserve-3d;
}
.box div {
position: absolute;
width: 100%;
height: 100%;
transform-style: preserve-3d;
animation: animate 24s linear infinite;
}
.box div span {
position: absolute;
inset: 0;
transform: rotateX(calc(var(--i) * 15deg));
}
.box div span::before {
content: 'Madhav';
position: absolute;
width: 100%;
height: 100px;
text-align: center;
color: #fffd;
text-transform: uppercase;
font-size: 8em;
font-weight: 800;
-webkit-text-stroke: 2px #000;
text-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}
.box div span:nth-child(3n+2):before {
color: #e3f2fddd;
}
.box div span:nth-child(3n+3):before {
color: #fce4ecdd;
}
@keyframes animate {
0% {
transform: perspective(1000px) rotateX(0deg);
}
100% {
transform: perspective(1000px) rotateX(360deg);
}
}
</style>
</body>
</html>