Adds waitlist UI with drawer and responsive styles
Implements a new waitlist component with mini card, drawer, and interactive functionality Introduces: - Waitlist mini card with badge - Drawer overlay with detailed waitlist entries - Responsive CSS for various waitlist UI elements - Interactive JavaScript for opening/closing drawer and handling actions
This commit is contained in:
parent
0137a4b4f9
commit
4ead6bb544
2 changed files with 513 additions and 0 deletions
|
|
@ -392,6 +392,15 @@
|
|||
</swp-notification-list>
|
||||
</swp-card>
|
||||
|
||||
<!-- Waitlist Mini Card -->
|
||||
<swp-waitlist-card>
|
||||
<swp-waitlist-icon>
|
||||
<i class="ph ph-users-three"></i>
|
||||
<swp-waitlist-badge>4</swp-waitlist-badge>
|
||||
</swp-waitlist-icon>
|
||||
<swp-waitlist-label>På venteliste</swp-waitlist-label>
|
||||
</swp-waitlist-card>
|
||||
|
||||
<!-- Quick Stats -->
|
||||
<swp-card>
|
||||
<swp-card-header>
|
||||
|
|
@ -472,6 +481,178 @@
|
|||
</swp-dashboard-grid>
|
||||
</swp-page-container>
|
||||
|
||||
<!-- Waitlist Drawer Overlay -->
|
||||
<swp-drawer-overlay></swp-drawer-overlay>
|
||||
|
||||
<!-- Waitlist Drawer -->
|
||||
<swp-waitlist-drawer>
|
||||
<swp-drawer-header>
|
||||
<swp-drawer-title>
|
||||
Venteliste <swp-count>(4)</swp-count>
|
||||
</swp-drawer-title>
|
||||
<swp-drawer-close>
|
||||
<i class="ph ph-x"></i>
|
||||
</swp-drawer-close>
|
||||
</swp-drawer-header>
|
||||
<swp-drawer-body>
|
||||
<swp-waitlist-list>
|
||||
<!-- Entry 1 -->
|
||||
<swp-waitlist-item>
|
||||
<swp-waitlist-customer>
|
||||
<swp-avatar>EC</swp-avatar>
|
||||
<swp-waitlist-customer-info>
|
||||
<swp-waitlist-name>Emma Christensen</swp-waitlist-name>
|
||||
<swp-waitlist-phone>+45 12 34 56 78</swp-waitlist-phone>
|
||||
</swp-waitlist-customer-info>
|
||||
</swp-waitlist-customer>
|
||||
<swp-waitlist-service>Dameklip + Farve</swp-waitlist-service>
|
||||
<swp-waitlist-meta>
|
||||
<swp-waitlist-periods>
|
||||
<swp-label>Ønsker:</swp-label>
|
||||
<swp-waitlist-period-tag>Mandag-Onsdag</swp-waitlist-period-tag>
|
||||
<swp-waitlist-period-tag>Formiddag</swp-waitlist-period-tag>
|
||||
</swp-waitlist-periods>
|
||||
<swp-waitlist-dates>
|
||||
<swp-waitlist-date>
|
||||
<i class="ph ph-calendar"></i>
|
||||
Tilmeldt: 2. jan 2026
|
||||
</swp-waitlist-date>
|
||||
<swp-waitlist-date class="expires">
|
||||
<i class="ph ph-clock"></i>
|
||||
Udløber: 16. jan 2026
|
||||
</swp-waitlist-date>
|
||||
</swp-waitlist-dates>
|
||||
</swp-waitlist-meta>
|
||||
<swp-waitlist-actions>
|
||||
<swp-btn class="secondary">
|
||||
<i class="ph ph-phone"></i>
|
||||
Kontakt
|
||||
</swp-btn>
|
||||
<swp-btn class="primary">
|
||||
<i class="ph ph-calendar-plus"></i>
|
||||
Book nu
|
||||
</swp-btn>
|
||||
</swp-waitlist-actions>
|
||||
</swp-waitlist-item>
|
||||
|
||||
<!-- Entry 2 -->
|
||||
<swp-waitlist-item>
|
||||
<swp-waitlist-customer>
|
||||
<swp-avatar>MS</swp-avatar>
|
||||
<swp-waitlist-customer-info>
|
||||
<swp-waitlist-name>Mikkel Sørensen</swp-waitlist-name>
|
||||
<swp-waitlist-phone>+45 23 45 67 89</swp-waitlist-phone>
|
||||
</swp-waitlist-customer-info>
|
||||
</swp-waitlist-customer>
|
||||
<swp-waitlist-service>Herreklip</swp-waitlist-service>
|
||||
<swp-waitlist-meta>
|
||||
<swp-waitlist-periods>
|
||||
<swp-label>Ønsker:</swp-label>
|
||||
<swp-waitlist-period-tag>Weekend</swp-waitlist-period-tag>
|
||||
</swp-waitlist-periods>
|
||||
<swp-waitlist-dates>
|
||||
<swp-waitlist-date>
|
||||
<i class="ph ph-calendar"></i>
|
||||
Tilmeldt: 30. dec 2025
|
||||
</swp-waitlist-date>
|
||||
<swp-waitlist-date class="expires soon">
|
||||
<i class="ph ph-clock"></i>
|
||||
Udløber: 6. jan 2026
|
||||
</swp-waitlist-date>
|
||||
</swp-waitlist-dates>
|
||||
</swp-waitlist-meta>
|
||||
<swp-waitlist-actions>
|
||||
<swp-btn class="secondary">
|
||||
<i class="ph ph-phone"></i>
|
||||
Kontakt
|
||||
</swp-btn>
|
||||
<swp-btn class="primary">
|
||||
<i class="ph ph-calendar-plus"></i>
|
||||
Book nu
|
||||
</swp-btn>
|
||||
</swp-waitlist-actions>
|
||||
</swp-waitlist-item>
|
||||
|
||||
<!-- Entry 3 -->
|
||||
<swp-waitlist-item>
|
||||
<swp-waitlist-customer>
|
||||
<swp-avatar>LA</swp-avatar>
|
||||
<swp-waitlist-customer-info>
|
||||
<swp-waitlist-name>Lise Andersen</swp-waitlist-name>
|
||||
<swp-waitlist-phone>+45 34 56 78 90</swp-waitlist-phone>
|
||||
</swp-waitlist-customer-info>
|
||||
</swp-waitlist-customer>
|
||||
<swp-waitlist-service>Balayage</swp-waitlist-service>
|
||||
<swp-waitlist-meta>
|
||||
<swp-waitlist-periods>
|
||||
<swp-label>Ønsker:</swp-label>
|
||||
<swp-waitlist-period-tag>Tirsdag-Torsdag</swp-waitlist-period-tag>
|
||||
<swp-waitlist-period-tag>Eftermiddag</swp-waitlist-period-tag>
|
||||
</swp-waitlist-periods>
|
||||
<swp-waitlist-dates>
|
||||
<swp-waitlist-date>
|
||||
<i class="ph ph-calendar"></i>
|
||||
Tilmeldt: 28. dec 2025
|
||||
</swp-waitlist-date>
|
||||
<swp-waitlist-date class="expires">
|
||||
<i class="ph ph-clock"></i>
|
||||
Udløber: 11. jan 2026
|
||||
</swp-waitlist-date>
|
||||
</swp-waitlist-dates>
|
||||
</swp-waitlist-meta>
|
||||
<swp-waitlist-actions>
|
||||
<swp-btn class="secondary">
|
||||
<i class="ph ph-phone"></i>
|
||||
Kontakt
|
||||
</swp-btn>
|
||||
<swp-btn class="primary">
|
||||
<i class="ph ph-calendar-plus"></i>
|
||||
Book nu
|
||||
</swp-btn>
|
||||
</swp-waitlist-actions>
|
||||
</swp-waitlist-item>
|
||||
|
||||
<!-- Entry 4 -->
|
||||
<swp-waitlist-item>
|
||||
<swp-waitlist-customer>
|
||||
<swp-avatar>PH</swp-avatar>
|
||||
<swp-waitlist-customer-info>
|
||||
<swp-waitlist-name>Peter Hansen</swp-waitlist-name>
|
||||
<swp-waitlist-phone>+45 45 67 89 01</swp-waitlist-phone>
|
||||
</swp-waitlist-customer-info>
|
||||
</swp-waitlist-customer>
|
||||
<swp-waitlist-service>Herreklip + Skæg</swp-waitlist-service>
|
||||
<swp-waitlist-meta>
|
||||
<swp-waitlist-periods>
|
||||
<swp-label>Ønsker:</swp-label>
|
||||
<swp-waitlist-period-tag>Fleksibel</swp-waitlist-period-tag>
|
||||
</swp-waitlist-periods>
|
||||
<swp-waitlist-dates>
|
||||
<swp-waitlist-date>
|
||||
<i class="ph ph-calendar"></i>
|
||||
Tilmeldt: 27. dec 2025
|
||||
</swp-waitlist-date>
|
||||
<swp-waitlist-date class="expires">
|
||||
<i class="ph ph-clock"></i>
|
||||
Udløber: 10. jan 2026
|
||||
</swp-waitlist-date>
|
||||
</swp-waitlist-dates>
|
||||
</swp-waitlist-meta>
|
||||
<swp-waitlist-actions>
|
||||
<swp-btn class="secondary">
|
||||
<i class="ph ph-phone"></i>
|
||||
Kontakt
|
||||
</swp-btn>
|
||||
<swp-btn class="primary">
|
||||
<i class="ph ph-calendar-plus"></i>
|
||||
Book nu
|
||||
</swp-btn>
|
||||
</swp-waitlist-actions>
|
||||
</swp-waitlist-item>
|
||||
</swp-waitlist-list>
|
||||
</swp-drawer-body>
|
||||
</swp-waitlist-drawer>
|
||||
|
||||
<script>
|
||||
// Update current time
|
||||
function updateTime() {
|
||||
|
|
@ -502,6 +683,50 @@
|
|||
alert('Åbn booking: ' + service);
|
||||
});
|
||||
});
|
||||
|
||||
// Waitlist Drawer functionality
|
||||
const waitlistCard = document.querySelector('swp-waitlist-card');
|
||||
const waitlistDrawer = document.querySelector('swp-waitlist-drawer');
|
||||
const drawerOverlay = document.querySelector('swp-drawer-overlay');
|
||||
const drawerClose = document.querySelector('swp-drawer-close');
|
||||
|
||||
function openWaitlistDrawer() {
|
||||
waitlistDrawer.classList.add('open');
|
||||
drawerOverlay.classList.add('visible');
|
||||
document.body.style.overflow = 'hidden';
|
||||
}
|
||||
|
||||
function closeWaitlistDrawer() {
|
||||
waitlistDrawer.classList.remove('open');
|
||||
drawerOverlay.classList.remove('visible');
|
||||
document.body.style.overflow = '';
|
||||
}
|
||||
|
||||
waitlistCard.addEventListener('click', openWaitlistDrawer);
|
||||
drawerClose.addEventListener('click', closeWaitlistDrawer);
|
||||
drawerOverlay.addEventListener('click', closeWaitlistDrawer);
|
||||
|
||||
// Close on Escape key
|
||||
document.addEventListener('keydown', (e) => {
|
||||
if (e.key === 'Escape' && waitlistDrawer.classList.contains('open')) {
|
||||
closeWaitlistDrawer();
|
||||
}
|
||||
});
|
||||
|
||||
// Click handlers for waitlist actions
|
||||
document.querySelectorAll('swp-waitlist-actions swp-btn').forEach(btn => {
|
||||
btn.addEventListener('click', (e) => {
|
||||
e.stopPropagation();
|
||||
const isContact = btn.classList.contains('secondary');
|
||||
const name = btn.closest('swp-waitlist-item').querySelector('swp-waitlist-name').textContent;
|
||||
if (isContact) {
|
||||
alert('Kontakt: ' + name);
|
||||
} else {
|
||||
alert('Book nu for: ' + name);
|
||||
closeWaitlistDrawer();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue