Skip to content

Commit 29e7112

Browse files
Кастомные скроллбары
1 parent cc93b82 commit 29e7112

File tree

2 files changed

+79
-19
lines changed

2 files changed

+79
-19
lines changed

src/pages/index.astro

Lines changed: 44 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import CVCard from '../components/cards/CVCard.astro'
1010
import ExperienceCard from '../components/cards/ExperienceCard.astro'
1111
import StudyCard from '../components/cards/StudyCard.astro'
1212
import GitHubActivityCard from '../components/cards/GitHubActivityCard.astro'
13-
1413
---
1514

1615
<script>
@@ -34,7 +33,7 @@ import GitHubActivityCard from '../components/cards/GitHubActivityCard.astro'
3433
]
3534

3635
await timeline(sequence as TimelineDefinition).finished
37-
cards.forEach(card => {
36+
cards.forEach((card) => {
3837
card.style.transform = ''
3938
card.style.opacity = ''
4039
})
@@ -50,39 +49,60 @@ import GitHubActivityCard from '../components/cards/GitHubActivityCard.astro'
5049
>
5150
<div class="flex flex-col items-center gap-6">
5251
<div class="relative">
53-
<div class="h-14 w-14 animate-spin rounded-full border-2 border-muted border-t-primary" aria-hidden="true"></div>
54-
<div class="absolute inset-0 h-14 w-14 rounded-full bg-primary/5 animate-glow-pulse" aria-hidden="true"></div>
52+
<div
53+
class="h-14 w-14 animate-spin rounded-full border-2 border-muted border-t-primary"
54+
aria-hidden="true"
55+
>
56+
</div>
57+
<div
58+
class="absolute inset-0 h-14 w-14 animate-glow-pulse rounded-full bg-primary/5"
59+
aria-hidden="true"
60+
>
61+
</div>
5562
</div>
56-
<span class="text-lg font-medium text-muted-foreground animate-fade-in-up">Загрузка...</span>
63+
<span class="animate-fade-in-up text-lg font-medium text-muted-foreground"
64+
>Загрузка...</span
65+
>
5766
</div>
5867
</div>
5968

60-
<div class="fixed inset-0 -z-50 overflow-hidden pointer-events-none">
61-
<div class="absolute inset-0 bg-grid-pattern opacity-[0.03] dark:opacity-[0.04]"></div>
62-
<div class="absolute -top-40 -right-40 h-80 w-80 rounded-full bg-primary/8 blur-3xl animate-glow-pulse"></div>
63-
<div class="absolute -bottom-40 -left-40 h-80 w-80 rounded-full bg-primary/8 blur-3xl animate-glow-pulse" style="animation-delay: 1.5s"></div>
69+
<div class="pointer-events-none fixed inset-0 -z-50 overflow-hidden">
70+
<div
71+
class="bg-grid-pattern absolute inset-0 opacity-[0.03] dark:opacity-[0.04]"
72+
>
73+
</div>
74+
<div
75+
class="bg-primary/8 absolute -right-40 -top-40 h-80 w-80 animate-glow-pulse rounded-full blur-3xl"
76+
>
77+
</div>
78+
<div
79+
class="bg-primary/8 absolute -bottom-40 -left-40 h-80 w-80 animate-glow-pulse rounded-full blur-3xl"
80+
style="animation-delay: 1.5s"
81+
>
82+
</div>
6483
</div>
6584

6685
<main
67-
class="relative m-auto grid w-full max-w-7xl gap-3 overflow-hidden p-3 sm:gap-4 sm:p-4 md:grid-cols-2 md:gap-6 md:p-6 lg:grid-cols-4 lg:grid-rows-8 lg:gap-8"
86+
class="relative m-auto grid w-full max-w-7xl gap-3 overflow-hidden p-3 sm:gap-4 sm:p-4 md:grid-cols-2 md:gap-6 md:p-6 lg:grid-cols-4 lg:grid-rows-4 lg:gap-8"
6887
>
6988
<IntroCard />
7089
<AboutMe />
7190
<CVCard />
72-
<Now />
7391
<Card
7492
colSpan="md:col-span-1"
7593
rowSpan="md:row-span-2"
76-
title="Портфолио и проекты"
77-
href="/portfolio"
94+
title="Блог"
95+
href="/blog"
96+
body="Заметки о разработке и не только"
7897
/>
7998
<Card
8099
colSpan="md:col-span-1"
81100
rowSpan="md:row-span-2"
82-
title="Блог"
83-
href="/blog"
84-
body="Заметки о разработке и не только"
101+
title="Портфолио и проекты"
102+
href="/portfolio"
103+
body="Мои pet-проекты"
85104
/>
105+
<Now />
86106
<TimeZoneCard />
87107
<ContactsCard />
88108
<ExperienceCard />
@@ -93,10 +113,15 @@ import GitHubActivityCard from '../components/cards/GitHubActivityCard.astro'
93113

94114
<style>
95115
.bg-grid-pattern {
96-
background-image:
97-
radial-gradient(circle at center, currentColor 1px, transparent 1px),
116+
background-image: radial-gradient(
117+
circle at center,
118+
currentColor 1px,
119+
transparent 1px
120+
),
98121
linear-gradient(to right, currentColor 1px, transparent 1px);
99-
background-size: 40px 40px, 40px 40px;
122+
background-size:
123+
40px 40px,
124+
40px 40px;
100125
mask-image: radial-gradient(ellipse at center, black 40%, transparent 70%);
101126
}
102127
</style>

src/styles/globals.css

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
@layer base {
66
:root {
7+
--scrollbar-track: 60 4.8% 95.9%;
8+
--scrollbar-thumb: 20 5.9% 75%;
9+
--scrollbar-thumb-hover: 20 5.9% 65%;
710
--background: 0 0% 100%;
811
--foreground: 20 14.3% 4.1%;
912
--card: 0 0% 100%;
@@ -29,6 +32,9 @@
2932
}
3033

3134
.dark {
35+
--scrollbar-track: 12 6.5% 12%;
36+
--scrollbar-thumb: 12 6.5% 28%;
37+
--scrollbar-thumb-hover: 12 6.5% 36%;
3238
--background: 20 14.3% 4.1%;
3339
--foreground: 60 9.1% 97.8%;
3440
--card: 20 14.3% 4.1%;
@@ -92,4 +98,33 @@
9298
animation: none;
9399
}
94100
}
101+
102+
/* Кастомные скроллбары (светлая/тёмная тема через переменные) */
103+
* {
104+
scrollbar-width: thin;
105+
scrollbar-color: hsl(var(--scrollbar-thumb)) hsl(var(--scrollbar-track));
106+
}
107+
108+
*::-webkit-scrollbar {
109+
width: 10px;
110+
height: 10px;
111+
}
112+
113+
*::-webkit-scrollbar-track {
114+
background: hsl(var(--scrollbar-track));
115+
}
116+
117+
*::-webkit-scrollbar-thumb {
118+
background: hsl(var(--scrollbar-thumb));
119+
border-radius: 5px;
120+
border: 2px solid hsl(var(--scrollbar-track));
121+
}
122+
123+
*::-webkit-scrollbar-thumb:hover {
124+
background: hsl(var(--scrollbar-thumb-hover));
125+
}
126+
127+
*::-webkit-scrollbar-corner {
128+
background: hsl(var(--scrollbar-track));
129+
}
95130
}

0 commit comments

Comments
 (0)