-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbutton-motion-dark.html
107 lines (92 loc) · 1.86 KB
/
button-motion-dark.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<style>
body {
background: rgb(9, 9, 11);
}
.container {
position: relative;
width: 400px;
height: 200px;
margin: 50px;
/* Make sure you have enough space to display the animation */
border-radius: 30px;
overflow: hidden;
padding: 1px;
}
.element {
background: rgba(9, 9, 11, 0.38);
border: 1px solid rgb(30, 41, 59);
width: 100%;
height: 100%;
border-radius: 30px;
-webkit-backdrop-filter: blur(24px);
backdrop-filter: blur(24px);
box-sizing: border-box;
color: #cbacf9;
display: flex;
align-items: center;
justify-content: center;
font-size: 60px;
}
.moving-element {
position: absolute;
top: 0;
left: 40px;
width: 80px;
height: 80px;
background-image: radial-gradient(#cbacf9 40%, transparent 80%);
border-radius: 40px;
animation: moveAround 8s linear infinite;
transform: translate(-40px, -40px);
}
@keyframes moveAround {
0% {
left: 40px;
top: 0px;
}
28.93% {
left: 360px;
top: 0px;
}
33.99% {
left: 400px;
top: 40px;
}
44.82% {
left: 400px;
top: 160px;
}
49.88% {
left: 360px;
top: 200px;
}
78.81% {
left: 40px;
top: 200px;
}
83.87% {
left: 0px;
top: 160px;
}
94.70% {
left: 0px;
top: 40px;
}
100% {
left: 40px;
top: 0px;
}
}
</style>
</head>
<body>
<div class="container">
<div class="moving-element"></div>
<div class="element">hello</div>
</div>
</body>
</html>