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
6 changes: 1 addition & 5 deletions frontend/src/scripts/emailApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
* Sends registration confirmation emails through the Node.js Nodemailer backend.
*/

const BACKEND_URL = (
import.meta.env?.VITE_BACKEND_URL ||
import.meta.env?.VITE_EMAIL_API_URL ||
''
)
const BACKEND_URL = (import.meta.env?.VITE_BACKEND_URL || import.meta.env?.VITE_EMAIL_API_URL || '')
.trim()
.replace(/\/+$/, '');

Expand Down
18 changes: 17 additions & 1 deletion frontend/src/scripts/event-cards.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import { prefersReducedMotion } from './device.js';
* "Our other haunts": each card starts closed (picture + title). Tapping it
* rattles the frame like something unseen knocked it, then opens the details.
* Tapping again closes it. Reduced-motion users get the open/close without the rattle.
*
* The full card surface is the click target (via a ::after overlay on .event-card).
* Clicks anywhere on the card — including the image well, tag, and hint — are
* forwarded to the toggle button so that aria-expanded stays in sync.
*/
export function initEventCards(root = document) {
const cards = root.querySelectorAll('[data-event-card]');
Expand All @@ -16,7 +20,7 @@ export function initEventCards(root = document) {
if (e.animationName === 'frame-rattle') card.classList.remove('is-rattling');
});

toggle.addEventListener('click', () => {
function activateToggle() {
const open = toggle.getAttribute('aria-expanded') !== 'true';
toggle.setAttribute('aria-expanded', String(open));
card.classList.toggle('is-open', open);
Expand All @@ -26,6 +30,18 @@ export function initEventCards(root = document) {
void card.offsetWidth; // restart the animation if tapped again quickly
card.classList.add('is-rattling');
}
}

// The toggle button handles its own clicks (keyboard, direct click).
toggle.addEventListener('click', activateToggle);

// The card ::after overlay catches clicks that land outside the toggle button
// (on the image well, tag badge, hint text, etc.). We check that the click
// did NOT originate from inside the toggle itself to avoid double-firing.
card.addEventListener('click', (e) => {
if (!toggle.contains(e.target) && e.target !== toggle) {
activateToggle();
}
});
});
}
70 changes: 57 additions & 13 deletions frontend/src/styles/sections/curriculum.css
Original file line number Diff line number Diff line change
Expand Up @@ -284,38 +284,82 @@
}

@media (max-width: 700px) {
/* On phones the signs sit in a row under the picture instead of over the houses. */
/*
* Layout on phones:
*
* ┌──────────────────────────────┐ order 0 — village frame (image)
* │ [Sign 1] [Sign 2] │ order 1 & 2 — both signs in one row
* ├──────────────────────────────┤
* │ details panel (whichever │ order 3 — whichever scroll is visible
* │ session is open) │
* └──────────────────────────────┘
*
* Both signs always stay together. The details area sits entirely below
* them, so opening session 1 never pushes session 2's sign downward.
*/
.village__stage {
display: flex;
flex-wrap: wrap;
justify-content: space-between; /* each sign sits under its own house */
justify-content: space-between;
gap: 14px;
padding-inline: 2%;
}
.village__frame {
flex: 0 0 100%;
order: 0;
margin-inline: -2%;
}
/* Both signs share order 1 — they sit side by side in the same flex row */
.sign {
position: relative;
inset: auto;
translate: none;
padding: 7px 12px 8px;
padding: 7px 10px 8px;
flex: 1 1 0;
min-width: 0;
max-width: calc(50% - 7px);
order: 1;
}
.sign--one,
.sign--two {
order: 1;
}
.sign__kicker {
font-size: 0.75rem;
}
.sign__title {
font-size: 0.9375rem;
font-size: 0.875rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 100%;
}
.scroll {
position: absolute;
inset: 6px;
width: auto;
max-width: none;
padding: 16px 18px;
/* Both scroll panels sit after the sign row (order 3).
Only one is visible at a time (the other has [hidden]), so the
details area never shifts the signs. */
.scroll,
.scroll--one,
.scroll--two {
position: relative;
inset: auto;
top: auto;
left: auto;
right: auto;
bottom: auto;
flex: 0 0 100%;
width: 100%;
max-width: 100%;
box-sizing: border-box;
order: 3;
margin-top: 6px;
padding: 18px 20px;
border-radius: 18px;
overflow-y: auto;
z-index: 35;
overflow-y: visible;
z-index: 5;
}
.scroll::before {
.scroll::before,
.scroll--one::before,
.scroll--two::before {
display: none;
}
}
17 changes: 15 additions & 2 deletions frontend/src/styles/sections/events.css
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@
outline: 3px solid var(--c-candle);
outline-offset: 4px;
}
/* Keep the ::after overlay below any interactive children that might be added inside the body */
.event-card__body {
position: relative;
z-index: 2;
}

.event-card__toggle {
padding: 0;
Expand All @@ -117,16 +122,24 @@
font: inherit;
text-align: left;
cursor: pointer;
/* Reset: the card itself is now the full click target */
}
.event-card__toggle:focus-visible {
outline: none;
}
/* the whole card is the click target */
.event-card__toggle::after {

/* ------------------------------------------------------------------
* The whole card face is the click target.
* We put the overlay on .event-card (position: relative) so it sits
* above all flex-children without fighting their stacking order.
* ------------------------------------------------------------------ */
.event-card::after {
content: '';
position: absolute;
inset: 0;
border-radius: inherit;
cursor: pointer;
z-index: 1;
}

.event-card__hint {
Expand Down
Loading