Skip to content

Commit

Permalink
remade first page :D
Browse files Browse the repository at this point in the history
  • Loading branch information
saumilthecode committed Oct 21, 2024
1 parent 02ab8af commit 56c087f
Show file tree
Hide file tree
Showing 28 changed files with 13,679 additions and 76 deletions.
9,694 changes: 9,694 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

Binary file added public/logo.webp
Binary file not shown.
Binary file added src/assets/img/zennethmotivational.webp
Binary file not shown.
6 changes: 3 additions & 3 deletions src/components/core/Footer.astro
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ const { class: className } = Astro.props;
class="text-center text-sm leading-loose text-muted-foreground md:text-left"
>
Built by <a
href="https://hyperoot.dev"
href="https://github.com/saumilthecode"
target="_blank"
rel="noreferrer"
class="font-medium underline underline-offset-4">HYP3R00T</a
class="font-medium underline underline-offset-4">Saumil</a
>. The source code is available on
<a
href="https://github.com/HYP3R00T/CelestialDocs"
href="https://github.com/saumilthecode/bbsshackclub"
target="_blank"
rel="noreferrer"
class="font-medium underline underline-offset-4">GitHub</a
Expand Down
6 changes: 5 additions & 1 deletion src/components/core/HamNavMenu.astro
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ const pathname_part: string = pathname.split("/")[1];
<a href={item.href}>
<Button
variant="link"
className=`${"/" + pathname_part === "/" + item.href.split("/")[1] ? "underline" : ""} text-foreground`
className={`${
"/" + pathname_part === "/" + item.href.split("/")[1]
? "underline"
: ""
} text-foreground`}
key={item.href}
>
{item.title}
Expand Down
73 changes: 41 additions & 32 deletions src/components/core/Header.astro
Original file line number Diff line number Diff line change
@@ -1,66 +1,79 @@
---
import { ModeToggle } from "@/components/core/ModeToggle";
import HamNavMenu from "@/components/core/HamNavMenu.astro";
import NavMenue from "@/components/core/navmenue.astro";
import NavMenu from "@/components/core/NavMenu.astro";
import { Search } from "@/components/core/Search";
import { Button } from "@/components/ui/button";
import { docconfig, SITE } from "@/config";
import { Github } from "lucide-react";
// To pass the tailwindcss classes to the astro component
const { class: className } = Astro.props;
---

<header
class:list={[
"py-4 px-6 md:px-16 lg:px-48 w-full sticky top-0 z-50",
"py-2 px-2 sm:py-3 sm:px-4 md:px-6 lg:px-12 w-full sticky top-0 z-50",
className,
]}
>
<div
class="flex space-x-4 justify-between items-center md:items-center md:space-x-0 md:max-w-8xl"
class="flex justify-between items-center"
>
<div class="font-bold flex flex-row items-center">
<a href="/" class="px-4 hidden md:flex no-underline">
<!-- Left Side Logo -->
<div class="font-bold flex items-center">
<a href="/" class="no-underline">
<Button
client:load
className="flex gap-2 hover:no-underline text-2xl"
className="flex gap-2 hover:no-underline text-lg sm:text-xl md:text-2xl p-1 sm:p-2"
variant="link"
>
<img src="/logo.svg" alt="Logo" class="w-[2rem] h-[2rem]" />
<img src="/logo.webp" alt="Logo" class="w-6 h-6 sm:w-8 sm:h-8" />
{SITE.title}
</Button>
</a>
<a href="/" class="px-4 flex md:hidden">
<Button client:load className="" variant="ghost" size="icon">
<img src="/logo.svg" alt="Logo" class="w-[2rem] h-[2rem]" />
</Button>
</a>
<div class="hidden md:block">
<NavMenu />
</div>
</div>

<div class="flex flex-row gap-2 md:px-8">
{!docconfig.hide_search && <Search client:only="react" />}
<!-- Center Navigation Links - Only visible on desktop -->
<div class="hidden md:flex items-center gap-6">
<a href="/projects">
<Button variant="ghost">Projects</Button>
</a>
<a href="/competition">
<Button variant="ghost">Competition</Button>
</a>
<a href="/our-people">
<Button variant="ghost">Our People</Button>
</a>
</div>

