Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 1 addition & 51 deletions apps/blog/src/components/pixel/pixel-sprite.tsx
Original file line number Diff line number Diff line change
@@ -1,51 +1 @@
import type { Sprite } from './sprites'

/**
* Dessine un sprite en SVG net (crispEdges). La taille vient de la classe : le
* viewBox suit la grille, donc un pixel du sprite reste un carré parfait.
*/
export function PixelSprite({
sprite,
className,
title,
x,
y,
width: w,
height: h,
}: {
sprite: Sprite
className?: string
/** Placement quand le sprite est imbriqué dans un autre SVG. */
x?: number
y?: number
width?: number
height?: number
/** Sans titre, le sprite est décoratif et masqué aux lecteurs d'écran. */
title?: string
}) {
const width = Math.max(...sprite.rows.map((r) => r.length))
const height = sprite.rows.length

return (
<svg
viewBox={`0 0 ${width} ${height}`}
x={x}
y={y}
width={w}
height={h}
shapeRendering="crispEdges"
className={className}
role={title ? 'img' : undefined}
aria-hidden={title ? undefined : true}
aria-label={title}
>
{sprite.rows.flatMap((row, y) =>
[...row].map((char, x) =>
char === '.' ? null : (
<rect key={`${x}-${y}`} x={x} y={y} width={1.02} height={1.02} fill={sprite.palette[char]} />
),
),
)}
</svg>
)
}
export { PixelSprite } from '@explainer/ui/pixel/pixel-sprite'
147 changes: 1 addition & 146 deletions apps/blog/src/components/pixel/sprites.ts
Original file line number Diff line number Diff line change
@@ -1,146 +1 @@
/**
* Les sprites du site, dessinés à la main sur une grille. Une ligne par rangée
* de pixels, un caractère par pixel, « . » pour transparent. La palette dit
* quelle couleur prend chaque caractère.
*
* Le crabe reprend exactement public/logo.svg (9 × 9) : c'est l'unité de base
* de toute la direction artistique.
*/
export interface Sprite {
rows: string[]
palette: Record<string, string>
}

const RUST = { D: '#a83e08', O: '#f2670f', E: '#1c1917' }

export const crab: Sprite = {
rows: [
'.........',
'..D...D..',
'.DD...DD.',
'.D.E.E.D.',
'.DOOOOOD.',
'OOOOOOOOO',
'.OOOOOOO.',
'D.OOOOO.D',
'.........',
],
palette: RUST,
}

/** Ferriskey : une clé dorée. */
export const key: Sprite = {
rows: [
'.GGG.......',
'GYYYG......',
'GY.YGGGGGGG',
'GYYYGYYYYYG',
'.GGG...G.GG',
'.......G.G.',
],
palette: { G: '#b7791f', Y: '#f3b544' },
}

const MOD = { O: '#3b6cf0', D: '#1e3a8a', Y: '#bcd2ff' }

/** Compass : le moteur de flux d'authentification. */
export const compassSprite: Sprite = {
rows: ['..OOOOO..', '.O.....O.', 'O.....Y.O', 'O....YY.O', 'O...DD..O', 'O.YYD...O', 'O.Y.....O', '.O.....O.', '..OOOOO..'],
palette: MOD,
}

/** Trident : l'authentification multi-facteurs. */
export const tridentSprite: Sprite = {
rows: ['O...O...O', 'O...O...O', 'O...O...O', 'OO..O..OO', '.OOOOOOO.', '....O....', '....O....', '....O....', '....O....'],
palette: MOD,
}

/** Abyss : la fédération d'identités, deux cadres qui s'emboîtent. */
export const abyssSprite: Sprite = {
rows: ['.........', '.OOOOO...', '.O...O...', '.O..DDDDD', '.OOODO..D', '....D...D', '....D...D', '....DDDDD', '.........'],
palette: MOD,
}

/** Aegis : le bouclier des scopes et des mappers. */
export const aegisSprite: Sprite = {
rows: ['OOOOOOOOO', 'ODDDYDDDO', 'ODDDYDDDO', 'OYYYYYYYO', 'ODDDYDDDO', '.ODDYDDO.', '..ODYDO..', '...ODO...', '....O....'],
palette: MOD,
}

/** SeaWatch : l'œil de l'audit. */
export const seawatchSprite: Sprite = {
rows: ['.........', '..OOOOO..', '.O.....O.', 'O..DDD..O', 'O.DYYYD.O', 'O..DDD..O', '.O.....O.', '..OOOOO..', '.........'],
palette: MOD,
}

/** Webhooks : l'éclair des événements. */
export const webhooksSprite: Sprite = {
rows: ['.....OO..', '....OO...', '...OO....', '..OOOOO..', '....OO...', '...OO....', '..OO.....', '.OO......', '.........'],
palette: MOD,
}

