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
16 changes: 16 additions & 0 deletions docs/githire.css
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,22 @@ main, .topnav, .site-foot { position: relative; z-index: 1; }
text-align: center;
padding: 0 var(--gutter);
}
/* Soft paper scrim between the moving canvas and the text. Sits inside the
hero's stacking context (so it's above the z-0 canvas) but behind the copy,
lifting legibility while the starfield still reads through at the edges. */
.hero-content::before{
content: "";
position: absolute;
inset: -10% -8%;
z-index: -1;
pointer-events: none;
background: radial-gradient(
ellipse 76% 66% at 50% 47%,
rgba(246, 241, 232, 0.85) 0%,
rgba(246, 241, 232, 0.66) 40%,
rgba(246, 241, 232, 0) 76%
);
}
.hero-title{
font-family: var(--font-serif);
font-weight: 500;
Expand Down
15 changes: 15 additions & 0 deletions docs/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -937,13 +937,28 @@
return 'en';
}

// Normalize markup for comparison only: collapse insignificant whitespace
// and drop the self-closing slash on void elements. The browser serializes
// `<br/>` as `<br>`, so without this the dictionary source (which writes
// `<br/>`) would never match the DOM and we'd re-render needlessly.
function normMarkup(s) {
return s.replace(/\s+/g, ' ').replace(/\s*\/>/g, '>').trim();
}

function applyTo(root, lang) {
var els = root.querySelectorAll('[data-i18n]');
for (var i = 0; i < els.length; i++) {
var el = els[i];
var key = el.getAttribute('data-i18n');
var entry = T[key];
if (!entry || typeof entry[lang] !== 'string') continue;
// Skip the swap when the element already renders this exact markup.
// The page ships in its own language, so on first load every value
// already matches — re-setting innerHTML would needlessly reflow the
// page and restart the hero's CSS entrance animation, making the
// slogan visibly "jump" a second time. Comparison only; a mismatch
// (a real language switch) still updates as before.
if (normMarkup(el.innerHTML) === normMarkup(entry[lang])) continue;
el.innerHTML = entry[lang];
}

Expand Down