feat: Intro flüssiger machen und englische Sprachversion ergänzen
Intro „Fokus": - zwei Bild-Ebenen blenden ineinander über statt hartem Bildwechsel - Unschärfe über winzige Vorschaubilder statt live berechnetem Weichzeichner (animiert werden nur noch transform und opacity) - eigene WebP-Dateien für Laptop (quer) und Handy (hoch) in assets/intro, erzeugt mit scripts/intro-bilder.py; 1,8 MB bzw. 1,1 MB statt 5,9 MB - Bühnenhöhe auf dem Handy unabhängig von der Adressleiste, größere HUD-Schrift - „Überspringen"-Knopf, Scroll-Hinweis blendet jetzt wirklich aus - Bildpfade relativ zum Skript, damit das Intro auch unter /en/ lädt Zweisprachigkeit: - englische Seiten unter public/en/, Sprachschalter in Topbar und Dock - hreflang-Verweise, SEO-Konfiguration, Sitemap und SEO-Prüfskript angepasst - docs/zweisprachigkeit.md Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
9639098303
commit
c793eb7359
105 files changed
+7107
-126
No files matched your search
+15
-3
@@ -41,6 +41,13 @@ function pageHtml(file) {
|
||||
return read(`public/${file}`);
|
||||
}
|
||||
|
||||
// PAGES-Pfad → Datei unter public/ ('/' und '/en' sind Verzeichnis-Startseiten)
|
||||
function pageFile(urlPath) {
|
||||
if (urlPath === '/') return 'index.html';
|
||||
if (urlPath === '/en') return 'en/index.html';
|
||||
return `${urlPath.slice(1)}.html`;
|
||||
}
|
||||
|
||||
function loadConfig() {
|
||||
const context = { window: {} };
|
||||
vm.createContext(context);
|
||||
@@ -104,7 +111,7 @@ if (wants('core')) {
|
||||
|
||||
check('crawlbare Seiten behaupten keinen Standort Uelzen', () => {
|
||||
for (const urlPath of Object.keys(config.PAGES)) {
|
||||
const file = urlPath === '/' ? 'index.html' : `${urlPath.slice(1)}.html`;
|
||||
const file = pageFile(urlPath);
|
||||
const html = pageHtml(file);
|
||||
if (/<meta\s+name=["']robots["'][^>]*\bnoindex\b/i.test(html)) continue;
|
||||
assert.doesNotMatch(
|
||||
@@ -291,7 +298,7 @@ if (wants('links')) {
|
||||
check('alle konfigurierten Seiten haben genau einen statischen SEO-Block', () => {
|
||||
const config = loadConfig();
|
||||
for (const [urlPath, page] of Object.entries(config.PAGES)) {
|
||||
const file = urlPath === '/' ? 'index.html' : `${urlPath.slice(1)}.html`;
|
||||
const file = pageFile(urlPath);
|
||||
const html = pageHtml(file);
|
||||
assert.equal(count(html, /<!-- STATIC-SEO:/g), 1, `${file}: Startmarker`);
|
||||
assert.equal(count(html, /<!-- \/STATIC-SEO -->/g), 1, `${file}: Endmarker`);
|
||||
@@ -311,7 +318,12 @@ if (wants('links')) {
|
||||
);
|
||||
for (const href of hrefs) {
|
||||
const clean = decodeURIComponent(href.slice(2));
|
||||
const target = clean === '' ? 'index.html' : clean.endsWith('.html') ? clean : `${clean}.html`;
|
||||
// Verzeichnis-Links (z. B. ./en/ für die Sprachversion) auf index.html auflösen
|
||||
const target =
|
||||
clean === '' ? 'index.html'
|
||||
: clean.endsWith('/') ? `${clean}index.html`
|
||||
: clean.endsWith('.html') ? clean
|
||||
: `${clean}.html`;
|
||||
assert.ok(existsSync(path.join(PUBLIC, target)), `${file} → ${href}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Erzeugt die Bilddateien für das Startseiten-Intro (public/assets/intro/).
|
||||
|
||||
Aufruf (im Projektordner): python3 scripts/intro-bilder.py
|
||||
Braucht Pillow (pip install pillow).
|
||||
|
||||
Pro Foto entstehen vier Dateien:
|
||||
NN-quer.webp Laptop/Querformat (volle Breite)
|
||||
NN-hoch.webp Handy/Hochformat (4:5-Ausschnitt um den Fokuspunkt)
|
||||
NN-*-klein.webp 64 px breite, weichgezeichnete Vorschau (wird im Intro
|
||||
groß gezogen und wirkt dadurch unscharf)
|
||||
|
||||
Reihenfolge und Fokuspunkt (fx, Prozent von links) müssen zur Liste BILDER
|
||||
in public/custom/fokus.js passen.
|
||||
"""
|
||||
from pathlib import Path
|
||||
from PIL import Image, ImageFilter
|
||||
|
||||
PUBLIC = Path(__file__).resolve().parent.parent / "public"
|
||||
ZIEL = PUBLIC / "assets" / "intro"
|
||||
BILDER = [
|
||||
("assets/portfolio/fussball/hamburger-sv/galerie-freiburg/galerie-01.jpg", 50),
|
||||
("assets/portfolio/fussball/frauen-bundesliga/galerie-03.jpg", 55),
|
||||
("assets/portfolio/fussball/fc-st-pauli/galerie-bayern/galerie-07.jpg", 50),
|
||||
("assets/portfolio/fussball/hannover-96/galerie-braunschweig/galerie-03.jpg", 50),
|
||||
("assets/portfolio/fussball/deutschland-u21/galerie-01.jpg", 50),
|
||||
("assets/portfolio/fussball/nfv-pokalfinale-2026/galerie-01.jpg", 30),
|
||||
("assets/portfolio/sports/beach-soccer-cup-2026/galerie-01.jpg", 58),
|
||||
("assets/portfolio/sports/svg-lueneburg/galerie-br-volleys/galerie-06.jpg", 50),
|
||||
("assets/portfolio/sports/rhine-ruhr/beachvolleyball/galerie-02.jpg", 40),
|
||||
]
|
||||
|
||||
|
||||
def klein(bild, pfad):
|
||||
k = bild.resize((64, round(64 * bild.height / bild.width)), Image.LANCZOS)
|
||||
k.filter(ImageFilter.GaussianBlur(2.5)).save(pfad, "WEBP", quality=60)
|
||||
|
||||
|
||||
ZIEL.mkdir(parents=True, exist_ok=True)
|
||||
for nr, (quelle, fx) in enumerate(BILDER, 1):
|
||||
bild = Image.open(PUBLIC / quelle).convert("RGB")
|
||||
name = str(ZIEL / f"{nr:02d}")
|
||||
bild.save(name + "-quer.webp", "WEBP", quality=78, method=6)
|
||||
klein(bild, name + "-quer-klein.webp")
|
||||
breite = round(bild.height * 0.8)
|
||||
x = min(max(round(bild.width * fx / 100 - breite / 2), 0), bild.width - breite)
|
||||
hoch = bild.crop((x, 0, x + breite, bild.height))
|
||||
hoch.save(name + "-hoch.webp", "WEBP", quality=78, method=6)
|
||||
klein(hoch, name + "-hoch-klein.webp")
|
||||
print("ok", name)
|
||||
Reference in new issue
Block a user