Standardize public images on WebP and add conversion tooling
All checks were successful
Deploy Sokko G / deploy (push) Successful in 20s
All checks were successful
Deploy Sokko G / deploy (push) Successful in 20s
This commit is contained in:
parent
75592d7d7a
commit
ca39b76282
883 changed files with 503 additions and 90 deletions
|
|
@ -54,7 +54,7 @@ export function Shell({ route, content, games, drawerGameId = "", drawerVisible
|
|||
<Tooltip as="a" className={`nav-item ${route.startsWith("/toolboxes") || route.startsWith("/toolbox") ? "active" : ""}`} content={compactSidebar ? content.navigation.toolboxes : ""} position="right" href="#/toolboxes" aria-label={content.navigation.toolboxes}><span className="nav-icon nav-icon-toolbox" aria-hidden="true" /><strong>{content.navigation.toolboxes}</strong></Tooltip>
|
||||
</nav>
|
||||
<div className="sidebar-mascot" aria-hidden="true">
|
||||
<img src="/static/img/dragon-sidebar.png" alt="" />
|
||||
<img src="/static/img/dragon-sidebar.webp" alt="" />
|
||||
</div>
|
||||
<div className="sidebar-secondary-links">
|
||||
<Tooltip as="a" className={`sidebar-about-link ${route === "/about" ? "active" : ""}`} content={compactSidebar ? content.navigation.about : ""} position="right" href="#/about" aria-label={content.navigation.about}><span className="sidebar-about-icon" aria-hidden="true">?</span><strong>{content.navigation.about}</strong></Tooltip>
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ export function aniimoLabel(translations, key) {
|
|||
}
|
||||
|
||||
export function aniimoAsset(key) {
|
||||
return `/static/img/aniimo/${key}.png`;
|
||||
return `/static/img/aniimo/${key}.webp`;
|
||||
}
|
||||
|
||||
function normalizeName(value) {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
const MHWILDS_IMG_PATH = "/static/img/mhwilds";
|
||||
|
||||
export function assetPath(name) {
|
||||
return encodeURI(`${MHWILDS_IMG_PATH}/${String(name || "").replace(/_/g, " ")}.png`);
|
||||
return encodeURI(`${MHWILDS_IMG_PATH}/${String(name || "").replace(/_/g, " ")}.webp`);
|
||||
}
|
||||
|
||||
export function normalizeText(value) {
|
||||
|
|
|
|||
|
|
@ -133,9 +133,9 @@ export function ToolboxIconPicker({ toolbox, onChange, tutorialTarget = "" }) {
|
|||
onChange(path, "");
|
||||
close();
|
||||
}}
|
||||
aria-label={`Utiliser l'icône ${path.split("/").pop().replace(".png", "")}`}
|
||||
aria-label={`Utiliser l'icône ${path.split("/").pop().replace(/\.[^.]+$/, "")}`}
|
||||
aria-pressed={!toolbox.customCover && path === icon}
|
||||
title={path.split("/").pop().replace(".png", "")}
|
||||
title={path.split("/").pop().replace(/\.[^.]+$/, "")}
|
||||
>
|
||||
<img src={path} alt="" aria-hidden="true" loading="lazy" />
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -24,35 +24,35 @@ export { normalizeTimerData } from "./modules/timer.js";
|
|||
|
||||
const TOOLBOX_ICON_BASE = "/static/img/toolbox-icons/";
|
||||
const TOOLBOX_ICON_FILES = [
|
||||
"toolbox.png",
|
||||
"ball.png",
|
||||
"capture.png",
|
||||
"card.png",
|
||||
"city.png",
|
||||
"compass.png",
|
||||
"crash.png",
|
||||
"detective.png",
|
||||
"fire.png",
|
||||
"horror.png",
|
||||
"jump.png",
|
||||
"mining.png",
|
||||
"parachute.png",
|
||||
"puzzle.png",
|
||||
"reflexion.png",
|
||||
"shield.png",
|
||||
"sword.png",
|
||||
"target.png",
|
||||
"tower.png",
|
||||
"wheel.png"
|
||||
"toolbox.webp",
|
||||
"ball.webp",
|
||||
"capture.webp",
|
||||
"card.webp",
|
||||
"city.webp",
|
||||
"compass.webp",
|
||||
"crash.webp",
|
||||
"detective.webp",
|
||||
"fire.webp",
|
||||
"horror.webp",
|
||||
"jump.webp",
|
||||
"mining.webp",
|
||||
"parachute.webp",
|
||||
"puzzle.webp",
|
||||
"reflexion.webp",
|
||||
"shield.webp",
|
||||
"sword.webp",
|
||||
"target.webp",
|
||||
"tower.webp",
|
||||
"wheel.webp"
|
||||
];
|
||||
export const TOOLBOX_ICONS = TOOLBOX_ICON_FILES.map((file) => `${TOOLBOX_ICON_BASE}${file}`);
|
||||
export const DEFAULT_TOOLBOX_ICON = `${TOOLBOX_ICON_BASE}toolbox.png`;
|
||||
export const DEFAULT_TOOLBOX_ICON = `${TOOLBOX_ICON_BASE}toolbox.webp`;
|
||||
export const MAX_TOOLBOX_SPACES = 5;
|
||||
const LEGACY_TOOLBOX_UPDATED_AT = "1970-01-01T00:00:00.000Z";
|
||||
|
||||
export function normalizeToolboxIcon(icon) {
|
||||
const value = String(icon || "").trim();
|
||||
const file = value.replace(TOOLBOX_ICON_BASE, "").split("/").pop();
|
||||
const file = value.replace(TOOLBOX_ICON_BASE, "").split("/").pop().replace(/\.png$/i, ".webp");
|
||||
return TOOLBOX_ICON_FILES.includes(file) ? `${TOOLBOX_ICON_BASE}${file}` : DEFAULT_TOOLBOX_ICON;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
// Rôle : expose en développement un catalogue vivant et interactif des contrôles NDS.
|
||||
import { useState } from "react";
|
||||
import "../styles/_design-system.scss";
|
||||
import { CompactDropdown } from "../components/CompactDropdown.jsx";
|
||||
import { Icon } from "../components/Icon.jsx";
|
||||
import { MixTagsInput } from "../components/MixTagsInput.jsx";
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ export function HomePage({ siteContent, toolboxes, actions }) {
|
|||
</div>
|
||||
</div>
|
||||
<div className="home-visual" aria-label="Illustration Sokko G">
|
||||
<img src="/static/img/dragon-home.png" alt={content.origin.visualAlt} />
|
||||
<img src="/static/img/dragon-home.webp" alt={content.origin.visualAlt} />
|
||||
</div>
|
||||
</section>
|
||||
<footer className="home-legal">
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
@use "home";
|
||||
@use "cards";
|
||||
@use "components";
|
||||
@use "design-system";
|
||||
@use "icons";
|
||||
@use "games";
|
||||
@use "toolboxes";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue