From c41697065a44de8048569b6062aba9123a75c955 Mon Sep 17 00:00:00 2001 From: Simon Hamp Date: Thu, 23 Jul 2026 03:51:04 +0100 Subject: [PATCH] Add ticket-sales countdown to The Vibes banner The site-wide Vibes banner now shows a live d/h/m/s countdown to ticket sales closing at midnight Boston time on July 30 (04:00 UTC). The deadline is defined once and drives both a server-side render guard and the Alpine timer, so the whole banner disappears the moment sales close - on page loads after the deadline and live in already-open tabs. Also adds the php attribute to the webview example on the SuperNative docs page, matching the documented PHP mode. Co-Authored-By: Claude Fable 5 --- .../components/the-vibes-banner.blade.php | 169 ++++++++++++------ .../mobile/4/architecture/super-native.md | 2 +- tests/Feature/TheVibesBannerTest.php | 53 ++++++ 3 files changed, 166 insertions(+), 58 deletions(-) create mode 100644 tests/Feature/TheVibesBannerTest.php diff --git a/resources/views/components/the-vibes-banner.blade.php b/resources/views/components/the-vibes-banner.blade.php index a258503d..184ed9c2 100644 --- a/resources/views/components/the-vibes-banner.blade.php +++ b/resources/views/components/the-vibes-banner.blade.php @@ -1,65 +1,120 @@ - - {{-- Label --}} - - {{-- Arrow --}} -
- -
-
+ {{-- Countdown to ticket sales closing, midnight in Boston --}} +
+ + 0 + d + + + 00 + h + + + 00 + m + + + 00 + s + +
+ + {{-- Arrow --}} +
+ +
+ +@endif diff --git a/resources/views/docs/mobile/4/architecture/super-native.md b/resources/views/docs/mobile/4/architecture/super-native.md index 22cb8bf0..0b622f5b 100644 --- a/resources/views/docs/mobile/4/architecture/super-native.md +++ b/resources/views/docs/mobile/4/architecture/super-native.md @@ -110,7 +110,7 @@ the same way that NativePHP for Mobile versions before v4 did, you can do someth Route::native('/home', WebViewScreen::class); // webviewscreen.blade.php - + // routes/web.php Route::view('/', 'welcome'); diff --git a/tests/Feature/TheVibesBannerTest.php b/tests/Feature/TheVibesBannerTest.php new file mode 100644 index 00000000..980bdf5b --- /dev/null +++ b/tests/Feature/TheVibesBannerTest.php @@ -0,0 +1,53 @@ +travelTo(Carbon::parse('2026-07-29T23:59:59-04:00')); + + $this->blade('') + ->assertSee('2026-07-30T00:00:00-04:00', false) + ->assertSeeInOrder(['x-text="days"', 'x-text="hours"', 'x-text="minutes"', 'x-text="seconds"'], false); + } + + #[Test] + public function the_banner_disappears_once_ticket_sales_close() + { + $this->travelTo(Carbon::parse('2026-07-30T00:00:00-04:00')); + + $this->blade('') + ->assertDontSee('2026-07-30T00:00:00-04:00', false) + ->assertDontSee('Get your ticket'); + } + + #[Test] + public function the_homepage_shows_the_countdown_while_tickets_are_on_sale() + { + $this->travelTo(Carbon::parse('2026-07-23T12:00:00-04:00')); + + $this->get('/') + ->assertOk() + ->assertSee('2026-07-30T00:00:00-04:00', false); + } + + #[Test] + public function the_homepage_hides_the_banner_once_ticket_sales_close() + { + $this->travelTo(Carbon::parse('2026-07-30T04:00:00Z')); + + $this->get('/') + ->assertOk() + ->assertDontSee('2026-07-30T00:00:00-04:00', false); + } +}