Refactor: header sémantique + backdrop limité à expertise/about/blog
- Header : <nav> enveloppée dans <header> (landmark sémantique) - Backdrop navbar restreint aux slides about et blog (scroll > 100px) - Portfolio : $effect navbar backdrop supprimé + import navigation retiré Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
0a346040a2
commit
4eb495c021
2 changed files with 44 additions and 44 deletions
|
|
@ -26,9 +26,11 @@
|
||||||
navigation.toggleMenu()
|
navigation.toggleMenu()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const scrollableSlides = new Set(['about', 'blog'])
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
function onScroll(e) {
|
function onScroll(e) {
|
||||||
if (e.target?.classList?.contains('page-scrollable')) {
|
if (e.target?.classList?.contains('page-scrollable') && scrollableSlides.has(slides.active?.id)) {
|
||||||
navigation.setScrolled(e.target.scrollTop > 100)
|
navigation.setScrolled(e.target.scrollTop > 100)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -37,7 +39,8 @@
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<nav class="navbar" class:navbar--open={isMenuOpen} class:navbar--scrolled={isScrolled && !isMenuOpen}>
|
<header>
|
||||||
|
<nav class="navbar" class:navbar--open={isMenuOpen} class:navbar--scrolled={isScrolled && !isMenuOpen}>
|
||||||
<a href="/" class="navbar-logo">
|
<a href="/" class="navbar-logo">
|
||||||
<img src="/assets/img/GIF_world_game_planete.gif" alt="World Game" class="wg-logo" />
|
<img src="/assets/img/GIF_world_game_planete.gif" alt="World Game" class="wg-logo" />
|
||||||
</a>
|
</a>
|
||||||
|
|
@ -72,9 +75,10 @@
|
||||||
<line x1="15" y1="9" x2="9" y2="15" stroke="white" stroke-width="2.5" stroke-linecap="round" class="cross-line" />
|
<line x1="15" y1="9" x2="9" y2="15" stroke="white" stroke-width="2.5" stroke-linecap="round" class="cross-line" />
|
||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<Menu />
|
<Menu />
|
||||||
|
</header>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.navbar {
|
.navbar {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
<script>
|
<script>
|
||||||
import { onMount } from 'svelte'
|
import { onMount } from 'svelte'
|
||||||
import { slides } from '@state/slides.svelte'
|
import { slides } from '@state/slides.svelte'
|
||||||
import { navigation } from '@state/navigation.svelte'
|
|
||||||
import { createScrollNav } from '@composables/useScrollNav.svelte.js'
|
import { createScrollNav } from '@composables/useScrollNav.svelte.js'
|
||||||
import GalleryAnimation from '@components/ui/GalleryAnimation.svelte'
|
import GalleryAnimation from '@components/ui/GalleryAnimation.svelte'
|
||||||
import ResponsivePicture from '@components/ui/ResponsivePicture.svelte'
|
import ResponsivePicture from '@components/ui/ResponsivePicture.svelte'
|
||||||
|
|
@ -18,10 +17,6 @@
|
||||||
const backgroundImage = $derived(data?.backgroundImage ?? null)
|
const backgroundImage = $derived(data?.backgroundImage ?? null)
|
||||||
const currentProject = $derived(projects[currentIndex] ?? 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
|
// Capture du hash synchrone avant que tout effect puisse le modifier
|
||||||
const initialHash = window.location.hash.slice(1)
|
const initialHash = window.location.hash.slice(1)
|
||||||
|
|
||||||
|
|
@ -241,10 +236,11 @@
|
||||||
color: var(--color-primary);
|
color: var(--color-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.portfolio-description {
|
.portfolio-description :global(p) {
|
||||||
font-size: var(--font-size-subtitle);
|
font-size: var(--font-size-paragraph-mobile);
|
||||||
line-height: 1.5;
|
line-height: 1.4;
|
||||||
opacity: 0.8;
|
opacity: 0.8;
|
||||||
|
letter-spacing: -2%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.portfolio-keywords {
|
.portfolio-keywords {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue