Refactor: sémantique HTML et suppression des styles inline
All checks were successful
Deploy / Deploy to Production (push) Successful in 13s

- App.svelte : suppression du wrapper .app redondant, montage direct sur #app, <section> pour les slides
- Header.svelte : <nav>, <ul><li><a> pour le menu, <button> pour le hamburger, animation hamburger en CSS pur (plus de style inline sur les cercles SVG)
- Home.svelte : fusion div[grid-area]+.olly en .home-bg, suppression de tous les style="" statiques

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
isUnknown 2026-02-19 12:58:32 +01:00
parent e65389534e
commit cfdaf1a6e2
3 changed files with 194 additions and 273 deletions

View file

@ -48,30 +48,32 @@
})
</script>
<div class="app">
<Cursor />
<Header />
<Cursor />
<Header />
<main class="main">
<div
class="slides-wrapper"
style="width: {wrapperWidth}; transform: {wrapperTransform}"
>
{#each slides.all as slide}
<div class="slide" data-slide={slide.id}>
{#if slide.loaded}
<svelte:component
this={templates[slide.template] ?? Default}
data={slide.data}
/>
{/if}
</div>
{/each}
</div>
</main>
</div>
<main class="main">
<div
class="slides-wrapper"
style="width: {wrapperWidth}; transform: {wrapperTransform}"
>
{#each slides.all as slide}
<section class="slide" data-slide={slide.id}>
{#if slide.loaded}
<svelte:component
this={templates[slide.template] ?? Default}
data={slide.data}
/>
{/if}
</section>
{/each}
</div>
</main>
<style>
:global(#app) {
height: 100vh;
}
:global(*) {
margin: 0;
padding: 0;
@ -95,10 +97,6 @@
height: auto;
}
.app {
height: 100vh;
}
.main {
position: relative;
overflow: hidden;

View file

@ -2,7 +2,6 @@
import { navigation } from '@state/navigation.svelte'
import { locale } from '@state/locale.svelte'
import { slides } from '@state/slides.svelte'
import { slideTo } from '@router'
const isMenuOpen = $derived(navigation.isMenuOpen)
const currentLang = $derived(locale.current)
@ -13,160 +12,50 @@
return slide.titles?.[currentLang] || slide.title || slide.id
}
function handleNav(path) {
slideTo(path)
}
function toggleMenu() {
navigation.toggleMenu()
}
</script>
<div class="navbar">
<div
class="clickable"
style="
z-index: 60;
position: absolute;
float: left;
left: 5vh;
top: 50%;
transform: translateY(-50%);
"
onclick={() => handleNav('/')}
onkeypress={(e) => e.key === 'Enter' && handleNav('/')}
role="button"
tabindex="0"
>
<img
src="/assets/img/GIF_world_game_planete.gif"
alt="World Game"
class="clickable wg-logo"
/>
</div>
<nav class="navbar" class:navbar--open={isMenuOpen}>
<a href="/" class="navbar-logo">
<img src="/assets/img/GIF_world_game_planete.gif" alt="World Game" class="wg-logo" />
</a>
{#each menuItems as slide}
<div
class="navbar-item clickable"
class:active={activeId === slide.id}
style="visibility: {isMenuOpen ? 'hidden' : 'visible'};"
onclick={() => handleNav(slide.path)}
onkeypress={(e) => e.key === 'Enter' && handleNav(slide.path)}
role="button"
tabindex="0"
>
{getTitle(slide)}
</div>
{/each}
<ul class="navbar-list">
{#each menuItems as slide}
<li>
<a
href={slide.path}
class="navbar-item"
class:active={activeId === slide.id}
>
{getTitle(slide)}
</a>
</li>
{/each}
</ul>
<div
class="clickable"
style="
z-index: 60;
position: absolute;
float: right;
right: 5vh;
top: 50%;
transform: translateY(-50%);
"
<button
class="navbar-toggle"
onclick={toggleMenu}
onkeypress={(e) => e.key === 'Enter' && toggleMenu()}
role="button"
tabindex="0"
aria-label={isMenuOpen ? 'Fermer le menu' : 'Ouvrir le menu'}
aria-expanded={isMenuOpen}
>
<svg
width="50"
height="50"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
style="height: 4.5vh; min-height: 36px;"
>
<circle
cx="7"
cy="7"
r="2"
fill="white"
style="
transform: {isMenuOpen ? 'translate(5px, 5px) scale(0.7)' : 'translate(0px, 0px) scale(1)'};
transform-origin: center;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
"
/>
<circle
cx="17"
cy="7"
r="2"
fill="white"
style="
transform: {isMenuOpen ? 'translate(-5px, 5px) scale(0.7)' : 'translate(0px, 0px) scale(1)'};
transform-origin: center;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
"
/>
<circle
cx="7"
cy="17"
r="2"
fill="white"
style="
transform: {isMenuOpen ? 'translate(5px, -5px) scale(0.7)' : 'translate(0px, 0px) scale(1)'};
transform-origin: center;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
"
/>
<circle
cx="17"
cy="17"
r="2"
fill="white"
style="
transform: {isMenuOpen ? 'translate(-5px, -5px) scale(0.7)' : 'translate(0px, 0px) scale(1)'};
transform-origin: center;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
"
/>
<line
x1="9"
y1="9"
x2="15"
y2="15"
stroke="white"
stroke-width="2.5"
stroke-linecap="round"
style="
opacity: {isMenuOpen ? 1 : 0};
transition: opacity 0.2s ease-in-out;
transition-delay: {isMenuOpen ? '0.1s' : '0s'};
"
/>
<line
x1="15"
y1="9"
x2="9"
y2="15"
stroke="white"
stroke-width="2.5"
stroke-linecap="round"
style="
opacity: {isMenuOpen ? 1 : 0};
transition: opacity 0.2s ease-in-out;
transition-delay: {isMenuOpen ? '0.1s' : '0s'};
"
/>
<svg width="50" height="50" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="7" cy="7" r="2" fill="white" class="dot dot-tl" />
<circle cx="17" cy="7" r="2" fill="white" class="dot dot-tr" />
<circle cx="7" cy="17" r="2" fill="white" class="dot dot-bl" />
<circle cx="17" cy="17" r="2" fill="white" class="dot dot-br" />
<line x1="9" y1="9" x2="15" 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>
</div>
</div>
</button>
</nav>
<style>
.navbar {
width: 100%;
align-items: center;
justify-self: center;
position: fixed;
top: 0;
left: 0;
@ -175,19 +64,44 @@
font-size: var(--font-size-paragraph);
font-weight: normal;
color: white;
text-align: center !important;
text-align: center;
text-transform: uppercase;
padding: 2vh 0 2vh 0;
backdrop-filter: blur(0px);
transition: all 0.3s ease-in-out;
color: white;
display: block;
padding: 2vh 0;
background-color: rgba(0, 0, 0, 0.3);
backdrop-filter: blur(15px);
transition: 0.3s;
}
/* Logo */
.navbar-logo {
position: absolute;
left: 5vh;
top: 50%;
transform: translateY(-50%);
z-index: 60;
}
.wg-logo {
height: 3rem;
display: block;
pointer-events: none;
}
/* Nav list */
.navbar-list {
list-style: none;
margin: 0;
padding: 0;
}
.navbar-list li {
display: inline;
}
.navbar--open .navbar-list {
visibility: hidden;
}
.navbar-item {
display: inline-block;
padding: 1vmax 2vmax;
@ -199,22 +113,50 @@
transition: color 0.3s;
}
.navbar-item.active {
color: #04fea0;
}
.navbar-item.active,
.navbar-item:hover {
color: #04fea0;
}
.wg-logo {
height: 3rem;
pointer-events: none;
/* Hamburger button */
.navbar-toggle {
position: absolute;
right: 5vh;
top: 50%;
transform: translateY(-50%);
z-index: 60;
background: none;
border: none;
padding: 0;
cursor: pointer;
}
.clickable {
cursor: pointer;
user-select: none;
.navbar-toggle svg {
height: 4.5vh;
min-height: 36px;
display: block;
}
/* Dot animation */
.dot {
transform-origin: center;
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.navbar--open .dot-tl { transform: translate(5px, 5px) scale(0.7); }
.navbar--open .dot-tr { transform: translate(-5px, 5px) scale(0.7); }
.navbar--open .dot-bl { transform: translate(5px, -5px) scale(0.7); }
.navbar--open .dot-br { transform: translate(-5px, -5px) scale(0.7); }
/* Cross lines */
.cross-line {
opacity: 0;
transition: opacity 0.2s ease-in-out;
}
.navbar--open .cross-line {
opacity: 1;
transition-delay: 0.1s;
}
@media screen and (max-width: 700px) {

View file

@ -45,83 +45,52 @@
</script>
<div class="home golden-grid slide" data-anchor="HOME">
<div style="grid-area: 1/1/span 20/span 20; filter: saturate(140%);">
<div class="olly">
<figure
style="
height: -webkit-fill-available;
width: -webkit-fill-available;
"
<div class="home-bg">
<figure class="home-figure">
<video
muted
autoplay
playsinline
loop
controls={false}
preload="metadata"
id="home-video"
class="home-video home-video-desktop"
>
<video
muted
autoplay
playsinline
loop
controls={false}
preload="metadata"
id="home-video"
class="home-video home-video-desktop"
style="
object-fit: cover;
min-height: 100%;
min-width: 100%;
height: -webkit-fill-available;
width: -webkit-fill-available;
"
>
<source
src="/assets/video/Website_version.mp4"
type="video/mp4"
/>
</video>
<video
muted
autoplay
playsinline
loop
controls={false}
preload="metadata"
id="home-video-mobile"
class="home-video-mobile"
style="
object-fit: cover;
min-height: 100%;
min-width: 100%;
height: -webkit-fill-available;
width: -webkit-fill-available;
"
>
<source
src="/assets/video/mobile_version_texte_fixe.mp4"
type="video/mp4"
/>
</video>
</figure>
</div>
<source src="/assets/video/Website_version.mp4" type="video/mp4" />
</video>
<video
muted
autoplay
playsinline
loop
controls={false}
preload="metadata"
id="home-video-mobile"
class="home-video home-video-mobile"
>
<source src="/assets/video/mobile_version_texte_fixe.mp4" type="video/mp4" />
</video>
</figure>
</div>
<div class="vertical-line-start"></div>
<div class="vertical-line-center"></div>
<div class="vertical-line-end"></div>
<div
class="home-text"
style="z-index: 5; justify-self: center; margin-top: 6vmax;"
>
<div class="home-text">
<h2 class="font-face-danzza-light home-subtitle">
{data.hero.subtitle}
</h2>
<div
class="clickable button"
style="margin: auto; margin-top: 40px;"
class="clickable button home-cta"
onclick={handleExplore}
onkeypress={(e) => e.key === 'Enter' && handleExplore()}
role="button"
tabindex="0"
>
<div class="earth-icon clickable-filter-black"></div>
<p class="clickable" style="font-family: Terminal; font-size: 1.2em;">
<p class="home-cta-text clickable">
{data.hero.ctaText}
</p>
</div>
@ -133,10 +102,44 @@
background-color: rgba(0, 0, 0, 0);
}
/* Full-grid video background — replaces div[grid-area] + .olly */
.home-bg {
grid-area: 1/1 / span 20 / span 20;
filter: saturate(140%);
position: relative;
overflow: hidden;
}
.home-figure {
position: absolute;
inset: 0;
margin: 0;
padding: 0;
}
.home-video {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
object-fit: cover;
}
.home-video-desktop {
display: block !important;
}
.home-video-mobile {
display: none !important;
}
/* Text overlay */
.home-text {
z-index: 9;
z-index: 5;
grid-area: 9/1 / span 6 / span 20;
width: 100%;
justify-self: center;
margin-top: 6vmax;
}
.home-subtitle {
@ -146,37 +149,15 @@
margin: auto;
}
.olly {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
overflow: hidden;
/* CTA button */
.home-cta {
margin: auto;
margin-top: 40px;
}
.olly figure {
margin: 0;
padding: 0;
position: relative;
width: 100%;
height: 100%;
}
.home-video {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.home-video-desktop {
display: block !important;
}
.home-video-mobile {
display: none !important;
.home-cta-text {
font-family: Terminal;
font-size: 1.2em;
}
@media screen and (max-width: 1000px) {