v0.4.9a — box art opens full size, a third splash card, and a scoped footer claim
Splash page only: the box art thumbnail opens a full-size lightbox on click, a new "Play multiplayer" (coming soon) card balances the bottom row to three cards, and the footer's "runs entirely in your browser" claim is now scoped to solitaire.
This commit is contained in:
@@ -7,3 +7,22 @@ if (ties) {
|
||||
}
|
||||
ties.innerHTML = out;
|
||||
}
|
||||
|
||||
/** Clicking the box art opens it full size, since the thumbnail is too small to read. */
|
||||
const heroImage = document.getElementById('hero-image');
|
||||
const lightbox = document.getElementById('lightbox');
|
||||
if (heroImage && lightbox) {
|
||||
const open = () => { lightbox.hidden = false; };
|
||||
const close = () => { lightbox.hidden = true; };
|
||||
heroImage.addEventListener('click', open);
|
||||
heroImage.addEventListener('keydown', (e) => {
|
||||
if (e instanceof KeyboardEvent && (e.key === 'Enter' || e.key === ' ')) {
|
||||
e.preventDefault();
|
||||
open();
|
||||
}
|
||||
});
|
||||
lightbox.addEventListener('click', close);
|
||||
document.addEventListener('keydown', (e) => {
|
||||
if (e instanceof KeyboardEvent && e.key === 'Escape') close();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user