From 352fa24e6df8e37d7966da7b50f917754ce8c3db Mon Sep 17 00:00:00 2001 From: James Pattinson Date: Sun, 28 Jun 2026 14:24:28 -0400 Subject: [PATCH] Add webcam --- src/components/WebcamPanel.astro | 161 +++++++++++++++++++++++++++++++ src/lib/site.ts | 1 + src/pages/webcam.astro | 10 ++ 3 files changed, 172 insertions(+) create mode 100644 src/components/WebcamPanel.astro create mode 100644 src/pages/webcam.astro diff --git a/src/components/WebcamPanel.astro b/src/components/WebcamPanel.astro new file mode 100644 index 0000000..6bcf4cc --- /dev/null +++ b/src/components/WebcamPanel.astro @@ -0,0 +1,161 @@ +--- +const webcamBase = (import.meta.env.PUBLIC_WEATHER_BASE ?? 'https://wx.swansea-airport.wales').replace(/\/$/, ''); +const webcamImage = `${webcamBase}/webcam/apron.jpg`; +--- + +
+
+
+

Live apron webcam

+

Swansea Airport apron

+

+ A live view across the apron. The image refreshes automatically every 30 seconds. +

+
+
+ + Loading +
+
+ +
+ Live webcam view of Swansea Airport apron +
+ Waiting for latest image +
+
+
+ + + + diff --git a/src/lib/site.ts b/src/lib/site.ts index c62cfbd..da9d075 100644 --- a/src/lib/site.ts +++ b/src/lib/site.ts @@ -17,6 +17,7 @@ export const site = { { label: 'Home', href: '/' }, { label: 'Pilot Info', href: '/pilot-info/' }, { label: 'Weather', href: '/weather/' }, + { label: 'Webcam', href: '/webcam/' }, { label: 'About', href: '/about/', diff --git a/src/pages/webcam.astro b/src/pages/webcam.astro new file mode 100644 index 0000000..4e073ba --- /dev/null +++ b/src/pages/webcam.astro @@ -0,0 +1,10 @@ +--- +import BaseLayout from '../layouts/BaseLayout.astro'; +import WebcamPanel from '../components/WebcamPanel.astro'; +--- + + +
+ +
+