Skip to content

Commit 57a50a2

Browse files
Improve UI, theme toggle, work section and blog updates
1 parent 2577e2e commit 57a50a2

2 files changed

Lines changed: 75 additions & 16 deletions

File tree

src/components/Header.astro

Lines changed: 51 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,16 @@ const isActive = (path: string) => {
1818
return currentPath === path;
1919
};
2020
---
21-
22-
<header class="sticky top-0 z-50 w-full border-b border-foreground/10 bg-background/95 backdrop-blur-md">
21+
<header
22+
class="sticky top-0 z-50 w-full border-b border-foreground/10"
23+
style="background: hsl(var(--background)); backdrop-filter: none;"
24+
>
2325

2426
<div class="mx-auto flex h-24 w-full items-center justify-between px-4 sm:px-6 lg:px-10">
2527

2628
<!-- LEFT LOGO -->
2729
<a href="/" class="flex items-center gap-3 lg:gap-4">
28-
30+
2931
<Picture
3032
src={logoImage}
3133
formats={["png", "webp", "jpg"]}
@@ -41,7 +43,7 @@ const isActive = (path: string) => {
4143
</a>
4244

4345
<!-- CENTER NAV -->
44-
<nav class="hidden lg:flex absolute left-1/2 -translate-x-1/2">
46+
<nav class="absolute left-1/2 hidden -translate-x-1/2 lg:flex">
4547
<ul class="flex items-center gap-10">
4648

4749
{
@@ -67,18 +69,18 @@ const isActive = (path: string) => {
6769
<!-- RIGHT -->
6870
<div class="flex items-center gap-4">
6971

70-
<!-- TOGGLE -->
72+
<!-- THEME TOGGLE -->
7173
<button
7274
id="themeToggle"
73-
class="flex h-12 w-12 items-center justify-center rounded-2xl border border-foreground/10 text-lg text-foreground transition hover:bg-foreground hover:text-background"
75+
class="flex h-12 w-12 items-center justify-center rounded-2xl border border-foreground/10 text-2xl text-foreground transition duration-300 hover:bg-foreground hover:text-background"
7476
>
75-
🌙
77+
☀️
7678
</button>
7779

7880
<!-- JOIN BUTTON -->
7981
<a
8082
href="/career"
81-
class="hidden rounded-2xl bg-foreground px-6 py-3 text-lg font-semibold text-background transition hover:bg-cyan-500 hover:text-black lg:block"
83+
class="hidden rounded-2xl bg-foreground px-6 py-3 text-lg font-semibold text-background transition duration-300 hover:bg-cyan-500 hover:text-black lg:block"
8284
>
8385
Join Us
8486
</a>
@@ -122,13 +124,54 @@ const isActive = (path: string) => {
122124

123125
</div>
124126
</div>
127+
125128
</header>
126129

127130
<script is:inline>
131+
// MOBILE MENU
128132
const btn = document.getElementById("menuBtn");
129133
const menu = document.getElementById("mobileMenu");
130134

131135
btn?.addEventListener("click", () => {
132136
menu.classList.toggle("hidden");
133137
});
138+
139+
// THEME TOGGLE
140+
const themeToggle = document.getElementById("themeToggle");
141+
142+
// LOAD SAVED THEME
143+
const savedTheme = localStorage.getItem("theme");
144+
145+
if (savedTheme === "dark") {
146+
document.documentElement.classList.add("dark");
147+
} else {
148+
document.documentElement.classList.remove("dark");
149+
}
150+
151+
// UPDATE ICON
152+
const updateThemeIcon = () => {
153+
const isDark = document.documentElement.classList.contains("dark");
154+
155+
if (themeToggle) {
156+
themeToggle.textContent = isDark ? "🌙" : "☀️";
157+
}
158+
};
159+
160+
updateThemeIcon();
161+
162+
// TOGGLE THEME
163+
themeToggle?.addEventListener("click", () => {
164+
165+
document.documentElement.classList.toggle("dark");
166+
167+
const isDark =
168+
document.documentElement.classList.contains("dark");
169+
170+
localStorage.setItem(
171+
"theme",
172+
isDark ? "dark" : "light"
173+
);
174+
175+
updateThemeIcon();
176+
});
134177
</script>

src/pages/work.astro

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ const pages = import.meta.glob("./work/*.astro", {
77
});
88
99
// Extract frontmatter and routes
10-
const pageList = Object.entries(pages).map(
11-
([path, module]) => {
10+
const pageList = Object.entries(pages)
11+
.map(([path, module]) => {
1212
const { frontmatter } = module as any;
1313
1414
const route = path
@@ -23,17 +23,24 @@ const pageList = Object.entries(pages).map(
2323
image: frontmatter.image || "",
2424
route
2525
};
26-
}
27-
);
26+
})
27+
28+
// REMOVE INTERACTIVE LETTER CARD
29+
.filter(
30+
(item) =>
31+
item.title.toLowerCase() !==
32+
"interactive letter"
33+
);
2834
---
2935

3036
<BaseLayout meta={{ title: "Our Work" }}>
3137
<main class="bg-background text-foreground">
32-
38+
3339
<!-- HERO -->
3440
<section class="mx-auto max-w-7xl px-6 py-20 lg:px-10">
35-
41+
3642
<div class="text-center">
43+
3744
<!-- LABEL -->
3845
<p class="mb-4 text-sm font-semibold uppercase tracking-[0.25em] text-cyan-500">
3946
Portfolio
@@ -49,11 +56,12 @@ const pageList = Object.entries(pages).map(
4956
Explore our latest projects, products, platforms and
5057
engineering solutions crafted by Recursive Zero.
5158
</p>
59+
5260
</div>
5361

5462
<!-- GRID -->
5563
<div class="mt-16 grid grid-cols-1 gap-8 pb-12 md:grid-cols-2 lg:grid-cols-3">
56-
64+
5765
<!-- DYNAMIC PROJECTS -->
5866
{
5967
pageList.map(
@@ -81,7 +89,7 @@ const pageList = Object.entries(pages).map(
8189
url="http://abcdkbd.com"
8290
title="ABCDKBD"
8391
description="An interactive kids learning platform."
84-
image="https://abcdkbd.com/_astro/48x48.Uhmpc0nK_ZnUDXw.png"
92+
image="https://github.com/recursivezero/abcd/blob/main/public/assets/images/512x512.png?raw=true"
8593
/>
8694

8795
<!-- THREADZIP -->
@@ -99,6 +107,14 @@ const pageList = Object.entries(pages).map(
99107
description="A python tool that uses computer vision to identify and generate fabric patterns."
100108
image="https://lab.threadzip.com/media/4506a1f4769fb57c54b53e6189d5b405971d3595e689f77360792546.jpg"
101109
/>
110+
<!-- RZRO LINK -->
111+
<BlogCard
112+
url="https://rzro.link/"
113+
title="RZRO Link"
114+
description="A modern smart link and URL shortening platform by Recursive Zero."
115+
image="https://rzro.link/favicon.ico"
116+
/>
117+
102118

103119
</div>
104120
</section>

0 commit comments

Comments
 (0)