Skip to content

Commit

Permalink
feat: custom scrollbar
Browse files Browse the repository at this point in the history
  • Loading branch information
zaida04 committed Jan 21, 2024
1 parent 913e477 commit 9cc33b7
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 26 deletions.
Binary file modified bun.lockb
Binary file not shown.
1 change: 1 addition & 0 deletions src/layouts/PageLayout.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
import Layout from "./Layout.astro";
import Navbar from "../components/nav/Navbar.tsx";
import { Scrollbar } from "react-scrollbars-custom";
interface Props {
title: string;
Expand Down
47 changes: 21 additions & 26 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ import projects_data from "../data/projects.json";
import PageLayout from "../layouts/PageLayout.astro";
import ProjectCard from "../components/project/ProjectCard";
import { Github, Mail } from "lucide-react";
import { Scrollbar } from "react-scrollbars-custom";
const project_sections: Record<string, keyof typeof projects_data> = {
"Websites & Fullstack": "sites",
"Backend & Bots": "backends",
Libraries: "libraries",
};
---

<PageLayout title="Zaid's Site">
Expand Down Expand Up @@ -52,32 +59,20 @@ import { Github, Mail } from "lucide-react";
<h2>Featured Projects</h2>

<div class="flex flex-col gap-4">
<h3>Websites & Fullstack</h3>
<div class="flex flex-row flex-wrap gap-4">
{
projects_data.sites.map((project) => (
<ProjectCard {...project} />
))
}
</div>

<h3>Backend & Bots</h3>
<div class="flex flex-row flex-wrap gap-4">
{
projects_data.backends.map((project) => (
<ProjectCard {...project} />
))
}
</div>

<h3>Libraries</h3>
<div class="flex flex-row flex-wrap gap-4">
{
projects_data.libraries.map((project) => (
<ProjectCard {...project} />
))
}
</div>
{
Object.entries(project_sections).map(
([title, json_section]) => (
<>
<h3>{title}</h3>
<div class="flex flex-row gap-4 overflow-x-auto pb-4">
{projects_data[json_section].map((project) => (
<ProjectCard {...project} />
))}
</div>
</>
),
)
}
</div>

<div id="competitions">
Expand Down
17 changes: 17 additions & 0 deletions src/styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,21 @@
html {
@apply overflow-y-scroll
}

* {
scrollbar-width: auto;
scrollbar-color: #8f54a0 #ffffff;
}

*::-webkit-scrollbar {
@apply w-[12px];
}

*::-webkit-scrollbar-track {
@apply bg-white
}

*::-webkit-scrollbar-thumb {
@apply bg-slate-800 border border-white;
}
}

0 comments on commit 9cc33b7

Please sign in to comment.