public/wunsch.html aktualisiert

This commit is contained in:
M_Viper 2024-10-18 23:50:37 +00:00
parent 721386bbd4
commit d061668ab6
1 changed files with 73 additions and 136 deletions

View File

@ -1,136 +1,73 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="de"> <html lang="de">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/styles.css"> <link rel="stylesheet" href="css/styles.css">
<link rel="icon" type="image/png" href="img/Viper-plex-logo.png"> <link rel="icon" type="image/png" href="img/Viper-plex-logo.png">
<title>Wunsch - Viper-Plex</title> <title id="web-title">${WEB_NAME}</title> <!-- Platzhalter für den Titel -->
</head> </head>
<body> <body>
<!-- Logo separat einfügen --> <!-- Logo separat einfügen -->
<div class="logo-container"> <div class="logo-container">
<a href="index.html"> <a href="index.html">
<img src="img/Viper-plex-logo.png" alt="Viper-Plex Logo" class="logo"> <img src="img/Viper-plex-logo.png" alt="Viper-Plex Logo" class="logo">
</a> </a>
</div> </div>
<div class="welcome-box"> <div class="welcome-box">
<h1>Wunsch Seite</h1> <h1 id="welcome-title">${WEB_NAME}</h1> <!-- ID für das h1-Tag -->
<nav class="navbar"> <nav class="navbar">
<div class="navbar-container"> <div class="navbar-container">
<a href="index.html" class="navbar-link">Home</a> <a href="index.html" class="navbar-link">Home</a>
<a href="wunsch.html" class="navbar-link">Film & Serien wunsch</a> <a href="wunsch.html" class="navbar-link">Film & Serien wunsch</a>
<a href="anleitung.html" class="navbar-link">Anleitung</a> <a href="anleitung.html" class="navbar-link">Anleitung</a>
<a href="funktionen.html" class="navbar-link">Funktionen</a> <a href="funktionen.html" class="navbar-link">Funktionen</a>
<a href="faq.html" class="navbar-link">FAQs</a> <a href="faq.html" class="navbar-link">FAQs</a>
<a href="kontakt.html" class="navbar-link">Kontakt</a> <a href="kontakt.html" class="navbar-link">Kontakt</a>
<a href="link.html" class="navbar-link">Links</a> <a href="link.html" class="navbar-link">Links</a>
<a href="report.html" class="navbar-link">Dev-Report</a> <a href="report.html" class="navbar-link">Dev-Report</a>
<a href="admin.html" class="navbar-link">Admin</a> <a href="admin.html" class="navbar-link">Admin</a>
</div> </div>
</nav> </nav>
<label class="switch"> <label class="switch">
<input type="checkbox" id="dark-mode-toggle"> <input type="checkbox" id="dark-mode-toggle">
<span class="slider"></span> <span class="slider"></span>
</label> </label>
</div> </div>
<div class="container"> <div class="container">
<main> <main>
<div class="wunsch-box"> <div class="wunsch-box">
<h2>Dein Wunsch</h2> <h2>Dein Wunsch</h2>
<form id="wunsch-form"> <form id="wunsch-form">
<label for="wunsch">Wunsch eingeben:</label> <label for="wunsch">Wunsch eingeben:</label>
<input type="text" id="wunsch" placeholder="Gib deinen Wunsch ein" required> <input type="text" id="wunsch" placeholder="Gib deinen Wunsch ein" required>
<label for="type">Wunschtyp:</label> <label for="type">Wunschtyp:</label>
<select id="type"> <select id="type">
<option value="film">Film</option> <option value="film">Film</option>
<option value="serie">Serie</option> <option value="serie">Serie</option>
</select> </select>
<button type="submit">Absenden</button> <button type="submit">Absenden</button>
</form> </form>
<p id="response-message"></p> <p id="response-message"></p>
</div> </div>
</main> </main>
<aside class="sidebar"> <aside class="sidebar">
<div class="gitea-box"> <div class="gitea-box">
<p>Sieh dir den Code auf <a href="https://git.viper.ipv64.net/M_Viper/Plex-Telegram-Bot" target="_blank">Gitea</a> an!</p> <p>Sieh dir den Code auf <a href="https://git.viper.ipv64.net/M_Viper/Plex-Telegram-Bot" target="_blank">Gitea</a> an!</p>
<p>Aktuelle Version: <span id="bot-version"></span></p> <p>Aktuelle Version: <span id="bot-version"></span></p>
<div class="telegram-connect-box"> <div class="telegram-connect-box">
<p>Verbinde dich mit unserem Telegram-Bot!</p> <p>Verbinde dich mit unserem Telegram-Bot!</p>
<a id="telegram-link" href="#" target="_blank">Jetzt verbinden</a> <a id="telegram-link" href="#" target="_blank">Jetzt verbinden</a>
</div> </div>
</div> </div>
</aside> </aside>
</div> </div>
<footer class="footer"> <footer class="footer">
<p>&copy; 2024 Viper-Plex. Alle Rechte vorbehalten.</p> <p>&copy; 2024 M_Viper. Alle Rechte vorbehalten.</p>
</footer> </footer>
<script> <script src="js/script.js"></script>
// Funktion, um die Umgebungsvariablen abzurufen </body>
const fetchEnvVariables = async () => { </html>
const response = await fetch('/api/env');
const data = await response.json();
document.getElementById('bot-alias').textContent = data.botAlias;
document.getElementById('telegram-link').href = data.telegramLink;
};
document.addEventListener('DOMContentLoaded', () => {
fetch('/api/telegram-link') // API-Endpunkt zum Abrufen des Telegram-Links
.then(response => response.json())
.then(data => {
const telegramLink = document.getElementById('telegram-link');
telegramLink.href = data.link; // Setze den Link im Anchor-Tag
})
.catch(error => console.error('Fehler beim Abrufen des Telegram-Links:', error));
// Version abrufen
fetch('/api/bot-version')
.then(response => response.json())
.then(data => {
const botVersion = document.getElementById('bot-version');
botVersion.textContent = data.version; // Setze die Versionsnummer
})
.catch(error => console.error('Fehler beim Abrufen der Bot-Version:', error));
// Handle form submission
document.getElementById('wunsch-form').addEventListener('submit', function(event) {
event.preventDefault();
const wunsch = document.getElementById('wunsch').value;
const type = document.getElementById('type').value;
fetch('/api/telegram-wunsch', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ wunsch, type })
})
.then(response => response.json())
.then(data => {
document.getElementById('response-message').textContent = data.message;
})
.catch(error => {
document.getElementById('response-message').textContent = 'Fehler beim Senden des Wunsches: ' + error;
});
});
});
// Darkmode umschalten
const toggle = document.getElementById('dark-mode-toggle');
const darkModeEnabled = localStorage.getItem('darkMode') === 'true';
toggle.checked = darkModeEnabled;
if (darkModeEnabled) document.body.classList.add('dark-mode');
toggle.addEventListener('change', () => {
const isChecked = toggle.checked;
document.body.classList.toggle('dark-mode', isChecked);
localStorage.setItem('darkMode', isChecked);
});
</script>
</body>
</html>