dynamic naming
This commit is contained in:
@@ -3,12 +3,24 @@ let resultsData = {};
|
||||
let messageData = {};
|
||||
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
initAppUI();
|
||||
initTabs();
|
||||
loadData();
|
||||
|
||||
setInterval(loadData, CONFIG.REFRESH_INTERVAL);
|
||||
});
|
||||
|
||||
function initAppUI() {
|
||||
const fullTitle = `${CONFIG.EVENT_NAME} – Rennplan & Ergebnisse`;
|
||||
|
||||
document.title = fullTitle;
|
||||
|
||||
const titleEl = document.getElementById("app-title");
|
||||
if (titleEl) {
|
||||
titleEl.textContent = fullTitle;
|
||||
}
|
||||
}
|
||||
|
||||
function initTabs() {
|
||||
const rennplanBtn = document.getElementById("tab-rennplan");
|
||||
const resultsBtn = document.getElementById("tab-ergebnisse");
|
||||
|
||||
+5
-3
@@ -1,7 +1,9 @@
|
||||
const CONFIG = {
|
||||
RESULTS_URL: "https://example.com/api/results",
|
||||
RENNPLAN_URL: "https://example.com/api/rennplan",
|
||||
MESSAGE_URL: "https://example.com/api/message",
|
||||
EVENT_NAME: "Beispiel Regatta",
|
||||
|
||||
RESULTS_URL: "https://api.demo.regattatech.de/api/v1/results/current",
|
||||
RENNPLAN_URL: "https://api.demo.regattatech.de/api/v1/rennplan/current",
|
||||
MESSAGE_URL: "https://api.demo.regattatech.de/api/v1/message",
|
||||
|
||||
REFRESH_INTERVAL: 30000 // 30 Sekunden
|
||||
};
|
||||
+2
-2
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Sport am Tankumsee Rennplan & Ergebnisse</title>
|
||||
<title></title>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
|
||||
<script src="config.js"></script>
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
<header class="bg-indigo-600 text-white shadow-md sticky top-0 z-50">
|
||||
<div class="max-w-7xl mx-auto px-6 py-4">
|
||||
<h1 class="text-xl font-medium tracking-wide">Sport am Tankumsee</h1>
|
||||
<h1 id="app-title" class="text-xl font-medium tracking-wide"></h1>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user