Upgrade vers Svelte 5 et reproduction de la page d'accueil
- Upgrade : Svelte 5.0.0, Vite 7.0.4, @sveltejs/vite-plugin-svelte 6.0.0 - Migration syntaxe Svelte 5 : $derived, $props(), onclick, mount() - Navbar identique au site source avec logo GIF et menu animé - Page Home avec vidéo plein écran et lignes verticales - CSS modulaire organisé en fichiers séparés (variables, fonts, layout, buttons, etc.) - Assets copiés : fonts Danzza, vidéos, icônes Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
cbe89acb21
commit
a12c2df8f9
28 changed files with 1062 additions and 576 deletions
|
|
@ -29,9 +29,10 @@
|
|||
'default': Default
|
||||
}
|
||||
|
||||
$: template = $pageStore.template || 'default'
|
||||
$: component = templates[template] || Default
|
||||
$: data = $pageStore.data
|
||||
const template = $derived($pageStore.template || 'default')
|
||||
const component = $derived(templates[template] || Default)
|
||||
const data = $derived($pageStore.data)
|
||||
const showFooter = $derived(template !== 'home')
|
||||
</script>
|
||||
|
||||
<div class="app">
|
||||
|
|
@ -39,12 +40,15 @@
|
|||
<Header />
|
||||
|
||||
<main class="main">
|
||||
{#if data}
|
||||
<svelte:component this={component} {data} />
|
||||
{#if data && component}
|
||||
{@const Component = component}
|
||||
<Component {data} />
|
||||
{/if}
|
||||
</main>
|
||||
|
||||
<Footer />
|
||||
{#if showFooter}
|
||||
<Footer />
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<style>
|
||||
|
|
|
|||
|
|
@ -1,245 +1,280 @@
|
|||
<script>
|
||||
import { navigationStore } from '@stores/navigation'
|
||||
import { localeStore } from '@stores/locale'
|
||||
import { siteStore } from '@stores/site'
|
||||
import { pageStore } from '@stores/page'
|
||||
import { navigateTo } from '@lib/router'
|
||||
|
||||
$: isMenuOpen = $navigationStore.isMenuOpen
|
||||
$: currentLang = $localeStore.current
|
||||
$: site = $siteStore
|
||||
$: logo = site.logo
|
||||
$: siteTitle = site.title
|
||||
$: navigation = site.navigation || []
|
||||
$: languages = site.languages || []
|
||||
const isMenuOpen = $derived($navigationStore.isMenuOpen)
|
||||
const currentLang = $derived($localeStore.current)
|
||||
const currentPage = $derived($pageStore.template || 'home')
|
||||
|
||||
const translations = {
|
||||
expertise: { fr: 'EXPERTISE', en: 'EXPERTISE' },
|
||||
games: { fr: 'GAMES', en: 'GAMES' },
|
||||
play: { fr: 'PLAY', en: 'PLAY' },
|
||||
about: { fr: 'À PROPOS', en: 'ABOUT' },
|
||||
blog: { fr: 'BLOG', en: 'BLOG' }
|
||||
}
|
||||
|
||||
function t(key) {
|
||||
return translations[key]?.[currentLang] || translations[key]?.fr || key
|
||||
}
|
||||
|
||||
function handleNav(path) {
|
||||
navigateTo(path)
|
||||
navigationStore.closeMenu()
|
||||
}
|
||||
|
||||
function handleLanguageChange(langCode) {
|
||||
// In a full implementation, this would switch to the translated URL
|
||||
localeStore.setLanguage(langCode)
|
||||
function toggleMenu() {
|
||||
navigationStore.toggleMenu()
|
||||
}
|
||||
</script>
|
||||
|
||||
<header class="header" class:menu-open={isMenuOpen}>
|
||||
<div class="header__container">
|
||||
<!-- Logo -->
|
||||
<a href="/" on:click|preventDefault={() => handleNav('/')} class="header__logo">
|
||||
{#if logo}
|
||||
<img src={logo} alt={siteTitle} />
|
||||
{:else}
|
||||
<span class="header__logo-text">{siteTitle}</span>
|
||||
{/if}
|
||||
</a>
|
||||
|
||||
<!-- Navigation -->
|
||||
<nav class="header__nav" class:open={isMenuOpen}>
|
||||
<ul class="header__nav-list">
|
||||
{#each navigation as item}
|
||||
{#if item.url}
|
||||
<li class="header__nav-item" class:active={item.isActive}>
|
||||
<a
|
||||
href={item.url}
|
||||
on:click|preventDefault={() => handleNav(item.url)}
|
||||
>
|
||||
{currentLang === 'en' ? item.label_en : item.label_fr}
|
||||
</a>
|
||||
</li>
|
||||
{/if}
|
||||
{/each}
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<!-- Language Switcher -->
|
||||
{#if languages.length > 1}
|
||||
<div class="header__lang">
|
||||
{#each languages as lang}
|
||||
<button
|
||||
class="header__lang-btn"
|
||||
class:active={lang.code === currentLang}
|
||||
on:click={() => handleLanguageChange(lang.code)}
|
||||
>
|
||||
{lang.code.toUpperCase()}
|
||||
</button>
|
||||
{/each}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<!-- Mobile Menu Toggle -->
|
||||
<button
|
||||
class="header__toggle"
|
||||
on:click={() => navigationStore.toggleMenu()}
|
||||
aria-label="Menu"
|
||||
>
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>
|
||||
</button>
|
||||
<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>
|
||||
</header>
|
||||
|
||||
<div
|
||||
class="navbar-item clickable"
|
||||
class:active={currentPage === 'expertise'}
|
||||
style="visibility: {isMenuOpen ? 'hidden' : 'visible'};"
|
||||
onclick={() => handleNav('/expertise')}
|
||||
onkeypress={(e) => e.key === 'Enter' && handleNav('/expertise')}
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
{t('expertise')}
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="navbar-item clickable"
|
||||
class:active={currentPage === 'portfolio'}
|
||||
style="visibility: {isMenuOpen ? 'hidden' : 'visible'};"
|
||||
onclick={() => handleNav('/portfolio')}
|
||||
onkeypress={(e) => e.key === 'Enter' && handleNav('/portfolio')}
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
{t('games')}
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="navbar-item clickable"
|
||||
class:active={currentPage === 'jouer'}
|
||||
style="visibility: {isMenuOpen ? 'hidden' : 'visible'};"
|
||||
onclick={() => handleNav('/jouer')}
|
||||
onkeypress={(e) => e.key === 'Enter' && handleNav('/jouer')}
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
{t('play')}
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="navbar-item clickable"
|
||||
class:active={currentPage === 'about'}
|
||||
style="visibility: {isMenuOpen ? 'hidden' : 'visible'};"
|
||||
onclick={() => handleNav('/a-propos')}
|
||||
onkeypress={(e) => e.key === 'Enter' && handleNav('/a-propos')}
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
{t('about')}
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="navbar-item clickable"
|
||||
class:active={currentPage === 'blog' || currentPage === 'article'}
|
||||
style="visibility: {isMenuOpen ? 'hidden' : 'visible'};"
|
||||
onclick={() => handleNav('/blog')}
|
||||
onkeypress={(e) => e.key === 'Enter' && handleNav('/blog')}
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
{t('blog')}
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="clickable"
|
||||
style="
|
||||
z-index: 60;
|
||||
position: absolute;
|
||||
float: right;
|
||||
right: 5vh;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
"
|
||||
onclick={toggleMenu}
|
||||
onkeypress={(e) => e.key === 'Enter' && toggleMenu()}
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.header {
|
||||
.navbar {
|
||||
width: 100%;
|
||||
align-items: center;
|
||||
justify-self: center;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 1000;
|
||||
background: rgba(0, 0, 0, 0.9);
|
||||
backdrop-filter: blur(10px);
|
||||
}
|
||||
|
||||
.header__container {
|
||||
max-width: 1400px;
|
||||
margin: 0 auto;
|
||||
padding: 1.5rem 2rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
.header__logo {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
text-decoration: none;
|
||||
z-index: 1001;
|
||||
}
|
||||
|
||||
.header__logo img {
|
||||
height: 40px;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.header__logo-text {
|
||||
font-size: 1.5rem;
|
||||
font-weight: 700;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.header__nav {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.header__nav-list {
|
||||
display: flex;
|
||||
gap: 2rem;
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.header__nav-item a {
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
font-weight: 500;
|
||||
z-index: 50;
|
||||
font-family: "Danzza";
|
||||
font-size: var(--font-size-paragraph);
|
||||
font-weight: normal;
|
||||
color: white;
|
||||
text-align: center !important;
|
||||
text-transform: uppercase;
|
||||
font-size: 0.9rem;
|
||||
letter-spacing: 0.05em;
|
||||
padding: 2vh 0 2vh 0;
|
||||
backdrop-filter: blur(0px);
|
||||
transition: all 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
.navbar-item {
|
||||
display: inline-block;
|
||||
padding: 1vmax 2vmax;
|
||||
font-weight: bold;
|
||||
vertical-align: middle;
|
||||
position: relative;
|
||||
z-index: 5;
|
||||
color: white;
|
||||
transition: color 0.3s;
|
||||
}
|
||||
|
||||
.header__nav-item a:hover,
|
||||
.header__nav-item.active a {
|
||||
.navbar-item.active {
|
||||
color: #04fea0;
|
||||
}
|
||||
|
||||
.header__lang {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
.navbar-item:hover {
|
||||
color: #04fea0;
|
||||
}
|
||||
|
||||
.header__lang-btn {
|
||||
background: none;
|
||||
border: 1px solid #fff;
|
||||
color: #fff;
|
||||
padding: 0.5rem 1rem;
|
||||
.wg-logo {
|
||||
height: 4.8vh;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.clickable {
|
||||
cursor: pointer;
|
||||
font-size: 0.8rem;
|
||||
font-weight: 600;
|
||||
transition: all 0.3s;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.header__lang-btn:hover,
|
||||
.header__lang-btn.active {
|
||||
background: #04fea0;
|
||||
border-color: #04fea0;
|
||||
color: #000;
|
||||
@media screen and (max-width: 700px) {
|
||||
.navbar-item {
|
||||
font-size: var(--font-size-paragraph-mobile);
|
||||
padding: 1vmax 1.5vmax;
|
||||
}
|
||||
}
|
||||
|
||||
.header__toggle {
|
||||
display: none;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
background: none;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
padding: 0.5rem;
|
||||
z-index: 1001;
|
||||
}
|
||||
|
||||
.header__toggle span {
|
||||
width: 25px;
|
||||
height: 2px;
|
||||
background: #fff;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.header__container {
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.header__toggle {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.header__nav {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
max-width: 300px;
|
||||
background: rgba(0, 0, 0, 0.98);
|
||||
transform: translateX(100%);
|
||||
transition: transform 0.3s;
|
||||
padding: 5rem 2rem 2rem;
|
||||
}
|
||||
|
||||
.header__nav.open {
|
||||
transform: translateX(0);
|
||||
}
|
||||
|
||||
.header__nav-list {
|
||||
flex-direction: column;
|
||||
gap: 1.5rem;
|
||||
}
|
||||
|
||||
.header__nav-item a {
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
.header__lang {
|
||||
position: fixed;
|
||||
bottom: 2rem;
|
||||
right: 2rem;
|
||||
}
|
||||
|
||||
.menu-open .header__toggle span:nth-child(1) {
|
||||
transform: rotate(45deg) translate(5px, 5px);
|
||||
}
|
||||
|
||||
.menu-open .header__toggle span:nth-child(2) {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.menu-open .header__toggle span:nth-child(3) {
|
||||
transform: rotate(-45deg) translate(7px, -6px);
|
||||
@media screen and (min-width: 701px) and (max-width: 912px) {
|
||||
.navbar-item {
|
||||
font-size: var(--font-size-paragraph-tablet);
|
||||
padding: 1vmax 1.8vmax;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
import './style.css'
|
||||
import './styles/index.css'
|
||||
import App from './App.svelte'
|
||||
import { mount } from 'svelte'
|
||||
import { initRouter } from './lib/router'
|
||||
|
||||
// Initialize the router
|
||||
initRouter()
|
||||
|
||||
// Mount the app
|
||||
const app = new App({
|
||||
const app = mount(App, {
|
||||
target: document.getElementById('app')
|
||||
})
|
||||
|
||||
|
|
|
|||
53
src/styles/buttons.css
Normal file
53
src/styles/buttons.css
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
/* Button */
|
||||
.button {
|
||||
width: 14vmax;
|
||||
min-width: 130px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: sticky;
|
||||
z-index: 1;
|
||||
padding: 12px 16px;
|
||||
transition: 0.5s ease-out;
|
||||
font-family: "Danzza Bold";
|
||||
background-color: var(--color-primary);
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.button:hover {
|
||||
background-position: left;
|
||||
background-color: transparent;
|
||||
outline: solid 2px var(--color-primary);
|
||||
}
|
||||
|
||||
.button p {
|
||||
color: black;
|
||||
margin: 0;
|
||||
transition: color 0.3s;
|
||||
}
|
||||
|
||||
.button:hover p {
|
||||
color: var(--color-primary) !important;
|
||||
}
|
||||
|
||||
.earth-icon {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
background-image: url('/assets/img/icon-earth-green.png');
|
||||
background-size: contain;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
margin-right: 8px;
|
||||
transition: filter 0.3s;
|
||||
}
|
||||
|
||||
.button:hover .earth-icon {
|
||||
filter: brightness(0) saturate(100%) invert(77%) sepia(82%) saturate(507%) hue-rotate(91deg) brightness(101%) contrast(97%);
|
||||
}
|
||||
|
||||
/* Clickable elements */
|
||||
.clickable {
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
}
|
||||
42
src/styles/cursor.css
Normal file
42
src/styles/cursor.css
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
/* Custom Cursor */
|
||||
#cursor-dot,
|
||||
#cursor-dot-outline,
|
||||
#cursor-circle {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
z-index: 99999;
|
||||
transform: translate(-50%, -50%);
|
||||
transition: opacity 0.15s ease-in-out, transform 0.15s ease-in-out;
|
||||
border-radius: 50%;
|
||||
pointer-events: none;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
#cursor-dot {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
#cursor-circle {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border-width: 3px;
|
||||
border-style: solid;
|
||||
border-color: var(--color-primary);
|
||||
}
|
||||
|
||||
#cursor-dot-outline {
|
||||
width: 13px;
|
||||
height: 13px;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
@media (pointer: coarse) {
|
||||
#cursor-dot,
|
||||
#cursor-dot-outline,
|
||||
#cursor-circle {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
60
src/styles/fonts.css
Normal file
60
src/styles/fonts.css
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
/* Font faces */
|
||||
@font-face {
|
||||
font-family: "Terminal";
|
||||
font-weight: bold;
|
||||
src: local("terminal-grotesque"),
|
||||
url("/assets/fonts/terminal-grotesque.ttf") format("truetype");
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Danzza";
|
||||
src: local("Danzza Regular"),
|
||||
url("/assets/fonts/Danzza-Regular.woff") format("woff"),
|
||||
url("/assets/fonts/Danzza-Regular.otf") format("opentype");
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Danzza Light";
|
||||
src: local("Danzza Light"),
|
||||
url("/assets/fonts/Danzza-Light.woff") format("woff"),
|
||||
url("/assets/fonts/Danzza-Light.otf") format("opentype");
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Danzza Medium";
|
||||
src: local("Danzza Medium"),
|
||||
url("/assets/fonts/Danzza-Medium.woff") format("woff"),
|
||||
url("/assets/fonts/Danzza-Medium.otf") format("opentype");
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Danzza Bold";
|
||||
src: local("Danzza Bold"),
|
||||
url("/assets/fonts/Danzza-Bold.woff") format("woff"),
|
||||
url("/assets/fonts/Danzza-Bold.otf") format("opentype");
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
/* Font utility classes */
|
||||
.font-face-terminal {
|
||||
font-family: "Terminal";
|
||||
}
|
||||
|
||||
.font-face-danzza {
|
||||
font-family: "Danzza";
|
||||
}
|
||||
|
||||
.font-face-danzza-light {
|
||||
font-family: "Danzza Light";
|
||||
}
|
||||
|
||||
.font-face-danzza-medium {
|
||||
font-family: "Danzza Medium";
|
||||
}
|
||||
|
||||
.font-face-danzza-bold {
|
||||
font-family: "Danzza Bold";
|
||||
}
|
||||
8
src/styles/index.css
Normal file
8
src/styles/index.css
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
/* Main styles entry point */
|
||||
@import './variables.css';
|
||||
@import './reset.css';
|
||||
@import './fonts.css';
|
||||
@import './layout.css';
|
||||
@import './buttons.css';
|
||||
@import './cursor.css';
|
||||
@import './utils.css';
|
||||
42
src/styles/layout.css
Normal file
42
src/styles/layout.css
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
/* Golden Grid */
|
||||
.golden-grid {
|
||||
height: 100% !important;
|
||||
min-height: 100% !important;
|
||||
display: grid !important;
|
||||
position: relative;
|
||||
grid-template-rows: 1fr 1fr 2fr 4fr 2.66fr 5.33fr 5.33fr 4.33fr 2.83fr 3.5fr 3.5fr 2.83fr 4.33fr 5.33fr 5.33fr 2.66fr 4fr 2fr 1fr 1fr;
|
||||
grid-template-columns: 1fr 1fr 2fr 4fr 2.66fr 5.33fr 5.33fr 4.33fr 2.83fr 3.5fr 3.5fr 2.83fr 4.33fr 5.33fr 5.33fr 2.66fr 4fr 2fr 1fr 1fr;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.slide {
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
/* Vertical Lines */
|
||||
.vertical-line {
|
||||
z-index: 1;
|
||||
border-left: 0.1px solid rgba(238, 238, 238, 0.2);
|
||||
height: 150%;
|
||||
}
|
||||
|
||||
.vertical-line-start {
|
||||
z-index: 1;
|
||||
border-left: 0.1px solid rgba(238, 238, 238, 0.2);
|
||||
grid-area: 1/6 / span 20 / span 1;
|
||||
height: 150%;
|
||||
}
|
||||
|
||||
.vertical-line-center {
|
||||
z-index: 1;
|
||||
border-left: 0.1px solid rgba(238, 238, 238, 0.2);
|
||||
grid-area: 1/11 / span 20 / span 1;
|
||||
height: 150%;
|
||||
}
|
||||
|
||||
.vertical-line-end {
|
||||
z-index: 1;
|
||||
border-left: 0.1px solid rgba(238, 238, 238, 0.2);
|
||||
grid-area: 1/16 / span 20 / span 1;
|
||||
height: 150%;
|
||||
}
|
||||
34
src/styles/reset.css
Normal file
34
src/styles/reset.css
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
/* CSS Reset */
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
cursor: none;
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
min-height: 100vh;
|
||||
min-height: -webkit-fill-available;
|
||||
min-height: calc(var(--vh, 1vh) * 100);
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: "Danzza Regular", "Danzza", -apple-system, BlinkMacSystemFont,
|
||||
"Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans",
|
||||
"Droid Sans", "Helvetica Neue", sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
background: var(--color-background);
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
@media (pointer: coarse) {
|
||||
body,
|
||||
* {
|
||||
cursor: auto;
|
||||
}
|
||||
}
|
||||
23
src/styles/utils.css
Normal file
23
src/styles/utils.css
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
/* Selection */
|
||||
::selection {
|
||||
background: var(--color-primary);
|
||||
color: #000;
|
||||
}
|
||||
|
||||
/* Scrollbar */
|
||||
::-webkit-scrollbar {
|
||||
width: 10px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background: #000;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: var(--color-primary);
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: var(--color-primary-hover);
|
||||
}
|
||||
38
src/styles/variables.css
Normal file
38
src/styles/variables.css
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
/* CSS Variables */
|
||||
:root {
|
||||
/* Base font sizes for desktop */
|
||||
--font-size-paragraph: 18px;
|
||||
--font-size-paragraph-small: 16px;
|
||||
--font-size-subtitle: 20px;
|
||||
--font-size-title-section: 32px;
|
||||
--font-size-title-main: 48px;
|
||||
--font-size-title-hero: 96px;
|
||||
--font-size-button: 13px;
|
||||
--font-size-caption: 12px;
|
||||
|
||||
/* Mobile font sizes */
|
||||
--font-size-paragraph-mobile: 16px;
|
||||
--font-size-paragraph-small-mobile: 12px;
|
||||
--font-size-subtitle-mobile: 16px;
|
||||
--font-size-title-section-mobile: 24px;
|
||||
--font-size-title-main-mobile: 32px;
|
||||
--font-size-title-hero-mobile: 48px;
|
||||
--font-size-button-mobile: 11px;
|
||||
--font-size-caption-mobile: 10px;
|
||||
|
||||
/* Tablet font sizes */
|
||||
--font-size-paragraph-tablet: 16px;
|
||||
--font-size-paragraph-small-tablet: 14px;
|
||||
--font-size-subtitle-tablet: 18px;
|
||||
--font-size-title-section-tablet: 28px;
|
||||
--font-size-title-main-tablet: 40px;
|
||||
--font-size-title-hero-tablet: 64px;
|
||||
--font-size-button-tablet: 12px;
|
||||
--font-size-caption-tablet: 11px;
|
||||
|
||||
/* Colors */
|
||||
--color-primary: #04fea0;
|
||||
--color-primary-hover: #03d98c;
|
||||
--color-background: #000;
|
||||
--color-text: #fff;
|
||||
}
|
||||
|
|
@ -1,164 +1,218 @@
|
|||
<script>
|
||||
import { onMount } from 'svelte'
|
||||
import { fade } from 'svelte/transition'
|
||||
import VideoBackground from '@components/ui/VideoBackground.svelte'
|
||||
import Button from '@components/ui/Button.svelte'
|
||||
import { localeStore } from '@stores/locale'
|
||||
import { navigateTo } from '@lib/router'
|
||||
import { pageEnter } from '@lib/animations'
|
||||
|
||||
export let data
|
||||
let { data } = $props()
|
||||
|
||||
let contentElement
|
||||
const currentLang = $derived($localeStore.current)
|
||||
|
||||
const translations = {
|
||||
homeText: {
|
||||
fr: "World Game crée des expériences gamifiées qui transforment l'engagement en résultats mesurables",
|
||||
en: "World Game creates gamified experiences that transform engagement into measurable results"
|
||||
},
|
||||
explore: {
|
||||
fr: "EXPLORER",
|
||||
en: "EXPLORE"
|
||||
}
|
||||
}
|
||||
|
||||
function t(key) {
|
||||
return translations[key]?.[currentLang] || translations[key]?.fr || ''
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
if (contentElement) {
|
||||
pageEnter(contentElement)
|
||||
const playVideo = async (videoId) => {
|
||||
const video = document.getElementById(videoId)
|
||||
if (video) {
|
||||
try {
|
||||
video.muted = true
|
||||
video.playsInline = true
|
||||
const playPromise = video.play()
|
||||
if (playPromise !== undefined) {
|
||||
await playPromise
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(`Autoplay failed for ${videoId}:`, error)
|
||||
const playOnInteraction = () => {
|
||||
video.play().catch(e => console.log('Fallback play failed:', e))
|
||||
document.removeEventListener('click', playOnInteraction)
|
||||
document.removeEventListener('touchstart', playOnInteraction)
|
||||
}
|
||||
document.addEventListener('click', playOnInteraction)
|
||||
document.addEventListener('touchstart', playOnInteraction)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const timer = setTimeout(() => {
|
||||
playVideo('home-video')
|
||||
playVideo('home-video-mobile')
|
||||
}, 100)
|
||||
|
||||
return () => clearTimeout(timer)
|
||||
})
|
||||
|
||||
function handleExplore() {
|
||||
navigateTo(data?.hero?.cta_link || '/portfolio')
|
||||
navigateTo('/portfolio')
|
||||
}
|
||||
|
||||
$: hero = data?.hero || {}
|
||||
$: backgroundVideo = data?.background_video
|
||||
$: floatingBubbles = data?.floating_bubbles || []
|
||||
</script>
|
||||
|
||||
<div class="home" transition:fade>
|
||||
{#if backgroundVideo}
|
||||
<VideoBackground src={backgroundVideo} />
|
||||
{/if}
|
||||
|
||||
<div class="home__content" bind:this={contentElement}>
|
||||
<h1 class="home__title">
|
||||
{@html hero.title || 'PLAY TO ENGAGE'}
|
||||
</h1>
|
||||
|
||||
{#if hero.subtitle}
|
||||
<p class="home__subtitle">
|
||||
{@html hero.subtitle}
|
||||
</p>
|
||||
{/if}
|
||||
|
||||
{#if hero.cta_text}
|
||||
<Button on:click={handleExplore} variant="primary" size="large">
|
||||
{hero.cta_text}
|
||||
</Button>
|
||||
{/if}
|
||||
<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;
|
||||
"
|
||||
>
|
||||
<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>
|
||||
</div>
|
||||
|
||||
{#if floatingBubbles.length > 0}
|
||||
<div class="home__bubbles">
|
||||
{#each floatingBubbles as bubble}
|
||||
<div class="bubble bubble--{bubble.position}">
|
||||
{bubble.text}
|
||||
</div>
|
||||
{/each}
|
||||
<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;"
|
||||
>
|
||||
<h2 class="font-face-danzza-light home-subtitle">
|
||||
{t('homeText')}
|
||||
</h2>
|
||||
<div
|
||||
class="clickable button"
|
||||
style="margin: auto; margin-top: 40px;"
|
||||
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;">
|
||||
{t('explore')}
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.home {
|
||||
position: relative;
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
overflow: hidden;
|
||||
padding: 6rem 2rem 2rem;
|
||||
background-color: rgba(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
.home__content {
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
text-align: center;
|
||||
max-width: 1200px;
|
||||
.home-text {
|
||||
z-index: 9;
|
||||
grid-area: 9/1 / span 6 / span 20;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.home-subtitle {
|
||||
font-size: var(--font-size-subtitle);
|
||||
color: white;
|
||||
width: 30%;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.home__title {
|
||||
font-size: clamp(3rem, 8vw, 8rem);
|
||||
font-family: 'Danzza', sans-serif;
|
||||
font-weight: 700;
|
||||
margin: 0 0 1.5rem;
|
||||
line-height: 1.1;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.home__title :global(.highlight) {
|
||||
color: #04fea0;
|
||||
}
|
||||
|
||||
.home__subtitle {
|
||||
font-size: clamp(1.2rem, 3vw, 2rem);
|
||||
margin: 0 0 3rem;
|
||||
opacity: 0.9;
|
||||
max-width: 800px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.home__bubbles {
|
||||
.olly {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
pointer-events: none;
|
||||
z-index: 5;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.bubble {
|
||||
.olly figure {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.home-video {
|
||||
position: absolute;
|
||||
background: rgba(4, 254, 160, 0.1);
|
||||
border: 1px solid rgba(4, 254, 160, 0.3);
|
||||
border-radius: 50%;
|
||||
padding: 1rem 1.5rem;
|
||||
font-size: 0.9rem;
|
||||
color: #04fea0;
|
||||
backdrop-filter: blur(10px);
|
||||
animation: float 6s ease-in-out infinite;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.bubble--top-left {
|
||||
top: 15%;
|
||||
left: 10%;
|
||||
.home-video-desktop {
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
.bubble--top-right {
|
||||
top: 20%;
|
||||
right: 15%;
|
||||
animation-delay: -2s;
|
||||
.home-video-mobile {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.bubble--bottom-left {
|
||||
bottom: 25%;
|
||||
left: 15%;
|
||||
animation-delay: -4s;
|
||||
}
|
||||
|
||||
.bubble--bottom-right {
|
||||
bottom: 20%;
|
||||
right: 10%;
|
||||
animation-delay: -3s;
|
||||
}
|
||||
|
||||
@keyframes float {
|
||||
0%, 100% {
|
||||
transform: translateY(0);
|
||||
@media screen and (max-width: 1000px) {
|
||||
.home-video-desktop {
|
||||
display: none !important;
|
||||
}
|
||||
50% {
|
||||
transform: translateY(-20px);
|
||||
.home-video-mobile {
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
.home-subtitle {
|
||||
font-size: var(--font-size-subtitle-mobile);
|
||||
width: 80%;
|
||||
line-height: 1.4;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.home {
|
||||
padding: 5rem 1rem 2rem;
|
||||
}
|
||||
|
||||
.bubble {
|
||||
font-size: 0.7rem;
|
||||
padding: 0.75rem 1rem;
|
||||
@media screen and (min-width: 701px) and (max-width: 912px) {
|
||||
.home-subtitle {
|
||||
font-size: var(--font-size-subtitle-tablet);
|
||||
width: 70%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue