perf(wpo): self-host woff2 fonts, add 404.html, explicit img dims, twitter:card, and view transitions (#17)

* test(wpo): add Red contract tests for self-hosted woff2, 404.html, twitter:card, img dims, and view transitions

- Assert self-hosted .woff2 fonts in public/fonts/, @font-face in built CSS, and zero Google Fonts links
- Assert dist/404.html with shared partials, zero inline scripts, and return CTA to /
- Assert twitter:card on all 4 routes, numeric width/height on all <img> tags, @view-transition, and brand hover

* perf(wpo): self-host woff2 fonts, add 404.html, explicit img dims, twitter:card, and view transitions

- Self-host 5 latin .woff2 font files (176 KB total) in public/fonts/ with @font-face in src/style.css and remove Google Fonts links
- Add static 404.html with shared partials and register in vite.config.ts
- Add twitter:card metadata across all 4 routes and explicit width/height on logo.png and all 8 index.html images
- Add @view-transition (prefers-reduced-motion: no-preference), brand hover state, arrow motion on solid CTAs, and reconcile services-catalog.test.js
This commit is contained in:
Andrés Tróchez authored and GitHub committed 2026-11-30 14:04:04 -05:00
1 parent 20908fdf78
commit 758706e65e
15 files changed
+406 -53

No files matched your search

+45
View File
@@ -0,0 +1,45 @@
<!DOCTYPE html>
<html lang="es" class="scroll-smooth">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Página no encontrada — El Corazón como Portal</title>
<meta
name="description"
content="La página que buscas no está disponible. Regresa al inicio de El Corazón como Portal."
/>
<meta name="robots" content="noindex" />
<link rel="icon" type="image/png" href="/img/logo.png" />
<link rel="stylesheet" href="/src/style.css" />
</head>
<body class="bg-ivory text-forest selection:bg-emerald/20 selection:text-forest">
<!-- @include src/partials/header.html -->
<!-- @include src/partials/whatsapp-fab.html -->
<main id="main" class="py-20 md:py-32">
<section class="mx-auto max-w-2xl px-6 text-center">
<span class="inline-block text-xs font-bold uppercase tracking-widest text-gold mb-3">
Error 404
</span>
<h1 class="font-display text-4xl leading-tight sm:text-5xl text-forest font-semibold mb-6">
Página no encontrada
</h1>
<p class="text-base sm:text-lg text-forest/85 leading-relaxed mb-10">
El camino que buscas no está disponible o cambió de lugar. Respira profundo y vuelve al inicio para seguir explorando nuestros espacios de acompañamiento.
</p>
<a
href="/"
class="group inline-flex items-center justify-center gap-3 rounded-full bg-emerald px-8 py-4 text-base font-semibold text-ivory shadow-lg shadow-emerald/25 transition hover:bg-forest hover:shadow-xl focus:outline-none focus:ring-4 focus:ring-emerald/40"
>
<span>Volver al inicio</span>
<span class="inline-block transition-transform group-hover:translate-x-1" aria-hidden="true">→</span>
</a>
</section>
</main>
<!-- @include src/partials/footer.html -->
<script type="module" src="/src/scripts/nav-menu.js"></script>
</body>
</html>
+1 -6
View File
@@ -21,13 +21,8 @@
<meta property="og:image:width" content="150" />
<meta property="og:image:height" content="150" />
<meta property="og:image:alt" content="Emblema de El Corazón como Portal" />
<meta name="twitter:card" content="summary_large_image" />
<link rel="icon" type="image/png" href="/img/logo.png" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Raleway:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,600&display=swap"
rel="stylesheet"
/>
<link rel="stylesheet" href="/src/style.css" />
</head>
<body class="bg-ivory text-forest selection:bg-emerald/20 selection:text-forest">
+24 -12
View File
@@ -21,13 +21,8 @@
<meta property="og:image:width" content="529" />
<meta property="og:image:height" content="530" />
<meta property="og:image:alt" content="Azucena Sánchez, facilitadora de El Corazón como Portal" />
<meta name="twitter:card" content="summary_large_image" />
<link rel="icon" type="image/png" href="/img/logo.png" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Raleway:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,600&display=swap"
rel="stylesheet"
/>
<link rel="stylesheet" href="/src/style.css" />
</head>
<body class="bg-ivory text-forest selection:bg-emerald/20 selection:text-forest">
@@ -54,10 +49,10 @@
href="https://wa.me/573215428972?text=Hola%20Azu,%20visit%C3%A9%20tu%20p%C3%A1gina%20y%20me%20gustar%C3%ADa%20conversar%20sobre%20tus%20sesiones."
target="_blank"
rel="noopener noreferrer"
class="inline-flex w-full sm:w-auto items-center justify-center gap-3 rounded-full bg-emerald px-8 py-4 text-base font-semibold text-ivory shadow-lg shadow-emerald/25 transition hover:bg-forest hover:shadow-xl focus:outline-none focus:ring-4 focus:ring-emerald/40"
class="group inline-flex w-full sm:w-auto items-center justify-center gap-3 rounded-full bg-emerald px-8 py-4 text-base font-semibold text-ivory shadow-lg shadow-emerald/25 transition hover:bg-forest hover:shadow-xl focus:outline-none focus:ring-4 focus:ring-emerald/40"
>
<span>Conversar por WhatsApp</span>
<span>→</span>
<span class="inline-block transition-transform group-hover:translate-x-1" aria-hidden="true">→</span>
</a>
</div>
<div class="relative md:col-span-5">
@@ -65,6 +60,8 @@
<img
src="/img/azu-hero.jpg"
alt="Retrato de Azucena Sánchez al aire libre, facilitadora y mentora de El Corazón como Portal"
width="529"
height="530"
class="h-full w-full object-cover"
loading="eager"
/>
@@ -101,6 +98,8 @@
<img
src="/img/oidaterapia.webp"
alt="Sesión de Mentorías y Oidaterapia para discernimiento y claridad emocional"
width="800"
height="600"
class="h-full w-full object-cover transition duration-300 hover:scale-105"
loading="lazy"
/>
@@ -134,6 +133,8 @@
<img
src="/img/kundalini-yoga.webp"
alt="Clases de Kundalini Yoga y acompañamiento con respiración consciente"
width="800"
height="600"
class="h-full w-full object-cover transition duration-300 hover:scale-105"
loading="lazy"
/>
@@ -165,6 +166,8 @@
<img
src="/img/barras-access.webp"
alt="Sesión de Barras de Access en Valledupar para liberación de sobrecarga mental"
width="800"
height="600"
class="h-full w-full object-cover transition duration-300 hover:scale-105"
loading="lazy"
/>
@@ -201,6 +204,8 @@
<img
src="/img/procesos-cuerpo.webp"
alt="Sesión de Procesos de Cuerpo para alivio del dolor y ligereza somática"
width="800"
height="600"
class="h-full w-full object-cover transition duration-300 hover:scale-105"
loading="lazy"
/>
@@ -234,6 +239,8 @@
<img
src="/img/meditaciones.webp"
alt="Meditaciones personalizadas grabadas a tu medida"
width="800"
height="600"
class="h-full w-full object-cover transition duration-300 hover:scale-105"
loading="lazy"
/>
@@ -283,6 +290,8 @@
<img
src="/img/hatha-yoga.webp"
alt="Práctica grupal de Hatha Yoga al aire libre guiada por Seva Surpreet Kaur"
width="800"
height="500"
class="h-full w-full object-cover"
loading="lazy"
/>
@@ -308,9 +317,10 @@
href="https://wa.me/573215428972?text=Hola%20Azu,%20me%20gustar%C3%ADa%20conversar%20sobre%20las%20Clases%20de%20Hatha%20Yoga."
target="_blank"
rel="noopener noreferrer"
class="inline-flex items-center justify-center rounded-full bg-emerald px-6 py-3.5 text-sm font-semibold text-ivory shadow-md transition hover:bg-forest"
class="group inline-flex items-center justify-center gap-2 rounded-full bg-emerald px-6 py-3.5 text-sm font-semibold text-ivory shadow-md transition hover:bg-forest"
>
<span>Conversar sobre Clases por WhatsApp →</span>
<span>Conversar sobre Clases por WhatsApp</span>
<span class="inline-block transition-transform group-hover:translate-x-1" aria-hidden="true">→</span>
</a>
</div>
</div>
@@ -357,6 +367,8 @@
<img
src="/img/namaste-bio.webp"
alt="Azucena Sánchez (Seva Surpreet Kaur) junto a su mentora Nam Nidhan Kaur"
width="800"
height="800"
class="h-full w-full object-cover"
loading="lazy"
/>
@@ -418,10 +430,10 @@
href="https://wa.me/573215428972?text=Hola%20Azu,%20quisiera%20ponerme%20en%20contacto%20contigo."
target="_blank"
rel="noopener noreferrer"
class="inline-flex items-center justify-center gap-3 rounded-full bg-emerald px-8 py-4 text-sm font-semibold text-ivory shadow-lg shadow-emerald/25 transition hover:bg-forest hover:shadow-xl"
class="group inline-flex items-center justify-center gap-3 rounded-full bg-emerald px-8 py-4 text-sm font-semibold text-ivory shadow-lg shadow-emerald/25 transition hover:bg-forest hover:shadow-xl"
>
<span>Conversar por WhatsApp</span>
<span>→</span>
<span class="inline-block transition-transform group-hover:translate-x-1" aria-hidden="true">→</span>
</a>
</div>
<div class="space-y-6">
+4 -8
View File
@@ -21,13 +21,8 @@
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta property="og:image:alt" content="Práctica de Kundalini Yoga con Seva Surpreet Kaur" />
<meta name="twitter:card" content="summary_large_image" />
<link rel="icon" type="image/png" href="/img/logo.png" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Raleway:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,600&display=swap"
rel="stylesheet"
/>
<link rel="stylesheet" href="/src/style.css" />
</head>
<body class="bg-ivory text-forest selection:bg-emerald/20 selection:text-forest">
@@ -81,9 +76,10 @@
</div>
<a
href="/volver-a-ti/"
class="block w-full rounded-full bg-emerald px-6 py-3.5 text-center text-sm font-semibold text-ivory shadow-sm transition hover:bg-forest"
class="group inline-flex w-full items-center justify-center gap-2 rounded-full bg-emerald px-6 py-3.5 text-center text-sm font-semibold text-ivory shadow-sm transition hover:bg-forest"
>
Conocer el programa Volver a ti →
<span>Conocer el programa Volver a ti</span>
<span class="inline-block transition-transform group-hover:translate-x-1" aria-hidden="true">→</span>
</a>
</article>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+2 -2
View File
@@ -9,8 +9,8 @@
<!-- Why: lg (1024px) desktop nav breakpoint + shrink-0 on the brand + gap-4 prevents brand/nav overlap at 768px–1018px. -->
<div class="relative mx-auto flex max-w-6xl items-center justify-between gap-4 px-6 py-4">
<!-- Why: the full brand title stays in the header row at 375px; only the nav collapses. -->
<a href="/" data-nav-current="home" class="flex shrink-0 items-center gap-3">
<img src="/img/logo.png" alt="Logo El Corazón como Portal" class="h-10 w-10 object-contain" />
<a href="/" data-nav-current="home" class="flex shrink-0 items-center gap-3 transition hover:text-emerald">
<img src="/img/logo.png" alt="Logo El Corazón como Portal" width="150" height="150" class="h-10 w-10 object-contain" />
<span class="font-display text-sm font-bold tracking-wide uppercase whitespace-nowrap text-forest sm:text-xl sm:tracking-wider">El Corazón como Portal</span>
</a>
<nav aria-label="Navegación principal">
+56
View File
@@ -1,5 +1,55 @@
@import "tailwindcss";
@font-face {
font-family: "Playfair Display";
font-style: normal;
font-weight: 400 700;
font-display: swap;
src: url("/fonts/playfair-display-latin-normal.woff2") format("woff2");
unicode-range:
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
font-family: "Playfair Display";
font-style: italic;
font-weight: 400;
font-display: swap;
src: url("/fonts/playfair-display-latin-italic.woff2") format("woff2");
unicode-range:
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
font-family: "Cormorant Garamond";
font-style: normal;
font-weight: 400 700;
font-display: swap;
src: url("/fonts/cormorant-garamond-latin-normal.woff2") format("woff2");
unicode-range:
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
font-family: "Cormorant Garamond";
font-style: italic;
font-weight: 400;
font-display: swap;
src: url("/fonts/cormorant-garamond-latin-italic.woff2") format("woff2");
unicode-range:
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
font-family: "Raleway";
font-style: normal;
font-weight: 400 700;
font-display: swap;
src: url("/fonts/raleway-latin-normal.woff2") format("woff2");
unicode-range:
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@theme {
--color-ivory: #f2ebdd;
--color-forest: #102f27;
@@ -37,6 +87,12 @@ a[aria-current="page"] {
outline-offset: 3px;
}
@media (prefers-reduced-motion: no-preference) {
@view-transition {
navigation: auto;
}
}
@media (prefers-reduced-motion: reduce) {
html {
scroll-behavior: auto;
+25 -13
View File
@@ -47,24 +47,36 @@ function extractCardByHeading(html, headingText) {
test('Slice 3 Acceptance Criteria: 5-Card Catalog, Brand Tokens & Complementary Paths', async (t) => {
await t.test(
'Criterion 1: Brand System Integrity (Google Fonts loaded, Tailwind @theme color tokens)',
'Criterion 1: Brand System Integrity (Self-hosted @font-face rules, Tailwind @theme color tokens)',
() => {
// 1. Google Fonts loaded in index.html
assert.match(
// 1. Self-hosted @font-face rules in built CSS and zero Google Fonts links in index.html
// Why: Issue #12 replaces external Google Fonts <link> requests with self-hosted .woff2
// @font-face rules for WPO (eliminates render-blocking third-party DNS/TLS/CSS round-trips).
assert.doesNotMatch(
indexHtml,
/fonts\.googleapis\.com\/css2\?[^"]*family=Playfair\+Display/i,
'index.html must load Playfair Display from Google Fonts',
/fonts\.googleapis\.com/i,
'dist/index.html must contain zero fonts.googleapis.com links',
);
assert.match(
indexHtml,
/fonts\.googleapis\.com\/css2\?[^"]*family=Cormorant\+Garamond/i,
'index.html must load Cormorant Garamond from Google Fonts',
const assetsDir = path.resolve('dist/assets');
const cssFiles = fs.readdirSync(assetsDir).filter((file) => file.endsWith('.css'));
assert.ok(cssFiles.length > 0, 'dist/assets must contain at least one built CSS file');
const builtCss = cssFiles
.map((file) => fs.readFileSync(path.join(assetsDir, file), 'utf-8'))
.join('\n');
const fontFaceRules = builtCss.match(/@font-face\s*\{[^}]*\}/gi) ?? [];
for (const family of ['Playfair Display', 'Cormorant Garamond', 'Raleway']) {
const hasSelfHostedWoff2 = fontFaceRules.some(
(rule) =>
new RegExp(`font-family:\\s*["']?${family}["']?`, 'i').test(rule) &&
/url\(["']?[^"')]+?\.woff2["']?\)/i.test(rule),
);
assert.match(
indexHtml,
/fonts\.googleapis\.com\/css2\?[^"]*family=Raleway/i,
'index.html must load Raleway from Google Fonts',
assert.ok(
hasSelfHostedWoff2,
`built CSS must declare a self-hosted @font-face rule for ${family} pointing to a .woff2 file`,
);
}
// 2. Custom color tokens in src/style.css @theme
assert.match(
+239
View File
@@ -0,0 +1,239 @@
import assert from 'node:assert/strict';
import fs from 'node:fs';
import path from 'node:path';
import test from 'node:test';
const ROUTES = [
'dist/index.html',
'dist/kundalini/index.html',
'dist/volver-a-ti/index.html',
'dist/descargo/index.html',
];
const ALL_BUILT_HTML = [...ROUTES, 'dist/404.html'];
function readHtml(filePath) {
return fs.readFileSync(path.resolve(filePath), 'utf-8');
}
function readBuiltCss() {
const assetsDir = path.resolve('dist/assets');
const cssFiles = fs.readdirSync(assetsDir).filter((file) => file.endsWith('.css'));
assert.ok(cssFiles.length > 0, 'dist/assets must contain at least one built CSS file');
return cssFiles.map((file) => fs.readFileSync(path.join(assetsDir, file), 'utf-8')).join('\n');
}
function extractBalancedBlock(css, startIndex) {
const openBrace = css.indexOf('{', startIndex);
if (openBrace === -1) {
return undefined;
}
let depth = 0;
for (let i = openBrace; i < css.length; i++) {
if (css[i] === '{') {
depth += 1;
} else if (css[i] === '}') {
depth -= 1;
if (depth === 0) {
return css.slice(openBrace + 1, i);
}
}
}
return undefined;
}
test('Issue #12 Acceptance Criteria: Self-hosted fonts, 404.html, meta/img dimensions, view transitions', async (t) => {
await t.test(
'Criterion 1a: public/fonts/ contains .woff2 files for Playfair Display, Cormorant Garamond, and Raleway',
() => {
const fontsDir = path.resolve('public/fonts');
assert.ok(fs.existsSync(fontsDir), 'public/fonts/ directory must exist');
const woff2Files = fs
.readdirSync(fontsDir)
.filter((file) => file.toLowerCase().endsWith('.woff2'));
assert.ok(woff2Files.length > 0, 'public/fonts/ must contain .woff2 files');
const joined = woff2Files.join('\n').toLowerCase();
assert.match(
joined,
/playfair-display/,
'public/fonts/ must include Playfair Display .woff2',
);
assert.match(
joined,
/cormorant-garamond/,
'public/fonts/ must include Cormorant Garamond .woff2',
);
assert.match(joined, /raleway/, 'public/fonts/ must include Raleway .woff2');
},
);
await t.test(
'Criterion 1b: built CSS declares @font-face rules pointing to /fonts/*.woff2',
() => {
const css = readBuiltCss();
const fontFaceMatches = css.match(/@font-face\s*\{[^}]*\}/gi) ?? [];
assert.ok(fontFaceMatches.length > 0, 'built CSS must declare @font-face rules');
const hasLocalWoff2 = fontFaceMatches.some((rule) =>
/url\(["']?\/fonts\/[^"')]+?\.woff2["']?\)/i.test(rule),
);
assert.ok(hasLocalWoff2, 'built CSS @font-face rules must point to /fonts/*.woff2');
},
);
await t.test(
'Criterion 1c: zero built HTML files contain fonts.googleapis.com or fonts.gstatic.com <link> tags',
() => {
for (const route of ALL_BUILT_HTML) {
const resolved = path.resolve(route);
if (!fs.existsSync(resolved)) {
continue;
}
const html = fs.readFileSync(resolved, 'utf-8');
const linkTags = html.match(/<link\b[^>]*>/gi) ?? [];
for (const tag of linkTags) {
assert.doesNotMatch(
tag,
/fonts\.googleapis\.com|fonts\.gstatic\.com/i,
`${route}: must not contain external Google Fonts <link> tag: ${tag}`,
);
}
}
},
);
await t.test(
'Criterion 2a: dist/404.html exists and includes shared <header> and <footer> partials',
() => {
const notFoundPath = path.resolve('dist/404.html');
assert.ok(fs.existsSync(notFoundPath), 'dist/404.html must exist');
const html = fs.readFileSync(notFoundPath, 'utf-8');
assert.match(html, /<header\b[^>]*>/i, 'dist/404.html must include shared <header>');
assert.match(html, /<footer\b[^>]*>/i, 'dist/404.html must include shared <footer>');
},
);
await t.test(
'Criterion 2b: dist/404.html has zero inline <script> blocks or on*= handlers and links back to /',
() => {
const html = readHtml('dist/404.html');
const scriptTags = html.match(/<script\b[^>]*>/gi) ?? [];
for (const tag of scriptTags) {
assert.match(
tag,
/\bsrc\s*=/i,
`dist/404.html must not contain inline <script> blocks: ${tag}`,
);
}
assert.doesNotMatch(
html,
/<[a-z][^>]*\son[a-z]+\s*=/i,
'dist/404.html must not contain inline on*= event handlers',
);
assert.match(
html,
/<a\b[^>]*\bhref="\/"[^>]*>/i,
'dist/404.html must include a link back to /',
);
},
);
await t.test(
'Criterion 3a: all 4 routes include <meta name="twitter:card" content="summary_large_image">',
() => {
for (const route of ROUTES) {
const html = readHtml(route);
const metaTags = html.match(/<meta\b[^>]*>/gi) ?? [];
const hasTwitterCard = metaTags.some(
(tag) =>
/\bname="twitter:card"/i.test(tag) && /\bcontent="summary_large_image"/i.test(tag),
);
assert.ok(
hasTwitterCard,
`${route}: must include <meta name="twitter:card" content="summary_large_image">`,
);
}
},
);
await t.test(
'Criterion 3b: every <img> tag across all built HTML pages has explicit numeric width and height attributes',
() => {
for (const route of ALL_BUILT_HTML) {
const resolved = path.resolve(route);
if (!fs.existsSync(resolved)) {
continue;
}
const html = fs.readFileSync(resolved, 'utf-8');
const imgTags = html.match(/<img\b[^>]*>/gi) ?? [];
assert.ok(imgTags.length > 0 || route === 'dist/404.html', `${route}: expected <img> tags`);
for (const img of imgTags) {
assert.match(
img,
/\bwidth="\d+"/i,
`${route}: <img> must have explicit numeric width attribute: ${img}`,
);
assert.match(
img,
/\bheight="\d+"/i,
`${route}: <img> must have explicit numeric height attribute: ${img}`,
);
}
}
},
);
await t.test(
'Criterion 4a: built CSS includes @view-transition (navigation: auto) inside @media (prefers-reduced-motion: no-preference)',
() => {
const css = readBuiltCss();
const mediaRegex = /@media\s*\(\s*prefers-reduced-motion\s*:\s*no-preference\s*\)/gi;
let found = false;
for (const match of css.matchAll(mediaRegex)) {
const block = extractBalancedBlock(css, match.index);
if (block && /@view-transition\s*\{[^}]*\bnavigation\s*:\s*auto\b/i.test(block)) {
found = true;
break;
}
}
assert.ok(
found,
'built CSS must include @view-transition { navigation: auto } inside @media (prefers-reduced-motion: no-preference)',
);
},
);
await t.test(
'Criterion 4b: header brand link a[href="/"] includes a hover: transition class',
() => {
for (const route of ROUTES) {
const html = readHtml(route);
const headerMatch = html.match(/<header\b[^>]*>([\s\S]*?)<\/header>/i);
assert.ok(headerMatch, `${route}: must contain <header>`);
const brandLink = headerMatch[1].match(/<a\b[^>]*\bhref="\/"[^>]*>/i)?.[0];
assert.ok(brandLink, `${route}: <header> must contain <a href="/">`);
const classAttr = brandLink.match(/\bclass="([^"]*)"/i)?.[1] ?? '';
assert.match(
classAttr,
/(?:^|\s)hover:/,
`${route}: header a[href="/"] must include a hover: class`,
);
assert.match(
classAttr,
/\btransition\b/,
`${route}: header a[href="/"] must include a transition class`,
);
}
},
);
});
+1
View File
@@ -19,6 +19,7 @@ export default defineConfig({
kundalini: path.resolve(import.meta.dirname, 'kundalini/index.html'),
volverATi: path.resolve(import.meta.dirname, 'volver-a-ti/index.html'),
descargo: path.resolve(import.meta.dirname, 'descargo/index.html'),
notFound: path.resolve(import.meta.dirname, '404.html'),
},
},
},
+9 -12
View File
@@ -21,13 +21,8 @@
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta property="og:image:alt" content="Volver a ti — Acompañamiento personalizado de Kundalini Yoga" />
<meta name="twitter:card" content="summary_large_image" />
<link rel="icon" type="image/png" href="/img/logo.png" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Raleway:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,600&display=swap"
rel="stylesheet"
/>
<link rel="stylesheet" href="/src/style.css" />
</head>
<body class="bg-ivory text-forest selection:bg-emerald/20 selection:text-forest">
@@ -69,10 +64,10 @@
<div class="flex flex-col sm:flex-row gap-4">
<a
href="#inscripcion"
class="inline-flex items-center justify-center gap-2 rounded-full bg-emerald px-8 py-4 text-base font-semibold text-ivory shadow-lg shadow-emerald/25 transition hover:bg-forest"
class="group inline-flex items-center justify-center gap-2 rounded-full bg-emerald px-8 py-4 text-base font-semibold text-ivory shadow-lg shadow-emerald/25 transition hover:bg-forest"
>
<span>Iniciar mi proceso</span>
<span>→</span>
<span class="inline-block transition-transform group-hover:translate-x-1" aria-hidden="true">→</span>
</a>
<a
href="#paquetes"
@@ -523,9 +518,10 @@
<div class="mt-6">
<a
href="#inscripcion"
class="block w-full scroll-mt-24 rounded-full bg-emerald px-6 py-3 text-center text-sm font-semibold text-ivory transition hover:bg-forest"
class="group inline-flex w-full scroll-mt-24 items-center justify-center gap-2 rounded-full bg-emerald px-6 py-3 text-center text-sm font-semibold text-ivory transition hover:bg-forest"
>
Ir a inscripción →
<span>Ir a inscripción</span>
<span class="inline-block transition-transform group-hover:translate-x-1" aria-hidden="true">→</span>
</a>
</div>
</article>
@@ -640,9 +636,10 @@
data-disclaimer-gate=""
target="_blank"
rel="noopener noreferrer"
class="flex-1 inline-flex items-center justify-center rounded-full bg-emerald px-6 py-4 text-center text-sm font-semibold text-ivory shadow-md transition hover:bg-forest"
class="group flex-1 inline-flex items-center justify-center gap-2 rounded-full bg-emerald px-6 py-4 text-center text-sm font-semibold text-ivory shadow-md transition hover:bg-forest"
>
Coordinar pago por Zelle (WhatsApp) →
<span>Coordinar pago por Zelle (WhatsApp)</span>
<span class="inline-block transition-transform group-hover:translate-x-1" aria-hidden="true">→</span>
</a>
<a
href="https://wa.me/573215428972?text=Hola%20Azu,%20quiero%20hacer%20una%20consulta%20sobre%20el%20acompa%C3%B1amiento%20Volver%20a%20ti."