Skip to content

Commit 819000e

Browse files
committed
feat: resembles the design
1 parent 4e5a70b commit 819000e

File tree

5 files changed

+27
-22
lines changed

5 files changed

+27
-22
lines changed

src/components/Card.astro

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ const techsGridAlign = 'grid grid-rows-2 gap-y-3'
1919
const techsFlexAlign = 'flex flex-wrap items-center justify-between'
2020
const levelSearchLink = `https://www.frontendmentor.io/challenges?difficulty=${level}&sort=difficulty%7Casc`
2121
const cardShadowClass =
22-
'before:pointer-events-none before:absolute before:top-0 before:z-10 before:h-24 before:w-full before:rounded-t-2xl before:bg-[linear-gradient(rgba(0,0,0,0.15),rgba(0,0,0,0))] before:content-[""]'
22+
'before:pointer-events-none before:absolute before:top-0 before:z-10 before:h-24 before:w-full before:bg-[linear-gradient(rgba(0,0,0,0.15),rgba(0,0,0,0))] before:content-[""]'
2323
---
2424

2525
<article class:list={['relative overflow-hidden rounded-2xl border border-gray-300 bg-white', cardShadowClass]}>
2626
<Link to={link} class="block overflow-hidden">
27-
<Picture {source} alt={title} width={384} height={266} class="transition-colorize rounded-t-2xl" />
27+
<Picture {source} alt={title} width={384} height={266} class="transition-zooming" />
2828
</Link>
2929

3030
<section class="p-6 sm:px-4 md:px-6 xl:p-10">

src/components/LevelTag.astro

+11-4
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,26 @@ const LEVELS = ['newbie', 'junior', 'intermediate', 'advanced', 'guru']
1010
const levelColor = LEVELS[level - 1]
1111
const bgColor = 'bg-' + levelColor
1212
const textColor = 'text-' + levelColor
13+
const borderColor = 'border-' + levelColor
1314
---
1415

1516
<div
1617
class:list={[
17-
'flex h-max w-max items-center rounded-lg border text-xs font-bold leading-5 md:text-sm md:leading-6',
18-
'border-' + levelColor,
18+
borderColor,
19+
'flex h-max w-max items-center rounded-md border text-xs font-bold leading-5 md:text-sm md:leading-6',
1920
extraClass
2021
]}
2122
>
22-
<span class={`block h-full rounded-l-lg ${bgColor} px-2 text-white md:px-3`}>
23+
<span class:list={[
24+
bgColor,
25+
'block h-full rounded-l-sm px-2 text-white md:px-3'
26+
]}>
2327
{level}
2428
</span>
25-
<span class={`block px-1.5 uppercase ${textColor} md:px-3`}>
29+
<span class:list={[
30+
textColor,
31+
'block px-1.5 uppercase md:px-3'
32+
]}>
2633
{levelColor}
2734
</span>
2835
</div>

src/layouts/Layout.astro

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,31 @@ import Header from '@/components/Header.astro'
1414
font-weight: 500;
1515
font-style: normal;
1616
font-display: swap;
17-
src: url('/fonts/barlow-500.woff2') format('woff2');
17+
src: url('/frontendmentor/fonts/barlow-500.woff2') format('woff2');
1818
}
1919

2020
@font-face {
2121
font-family: 'Barlow';
2222
font-weight: 500;
2323
font-style: italic;
2424
font-display: swap;
25-
src: url('/fonts/barlow-500-italic.woff2') format('woff2');
25+
src: url('/frontendmentor/fonts/barlow-500-italic.woff2') format('woff2');
2626
}
2727

2828
@font-face {
2929
font-family: 'Barlow';
3030
font-weight: 700;
3131
font-style: normal;
3232
font-display: swap;
33-
src: url('/fonts/barlow-700.woff2') format('woff2');
33+
src: url('/frontendmentor/fonts/barlow-700.woff2') format('woff2');
3434
}
3535

3636
@font-face {
3737
font-family: 'Barlow';
3838
font-weight: 700;
3939
font-style: italic;
4040
font-display: swap;
41-
src: url('/fonts/barlow-700-italic.woff2') format('woff2');
41+
src: url('/frontendmentor/fonts/barlow-700-italic.woff2') format('woff2');
4242
}
4343
</style>
4444
</head>

tailwind.config.ts

+10-3
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,20 @@ const config: Config = {
6565
}
6666
},
6767

68-
'@media screen and (pointer: fine)': {
68+
'@media (pointer: fine)': {
6969
'.transition-colorize': {
7070
filter: 'grayscale(100%)',
71-
transition: 'transform 300ms, filter 300ms ease-in-out',
71+
transition: 'filter 300ms ease-in-out',
72+
73+
'&:hover': {
74+
filter: 'grayscale(0)'
75+
}
76+
},
77+
78+
'.transition-zooming': {
79+
transition: 'transform 300ms ease-in-out',
7280

7381
'&:hover': {
74-
filter: 'grayscale(0)',
7582
transform: 'scale(1.05)'
7683
}
7784
}

vite.config.ts

-9
This file was deleted.

0 commit comments

Comments
 (0)