Skip to content

Commit d8cb5ae

Browse files
committed
feat: circle animation
1 parent 1d53a03 commit d8cb5ae

File tree

2 files changed

+88
-0
lines changed

2 files changed

+88
-0
lines changed

src/pages/home/index.jsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,13 @@ const Home = () => {
234234
</button>
235235
</section>
236236

237+
<section style={{ position: 'relative', margin: '80px 0 160px 50px' }}>
238+
<div className={styles['circle-1']}></div>
239+
<div className={styles['circle-2']}></div>
240+
<div className={styles['circle-3']}></div>
241+
<div className={styles['circle-4']}></div>
242+
</section>
243+
237244
<section style={{ width: 600, margin: '30px 0' }}>
238245
<Input defaultValue={apiKey} placeholder="api key" onChange={changeApiKey} style={{ marginBottom: 20 }} />
239246
<Flex align="center">

src/pages/home/index.module.less

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,84 @@
8585
font-size: 1.25rem;
8686
line-height: 1.5rem;
8787
}
88+
89+
.circle-1 {
90+
position: absolute;
91+
width: 20px;
92+
height: 20px;
93+
border-radius: 50%;
94+
top: calc(-10px);
95+
left: calc(-10px);
96+
animation-play-state: running;
97+
animation-delay: 1s;
98+
border: 1.5px solid rgba(121, 40, 202, 0.4);
99+
background: linear-gradient(-180deg, rgba(121, 40, 202, 0.4) 40%, #000000 100%);
100+
animation: expand 6s ease-out infinite both;
101+
}
102+
103+
.circle-2 {
104+
position: absolute;
105+
width: 40px;
106+
height: 40px;
107+
border-radius: 50%;
108+
top: calc(-20px);
109+
left: calc(-20px);
110+
animation-play-state: running;
111+
animation-delay: 0.5s;
112+
border: 1px solid rgba(121, 40, 202, 0.4);
113+
background: linear-gradient(-180deg, rgba(121, 40, 202, 0.30000000000000004) 20%, #000000 100%);
114+
animation: expand-opacity 6s linear infinite both;
115+
}
116+
.circle-3 {
117+
position: absolute;
118+
width: 60px;
119+
height: 60px;
120+
border-radius: 50%;
121+
top: calc(-30px);
122+
left: calc(-30px);
123+
animation-play-state: running;
124+
animation-delay: 1s;
125+
border: 1px solid rgba(121, 40, 202, 0.3);
126+
background: linear-gradient(-180deg, rgba(121, 40, 202, 0.2) 20%, #000000 100%);
127+
animation: expand-opacity 6s linear infinite both;
128+
}
129+
.circle-4 {
130+
position: absolute;
131+
width: 80px;
132+
height: 80px;
133+
border-radius: 50%;
134+
top: calc(-40px);
135+
left: calc(-40px);
136+
animation-play-state: running;
137+
animation-delay: 1.5s;
138+
border: 1px solid rgba(121, 40, 202, 0.2);
139+
background: linear-gradient(-180deg, rgba(121, 40, 202, 0.09999999999999998) 20%, #000000 100%);
140+
animation: expand-opacity 6s linear infinite both;
141+
}
142+
143+
@keyframes expand {
144+
0% {
145+
transform: scale(1);
146+
}
147+
50% {
148+
transform: scale(1.2);
149+
}
150+
100% {
151+
transform: scale(1);
152+
}
153+
}
154+
155+
@keyframes expand-opacity {
156+
0% {
157+
opacity: 0;
158+
transform: scale(1);
159+
}
160+
50% {
161+
opacity: 1;
162+
transform: scale(1.3);
163+
}
164+
100% {
165+
opacity: 0;
166+
transform: scale(1.295);
167+
}
168+
}

0 commit comments

Comments
 (0)