From 626fa3d4a61b70cad4957adb70ed6b1d3f8846b6 Mon Sep 17 00:00:00 2001
From: Steve Dogiakos <dogiakos@gmail.com>
Date: Mon, 27 Jan 2025 13:47:35 -0700
Subject: [PATCH] adding public folder

---
 public/script.js | 26 ++++++++++++++++++++++++++
 public/syle.css  | 40 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 66 insertions(+)
 create mode 100644 public/script.js
 create mode 100644 public/syle.css

diff --git a/public/script.js b/public/script.js
new file mode 100644
index 0000000..6dbe88e
--- /dev/null
+++ b/public/script.js
@@ -0,0 +1,26 @@
+async function fetchApproved() {
+  try {
+    const response = await fetch('/api/approved');
+    const data = await response.json();
+    return data;
+  } catch (error) {
+    console.error('Error fetching approved data:', error);
+    return [];
+  }
+}
+
+async function updateTicker() {
+  const approvedData = await fetchApproved();
+  const tickerContent = approvedData
+    .map(entry => `${entry.name} (${entry.location}): ${entry.comment}`)
+    .join(' – ');
+
+  const tickerElement = document.getElementById('ticker-content');
+  tickerElement.textContent = tickerContent;
+}
+
+// Fetch on load
+updateTicker();
+
+// Refresh every 30 seconds (adjust as needed)
+setInterval(updateTicker, 30000);
diff --git a/public/syle.css b/public/syle.css
new file mode 100644
index 0000000..afa62bd
--- /dev/null
+++ b/public/syle.css
@@ -0,0 +1,40 @@
+/* Basic layout */
+body {
+    margin: 0;
+    font-family: sans-serif;
+    background: #f0f0f0;
+}
+
+h1 {
+    text-align: center;
+    padding: 1rem;
+}
+
+/* Ticker styles */
+#ticker-container {
+    position: fixed;
+    bottom: 0;
+    width: 100%;
+    background-color: #333;
+    color: #fff;
+    height: 40px;
+    display: flex;
+    align-items: center;
+    overflow: hidden;
+}
+
+#ticker-content {
+    white-space: nowrap;
+    animation: ticker 20s linear infinite;
+    padding-left: 100%;
+}
+
+@keyframes ticker {
+    0% {
+        transform: translateX(0);
+    }
+
+    100% {
+        transform: translateX(-100%);
+    }
+}
\ No newline at end of file