Skip to content

Commit d1809fc

Browse files
committed
style: restyle and align main page progress bar
1 parent e5e1191 commit d1809fc

File tree

2 files changed

+58
-10
lines changed

2 files changed

+58
-10
lines changed

src/pages/index.tsx

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -239,22 +239,25 @@ const HomePage: React.FC<EventItem> = ({ slug, frontMatter }) => {
239239
className='relative h-[40px] w-full'
240240
>
241241
<div className='h-full rounded-full border border-blue-100 bg-white shadow-[inset_0_0_8px_rgba(0,0,0,0.3)]'>
242-
<span className='absolute top-[45px] right-2 text-base font-medium'>
243-
4000 participants
244-
</span>
245-
</div>
246-
247242
<motion.div
248243
variants={WidthFramerItem}
249244
className='absolute inset-0 max-w-[95%] rounded-full bg-blue-300'
250245
/>
251-
252246
<motion.div
253247
variants={FadeFramerItem}
254-
className='completed-consent-text xl:w-[240px] max-xl:w-[70px]'
248+
className='total-participants'
249+
>
250+
<span className='block text-xl font-bold'>Goal</span>
251+
<span className='text-[16px] font-normal'>
252+
data collection from 4,000 participants
253+
</span>
254+
</motion.div>
255+
<motion.div
256+
variants={FadeFramerItem}
257+
className='completed-consent-text'
255258
>
256259
<span className='block text-xl font-bold'>3,810+</span>
257-
<span className='text-[16px] font-normal max-xl:text-[12px]'>
260+
<span className='text-[16px] font-normal'>
258261
participants completed the consent process
259262
</span>
260263
</motion.div>
@@ -263,16 +266,17 @@ const HomePage: React.FC<EventItem> = ({ slug, frontMatter }) => {
263266
variants={WidthFramerItem}
264267
className='absolute inset-0 max-w-[48%] rounded-full bg-blue-600'
265268
/>
266-
267269
<motion.div
268270
variants={FadeFramerItem}
269271
className='completed-study-text'
270272
>
271273
<span className='block text-xl font-bold'>1,940+</span>
272-
<span className='text-[16px] font-normal max-xl:text-[12px]'>
274+
<span className='text-[16px] font-normal'>
273275
participants completed in-person study visit
274276
</span>
275277
</motion.div>
278+
</div>
279+
276280
</motion.div>
277281
</div>
278282
</div>

src/styles/globals.css

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,14 @@
162162
bottom: 85px;
163163
left: calc(95% - 12px);
164164
z-index: 4;
165+
width: 240px;
166+
}
167+
168+
.completed-consent-text > span
169+
{
170+
display: block;
171+
transform: translateX(calc(-100% + 32px));
172+
text-align: right;
165173
}
166174

167175
.completed-consent-text:after {
@@ -186,6 +194,13 @@
186194
width: 240px;
187195
}
188196

197+
.completed-study-text > span
198+
{
199+
display: block;
200+
transform: translateX(calc(-100% + 32px));
201+
text-align: right;
202+
}
203+
189204
.completed-study-text:after {
190205
content: '';
191206
position: absolute;
@@ -199,3 +214,32 @@
199214

200215
@apply border-b-transparent border-l-transparent border-r-transparent border-t-blue-600;
201216
}
217+
218+
.total-participants {
219+
position: absolute;
220+
top: 85px;
221+
left: calc(99% - 12px);
222+
z-index: 4;
223+
width: 240px;
224+
}
225+
226+
.total-participants > span
227+
{
228+
display: block;
229+
transform: translateX(calc(-101% + 32px));
230+
text-align: right;
231+
}
232+
233+
.total-participants:after {
234+
content: '';
235+
position: absolute;
236+
top: -34px;
237+
left: 0;
238+
width: 0px;
239+
height: 0px;
240+
border-style: solid;
241+
border-width: 28px 16.5px 0 16.5px;
242+
transform: rotate(180deg);
243+
244+
@apply border-b-transparent border-l-transparent border-r-transparent border-t-blue-600;
245+
}

0 commit comments

Comments
 (0)