614 lines
22 KiB
HTML
614 lines
22 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Complete Payment — WORLDPLAY</title>
|
|
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🌍</text></svg>">
|
|
<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=Space+Grotesk:wght@300;400;500;600;700&family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap" rel="stylesheet">
|
|
<style>
|
|
:root {
|
|
--bg-dark: #0a0a0f;
|
|
--bg-card: #12121a;
|
|
--bg-input: #1a1a2e;
|
|
--text-primary: #f0f0f5;
|
|
--text-secondary: #a0a0b0;
|
|
--accent-purple: #9d4edd;
|
|
--accent-cyan: #00d9ff;
|
|
--accent-green: #00ff88;
|
|
--accent-orange: #ff9500;
|
|
--accent-pink: #ff006e;
|
|
--gradient-1: linear-gradient(135deg, #9d4edd 0%, #ff006e 100%);
|
|
}
|
|
|
|
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
|
|
body {
|
|
font-family: 'Space Grotesk', sans-serif;
|
|
background-color: var(--bg-dark);
|
|
color: var(--text-primary);
|
|
line-height: 1.7;
|
|
min-height: 100vh;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 2rem;
|
|
}
|
|
|
|
.container {
|
|
max-width: 620px;
|
|
width: 100%;
|
|
}
|
|
|
|
.logo {
|
|
text-align: center;
|
|
margin-bottom: 2rem;
|
|
}
|
|
|
|
.logo h1 {
|
|
font-family: 'Space Mono', monospace;
|
|
font-size: 2rem;
|
|
background: var(--gradient-1);
|
|
-webkit-background-clip: text;
|
|
-webkit-text-fill-color: transparent;
|
|
background-clip: text;
|
|
}
|
|
|
|
.logo p {
|
|
color: var(--text-secondary);
|
|
font-style: italic;
|
|
margin-top: 4px;
|
|
}
|
|
|
|
.card {
|
|
background: var(--bg-card);
|
|
border: 1px solid rgba(157, 78, 221, 0.3);
|
|
border-radius: 16px;
|
|
padding: 2.5rem;
|
|
position: relative;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.card::before {
|
|
content: '';
|
|
position: absolute;
|
|
top: 0; left: 0; right: 0;
|
|
height: 3px;
|
|
background: var(--gradient-1);
|
|
}
|
|
|
|
.card h2 {
|
|
font-size: 1.4rem;
|
|
margin-bottom: 0.5rem;
|
|
}
|
|
|
|
.card > p {
|
|
color: var(--text-secondary);
|
|
margin-bottom: 1.5rem;
|
|
font-size: 0.95rem;
|
|
}
|
|
|
|
label {
|
|
display: block;
|
|
font-size: 0.9rem;
|
|
color: var(--text-secondary);
|
|
margin-bottom: 0.5rem;
|
|
}
|
|
|
|
input[type="email"] {
|
|
width: 100%;
|
|
padding: 0.85rem 1rem;
|
|
background: var(--bg-input);
|
|
border: 2px solid rgba(157, 78, 221, 0.2);
|
|
border-radius: 10px;
|
|
color: var(--text-primary);
|
|
font-family: 'Space Grotesk', sans-serif;
|
|
font-size: 1rem;
|
|
outline: none;
|
|
transition: border-color 0.3s;
|
|
}
|
|
|
|
input[type="email"]:focus {
|
|
border-color: var(--accent-purple);
|
|
}
|
|
|
|
.btn {
|
|
display: inline-block;
|
|
padding: 0.9rem 2rem;
|
|
border: none;
|
|
border-radius: 50px;
|
|
font-family: 'Space Grotesk', sans-serif;
|
|
font-size: 1rem;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
transition: all 0.3s;
|
|
text-decoration: none;
|
|
text-align: center;
|
|
}
|
|
|
|
.btn-primary {
|
|
background: var(--gradient-1);
|
|
color: white;
|
|
width: 100%;
|
|
margin-top: 1rem;
|
|
}
|
|
|
|
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
|
|
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
|
|
|
|
.form-message {
|
|
margin-top: 1rem;
|
|
padding: 0.75rem 1rem;
|
|
border-radius: 8px;
|
|
font-size: 0.9rem;
|
|
display: none;
|
|
}
|
|
|
|
.form-message.error {
|
|
display: block;
|
|
background: rgba(255, 0, 110, 0.1);
|
|
border: 1px solid rgba(255, 0, 110, 0.3);
|
|
color: var(--accent-pink);
|
|
}
|
|
|
|
.form-message.success {
|
|
display: block;
|
|
background: rgba(0, 255, 136, 0.08);
|
|
border: 1px solid rgba(0, 255, 136, 0.3);
|
|
color: var(--accent-green);
|
|
}
|
|
|
|
.form-message a {
|
|
color: var(--accent-cyan);
|
|
}
|
|
|
|
/* Accommodation UI (mirrors index.html) */
|
|
.accom-toggle {
|
|
display: flex;
|
|
gap: 1rem;
|
|
margin-bottom: 1.5rem;
|
|
}
|
|
|
|
.accom-toggle-btn {
|
|
flex: 1;
|
|
padding: 1rem;
|
|
background: var(--bg-input);
|
|
border: 2px solid rgba(157, 78, 221, 0.2);
|
|
border-radius: 10px;
|
|
color: var(--text-secondary);
|
|
font-family: 'Space Grotesk', sans-serif;
|
|
font-size: 0.95rem;
|
|
cursor: pointer;
|
|
transition: all 0.3s;
|
|
text-align: center;
|
|
}
|
|
|
|
.accom-toggle-btn:hover { border-color: var(--accent-purple); }
|
|
|
|
.accom-toggle-btn.selected {
|
|
border-color: var(--accent-cyan);
|
|
background: rgba(0, 217, 255, 0.08);
|
|
color: var(--text-primary);
|
|
}
|
|
|
|
.accom-cards {
|
|
display: none;
|
|
flex-direction: column;
|
|
gap: 0.75rem;
|
|
margin-bottom: 1.5rem;
|
|
}
|
|
|
|
.accom-cards.visible { display: flex; }
|
|
|
|
.accom-venue-label {
|
|
font-size: 0.8rem;
|
|
color: var(--accent-purple);
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.1em;
|
|
margin-top: 0.75rem;
|
|
margin-bottom: 0.25rem;
|
|
}
|
|
|
|
.accom-card {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
padding: 1rem 1.25rem;
|
|
background: var(--bg-input);
|
|
border: 2px solid rgba(157, 78, 221, 0.15);
|
|
border-radius: 10px;
|
|
cursor: pointer;
|
|
transition: all 0.3s;
|
|
}
|
|
|
|
.accom-card:hover {
|
|
border-color: var(--accent-purple);
|
|
background: rgba(157, 78, 221, 0.08);
|
|
}
|
|
|
|
.accom-card.selected {
|
|
border-color: var(--accent-cyan);
|
|
background: rgba(0, 217, 255, 0.08);
|
|
}
|
|
|
|
.accom-card .accom-name {
|
|
font-size: 0.95rem;
|
|
color: var(--text-primary);
|
|
}
|
|
|
|
.accom-card .accom-price {
|
|
font-family: 'Space Mono', monospace;
|
|
font-size: 0.9rem;
|
|
color: var(--accent-cyan);
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.accom-card .accom-note {
|
|
font-size: 0.75rem;
|
|
color: var(--text-secondary);
|
|
margin-top: 2px;
|
|
}
|
|
|
|
.price-summary {
|
|
background: rgba(157, 78, 221, 0.08);
|
|
border: 1px solid rgba(157, 78, 221, 0.3);
|
|
border-radius: 12px;
|
|
padding: 1.5rem;
|
|
margin-bottom: 1.5rem;
|
|
}
|
|
|
|
.price-summary h4 {
|
|
font-size: 0.85rem;
|
|
color: var(--accent-purple);
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.1em;
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.price-line {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
padding: 0.4rem 0;
|
|
font-size: 0.9rem;
|
|
color: var(--text-secondary);
|
|
}
|
|
|
|
.price-line.total {
|
|
border-top: 1px solid rgba(157, 78, 221, 0.3);
|
|
margin-top: 0.5rem;
|
|
padding-top: 0.75rem;
|
|
font-weight: 700;
|
|
font-size: 1.1rem;
|
|
color: var(--text-primary);
|
|
}
|
|
|
|
.price-line.total .price-amount { color: var(--accent-green); }
|
|
|
|
.price-amount { font-family: 'Space Mono', monospace; }
|
|
|
|
.info-box {
|
|
background: rgba(255, 149, 0, 0.08);
|
|
border: 1px solid rgba(255, 149, 0, 0.3);
|
|
border-radius: 10px;
|
|
padding: 1rem 1.25rem;
|
|
margin-bottom: 1.5rem;
|
|
font-size: 0.85rem;
|
|
color: var(--text-secondary);
|
|
line-height: 1.6;
|
|
}
|
|
|
|
.info-box strong { color: var(--accent-orange); }
|
|
|
|
.back-link {
|
|
display: block;
|
|
text-align: center;
|
|
margin-top: 2rem;
|
|
color: var(--accent-cyan);
|
|
text-decoration: none;
|
|
font-size: 0.9rem;
|
|
}
|
|
|
|
.back-link:hover { text-decoration: underline; }
|
|
|
|
.welcome-name {
|
|
color: var(--accent-cyan);
|
|
}
|
|
|
|
#state-payment { display: none; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<div class="logo">
|
|
<h1>WORLDPLAY</h1>
|
|
<p>To be Defined</p>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<!-- State 1: Email lookup -->
|
|
<div id="state-lookup">
|
|
<h2>Complete Your Payment</h2>
|
|
<p>Already registered? Enter your email to pick up where you left off.</p>
|
|
|
|
<label for="email">Email address</label>
|
|
<input type="email" id="email" placeholder="you@example.com" autocomplete="email">
|
|
|
|
<button class="btn btn-primary" id="btn-lookup">Look up my registration</button>
|
|
<div class="form-message" id="lookup-msg"></div>
|
|
</div>
|
|
|
|
<!-- State 2: Accommodation & Payment -->
|
|
<div id="state-payment">
|
|
<h2>Welcome back, <span class="welcome-name" id="welcome-name"></span>!</h2>
|
|
<p>Choose your accommodation and complete payment.</p>
|
|
|
|
<div class="form-group">
|
|
<label>Do you need on-site accommodation? (7 nights, June 7-13)</label>
|
|
<div class="accom-toggle">
|
|
<button type="button" class="accom-toggle-btn selected" data-accom="no">No, I'll arrange my own</button>
|
|
<button type="button" class="accom-toggle-btn" data-accom="yes">Yes, book a room</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="accom-cards" id="accom-cards">
|
|
<div class="accom-venue-label">Commons Hub</div>
|
|
<div class="accom-card" data-type="ch-shared" data-price="275">
|
|
<div>
|
|
<div class="accom-name">Shared Room</div>
|
|
<div class="accom-note">Bunk beds / shared room</div>
|
|
</div>
|
|
<div class="accom-price">€275</div>
|
|
</div>
|
|
<div class="accom-card" data-type="ch-double" data-price="350">
|
|
<div>
|
|
<div class="accom-name">Double Room</div>
|
|
<div class="accom-note">Double bed, private or shared</div>
|
|
</div>
|
|
<div class="accom-price">€350</div>
|
|
</div>
|
|
|
|
<div class="accom-venue-label">Herrnhof Villa</div>
|
|
<div class="accom-card" data-type="hh-living" data-price="315">
|
|
<div>
|
|
<div class="accom-name">Living Room</div>
|
|
<div class="accom-note">Sofa bed / daybed in shared living area</div>
|
|
</div>
|
|
<div class="accom-price">€315</div>
|
|
</div>
|
|
<div class="accom-card" data-type="hh-triple" data-price="350">
|
|
<div>
|
|
<div class="accom-name">Triple Room</div>
|
|
<div class="accom-note">Shared with two others</div>
|
|
</div>
|
|
<div class="accom-price">€350</div>
|
|
</div>
|
|
<div class="accom-card" data-type="hh-twin" data-price="420">
|
|
<div>
|
|
<div class="accom-name">Twin Room</div>
|
|
<div class="accom-note">Two separate beds, shared with one other</div>
|
|
</div>
|
|
<div class="accom-price">€420</div>
|
|
</div>
|
|
<div class="accom-card" data-type="hh-single" data-price="665">
|
|
<div>
|
|
<div class="accom-name">Single Room</div>
|
|
<div class="accom-note">Private room for one</div>
|
|
</div>
|
|
<div class="accom-price">€665</div>
|
|
</div>
|
|
<div class="accom-card" data-type="hh-couple" data-price="700">
|
|
<div>
|
|
<div class="accom-name">Couple Room</div>
|
|
<div class="accom-note">Double bed, private room for two</div>
|
|
</div>
|
|
<div class="accom-price">€700</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="price-summary" id="price-summary">
|
|
<h4>Price Summary</h4>
|
|
<div class="price-line">
|
|
<span>Participation fee</span>
|
|
<span class="price-amount">€50.00</span>
|
|
</div>
|
|
<div class="price-line" id="price-accom-line" style="display: none;">
|
|
<span id="price-accom-label">Accommodation</span>
|
|
<span class="price-amount" id="price-accom-amount">€0.00</span>
|
|
</div>
|
|
<div class="price-line">
|
|
<span>Processing fee (2%)</span>
|
|
<span class="price-amount" id="price-processing">€1.00</span>
|
|
</div>
|
|
<div class="price-line total">
|
|
<span>Total</span>
|
|
<span class="price-amount" id="price-total">€51.00</span>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="info-box">
|
|
<strong>About food:</strong> Food is not included in this payment. Expect approximately €15-20 per person per day. We'll be in touch about food choices and dietary preferences before the event.
|
|
</div>
|
|
|
|
<div class="info-box" style="background: rgba(157, 78, 221, 0.08); border-color: rgba(157, 78, 221, 0.3);">
|
|
<strong style="color: var(--accent-purple);">Deposit & cancellation:</strong> This is a full payment. If you cancel more than 1 month before the event, you'll receive a 70% refund. If you cancel between 1 month and 1 week before, you'll receive a 30% refund. No refunds within 1 week of the event.
|
|
</div>
|
|
|
|
<button class="btn btn-primary" id="btn-pay">Pay via Mollie</button>
|
|
<div class="form-message" id="payment-msg"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<a href="/" class="back-link">← Back to worldplay.art</a>
|
|
</div>
|
|
|
|
<script>
|
|
const stateLookup = document.getElementById('state-lookup');
|
|
const statePayment = document.getElementById('state-payment');
|
|
const emailInput = document.getElementById('email');
|
|
const btnLookup = document.getElementById('btn-lookup');
|
|
const lookupMsg = document.getElementById('lookup-msg');
|
|
const paymentMsg = document.getElementById('payment-msg');
|
|
|
|
let registrationId = null;
|
|
let selectedAccom = null;
|
|
|
|
function showMsg(el, html, type) {
|
|
el.innerHTML = html;
|
|
el.className = 'form-message ' + type;
|
|
}
|
|
|
|
function clearMsg(el) {
|
|
el.innerHTML = '';
|
|
el.className = 'form-message';
|
|
}
|
|
|
|
// Allow Enter key to submit
|
|
emailInput.addEventListener('keydown', (e) => {
|
|
if (e.key === 'Enter') btnLookup.click();
|
|
});
|
|
|
|
// Email lookup
|
|
btnLookup.addEventListener('click', async () => {
|
|
clearMsg(lookupMsg);
|
|
const email = emailInput.value.trim();
|
|
|
|
if (!email || !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) {
|
|
showMsg(lookupMsg, 'Please enter a valid email address.', 'error');
|
|
return;
|
|
}
|
|
|
|
btnLookup.disabled = true;
|
|
btnLookup.textContent = 'Looking up...';
|
|
|
|
try {
|
|
const res = await fetch(`/api/lookup-registration?email=${encodeURIComponent(email)}`);
|
|
const data = await res.json();
|
|
|
|
if (res.status === 404) {
|
|
showMsg(lookupMsg, 'No registration found for this email. <a href="/#register">Register here</a>.', 'error');
|
|
return;
|
|
}
|
|
|
|
if (!res.ok) {
|
|
throw new Error(data.error || 'Lookup failed');
|
|
}
|
|
|
|
if (data.paymentStatus === 'paid') {
|
|
showMsg(lookupMsg, 'Your payment is already confirmed! Check your email for your booking details.', 'success');
|
|
return;
|
|
}
|
|
|
|
// Show payment state
|
|
registrationId = data.id;
|
|
document.getElementById('welcome-name').textContent = data.firstName;
|
|
stateLookup.style.display = 'none';
|
|
statePayment.style.display = 'block';
|
|
|
|
} catch (err) {
|
|
showMsg(lookupMsg, err.message, 'error');
|
|
} finally {
|
|
btnLookup.disabled = false;
|
|
btnLookup.textContent = 'Look up my registration';
|
|
}
|
|
});
|
|
|
|
// Accommodation toggle
|
|
const accomCards = document.getElementById('accom-cards');
|
|
document.querySelectorAll('.accom-toggle-btn').forEach(btn => {
|
|
btn.addEventListener('click', () => {
|
|
document.querySelectorAll('.accom-toggle-btn').forEach(b => b.classList.remove('selected'));
|
|
btn.classList.add('selected');
|
|
|
|
if (btn.dataset.accom === 'yes') {
|
|
accomCards.classList.add('visible');
|
|
} else {
|
|
accomCards.classList.remove('visible');
|
|
selectedAccom = null;
|
|
document.querySelectorAll('.accom-card').forEach(c => c.classList.remove('selected'));
|
|
updatePriceSummary();
|
|
}
|
|
});
|
|
});
|
|
|
|
// Accommodation card selection
|
|
document.querySelectorAll('.accom-card').forEach(card => {
|
|
card.addEventListener('click', () => {
|
|
document.querySelectorAll('.accom-card').forEach(c => c.classList.remove('selected'));
|
|
card.classList.add('selected');
|
|
selectedAccom = card.dataset.type;
|
|
updatePriceSummary();
|
|
});
|
|
});
|
|
|
|
// Live price calculator
|
|
function updatePriceSummary() {
|
|
const participation = 50;
|
|
const accomLine = document.getElementById('price-accom-line');
|
|
const accomLabel = document.getElementById('price-accom-label');
|
|
const accomAmount = document.getElementById('price-accom-amount');
|
|
const processingEl = document.getElementById('price-processing');
|
|
const totalEl = document.getElementById('price-total');
|
|
|
|
let accomPrice = 0;
|
|
if (selectedAccom) {
|
|
const card = document.querySelector(`.accom-card[data-type="${selectedAccom}"]`);
|
|
accomPrice = parseInt(card.dataset.price);
|
|
accomLabel.textContent = card.querySelector('.accom-name').textContent + ' (7 nights)';
|
|
accomAmount.textContent = '\u20AC' + accomPrice.toFixed(2);
|
|
accomLine.style.display = 'flex';
|
|
} else {
|
|
accomLine.style.display = 'none';
|
|
}
|
|
|
|
const subtotal = participation + accomPrice;
|
|
const processing = Math.round(subtotal * 0.02 * 100) / 100;
|
|
const total = subtotal + processing;
|
|
|
|
processingEl.textContent = '\u20AC' + processing.toFixed(2);
|
|
totalEl.textContent = '\u20AC' + total.toFixed(2);
|
|
}
|
|
|
|
// Pay button
|
|
const btnPay = document.getElementById('btn-pay');
|
|
btnPay.addEventListener('click', async () => {
|
|
clearMsg(paymentMsg);
|
|
|
|
const accomToggled = document.querySelector('.accom-toggle-btn[data-accom="yes"]').classList.contains('selected');
|
|
if (accomToggled && !selectedAccom) {
|
|
showMsg(paymentMsg, 'Please select an accommodation option.', 'error');
|
|
return;
|
|
}
|
|
|
|
btnPay.disabled = true;
|
|
btnPay.textContent = 'Creating payment...';
|
|
|
|
try {
|
|
const response = await fetch('/api/create-checkout-session', {
|
|
method: 'POST',
|
|
headers: { 'Content-Type': 'application/json' },
|
|
body: JSON.stringify({
|
|
registrationId,
|
|
accommodationType: selectedAccom || null,
|
|
}),
|
|
});
|
|
|
|
const result = await response.json();
|
|
|
|
if (!response.ok) {
|
|
throw new Error(result.error || 'Failed to create payment');
|
|
}
|
|
|
|
window.location.href = result.checkoutUrl;
|
|
|
|
} catch (error) {
|
|
showMsg(paymentMsg, error.message, 'error');
|
|
btnPay.disabled = false;
|
|
btnPay.textContent = 'Pay via Mollie';
|
|
}
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|