Migration vers architecture Svelte + Kirby inspirée de design-to-pack
- Mise en place de Svelte 4 avec Vite pour le frontend (SPA)
- Simplification des templates PHP (header/footer minimalistes)
- Création de templates JSON pour API (home, about, expertise, portfolio, jouer, game, blog, article, project)
- Ajout d'un controller de site pour définir genericData globalement
- Structure des stores Svelte (page, navigation, locale, site)
- Router avec navaid pour navigation SPA et interception des liens
- Composants layout (Header, Footer, Cursor) et vues de base
- Build Vite vers assets/dist/ (index.js/css)
- Header PHP détecte assets/dist pour basculer dev/prod
Architecture fonctionnelle de base établie, à améliorer et compléter.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 16:30:15 +01:00
|
|
|
<script>
|
Feat: pages Article + navigation blog/article interne
- Router: findSlideIndex() avec fallback parent path
(/blog/slug → /blog) pour sub-pages
- article.json.php: réécriture — date, intro, cover, body (blocks→HTML),
related articles (fallback siblings si vide)
- Article.svelte: sous-composant — topbar date+retour, titre Terminal,
intro, cover, body rich text (styles :global pour blocks Kirby),
related articles grid, responsive
- Blog.svelte: gère deux modes (liste + article) —
intercepte les clics article via stopPropagation (avant le router),
fetch article data, pushState pour URL, popstate pour back/forward,
direct navigation /blog/slug sur mount
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 16:55:34 +01:00
|
|
|
import { onMount } from 'svelte'
|
|
|
|
|
import { slides } from '@state/slides.svelte'
|
2026-03-10 16:47:49 +01:00
|
|
|
import Footer from '@components/layout/Footer.svelte'
|
Feat: pages Article + navigation blog/article interne
- Router: findSlideIndex() avec fallback parent path
(/blog/slug → /blog) pour sub-pages
- article.json.php: réécriture — date, intro, cover, body (blocks→HTML),
related articles (fallback siblings si vide)
- Article.svelte: sous-composant — topbar date+retour, titre Terminal,
intro, cover, body rich text (styles :global pour blocks Kirby),
related articles grid, responsive
- Blog.svelte: gère deux modes (liste + article) —
intercepte les clics article via stopPropagation (avant le router),
fetch article data, pushState pour URL, popstate pour back/forward,
direct navigation /blog/slug sur mount
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 16:55:34 +01:00
|
|
|
import Article from '@views/Article.svelte'
|
2026-03-10 16:47:49 +01:00
|
|
|
|
2026-02-07 08:26:28 +01:00
|
|
|
let { data } = $props()
|
2026-03-10 16:47:49 +01:00
|
|
|
|
Feat: pages Article + navigation blog/article interne
- Router: findSlideIndex() avec fallback parent path
(/blog/slug → /blog) pour sub-pages
- article.json.php: réécriture — date, intro, cover, body (blocks→HTML),
related articles (fallback siblings si vide)
- Article.svelte: sous-composant — topbar date+retour, titre Terminal,
intro, cover, body rich text (styles :global pour blocks Kirby),
related articles grid, responsive
- Blog.svelte: gère deux modes (liste + article) —
intercepte les clics article via stopPropagation (avant le router),
fetch article data, pushState pour URL, popstate pour back/forward,
direct navigation /blog/slug sur mount
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 16:55:34 +01:00
|
|
|
const isActive = $derived(slides.active?.id === 'blog')
|
2026-03-10 16:47:49 +01:00
|
|
|
const featured = $derived(data?.featured ?? null)
|
|
|
|
|
const articles = $derived(data?.articles ?? [])
|
Feat: pages Article + navigation blog/article interne
- Router: findSlideIndex() avec fallback parent path
(/blog/slug → /blog) pour sub-pages
- article.json.php: réécriture — date, intro, cover, body (blocks→HTML),
related articles (fallback siblings si vide)
- Article.svelte: sous-composant — topbar date+retour, titre Terminal,
intro, cover, body rich text (styles :global pour blocks Kirby),
related articles grid, responsive
- Blog.svelte: gère deux modes (liste + article) —
intercepte les clics article via stopPropagation (avant le router),
fetch article data, pushState pour URL, popstate pour back/forward,
direct navigation /blog/slug sur mount
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 16:55:34 +01:00
|
|
|
|
|
|
|
|
// --- Article sub-page state ---
|
|
|
|
|
let articleData = $state(null)
|
|
|
|
|
let articleLoading = $state(false)
|
|
|
|
|
let sectionEl = $state(null)
|
|
|
|
|
|
|
|
|
|
// Extract slug from current URL (for direct navigation to /blog/slug)
|
|
|
|
|
function getSlugFromUrl() {
|
|
|
|
|
const parts = window.location.pathname.split('/').filter(Boolean)
|
|
|
|
|
// parts = ['blog', 'slug'] → slug = 'slug'
|
|
|
|
|
return parts.length >= 2 && parts[0] === 'blog' ? parts[1] : null
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function openArticle(slug) {
|
|
|
|
|
articleLoading = true
|
|
|
|
|
try {
|
|
|
|
|
const res = await fetch(`/blog/${slug}.json`)
|
|
|
|
|
if (!res.ok) throw new Error(`HTTP ${res.status}`)
|
|
|
|
|
articleData = await res.json()
|
|
|
|
|
scrollToTop()
|
|
|
|
|
} catch (e) {
|
|
|
|
|
console.error('[blog] Failed to load article:', e)
|
|
|
|
|
articleData = null
|
|
|
|
|
} finally {
|
|
|
|
|
articleLoading = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function backToList() {
|
|
|
|
|
articleData = null
|
|
|
|
|
history.pushState({}, '', '/blog')
|
|
|
|
|
document.title = `${data?.title ?? 'Blog'} — World Game`
|
|
|
|
|
scrollToTop()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function scrollToTop() {
|
|
|
|
|
sectionEl?.scrollTo(0, 0)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Handle article link clicks (intercepted BEFORE the router's document handler)
|
|
|
|
|
function handleClick(e) {
|
|
|
|
|
const link = e.target.closest('a[href]')
|
|
|
|
|
if (!link) return
|
|
|
|
|
|
|
|
|
|
const url = new URL(link.href, window.location.origin)
|
|
|
|
|
if (url.origin !== window.location.origin) return
|
|
|
|
|
|
|
|
|
|
const match = url.pathname.match(/^\/blog\/([^/]+)$/)
|
|
|
|
|
if (match) {
|
|
|
|
|
e.preventDefault()
|
|
|
|
|
e.stopPropagation()
|
|
|
|
|
const slug = match[1]
|
|
|
|
|
history.pushState({}, '', `/blog/${slug}`)
|
|
|
|
|
openArticle(slug)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Handle browser back/forward within blog
|
|
|
|
|
function handlePopState() {
|
|
|
|
|
if (!isActive) return
|
|
|
|
|
const slug = getSlugFromUrl()
|
|
|
|
|
if (slug && (!articleData || articleData.uri !== `blog/${slug}`)) {
|
|
|
|
|
openArticle(slug)
|
|
|
|
|
} else if (!slug && articleData) {
|
|
|
|
|
articleData = null
|
|
|
|
|
scrollToTop()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// On mount: check if URL is /blog/slug (direct navigation)
|
|
|
|
|
onMount(() => {
|
|
|
|
|
const slug = getSlugFromUrl()
|
|
|
|
|
if (slug) openArticle(slug)
|
|
|
|
|
|
|
|
|
|
window.addEventListener('popstate', handlePopState)
|
|
|
|
|
return () => {
|
|
|
|
|
window.removeEventListener('popstate', handlePopState)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// Reset article view when leaving the blog slide
|
|
|
|
|
$effect(() => {
|
|
|
|
|
if (!isActive && articleData) {
|
|
|
|
|
articleData = null
|
|
|
|
|
}
|
|
|
|
|
})
|
Migration vers architecture Svelte + Kirby inspirée de design-to-pack
- Mise en place de Svelte 4 avec Vite pour le frontend (SPA)
- Simplification des templates PHP (header/footer minimalistes)
- Création de templates JSON pour API (home, about, expertise, portfolio, jouer, game, blog, article, project)
- Ajout d'un controller de site pour définir genericData globalement
- Structure des stores Svelte (page, navigation, locale, site)
- Router avec navaid pour navigation SPA et interception des liens
- Composants layout (Header, Footer, Cursor) et vues de base
- Build Vite vers assets/dist/ (index.js/css)
- Header PHP détecte assets/dist pour basculer dev/prod
Architecture fonctionnelle de base établie, à améliorer et compléter.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 16:30:15 +01:00
|
|
|
</script>
|
|
|
|
|
|
Feat: pages Article + navigation blog/article interne
- Router: findSlideIndex() avec fallback parent path
(/blog/slug → /blog) pour sub-pages
- article.json.php: réécriture — date, intro, cover, body (blocks→HTML),
related articles (fallback siblings si vide)
- Article.svelte: sous-composant — topbar date+retour, titre Terminal,
intro, cover, body rich text (styles :global pour blocks Kirby),
related articles grid, responsive
- Blog.svelte: gère deux modes (liste + article) —
intercepte les clics article via stopPropagation (avant le router),
fetch article data, pushState pour URL, popstate pour back/forward,
direct navigation /blog/slug sur mount
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 16:55:34 +01:00
|
|
|
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
|
|
|
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
|
|
|
<section
|
|
|
|
|
class="blog page-scrollable"
|
|
|
|
|
bind:this={sectionEl}
|
|
|
|
|
onclick={handleClick}
|
|
|
|
|
>
|
|
|
|
|
{#if articleData}
|
|
|
|
|
<!-- Article view -->
|
|
|
|
|
<Article data={articleData} onBack={backToList} />
|
|
|
|
|
{:else}
|
|
|
|
|
<!-- Blog list -->
|
|
|
|
|
<div class="page-container">
|
|
|
|
|
|
|
|
|
|
{#if data?.intro}
|
|
|
|
|
<header class="blog-header">
|
|
|
|
|
{@html data.intro}
|
|
|
|
|
</header>
|
|
|
|
|
{/if}
|
|
|
|
|
|
|
|
|
|
{#if featured}
|
|
|
|
|
<article class="blog-card blog-card--featured">
|
|
|
|
|
<div class="blog-card-text">
|
|
|
|
|
<time class="blog-card-date">{featured.date}</time>
|
|
|
|
|
<h2 class="blog-card-title">
|
|
|
|
|
<a href="/blog/{featured.slug}">{featured.title}</a>
|
|
|
|
|
</h2>
|
|
|
|
|
{#if featured.intro}
|
2026-03-10 17:45:11 +01:00
|
|
|
<p class="blog-card-description">{featured.intro}</p>
|
Feat: pages Article + navigation blog/article interne
- Router: findSlideIndex() avec fallback parent path
(/blog/slug → /blog) pour sub-pages
- article.json.php: réécriture — date, intro, cover, body (blocks→HTML),
related articles (fallback siblings si vide)
- Article.svelte: sous-composant — topbar date+retour, titre Terminal,
intro, cover, body rich text (styles :global pour blocks Kirby),
related articles grid, responsive
- Blog.svelte: gère deux modes (liste + article) —
intercepte les clics article via stopPropagation (avant le router),
fetch article data, pushState pour URL, popstate pour back/forward,
direct navigation /blog/slug sur mount
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 16:55:34 +01:00
|
|
|
{/if}
|
|
|
|
|
<a href="/blog/{featured.slug}" class="blog-card-readmore">
|
|
|
|
|
Lire l'article <span class="arrow">→</span>
|
2026-03-10 16:47:49 +01:00
|
|
|
</a>
|
|
|
|
|
</div>
|
Feat: pages Article + navigation blog/article interne
- Router: findSlideIndex() avec fallback parent path
(/blog/slug → /blog) pour sub-pages
- article.json.php: réécriture — date, intro, cover, body (blocks→HTML),
related articles (fallback siblings si vide)
- Article.svelte: sous-composant — topbar date+retour, titre Terminal,
intro, cover, body rich text (styles :global pour blocks Kirby),
related articles grid, responsive
- Blog.svelte: gère deux modes (liste + article) —
intercepte les clics article via stopPropagation (avant le router),
fetch article data, pushState pour URL, popstate pour back/forward,
direct navigation /blog/slug sur mount
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 16:55:34 +01:00
|
|
|
{#if featured.cover}
|
|
|
|
|
<div class="blog-card-image blog-card-image--featured">
|
|
|
|
|
<a href="/blog/{featured.slug}">
|
|
|
|
|
<img src={featured.cover} alt={featured.title} />
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
{/if}
|
|
|
|
|
</article>
|
|
|
|
|
<hr class="blog-divider" />
|
|
|
|
|
{/if}
|
|
|
|
|
|
|
|
|
|
{#each articles as article, i}
|
|
|
|
|
<article class="blog-card">
|
|
|
|
|
<div class="blog-card-text">
|
|
|
|
|
<time class="blog-card-date">{article.date}</time>
|
|
|
|
|
<h2 class="blog-card-title">
|
|
|
|
|
<a href="/blog/{article.slug}">{article.title}</a>
|
|
|
|
|
</h2>
|
|
|
|
|
<a href="/blog/{article.slug}" class="blog-card-readmore">
|
|
|
|
|
Lire l'article <span class="arrow">→</span>
|
2026-03-10 16:47:49 +01:00
|
|
|
</a>
|
|
|
|
|
</div>
|
Feat: pages Article + navigation blog/article interne
- Router: findSlideIndex() avec fallback parent path
(/blog/slug → /blog) pour sub-pages
- article.json.php: réécriture — date, intro, cover, body (blocks→HTML),
related articles (fallback siblings si vide)
- Article.svelte: sous-composant — topbar date+retour, titre Terminal,
intro, cover, body rich text (styles :global pour blocks Kirby),
related articles grid, responsive
- Blog.svelte: gère deux modes (liste + article) —
intercepte les clics article via stopPropagation (avant le router),
fetch article data, pushState pour URL, popstate pour back/forward,
direct navigation /blog/slug sur mount
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 16:55:34 +01:00
|
|
|
{#if article.cover}
|
|
|
|
|
<div class="blog-card-image">
|
|
|
|
|
<a href="/blog/{article.slug}">
|
|
|
|
|
<img src={article.cover} alt={article.title} />
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
{/if}
|
|
|
|
|
</article>
|
|
|
|
|
{#if i < articles.length - 1}
|
|
|
|
|
<hr class="blog-divider" />
|
2026-03-10 16:47:49 +01:00
|
|
|
{/if}
|
Feat: pages Article + navigation blog/article interne
- Router: findSlideIndex() avec fallback parent path
(/blog/slug → /blog) pour sub-pages
- article.json.php: réécriture — date, intro, cover, body (blocks→HTML),
related articles (fallback siblings si vide)
- Article.svelte: sous-composant — topbar date+retour, titre Terminal,
intro, cover, body rich text (styles :global pour blocks Kirby),
related articles grid, responsive
- Blog.svelte: gère deux modes (liste + article) —
intercepte les clics article via stopPropagation (avant le router),
fetch article data, pushState pour URL, popstate pour back/forward,
direct navigation /blog/slug sur mount
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 16:55:34 +01:00
|
|
|
{/each}
|
|
|
|
|
|
|
|
|
|
{#if articleLoading}
|
|
|
|
|
<p class="blog-loading">Chargement…</p>
|
2026-03-10 16:47:49 +01:00
|
|
|
{/if}
|
|
|
|
|
|
Feat: pages Article + navigation blog/article interne
- Router: findSlideIndex() avec fallback parent path
(/blog/slug → /blog) pour sub-pages
- article.json.php: réécriture — date, intro, cover, body (blocks→HTML),
related articles (fallback siblings si vide)
- Article.svelte: sous-composant — topbar date+retour, titre Terminal,
intro, cover, body rich text (styles :global pour blocks Kirby),
related articles grid, responsive
- Blog.svelte: gère deux modes (liste + article) —
intercepte les clics article via stopPropagation (avant le router),
fetch article data, pushState pour URL, popstate pour back/forward,
direct navigation /blog/slug sur mount
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 16:55:34 +01:00
|
|
|
</div>
|
2026-03-10 16:47:49 +01:00
|
|
|
|
Feat: pages Article + navigation blog/article interne
- Router: findSlideIndex() avec fallback parent path
(/blog/slug → /blog) pour sub-pages
- article.json.php: réécriture — date, intro, cover, body (blocks→HTML),
related articles (fallback siblings si vide)
- Article.svelte: sous-composant — topbar date+retour, titre Terminal,
intro, cover, body rich text (styles :global pour blocks Kirby),
related articles grid, responsive
- Blog.svelte: gère deux modes (liste + article) —
intercepte les clics article via stopPropagation (avant le router),
fetch article data, pushState pour URL, popstate pour back/forward,
direct navigation /blog/slug sur mount
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 16:55:34 +01:00
|
|
|
<Footer />
|
|
|
|
|
{/if}
|
2026-03-10 16:47:49 +01:00
|
|
|
</section>
|
Migration vers architecture Svelte + Kirby inspirée de design-to-pack
- Mise en place de Svelte 4 avec Vite pour le frontend (SPA)
- Simplification des templates PHP (header/footer minimalistes)
- Création de templates JSON pour API (home, about, expertise, portfolio, jouer, game, blog, article, project)
- Ajout d'un controller de site pour définir genericData globalement
- Structure des stores Svelte (page, navigation, locale, site)
- Router avec navaid pour navigation SPA et interception des liens
- Composants layout (Header, Footer, Cursor) et vues de base
- Build Vite vers assets/dist/ (index.js/css)
- Header PHP détecte assets/dist pour basculer dev/prod
Architecture fonctionnelle de base établie, à améliorer et compléter.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 16:30:15 +01:00
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
.blog {
|
2026-03-10 16:47:49 +01:00
|
|
|
background: #0d0e22;
|
|
|
|
|
color: var(--color-text);
|
2026-03-10 17:45:11 +01:00
|
|
|
padding: 0 50px;
|
Migration vers architecture Svelte + Kirby inspirée de design-to-pack
- Mise en place de Svelte 4 avec Vite pour le frontend (SPA)
- Simplification des templates PHP (header/footer minimalistes)
- Création de templates JSON pour API (home, about, expertise, portfolio, jouer, game, blog, article, project)
- Ajout d'un controller de site pour définir genericData globalement
- Structure des stores Svelte (page, navigation, locale, site)
- Router avec navaid pour navigation SPA et interception des liens
- Composants layout (Header, Footer, Cursor) et vues de base
- Build Vite vers assets/dist/ (index.js/css)
- Header PHP détecte assets/dist pour basculer dev/prod
Architecture fonctionnelle de base établie, à améliorer et compléter.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 16:30:15 +01:00
|
|
|
}
|
|
|
|
|
|
2026-03-10 16:47:49 +01:00
|
|
|
/* --- Header / Intro --- */
|
|
|
|
|
.blog-header {
|
|
|
|
|
text-align: center;
|
|
|
|
|
padding: 6rem 0 3rem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.blog-header :global(h1) {
|
|
|
|
|
font-family: "Terminal", sans-serif;
|
|
|
|
|
font-size: var(--font-size-title-main);
|
|
|
|
|
text-transform: uppercase;
|
|
|
|
|
margin-bottom: 1.5rem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.blog-header :global(p) {
|
|
|
|
|
font-size: var(--font-size-subtitle);
|
|
|
|
|
line-height: 1.6;
|
|
|
|
|
max-width: 640px;
|
Migration vers architecture Svelte + Kirby inspirée de design-to-pack
- Mise en place de Svelte 4 avec Vite pour le frontend (SPA)
- Simplification des templates PHP (header/footer minimalistes)
- Création de templates JSON pour API (home, about, expertise, portfolio, jouer, game, blog, article, project)
- Ajout d'un controller de site pour définir genericData globalement
- Structure des stores Svelte (page, navigation, locale, site)
- Router avec navaid pour navigation SPA et interception des liens
- Composants layout (Header, Footer, Cursor) et vues de base
- Build Vite vers assets/dist/ (index.js/css)
- Header PHP détecte assets/dist pour basculer dev/prod
Architecture fonctionnelle de base établie, à améliorer et compléter.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 16:30:15 +01:00
|
|
|
margin: 0 auto;
|
2026-03-10 16:47:49 +01:00
|
|
|
opacity: 0.9;
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-10 17:45:11 +01:00
|
|
|
.page-container {
|
|
|
|
|
max-width: none;
|
|
|
|
|
margin: 0;
|
|
|
|
|
padding: 0 10%;
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-10 16:47:49 +01:00
|
|
|
/* --- Card (article item) --- */
|
|
|
|
|
.blog-card {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
align-items: flex-start;
|
|
|
|
|
gap: 2rem;
|
|
|
|
|
padding: 1.5rem 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.blog-card-text {
|
|
|
|
|
flex: 1;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
gap: 1rem;
|
|
|
|
|
max-width: 640px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.blog-card-date {
|
|
|
|
|
color: #d9d9d9;
|
|
|
|
|
font-size: var(--font-size-paragraph);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.blog-card-title {
|
2026-03-10 17:45:11 +01:00
|
|
|
font-family: "Danzza", sans-serif;
|
|
|
|
|
font-size: 40px;
|
|
|
|
|
max-width: 80%;
|
|
|
|
|
font-weight: 700;
|
2026-03-10 16:47:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.blog-card-title a {
|
|
|
|
|
transition: color 0.2s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.blog-card-title a:hover {
|
|
|
|
|
color: var(--color-primary);
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-10 17:45:11 +01:00
|
|
|
.blog-card-description {
|
2026-03-10 16:47:49 +01:00
|
|
|
color: #d9d9d9;
|
2026-03-10 17:45:11 +01:00
|
|
|
font-family: "Danzza",sans-serif;
|
2026-03-10 16:47:49 +01:00
|
|
|
font-size: var(--font-size-paragraph);
|
2026-03-10 17:45:11 +01:00
|
|
|
font-weight: 400;
|
2026-03-10 16:47:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.blog-card-readmore {
|
|
|
|
|
color: var(--color-primary);
|
2026-03-10 17:45:11 +01:00
|
|
|
font-family: "Danzza", sans-serif;
|
2026-03-10 16:47:49 +01:00
|
|
|
font-size: var(--font-size-paragraph);
|
2026-03-10 17:45:11 +01:00
|
|
|
font-weight: 500;
|
|
|
|
|
text-transform: uppercase;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.blog-card-readmore .arrow {
|
|
|
|
|
margin-left: 5px;
|
2026-03-10 16:47:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.blog-card-readmore:hover {
|
|
|
|
|
gap: 1rem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* --- Image --- */
|
|
|
|
|
.blog-card-image img {
|
|
|
|
|
width: 300px;
|
|
|
|
|
height: 169px;
|
|
|
|
|
object-fit: cover;
|
|
|
|
|
transition: transform 0.3s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.blog-card-image img:hover {
|
|
|
|
|
transform: scale(1.05);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.blog-card-image--featured img {
|
|
|
|
|
width: auto;
|
|
|
|
|
height: 300px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* --- Divider --- */
|
|
|
|
|
.blog-divider {
|
|
|
|
|
border: none;
|
|
|
|
|
border-top: 1px solid rgba(255, 255, 255, 0.15);
|
|
|
|
|
margin: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* --- Featured --- */
|
|
|
|
|
.blog-card--featured .blog-card-title {
|
|
|
|
|
font-size: 36px;
|
|
|
|
|
line-height: 1.3;
|
|
|
|
|
}
|
|
|
|
|
|
Feat: pages Article + navigation blog/article interne
- Router: findSlideIndex() avec fallback parent path
(/blog/slug → /blog) pour sub-pages
- article.json.php: réécriture — date, intro, cover, body (blocks→HTML),
related articles (fallback siblings si vide)
- Article.svelte: sous-composant — topbar date+retour, titre Terminal,
intro, cover, body rich text (styles :global pour blocks Kirby),
related articles grid, responsive
- Blog.svelte: gère deux modes (liste + article) —
intercepte les clics article via stopPropagation (avant le router),
fetch article data, pushState pour URL, popstate pour back/forward,
direct navigation /blog/slug sur mount
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 16:55:34 +01:00
|
|
|
/* --- Loading --- */
|
|
|
|
|
.blog-loading {
|
|
|
|
|
text-align: center;
|
|
|
|
|
padding: 4rem 0;
|
|
|
|
|
opacity: 0.6;
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-10 16:47:49 +01:00
|
|
|
/* --- Mobile --- */
|
|
|
|
|
@media (--mobile) {
|
|
|
|
|
.blog-header {
|
|
|
|
|
padding: 4rem 0 2rem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.blog-header :global(h1) {
|
|
|
|
|
font-size: var(--font-size-title-main-mobile);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.blog-header :global(p) {
|
|
|
|
|
font-size: var(--font-size-subtitle-mobile);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.blog-card {
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.blog-card-image img,
|
|
|
|
|
.blog-card-image--featured img {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: auto;
|
|
|
|
|
aspect-ratio: 16/9;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.blog-card--featured .blog-card-title {
|
|
|
|
|
font-size: var(--font-size-title-section-mobile);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.blog-card-title {
|
|
|
|
|
font-size: var(--font-size-title-section-mobile);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* --- Tablet --- */
|
|
|
|
|
@media (--tablet-only) {
|
|
|
|
|
.blog-header :global(h1) {
|
|
|
|
|
font-size: var(--font-size-title-main-tablet);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.blog-card {
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.blog-card-image img,
|
|
|
|
|
.blog-card-image--featured img {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: auto;
|
|
|
|
|
aspect-ratio: 16/9;
|
|
|
|
|
}
|
Migration vers architecture Svelte + Kirby inspirée de design-to-pack
- Mise en place de Svelte 4 avec Vite pour le frontend (SPA)
- Simplification des templates PHP (header/footer minimalistes)
- Création de templates JSON pour API (home, about, expertise, portfolio, jouer, game, blog, article, project)
- Ajout d'un controller de site pour définir genericData globalement
- Structure des stores Svelte (page, navigation, locale, site)
- Router avec navaid pour navigation SPA et interception des liens
- Composants layout (Header, Footer, Cursor) et vues de base
- Build Vite vers assets/dist/ (index.js/css)
- Header PHP détecte assets/dist pour basculer dev/prod
Architecture fonctionnelle de base établie, à améliorer et compléter.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 16:30:15 +01:00
|
|
|
}
|
|
|
|
|
</style>
|