<!-- Right Side Buttons and Controls -->
<div class="flex items-center gap-1 sm:gap-2">
{!docconfig.hide_search && (
<div class="hidden sm:block">
<Search client:only="react" />
</div>
)}
{
!docconfig.hide_repo_button && (
<a href={SITE.repo} target="_blank">
<Button client:load className="" variant="ghost" size="icon">
<Github className="w-[1.2rem] h-[1.2rem]" />
<a href={SITE.repo} target="_blank" class="hidden sm:inline-block">
<Button client:load variant="ghost" size="icon" className="p-1 sm:p-2">
<Github className="w-4 h-4 sm:w-5 sm:h-5" />
</Button>
</a>
)
}
<div class="md:hidden flex flex-row-reverse gap-4">
<HamNavMenu />
<ModeToggle client:load transition:persist />
<!-- Join Us button - Only visible on desktop -->
<div class="hidden md:block">
<a href="/join-us">
<Button client:load variant="default">Join Us</Button>
</a>
</div>

<div class="flex-row gap-4 hidden md:flex">
<ModeToggle client:load transition:persist />
<ModeToggle client:load transition:persist />
<div class="md:hidden">
<NavMenue />
</div>
</div>
</div>
Expand All @@ -69,10 +82,7 @@ const { class: className } = Astro.props;
<script is:inline>
function setDarkMode(document) {
const getThemePreference = () => {
if (
typeof localStorage !== "undefined" &&
localStorage.getItem("theme")
) {
if (typeof localStorage !== "undefined" && localStorage.getItem("theme")) {
return localStorage.getItem("theme");
}
return window.matchMedia("(prefers-color-scheme: dark)").matches
Expand All @@ -97,7 +107,6 @@ const { class: className } = Astro.props;
setDarkMode(document);

document.addEventListener("astro:before-swap", (ev) => {
// Pass the incoming document to set the theme on it
setDarkMode(ev.newDocument);
});
</script>
</script>
144 changes: 144 additions & 0 deletions src/components/core/navmenue.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
---
import { Button } from "@/components/ui/button";
import { MenuIcon, X } from "lucide-react";
import { SITE } from "@/config";
---

<style>
.menu-overlay {
display: none;
position: fixed;
inset: 0;
background-color: rgb(255, 255, 255);
z-index: 9999;
overflow-y: auto;
opacity: 0;
transition: opacity 0.3s ease-in-out;
}

@media (prefers-color-scheme: dark) {
.menu-overlay {
background-color: rgb(9, 9, 11);
}
}

.menu-overlay.active {
display: flex;
flex-direction: column;
opacity: 1;
}

.menu-content {
padding: 2rem;
flex-grow: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
position: relative;
z-index: 10000;
}

.close-button {
position: absolute;
top: 1rem;
right: 1rem;
z-index: 10001;
}

.menu-item {
width: 100%;
text-align: center;
padding: 0.5rem;
position: relative;
z-index: 10000;
list-style: none;
}

#menu-toggle {
position: relative;
z-index: 9998;
}

.menu-list {
list-style: none;
padding: 0;
margin: 0;
}

@media (max-width: 768px) {
.menu-content {
justify-content: flex-start;
padding-top: 4rem;
}
}
</style>

<div id="menu-toggle">
<Button variant="ghost" size="icon" client:load aria-label="Toggle menu">
<MenuIcon className="h-[1.2rem] w-[1.2rem]" />
</Button>
</div>

<div class="menu-overlay" role="dialog" aria-modal="true">
<div class="close-button">
<Button variant="ghost" size="icon" client:load id="close-menu" aria-label="Close menu">
<X className="h-[1.2rem] w-[1.2rem]" />
</Button>
</div>
<nav class="menu-content">
<ul class="menu-list flex flex-col items-center space-y-6 text-xl w-full">
<li class="menu-item">
<a href="/">
<Button client:load variant="link" size="lg" className="w-full">Home</Button>
</a>
</li>
<li class="menu-item">
<a href="/projects">
<Button client:load variant="link" size="lg" className="w-full">Projects</Button>
</a>
</li>
<li class="menu-item">
<a href="/competition">
<Button client:load variant="link" size="lg" className="w-full">Competition</Button>
</a>
</li>
<li class="menu-item">
<a href="/our-people">
<Button client:load variant="link" size="lg" className="w-full">Our People</Button>
</a>
</li>
<li class="menu-item">
<a href="/join-us">
<Button client:load variant="default" size="lg" className="w-full">Join Us</Button>
</a>
</li>
</ul>
</nav>
</div>

<script>
function toggleMenu() {
const menuOverlay = document.querySelector('.menu-overlay');
if (menuOverlay) {
menuOverlay.classList.toggle('active');
document.body.style.overflow = menuOverlay.classList.contains('active') ? 'hidden' : '';
}
}

document.getElementById('menu-toggle')?.addEventListener('click', toggleMenu);
document.getElementById('close-menu')?.addEventListener('click', toggleMenu);

document.querySelectorAll('.menu-overlay a').forEach(link => {
link.addEventListener('click', toggleMenu);
});

document.addEventListener('keydown', (e) => {
if (e.key === 'Escape') {
const menuOverlay = document.querySelector('.menu-overlay');
if (menuOverlay?.classList.contains('active')) {
toggleMenu();
}
}
});
</script>
13 changes: 13 additions & 0 deletions src/components/home/CallToAction.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
// CallToAction.astro
---

<div class="cta-container">
<h1 class="text-center">Take an idea you're interested in and bring it to <i>L</i>ife</h1>
</div>

<style>
.cta-container {
padding-bottom: 4rem; /* Adds padding below the h1 */
}
</style>
37 changes: 37 additions & 0 deletions src/components/home/entice.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
import { Image } from 'astro:assets';
import zennethmotivational from '/src/assets/img/zennethmotivational.webp';
---

<div class="flex flex-col md:flex-row items-center justify-center w-full max-w-4xl mx-auto pb-16 px-4 md:px-0">
<div class="flex-shrink-0 mb-6 md:mb-0 md:mr-8">
<Image
src={zennethmotivational}
alt="Motivational image"
width={320}
height={320}
class="w-full md:w-auto"
/>
</div>
<div class="flex-grow">
<p class="text-base md:text-lg text-[#cbd4f5] space-y-2 text-center md:text-left">
Ever wanted to make a <a href="https://hackclub.com/onboard/" class="text-[#00ff29]">PCB</a>?
<br />
What about a <a href="https://sprig.hackclub.com/" class="text-[#00ffb3]">game</a>?
<br />
What about a <a href="https://saumilthecode.github.io/dancefloor/" class="text-[#f2ed6d]">3D website</a>?
<br />
<br />
I could keep this list going but you get what I'm talking about.
<br />
Ever wanted to make something with Tech but never knew how to?
<br />
With BBSS Hack Club we <strong>will</strong> give you the resources, time and (<em>possibly</em>) funding to work on your projects
<br />
<br />
<a href="/projects" class="font-bold hover:underline transition-all duration-300 inline-block mt-4 text-lg">
🚀 <i class="text-primary">Explore Our Exciting Projects!</i>
</a>
</p>
</div>
</div>
12 changes: 5 additions & 7 deletions src/components/home/hero.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
const { class: className } = Astro.props;
import { Image } from "astro:assets";
import { Button } from "@/components/ui/button";
import KittyAstronaut from "@/assets/KittyAstronaut.svg";
import KittyAstronaut from "/public/logo.webp";
---

<div
Expand All @@ -18,13 +18,11 @@ import KittyAstronaut from "@/assets/KittyAstronaut.svg";
<h1
class="text-pretty text-center md:text-left md:text-4xl lg:text-5xl tracking-wide"
>
Elevate Your Documentation with a <i class="text-primary">Celestial</i> Touch
BBSS <i class="text-primary">Hack Club</i>
</h1>
<a href="/getting-started" class="py-4">
<Button size="lg" className="rounded-lg">
<h4 class="text-lg">Get started</h4>
</Button>
</a>
<p class="text-center md:text-left text-lg md:text-2xl">
Take an idea you're interested in and bring it to Life
</p>
</div>
<div class="hidden md:flex w-1/2 justify-center align-middle">
<Image src={KittyAstronaut} alt="404" />
Expand Down
Loading

0 comments on commit 56c087f

Please sign in to comment.