changes for nav and Juhatus

This commit is contained in:
Henri
2026-04-06 21:10:15 +03:00
parent 99ad293289
commit ae1a44b65f
13 changed files with 113 additions and 46 deletions

View File

@@ -7,8 +7,10 @@
{#if $text && Object.keys($text).length > 0} {#if $text && Object.keys($text).length > 0}
<Navbar /> <Navbar />
<main> <main class="min-h-screen flex flex-col">
<div class="flex-1 flex flex-col">
<Router {routes} /> <Router {routes} />
</div>
<Footer /> <Footer />
</main> </main>
{/if} {/if}

View File

@@ -5,9 +5,9 @@
/* Overwriting tailwindcss specific variables */ /* Overwriting tailwindcss specific variables */
@theme { @theme {
--color-orange-500: #f0941d; --color-orange-500: #f0941d; /* Primary color, use this for most things. */
--color-orange-300: #ffa940; --color-orange-300: #ffa80d; /* Use for hover states, accents, and highlights. (lighter than primary) */
--color-orange-600: #d67d0a; --color-orange-600: #d67d0a; /* Ideally don't use */
--color-gray-100: #fffdfa; --color-gray-100: #fffdfa;
--color-gray-900: #0d0d0d; --color-gray-900: #0d0d0d;
@@ -109,6 +109,11 @@ input[type="submit"] {
margin: -1px; margin: -1px;
} }
/* Safe area for content below navbar (94px scaled) */
.safe-area-navbar {
padding-top: calc(94px * var(--ui-scale));
}
/* Show/hide helpers for breakpoints */ /* Show/hide helpers for breakpoints */
.mobile-only { .mobile-only {
display: block; display: block;

View File

@@ -26,21 +26,13 @@
<div class="relative inline-block" onfocusout={handleFocusOut}> <div class="relative inline-block" onfocusout={handleFocusOut}>
<Button onClick={toggle} class={`${buttonClass} gap-0`}> <Button onClick={toggle} class={`${buttonClass} gap-0`}>
{name} {name}
<svg <span
xmlns="http://www.w3.org/2000/svg" class="ml-1 mr-0 mt-0.5 transition-transform inline-block text-[0.9em] opacity-60"
fill="none"
viewBox="0 0 24 24"
stroke-width="2"
stroke="currentColor"
class="w-4 h-4 ml-1 mr-0 mt-0.5 transition-transform inline-block"
style:transform={isOpen ? "rotate(180deg)" : "none"} style:transform={isOpen ? "rotate(180deg)" : "none"}
aria-hidden="true"
> >
<path
stroke-linecap="round" </span>
stroke-linejoin="round"
d="m19.5 8.25-7.5 7.5-7.5-7.5"
/>
</svg>
</Button> </Button>
<div <div

View File

@@ -33,7 +33,7 @@
"/management", "/management",
]; ];
const eventsRoutes = ["/kalender", "/striim", "/koolitused"]; const eventsRoutes = ["/koolitused"];
function isCurrent(path) { function isCurrent(path) {
return currentPath === path; return currentPath === path;
@@ -43,22 +43,74 @@
return paths.includes(currentPath); return paths.includes(currentPath);
} }
function isHomePage() {
return currentPath === "/";
}
function headerShellClass() {
return isHomePage()
? "bg-transparent"
: "border-b-2 border-orange-500 bg-gray-900 backdrop-blur-md";
}
function headerRowClass() {
return isHomePage()
? "flex items-center w-full relative min-h-10"
: "flex min-h-16 items-center gap-4";
}
function headerWrapClass() {
return isHomePage()
? "ml-auto flex w-full items-center justify-end md:w-auto md:border-b-3 md:border-white backdrop-blur-lg bg-black/35 pr-(--page-padding-inline)"
: "flex items-center justify-end ml-auto w-full md:w-auto";
}
function desktopNavClass() {
return isHomePage()
? "z-10 hidden md:flex gap-1 justify-end text-lg"
: "z-10 hidden md:flex items-center gap-1 justify-end text-lg";
}
function navButtonClass(active = false) { function navButtonClass(active = false) {
if (isHomePage()) {
return active return active
? "border-transparent text-orange-500 bg-white/5" ? "border-transparent text-orange-500 bg-transparent"
: "border-transparent text-white/75 hover:text-white hover:bg-white/5"; : "border-transparent bg-transparent text-white/75 hover:text-orange-500";
}
return active
? "border-transparent text-orange-500 hover:bg-white/5"
: "border-transparent text-white/75 hover:bg-white/5";
} }
function dropdownButtonClass(active = false) { function dropdownButtonClass(active = false) {
if (isHomePage()) {
return active return active
? "border-transparent text-orange-500 bg-white/5" ? "border-transparent text-orange-500 bg-transparent"
: "border-transparent text-white/75 hover:text-white hover:bg-white/5"; : "border-transparent bg-transparent text-white/75 hover:text-orange-500";
}
return active
? "border-transparent text-orange-500 hover:bg-white/5"
: "border-transparent text-white/75 hover:bg-white/5";
}
function languageButtonClass() {
if (isHomePage()) {
return "ml-3 border-transparent bg-transparent px-3 py-1 text-sm text-white/75 hover:text-orange-500";
}
return "ml-3 border-transparent bg-transparent px-3 py-1 text-sm text-white/75 hover:bg-white/5";
} }
function dropdownItemClass(active = false) { function dropdownItemClass(active = false) {
return active return active
? "bg-orange-500/10 text-orange-500" ? "w-full justify-start border-transparent bg-transparent text-orange-500"
: "bg-transparent text-black hover:text-orange-500"; : "w-full justify-start border-transparent bg-transparent text-black hover:text-orange-500";
}
function dropdownPanelClass() {
return "nav-dropdown-panel min-w-52 border border-black/10 bg-white/95 p-1 text-black backdrop-blur-md";
} }
// Update currentPath when navigation occurs // Update currentPath when navigation occurs
@@ -164,23 +216,25 @@
</style> </style>
<header class="fixed inset-x-0 top-0 z-50 text-white"> <header class="fixed inset-x-0 top-0 z-50 text-white">
<div class="border-b-2 border-orange-500 bg-gray-900/95 backdrop-blur-md"> <div class={headerShellClass()}>
<Container maxWidth={true} center={true} class="py-0"> <Container maxWidth={true} center={!isHomePage()} class="py-0">
{#if $text && Object.keys($text).length > 0} {#if $text && Object.keys($text).length > 0}
<div class="flex min-h-16 items-center gap-4"> <div class={headerRowClass()}>
{#if !isHomePage()}
<Button <Button
onClick={() => handleNavigation("/")} onClick={() => handleNavigation("/")}
class="nav-logo-button border-transparent bg-transparent px-0 py-0 text-white hover:text-white" class="nav-logo-button border-transparent bg-transparent px-0 py-3"
> >
<img src="/assets/LapLogo_white_orange.png" alt="Lapikud Logo" class="h-12 md:h-14 w-auto" /> <img src="/assets/LapLogo_white_orange.png" alt="Lapikud logo" class="h-12 md:h-14 w-auto" />
</Button> </Button>
{/if}
<div class="flex items-center justify-end ml-auto w-full md:w-auto"> <div class={headerWrapClass()}>
<nav class="z-10 hidden md:flex items-center gap-1 justify-end text-lg"> <nav class={desktopNavClass()}>
<Dropdown <Dropdown
name={$text.about} name={$text.about}
buttonClass={`${dropdownButtonClass(isInGroup(aboutRoutes))} ${isInGroup(aboutRoutes) ? "nav-active-parent" : ""}`} buttonClass={`${dropdownButtonClass(isInGroup(aboutRoutes))} ${isInGroup(aboutRoutes) ? "nav-active-parent" : ""}`}
panelClass="nav-dropdown-panel" panelClass={dropdownPanelClass()}
> >
<Button <Button
class={dropdownItemClass(isCurrent("/lapikutest") || isCurrent("/aboutus"))} class={dropdownItemClass(isCurrent("/lapikutest") || isCurrent("/aboutus"))}
@@ -211,7 +265,7 @@
<Dropdown <Dropdown
name={$text.events} name={$text.events}
buttonClass={`${dropdownButtonClass(isInGroup(eventsRoutes))} ${isInGroup(eventsRoutes) ? "nav-active-parent" : ""}`} buttonClass={`${dropdownButtonClass(isInGroup(eventsRoutes))} ${isInGroup(eventsRoutes) ? "nav-active-parent" : ""}`}
panelClass="nav-dropdown-panel" panelClass={dropdownPanelClass()}
> >
<Button <Button
class={dropdownItemClass(isCurrent("/koolitused"))} class={dropdownItemClass(isCurrent("/koolitused"))}
@@ -220,13 +274,13 @@
<Presentation />{$text.eventsPages.workshops} <Presentation />{$text.eventsPages.workshops}
</Button> </Button>
<Button <Button
class="bg-transparent text-black hover:text-orange-500" class={dropdownItemClass(false)}
onClick={() => handleNavigation("https://asikarikas.ee/", { external: true })} onClick={() => handleNavigation("https://asikarikas.ee/", { external: true })}
> >
<Trophy />ASI Karikas <Trophy />ASI Karikas
</Button> </Button>
<Button <Button
class="bg-transparent text-black hover:text-orange-500" class={dropdownItemClass(false)}
onClick={() => handleNavigation("https://remondikohvik.lapikud.ee/", { external: true })} onClick={() => handleNavigation("https://remondikohvik.lapikud.ee/", { external: true })}
> >
<Coffee />{$text.eventsPages.repair} <Coffee />{$text.eventsPages.repair}
@@ -248,7 +302,7 @@
</Button> </Button>
<Button <Button
class="ml-3 border-transparent bg-transparent px-3 py-1 text-sm text-white/75 hover:text-orange-500 hover:bg-white/5" class={languageButtonClass()}
onClick={() => switchLanguageRoute($currentLang === "est" ? "en" : "est")} onClick={() => switchLanguageRoute($currentLang === "est" ? "en" : "est")}
> >
{$currentLang === "est" ? "EN" : "EST"} {$currentLang === "est" ? "EN" : "EST"}

View File

@@ -37,6 +37,7 @@
}); });
</script> </script>
<div class="safe-area-navbar">
<!-- Hero Section --> <!-- Hero Section -->
<Section background="orange"> <Section background="orange">
<Center> <Center>
@@ -260,6 +261,7 @@
</div> </div>
</Section> </Section>
{/if} {/if}
</div>
<style> <style>
.feature-icon { .feature-icon {

View File

@@ -9,7 +9,7 @@
}); });
</script> </script>
<div bind:this={sectionElement}> <div class="safe-area-navbar" bind:this={sectionElement}>
<Section > <Section >
<Center dir="col" class="w-full"> <Center dir="col" class="w-full">
<div class="w-full max-w-4xl"> <div class="w-full max-w-4xl">

