Feat: navbar frosted glass au scroll

- navigation.svelte.js : ajout isScrolled + setScrolled()
- Header : scroll listener (capture) sur .page-scrollable > 100px,
  reset au changement de slide, classe navbar--scrolled conditionnelle,
  transition 0.4s sur background-color et backdrop-filter
- Expertise : $effect notifie quand currentItem > 0
- Portfolio : $effect notifie quand currentIndex > 0

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
isUnknown 2026-03-12 15:05:25 +01:00
parent 517143fe60
commit a0798e71d0
4 changed files with 45 additions and 2 deletions

View file

@ -1,6 +1,7 @@
<script>
import { onMount } from 'svelte'
import { slides } from '@state/slides.svelte'
import { navigation } from '@state/navigation.svelte'
import { createScrollNav } from '@composables/useScrollNav.svelte.js'
let { data } = $props()
@ -32,6 +33,10 @@
const items = $derived(data?.items ?? [])
const itemCount = $derived(items.length)
$effect(() => {
if (isActive) navigation.setScrolled(currentItem > 0)
})
const segmentEnds = $derived(
itemCount > 0 && videoDuration > 0
? Array.from({ length: itemCount }, (_, i) => videoDuration * (i + 1) / itemCount)
@ -347,6 +352,7 @@
/* Individual text items */
.expertise-item {
font-size: var(--font-size-expertise);
font-weight: 350;
color: var(--color-text);
text-align: left;
line-height: 1.4;
@ -375,6 +381,7 @@
.expertise-item {
font-size: var(--font-size-expertise-mobile);
transform: scale(0.75) translateX(2rem);
}
}

View file

@ -1,6 +1,7 @@
<script>
import { onMount } from 'svelte'
import { slides } from '@state/slides.svelte'
import { navigation } from '@state/navigation.svelte'
import { createScrollNav } from '@composables/useScrollNav.svelte.js'
import GalleryAnimation from '@components/ui/GalleryAnimation.svelte'
import ResponsivePicture from '@components/ui/ResponsivePicture.svelte'
@ -17,6 +18,10 @@
const backgroundImage = $derived(data?.backgroundImage ?? null)
const currentProject = $derived(projects[currentIndex] ?? null)
$effect(() => {
if (isActive) navigation.setScrolled(currentIndex > 0)
})
// Capture du hash synchrone avant que tout effect puisse le modifier
const initialHash = window.location.hash.slice(1)