-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathboxanimation-eligent.html
112 lines (88 loc) · 2.43 KB
/
boxanimation-eligent.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">
<title>Document</title>
<style>
*,
*::after,
*::before {
padding: 0;
margin: 0;
box-sizing: border-box;
}
body {
height: 100vh;
}
.main {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: #222;
}
.box {
position: relative;
width: 400px;
height: 300px;
}
.box::before {
content: '';
position: absolute;
inset: 0;
background: repeating-conic-gradient(from var(--a), #0f0,#01a501, #0f0, #01a501, #0f0);
/* background: repeating-conic-gradient(from var(--a), #0f0, #ff0, #0ff, #f0f, #0ff); */
border-radius: 20px;
animation: rotatin 4s linear infinite;
}
.box::after {
content: '';
position: absolute;
inset: 0;
background: repeating-conic-gradient(from var(--a), #0f0,#01a501, #0f0, #01a501, #0f0);
/* background: repeating-conic-gradient(from var(--a), #0f0, #ff0, #0ff, #f0f, #0ff); */
border-radius: 20px;
animation: rotating 4s linear infinite;
filter: blur(40px);
opacity: 0.75;
}
.box span {
position: absolute;
inset: 4px;
background: #222;
border-radius: 16px;
z-index: 1;
}
@property --a {
syntax: '<angle>';
inherits: false;
initial-value: 0deg;
}
@keyframes rotating {
0% {
--a: 0deg;
}
100% {
--a: 360deg;
}
}
.box .box {
position: absolute;
inset: 0 -50px;
top: 75px;
height: 150px;
width: 500px;
}
</style>
</head>
<body>
<div class="main">
<div class="box"><span></span>
<div class="box"><span></span></div>
</div>
</div>
<script>
</script>
</body>
</html>