Clean up dead code, unify helpers, move common elements to app.js, add RSVP confirmation

This commit is contained in:
Ian Gulliver
2025-12-30 12:10:37 -08:00
parent c620ce3b57
commit 4353da026a
4 changed files with 45 additions and 34 deletions

View File

@@ -1,15 +1,9 @@
<!DOCTYPE html>
<html lang="en">
<head>
<script>document.documentElement.className = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'wa-dark' : 'wa-light';</script>
<meta charset="UTF-8">
<link rel="icon" type="image/svg+xml" href="/favicon.svg">
<link rel="icon" type="image/png" href="/favicon.png">
<link rel="apple-touch-icon" href="/favicon.png">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Applause for a Cause - HCA Tickets</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3/dist-cdn/styles/themes/default.css">
<script type="module" src="https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3/dist-cdn/webawesome.loader.js"></script>
<style>
body {
font-family: var(--wa-font-sans);
@@ -105,9 +99,6 @@
background-color: #FEDE02;
color: #000;
}
.donation-group wa-input::part(prefix) {
padding-right: 0;
}
.donation-section {
margin-top: 1rem;
padding-top: 1rem;
@@ -142,6 +133,9 @@
<div id="thank-you" class="thank-you" style="display: none;">
Thank you for your donation!
</div>
<div id="rsvp-confirmed" class="thank-you" style="display: none;">
Your RSVP has been updated!
</div>
<wa-card>
<div class="event-header">
<img src="/afac26-logo.png" alt="Applause for a Cause">
@@ -183,10 +177,6 @@
<script type="module">
import { auth, logout, api } from '/app.js';
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', e => {
document.documentElement.className = e.matches ? 'wa-dark' : 'wa-light';
});
await auth();
document.getElementById('main').style.display = 'block';
document.getElementById('logout-btn').addEventListener('click', logout);
@@ -283,6 +273,7 @@
location.href = data.url;
} else {
updateUI(data);
document.getElementById('rsvp-confirmed').style.display = 'block';
}
});