From ea3442c9db9b9a49f5b301b1276fbc82fa1fe52e Mon Sep 17 00:00:00 2001 From: cproudlock Date: Tue, 18 Nov 2025 09:08:21 -0500 Subject: [PATCH] Add slide-up carousel for upcoming events in shopfloor dashboard MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implemented automatic cycling carousel for upcoming events section with smooth slide-up transitions, showing one event at a time. Features: - Current events: Show all at once (unchanged) - Upcoming events: Cycle through one at a time - 5-second display time per event - 0.8-second smooth slide-up transition - Current event slides up and fades out - Next event slides up from bottom and fades in - Loops continuously through all upcoming events - Only one upcoming event visible at a time Implementation: - Added carousel CSS with position-based transitions - Three states: active (visible), exit-up (sliding out), enter-down (waiting) - JavaScript interval rotates events every 5 seconds - Automatically starts/stops based on number of upcoming events - Pauses when page is hidden (tab switching) - Responsive to all screen sizes (720p, 1080p, 4K) Benefits: - Saves screen space - Each upcoming event gets dedicated visibility - Clean, professional transition effect - No competing for attention in grid layout - Better readability for shop floor displays 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- shopfloor-dashboard/index.html | 120 ++++++++++++++++++++++++++++++--- 1 file changed, 111 insertions(+), 9 deletions(-) diff --git a/shopfloor-dashboard/index.html b/shopfloor-dashboard/index.html index 5940de7..6e5b119 100644 --- a/shopfloor-dashboard/index.html +++ b/shopfloor-dashboard/index.html @@ -383,6 +383,42 @@ font-style: italic; } + /* Upcoming events carousel */ + .upcoming-carousel-container { + position: relative; + overflow: hidden; + min-height: 200px; + } + + .upcoming-carousel-wrapper { + position: relative; + width: 100%; + } + + .event-card.upcoming.carousel-item { + position: absolute; + width: 100%; + top: 0; + left: 0; + transition: transform 0.8s ease-in-out, opacity 0.8s ease-in-out; + } + + .event-card.upcoming.carousel-item.active { + transform: translateY(0); + opacity: 1; + position: relative; + } + + .event-card.upcoming.carousel-item.exit-up { + transform: translateY(-100%); + opacity: 0; + } + + .event-card.upcoming.carousel-item.enter-down { + transform: translateY(100%); + opacity: 0; + } + /* ============================================ */ /* RESPONSIVE SIZING FOR LOW-RES DISPLAYS (720p) */ /* ============================================ */ @@ -656,6 +692,9 @@ let clockInterval; let selectedBusinessUnit = ''; let businessUnitsLoaded = false; + let upcomingEvents = []; + let currentUpcomingIndex = 0; + let upcomingCarouselInterval = null; // Get business unit from URL parameter function getBusinessUnitFromURL() { @@ -795,7 +834,7 @@ html += ''; // Close section } - // Upcoming Events - show all in grid layout + // Upcoming Events - carousel with slide-up transition if (data.upcoming && data.upcoming.length > 0) { // Sort upcoming events by type priority, then by date const typePriority = { @@ -820,24 +859,26 @@ return dateA - dateB; }); + // Store for carousel + upcomingEvents = sortedUpcoming; + html += '
'; html += '
UPCOMING (Next 72 Hours)
'; + html += '