Remove landing page

This commit is contained in:
2026-01-06 11:34:38 +01:00
parent 8e9a8d80c3
commit f5ef439c74
2 changed files with 0 additions and 55 deletions

View File

@@ -1,54 +0,0 @@
document.addEventListener("DOMContentLoaded", () => {
const searchForm = document.getElementById("channel-search-form");
const searchInput = document.getElementById("channel-search");
const suggestions = document.getElementById("channel-suggestions");
if (!searchForm || !searchInput || !suggestions) {
console.error("Required elements not found in the DOM");
return;
}
let channels = [];
function updateSuggestions(term) {
const normalizedTerm = term.trim().toLowerCase();
const filtered = channels.filter((name) => !normalizedTerm || name.includes(normalizedTerm)).slice(0, 20);
suggestions.innerHTML = "";
filtered.forEach((name) => {
const option = document.createElement("option");
option.value = name;
suggestions.appendChild(option);
});
}
async function loadChannels() {
try {
const response = await fetch("/api/channels");
if (!response.ok) {
throw new Error(`Failed to load channels: ${response.status}`);
}
channels = await response.json();
updateSuggestions(searchInput.value || "");
} catch (error) {
console.error("Could not load channel directory", error);
}
}
searchInput.focus({ preventScroll: true });
searchInput.select();
searchInput.addEventListener("input", (event) => updateSuggestions(event.target.value || ""));
searchForm.addEventListener("submit", (event) => {
event.preventDefault();
const broadcaster = (searchInput.value || "").trim().toLowerCase();
if (!broadcaster) {
searchInput.focus();
return;
}
globalThis.location.href = `/view/${encodeURIComponent(broadcaster)}/broadcast`;
});
loadChannels();
});

View File

@@ -41,6 +41,5 @@
</main>
</div>
<script src="/js/cookie-consent.js"></script>
<script src="/js/landing.js"></script>
</body>
</html>