forked from MohmedIkram/Hacktoberfest2022
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CSS_Animated_Background.html
119 lines (107 loc) · 2.99 KB
/
CSS_Animated_Background.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
<!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>Animated Background</title>
</head>
<body>
<div class="container">
<span>CSS Only</span>
<div class="bubbles">
<span style="--i:11;"></span>
<span style="--i:12;"></span>
<span style="--i:24;"></span>
<span style="--i:10;"></span>
<span style="--i:14;"></span>
<span style="--i:23;"></span>
<span style="--i:18;"></span>
<span style="--i:16;"></span>
<span style="--i:19;"></span>
<span style="--i:20;"></span>
<span style="--i:22;"></span>
<span style="--i:25;"></span>
<span style="--i:21;"></span>
<span style="--i:15;"></span>
<span style="--i:13;"></span>
<span style="--i:26;"></span>
<span style="--i:17;"></span>
<span style="--i:13;"></span>
<span style="--i:28;"></span>
<span style="--i:11;"></span>
<span style="--i:12;"></span>
<span style="--i:24;"></span>
<span style="--i:10;"></span>
<span style="--i:14;"></span>
<span style="--i:23;"></span>
<span style="--i:18;"></span>
<span style="--i:16;"></span>
<span style="--i:19;"></span>
<span style="--i:20;"></span>
<span style="--i:22;"></span>
<span style="--i:25;"></span>
<span style="--i:21;"></span>
<span style="--i:15;"></span>
<span style="--i:13;"></span>
<span style="--i:26;"></span>
<span style="--i:17;"></span>
<span style="--i:13;"></span>
<span style="--i:28;"></span>
</div>
</div>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
min-height: 100vh;
background: #0c192c;
}
.container {
position: relative;
width: 100%;
height: 100vh;
overflow: hidden;
}
.container span {
position: relative;
display: flex;
justify-content: center;
align-items: center;
font-size: 100px;
color: white;
letter-spacing: 2px;
}
.bubbles {
position: relative;
display: flex;
}
.bubbles span {
position: relative;
width: 30px;
height: 30px;
background: #4fc3dc;
margin: 0 4px;
border-radius: 50%;
box-shadow: 0 0 0 10px #4fc3dc44, 0 0 50px #4fc3dc, 0 0 100px #4fc3dc;
animation: animate 15s linear infinite;
animation-duration: calc(125s/var(--i));
}
.bubbles span:nth-child(even) {
background: #ff2d75;
box-shadow: 0 0 0 10px #4fc3dc44, 0 0 50px #ff2d75, 0 0 100px #ff2d75;
}
@keyframes animate {
0% {
transform: translateY(100vh) scale(0);
}
100% {
transform: translateY(-20vh) scale(1);
}
}
</style>
</body>
</html>