generated from Templates_CodeFirst/templateHtmlCss
add dark and light mode
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
19a6e8d94e
commit
976c45d022
@ -0,0 +1,30 @@
|
|||||||
|
// Get the theme switch checkbox
|
||||||
|
const themeSwitch = document.getElementById('theme-switch');
|
||||||
|
|
||||||
|
// Function to set the theme
|
||||||
|
const setTheme = (isDark) => {
|
||||||
|
if (isDark) {
|
||||||
|
document.body.classList.add('dark-mode');
|
||||||
|
document.body.classList.remove('light-mode');
|
||||||
|
} else {
|
||||||
|
document.body.classList.add('light-mode');
|
||||||
|
document.body.classList.remove('dark-mode');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Retrieve the saved theme from localStorage
|
||||||
|
const savedTheme = localStorage.getItem('theme');
|
||||||
|
if (savedTheme) {
|
||||||
|
const isDark = savedTheme === 'dark';
|
||||||
|
themeSwitch.checked = !isDark; // Set the switch position
|
||||||
|
setTheme(isDark);
|
||||||
|
} else {
|
||||||
|
setTheme(true); // Default to dark mode
|
||||||
|
}
|
||||||
|
|
||||||
|
// Listen for changes on the switch
|
||||||
|
themeSwitch.addEventListener('change', (e) => {
|
||||||
|
const isDark = !e.target.checked; // Light mode when checked
|
||||||
|
setTheme(isDark);
|
||||||
|
localStorage.setItem('theme', isDark ? 'dark' : 'light'); // Save preference
|
||||||
|
});
|
@ -0,0 +1,84 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Contact Us</title>
|
||||||
|
<!-- Tailwind CSS via CDN -->
|
||||||
|
<script src="https://cdn.tailwindcss.com"></script>
|
||||||
|
<link type="text/css" rel="stylesheet" href="style.css">
|
||||||
|
<script src="effect.js" defer></script>
|
||||||
|
</head>
|
||||||
|
<body class="bg-gray-900 text-white">
|
||||||
|
|
||||||
|
<!-- Navigation (Optional) -->
|
||||||
|
<nav class="navbar bg-gray-800">
|
||||||
|
<ul class="navbar-list">
|
||||||
|
<li><a href="index.html">Accueil</a></li>
|
||||||
|
<li><a href="cursus.html">Cursus</a></li>
|
||||||
|
<li><a href="planning.html">Planning</a></li>
|
||||||
|
<li class="dropdown">
|
||||||
|
<a href="#">Gallerie</a>
|
||||||
|
<ul class="dropdown-content">
|
||||||
|
<li><a href="images.html">Images</a></li>
|
||||||
|
<li><a href="videos.html">Vidéos</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li><a href="form.html">Formulaire</a></li>
|
||||||
|
<label class="switch">
|
||||||
|
<input type="checkbox" id="theme-switch">
|
||||||
|
<span class="slider"></span>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<!-- Contact Form -->
|
||||||
|
<div class="container px-4 mx-auto mt-10">
|
||||||
|
<div class="max-w-md mx-auto px-8 py-6 bg-gray-800 rounded-lg shadow-lg">
|
||||||
|
<h2 class="text-2xl font-semibold text-white mb-4">Contact Us</h2>
|
||||||
|
<form>
|
||||||
|
<div class="mb-4">
|
||||||
|
<label class="block text-white mb-1" for="name">Your Name</label>
|
||||||
|
<input
|
||||||
|
class="w-full px-4 py-2 bg-gray-700 rounded-lg focus:outline-none focus:ring-2 focus:ring-yellow-300 transition duration-300"
|
||||||
|
placeholder="Enter your name"
|
||||||
|
type="text"
|
||||||
|
name="name"
|
||||||
|
id="name"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="mb-4">
|
||||||
|
<label class="block text-white mb-1" for="email">Your Email</label>
|
||||||
|
<input
|
||||||
|
class="w-full px-4 py-2 bg-gray-700 rounded-lg focus:outline-none focus:ring-2 focus:ring-yellow-300 transition duration-300"
|
||||||
|
placeholder="Enter your email"
|
||||||
|
type="email"
|
||||||
|
name="email"
|
||||||
|
id="email"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="mb-4">
|
||||||
|
<label class="block text-white mb-1" for="message">Your Message</label>
|
||||||
|
<textarea
|
||||||
|
class="w-full px-4 py-2 bg-gray-700 rounded-lg focus:outline-none focus:ring-2 focus:ring-yellow-300 transition duration-300"
|
||||||
|
rows="4"
|
||||||
|
placeholder="Enter your message"
|
||||||
|
name="message"
|
||||||
|
id="message"
|
||||||
|
></textarea>
|
||||||
|
</div>
|
||||||
|
<button
|
||||||
|
class="w-full bg-yellow-300 text-gray-800 py-2 px-4 rounded-lg hover:bg-yellow-400 transition duration-300"
|
||||||
|
type="submit"
|
||||||
|
>
|
||||||
|
Send Message
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -1,52 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="fr">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>Contactez-moi</title>
|
|
||||||
<link type="text/css" rel="stylesheet" href="style.css">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>Formulaire de Contact</h1>
|
|
||||||
<form action="process.php" method="GET">
|
|
||||||
<!-- Champ pour le nom (obligatoire) -->
|
|
||||||
<label for="name">Nom:</label>
|
|
||||||
<input type="text" id="name" name="name" required><br><br>
|
|
||||||
|
|
||||||
<!-- Champ pour l'adresse email (obligatoire) -->
|
|
||||||
<label for="email">Adresse de courriel:</label>
|
|
||||||
<input type="email" id="email" name="email" required><br><br>
|
|
||||||
|
|
||||||
<!-- Champ pour le numéro de téléphone (facultatif) -->
|
|
||||||
<label for="phone">Numéro de téléphone:</label>
|
|
||||||
<input type="tel" id="phone" name="phone"><br><br>
|
|
||||||
|
|
||||||
<!-- Liste déroulante pour le motif de contact -->
|
|
||||||
<label for="reason">Motif de contact:</label>
|
|
||||||
<select id="reason" name="reason">
|
|
||||||
<option value="information">Demande d'information</option>
|
|
||||||
<option value="support">Support technique</option>
|
|
||||||
<option value="feedback">Feedback</option>
|
|
||||||
<option value="other">Autre</option>
|
|
||||||
</select><br><br>
|
|
||||||
|
|
||||||
<!-- Champ pour le créneau horaire (jour + horaire) -->
|
|
||||||
<label for="schedule">Créneau horaire:</label>
|
|
||||||
<input type="datetime-local" id="schedule" name="schedule"><br><br>
|
|
||||||
|
|
||||||
<!-- Boutons radio pour indiquer si c'est la première demande -->
|
|
||||||
<label>Première demande ?</label><br>
|
|
||||||
<input type="radio" id="first_request_yes" name="first_request" value="yes">
|
|
||||||
<label for="first_request_yes">Oui</label>
|
|
||||||
<input type="radio" id="first_request_no" name="first_request" value="no">
|
|
||||||
<label for="first_request_no">Non</label><br><br>
|
|
||||||
|
|
||||||
<!-- Champ texte pour le message (obligatoire) -->
|
|
||||||
<label for="message">Message:</label>
|
|
||||||
<textarea id="message" name="message" required></textarea><br><br>
|
|
||||||
|
|
||||||
<!-- Boutons de soumission et de remise à zéro -->
|
|
||||||
<input type="submit" value="Envoyer">
|
|
||||||
<input type="reset" value="Réinitialiser">
|
|
||||||
</form>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
After Width: | Height: | Size: 10 KiB |
Loading…
Reference in new issue