View File

@@ -91,6 +91,7 @@
} }
</script> </script>
<div class="safe-area-navbar">
<!-- Hero Section --> <!-- Hero Section -->
<Section background="orange"> <Section background="orange">
<Center> <Center>
@@ -299,6 +300,7 @@
</Card> </Card>
</Grid> </Grid>
</Section> </Section>
</div>
<style> <style>
.feature-icon { .feature-icon {

View File

@@ -43,6 +43,7 @@
}); });
</script> </script>
<div class="safe-area-navbar">
<!-- Hero Section --> <!-- Hero Section -->
<div class="w-full bg-black"> <div class="w-full bg-black">
<div class="flex absolute justify-center items-center flex-row w-full h-[42vh] px-4"> <div class="flex absolute justify-center items-center flex-row w-full h-[42vh] px-4">
@@ -188,3 +189,4 @@
</div> </div>
</Grid> </Grid>
</Section> </Section>
</div>

View File

@@ -111,6 +111,7 @@
}); });
</script> </script>
<div class="safe-area-navbar">
<Section <Section
padding="none" padding="none"
fullWidth={true} fullWidth={true}
@@ -255,6 +256,7 @@
{/if} {/if}
</Container> </Container>
</Section> </Section>
</div>
<style> <style>
.hero-shell { .hero-shell {

View File

@@ -46,6 +46,7 @@
} }
</script> </script>
<div class="safe-area-navbar">
<!-- Hero Section --> <!-- Hero Section -->
<Section background="orange"> <Section background="orange">
<Center> <Center>
@@ -177,4 +178,5 @@
{/each} {/each}
</div> </div>
</Section> </Section>
</div>