/** Chariot élévateur, tourné vers la droite : le mât et les fourches sont à droite. */
export const forklift: Sprite = {
rows: [
'.........D..',
'.........D..',
'.OOOOOO..D..',
'.OWWWWO..D..',
'.OWWWWOOOD..',
'.OOOOOOOOD..',
'.OOOOOOOODDD',
'..KKK..KKK..',
'..KKK..KKK..',
],
palette: { O: '#f2670f', D: '#7a2d06', W: '#bcd2ff', K: '#1c1917' },
}

/** Camion de livraison, cabine à droite. */
export const truck: Sprite = {
rows: [
'DDDDDDDDDDDDD.......',
'DOOOOOOOOOOOD.......',
'DOOOOOOOOOOOD.DDDD..',
'DOOOYYYYYOOOD.DWWDD.',
'DOOOOOOOOOOODDDWWDDD',
'DOOOOOOOOOOODDDDDDDD',
'DDDDDDDDDDDDDDDDDDDD',
'..KKK.......KKK.KKK.',
'..KKK.......KKK.KKK.',
],
palette: { O: '#ffb547', D: '#7a2d06', Y: '#f2670f', W: '#bcd2ff', K: '#1c1917' },
}

/** Organizations : un immeuble. */
export const orgSprite: Sprite = {
rows: ['.OOOOOOO.', '.OYOYOYO.', '.OOOOOOO.', '.OYOYOYO.', '.OOOOOOO.', '.OYOYOYO.', '.OOODOOO.', '.OOODOOO.', 'DDDDDDDDD'],
palette: { O: '#3b6cf0', D: '#1e3a8a', Y: '#bcd2ff' },
}

/** Politiques Cedar : une feuille avec une coche. */
export const policySprite: Sprite = {
rows: ['.OOOOOO..', '.O....OO.', '.O.OOO.O.', '.O.....O.', '.O..YY.O.', '.O.YY..O.', '.OYY...O.', '.O.....O.', '.OOOOOOO.'],
palette: { O: '#3b6cf0', D: '#1e3a8a', Y: '#bcd2ff' },
}

/** Serveur MCP : une prise. */
export const mcpSprite: Sprite = {
rows: ['..O...O..', '..O...O..', '.OOOOOOO.', '.OYYYYYO.', '.OYYYYYO.', '..OOOOO..', '...OOO...', '...DOD...', '...D.D...'],
palette: { O: '#3b6cf0', D: '#1e3a8a', Y: '#bcd2ff' },
}

/** Le crabe qui dort, pour le pied de page : yeux fermés, pinces baissées. */
export const crabAsleep: Sprite = {
rows: ['.........', '.........', '.DD...DD.', '.D.....D.', '.DOEOEOD.', 'OOOOOOOOO', '.OOOOOOO.', 'D.OOOOO.D', '.........'],
palette: { D: '#a83e08', O: '#f2670f', E: '#1c1917' },
}