View File

@@ -69,6 +69,7 @@
]; ];
</script> </script>
<div class="safe-area-navbar">
<!-- Hero Section --> <!-- Hero Section -->
<Section background="orange"> <Section background="orange">
<Center> <Center>
@@ -257,6 +258,7 @@
</div> </div>
</Center> </Center>
</Section> </Section>
</div>
<style> <style>
.feature-icon { .feature-icon {

View File

@@ -13,9 +13,9 @@
} }
</script> </script>
<div bind:this={sectionElement}> <div class="safe-area-navbar" bind:this={sectionElement}>
<Section> <Section fullWidth={true} contentClass="flex items-start">
<Grid min="400px"> <Grid min="400px" class="w-full">
<a href="https://master.lapikud.ee/stream/1/stream"> <a href="https://master.lapikud.ee/stream/1/stream">
<img src="https://master.lapikud.ee/stream/1/substream" alt="video0" style="width:100%;" on:load={handleImageLoad}/> <img src="https://master.lapikud.ee/stream/1/substream" alt="video0" style="width:100%;" on:load={handleImageLoad}/>
</a> </a>

View File

@@ -25,6 +25,7 @@
}); });
</script> </script>
<div class="safe-area-navbar">
<!-- Hero Section --> <!-- Hero Section -->
<Section background="orange"> <Section background="orange">
<Center> <Center>
@@ -195,6 +196,7 @@
</div> </div>
{/if} {/if}
</Section> </Section>
</div>
<style> <style>
.feature-icon { .feature-icon {