/** Cadenas fermé, puis ouvert : l'arrivée de la clé au bout du mot. */
export const padlockClosed: Sprite = {
rows: ['..OOO..', '.O...O.', '.O...O.', 'OOOOOOO', 'OOODOOO', 'OOODOOO', 'OOOOOOO'],
palette: { O: '#f3b544', D: '#7a2d06' },
}
export const padlockOpen: Sprite = {
rows: ['..OOO..', '.O...O.', '.O.....', 'OOOOOOO', 'OOODOOO', 'OOODOOO', 'OOOOOOO'],
palette: { O: '#f3b544', D: '#7a2d06' },
}
export * from '@explainer/ui/pixel/sprites'
8 changes: 0 additions & 8 deletions apps/blog/src/i18n/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ export const ui = {
'rss.title': 'Explainer Blog',
'rss.description': 'Latest articles from the Explainer blog',

// Footer
'footer.text': '© 2025 Ferriskey · Apache 2.0',
'footer.tagline': 'Open-source identity and access management, written in Rust.',

// Post layout
'post.back': 'Back to writing',
'post.published': 'Published',
Expand Down Expand Up @@ -65,10 +61,6 @@ export const ui = {
'rss.title': 'Blog Explainer',
'rss.description': 'Les derniers articles du blog Explainer',

// Footer
'footer.text': '© 2025 Ferriskey · Apache 2.0',
'footer.tagline': 'Gestion des identités et des accès open source, écrite en Rust.',

// Post layout
'post.back': "Retour aux articles",
'post.published': 'Publié le',
Expand Down
6 changes: 2 additions & 4 deletions apps/blog/src/layouts/base.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
import '../styles/globals.css'
import { ClientRouter } from 'astro:transitions'
import { BlogNavbar } from '../components/blog-navbar'
import SiteFooter from '../components/site-footer.astro'
import { useTranslations } from '../i18n/utils'
import SiteFooter from '@explainer/ui/components/site-footer.astro'

interface Props {
title: string
Expand All @@ -15,7 +14,6 @@ interface Props {
}

const { title, description = 'The FerrisKey blog: identity, security and Rust.', thumbnail, locale = 'en', locales = ['en'], localeSwitchUrls = {} } = Astro.props
const t = useTranslations(locale)
const thumbnailPath = thumbnail ?? `${Astro.url.pathname.replace(/\/$/, '')}/thumbnail.png`
// og:image/twitter:image must be absolute: Discord and most link-preview bots won't resolve a relative path.
const thumbnailUrl = Astro.site ? new URL(thumbnailPath, Astro.site).toString() : thumbnailPath
Expand Down Expand Up @@ -64,6 +62,6 @@ const appUrlOverrides = {
<main class="flex-1 flex flex-col w-full">
<slot />
</main>
<SiteFooter docsHref={appUrlOverrides.docs ?? '/'} websiteHref={appUrlOverrides.website ?? '/'} tagline={t('footer.tagline')} copyright={t('footer.text')} />
<SiteFooter websiteUrl={appUrlOverrides.website} docsUrl={appUrlOverrides.docs} blogUrl={appUrlOverrides.blog} locale={locale === 'fr' ? 'fr' : 'en'} />
</body>
</html>
8 changes: 8 additions & 0 deletions apps/docs/src/layouts/base.astro
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
---
import '../styles/globals.css'
import { ClientRouter } from 'astro:transitions'
import SiteFooter from '@explainer/ui/components/site-footer.astro'

interface Props {
title: string
description?: string
}

const { title, description } = Astro.props

const appUrlOverrides = {
website: import.meta.env.PUBLIC_WEBSITE_URL,
docs: import.meta.env.PUBLIC_DOCS_URL,
blog: import.meta.env.PUBLIC_BLOG_URL,
}
---

<!doctype html>
Expand Down Expand Up @@ -42,5 +49,6 @@ const { title, description } = Astro.props
</head>
<body class="min-h-screen antialiased flex flex-col">
<slot />
<SiteFooter websiteUrl={appUrlOverrides.website} docsUrl={appUrlOverrides.docs} blogUrl={appUrlOverrides.blog} />
</body>
</html>
4 changes: 4 additions & 0 deletions apps/docs/src/layouts/docs.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Sidebar } from '../components/sidebar'
import { TableOfContents, type TocHeading } from '../components/toc'
import { fetchContributors, sortContributors } from '@explainer/ui'
import { Pagination } from '../components/pagination'
import SiteFooter from '@explainer/ui/components/site-footer.astro'
import type { NavItem, ProjectInfo, BreadcrumbItem } from '../lib/docs'

interface Props {
Expand Down Expand Up @@ -164,5 +165,8 @@ const appUrlOverrides = {
<TableOfContents headings={headings} contributors={contributors} client:load />
</div>
</div>
<div class="border-t border-border">
<SiteFooter websiteUrl={appUrlOverrides.website} docsUrl={appUrlOverrides.docs} blogUrl={appUrlOverrides.blog} locale={currentLocale === 'fr' ? 'fr' : 'en'} containerClass="max-w-[90rem]" />
</div>
</body>
</html>
9 changes: 9 additions & 0 deletions apps/website/src/components/legal-value.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
interface Props {
value: string | null
locale: 'en' | 'fr'
}
const { value, locale } = Astro.props
---

{value ?? <mark class="bg-primary/15 px-1 text-primary">{locale === 'fr' ? '[À compléter]' : '[To be completed]'}</mark>}
52 changes: 1 addition & 51 deletions apps/website/src/components/pixel/pixel-sprite.tsx
Original file line number Diff line number Diff line change
@@ -1,51 +1 @@
import type { Sprite } from './sprites'

/**
* Dessine un sprite en SVG net (crispEdges). La taille vient de la classe : le
* viewBox suit la grille, donc un pixel du sprite reste un carré parfait.
*/
export function PixelSprite({
sprite,
className,
title,
x,
y,
width: w,
height: h,
}: {
sprite: Sprite
className?: string
/** Placement quand le sprite est imbriqué dans un autre SVG. */
x?: number
y?: number
width?: number
height?: number
/** Sans titre, le sprite est décoratif et masqué aux lecteurs d'écran. */
title?: string
}) {
const width = Math.max(...sprite.rows.map((r) => r.length))
const height = sprite.rows.length

return (
<svg
viewBox={`0 0 ${width} ${height}`}
x={x}
y={y}
width={w}
height={h}
shapeRendering="crispEdges"
className={className}
role={title ? 'img' : undefined}
aria-hidden={title ? undefined : true}
aria-label={title}
>
{sprite.rows.flatMap((row, y) =>
[...row].map((char, x) =>
char === '.' ? null : (
<rect key={`${x}-${y}`} x={x} y={y} width={1.02} height={1.02} fill={sprite.palette[char]} />
),
),
)}
</svg>
)
}
export { PixelSprite } from '@explainer/ui/pixel/pixel-sprite'
Loading
Loading