formulaire / index.html
Adamchab's picture
undefined - Initial Deployment
59db631 verified
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Formulaire d'inscription Premium</title>
<!-- Importation de Tailwind CSS -->
<script src="https://cdn.tailwindcss.com"></script>
<!-- Importation de la police Inter de Google Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
<!-- Importation des icônes Heroicons -->
<script src="https://unpkg.com/@heroicons/[email protected]/dist/heroicons.js"></script>
<style>
/* Appliquer la police Inter comme police par défaut */
body {
font-family: 'Inter', sans-serif;
background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}
/* Animation pour le bouton */
@keyframes pulse {
0% { transform: scale(1); }
50% { transform: scale(1.05); }
100% { transform: scale(1); }
}
.pulse:hover {
animation: pulse 1.5s infinite;
}
/* Style personnalisé pour les messages d'erreur */
.error-message {
display: none;
color: #ef4444;
font-size: 0.875rem;
margin-top: 0.25rem;
}
/* Style pour les champs valides/invalides */
.input-valid {
border-color: #10b981;
box-shadow: 0 0 0 1px #10b981;
}
.input-invalid {
border-color: #ef4444;
box-shadow: 0 0 0 1px #ef4444;
}
/* Style pour la force du mot de passe */
.password-strength {
height: 4px;
margin-top: 0.5rem;
border-radius: 2px;
transition: all 0.3s ease;
}
.strength-0 {
width: 20%;
background-color: #ef4444;
}
.strength-1 {
width: 40%;
background-color: #f59e0b;
}
.strength-2 {
width: 60%;
background-color: #f59e0b;
}
.strength-3 {
width: 80%;
background-color: #10b981;
}
.strength-4 {
width: 100%;
background-color: #10b981;
}
</style>
</head>
<body class="flex items-center justify-center min-h-screen p-4">
<!-- Conteneur principal du formulaire -->
<div class="w-full max-w-lg bg-white rounded-2xl shadow-xl overflow-hidden">
<!-- Bandeau coloré en haut -->
<div class="bg-gradient-to-r from-indigo-500 to-purple-600 h-2"></div>
<div class="p-8 space-y-6">
<!-- En-tête du formulaire avec icône -->
<div class="text-center">
<div class="mx-auto flex items-center justify-center h-12 w-12 rounded-full bg-indigo-100 mb-4">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 text-indigo-600" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 11c0 3.517-1.009 6.799-2.753 9.571m-3.44-2.04l.054-.09A13.916 13.916 0 008 11a4 4 0 118 0c0 1.017-.07 2.019-.203 3m-2.118 6.844A21.88 21.88 0 0015.171 17m3.839 1.132c.645-2.266.99-4.659.99-7.132A8 8 0 008 4.07M3 15.364c.64-1.319 1-2.8 1-4.364 0-1.457.39-2.823 1.07-4" />
</svg>
</div>
<h1 class="text-3xl font-bold text-gray-900">Rejoignez notre communauté</h1>
<p class="mt-2 text-sm text-gray-600">
Commencez votre voyage avec nous en créant un compte
</p>
</div>
<!-- Formulaire -->
<form id="registration-form" class="space-y-6" action="#" method="POST">
<!-- Champs Nom et Prénom sur la même ligne -->
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label for="first-name" class="block text-sm font-medium text-gray-700 mb-1">Prénom</label>
<div class="relative">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" />
</svg>
</div>
<input id="first-name" name="first-name" type="text" required
class="pl-10 mt-1 block w-full px-3 py-2 bg-white border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm transition duration-150 ease-in-out"
placeholder="Jean">
</div>
<div id="first-name-error" class="error-message">Veuillez entrer un prénom valide</div>
</div>
<div>
<label for="last-name" class="block text-sm font-medium text-gray-700 mb-1">Nom</label>
<div class="relative">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" />
</svg>
</div>
<input id="last-name" name="last-name" type="text" required
class="pl-10 mt-1 block w-full px-3 py-2 bg-white border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm transition duration-150 ease-in-out"
placeholder="Dupont">
</div>
<div id="last-name-error" class="error-message">Veuillez entrer un nom valide</div>
</div>
</div>
<!-- Champ Email -->
<div>
<label for="email" class="block text-sm font-medium text-gray-700 mb-1">Adresse e-mail</label>
<div class="relative">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" />
</svg>
</div>
<input id="email" name="email" type="email" autocomplete="email" required
class="pl-10 mt-1 block w-full px-3 py-2 bg-white border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm transition duration-150 ease-in-out"
placeholder="[email protected]">
</div>
<div id="email-error" class="error-message">Veuillez entrer une adresse email valide</div>
</div>
<!-- Champ Mot de passe -->
<div>
<label for="password" class="block text-sm font-medium text-gray-700 mb-1">Mot de passe</label>
<div class="relative">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" />
</svg>
</div>
<input id="password" name="password" type="password" autocomplete="new-password" required
class="pl-10 mt-1 block w-full px-3 py-2 bg-white border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm transition duration-150 ease-in-out"
placeholder="********">
<button type="button" id="toggle-password" class="absolute inset-y-0 right-0 pr-3 flex items-center">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-gray-400 hover:text-gray-500" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" />
</svg>
</button>
</div>
<div id="password-error" class="error-message">Le mot de passe doit contenir au moins 8 caractères</div>
<div class="password-strength-container mt-2">
<div id="password-strength" class="password-strength strength-0"></div>
<div id="password-hints" class="text-xs text-gray-500 mt-1">
<div class="flex items-center mt-1">
<svg id="length-check" class="h-4 w-4 text-gray-300 mr-1" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
</svg>
<span>8 caractères minimum</span>
</div>
<div class="flex items-center mt-1">
<svg id="uppercase-check" class="h-4 w-4 text-gray-300 mr-1" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
</svg>
<span>1 lettre majuscule</span>
</div>
<div class="flex items-center mt-1">
<svg id="number-check" class="h-4 w-4 text-gray-300 mr-1" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
</svg>
<span>1 chiffre</span>
</div>
</div>
</div>
</div>
<!-- Champ Confirmer le mot de passe -->
<div>
<label for="confirm-password" class="block text-sm font-medium text-gray-700 mb-1">Confirmer le mot de passe</label>
<div class="relative">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" />
</svg>
</div>
<input id="confirm-password" name="confirm-password" type="password" autocomplete="new-password" required
class="pl-10 mt-1 block w-full px-3 py-2 bg-white border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm transition duration-150 ease-in-out"
placeholder="********">
</div>
<div id="confirm-password-error" class="error-message">Les mots de passe ne correspondent pas</div>
</div>
<!-- Case à cocher pour les conditions -->
<div class="flex items-start">
<div class="flex items-center h-5">
<input id="terms-and-conditions" name="terms-and-conditions" type="checkbox" required
class="focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300 rounded">
</div>
<div class="ml-3 text-sm">
<label for="terms-and-conditions" class="font-medium text-gray-700">
J'accepte les <a href="#" class="text-indigo-600 hover:text-indigo-500">termes et conditions</a> et la <a href="#" class="text-indigo-600 hover:text-indigo-500">politique de confidentialité</a>.
</label>
</div>
</div>
<div id="terms-error" class="error-message">Vous devez accepter les termes et conditions</div>
<!-- Bouton de soumission -->
<div>
<button type="submit" id="submit-button"
class="pulse w-full flex justify-center py-3 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-gradient-to-r from-indigo-600 to-purple-600 hover:from-indigo-700 hover:to-purple-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 transition-all duration-200 transform hover:scale-[1.02]">
Créer mon compte
</button>
</div>
</form>
<!-- Séparateur -->
<div class="relative">
<div class="absolute inset-0 flex items-center">
<div class="w-full border-t border-gray-300"></div>
</div>
<div class="relative flex justify-center text-sm">
<span class="px-2 bg-white text-gray-500">Ou continuez avec</span>
</div>
</div>
<!-- Boutons de connexion sociale -->
<div class="grid grid-cols-2 gap-3">
<button type="button" class="w-full inline-flex justify-center py-2 px-4 border border-gray-300 rounded-md shadow-sm bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 transition-colors duration-150">
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20" aria-hidden="true">
<path fill-rule="evenodd" d="M20 10c0-5.523-4.477-10-10-10S0 4.477 0 10c0 4.991 3.657 9.128 8.438 9.878v-6.987h-2.54V10h2.54V7.797c0-2.506 1.492-3.89 3.777-3.89 1.094 0 2.238.195 2.238.195v2.46h-1.26c-1.243 0-1.63.771-1.63 1.562V10h2.773l-.443 2.89h-2.33v6.988C16.343 19.128 20 14.991 20 10z" clip-rule="evenodd" />
</svg>
<span class="ml-2">Facebook</span>
</button>
<button type="button" class="w-full inline-flex justify-center py-2 px-4 border border-gray-300 rounded-md shadow-sm bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 transition-colors duration-150">
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20" aria-hidden="true">
<path d="M6.29 18.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0020 3.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.073 4.073 0 01.8 7.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 010 16.407a11.616 11.616 0 006.29 1.84" />
</svg>
<span class="ml-2">Twitter</span>
</button>
</div>
<!-- Lien de connexion -->
<p class="text-center text-sm text-gray-600">
Vous avez déjà un compte ?
<a href="#" class="font-medium text-indigo-600 hover:text-indigo-500 transition-colors duration-150">
Se connecter
</a>
</p>
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
// Références aux éléments du DOM
const form = document.getElementById('registration-form');
const passwordInput = document.getElementById('password');
const confirmPasswordInput = document.getElementById('confirm-password');
const togglePasswordButton = document.getElementById('toggle-password');
const passwordStrengthBar = document.getElementById('password-strength');
const termsCheckbox = document.getElementById('terms-and-conditions');
const submitButton = document.getElementById('submit-button');
// Icônes de vérification du mot de passe
const lengthCheck = document.getElementById('length-check');
const uppercaseCheck = document.getElementById('uppercase-check');
const numberCheck = document.getElementById('number-check');
// Fonction pour basculer la visibilité du mot de passe
togglePasswordButton.addEventListener('click', function() {
const type = passwordInput.getAttribute('type') === 'password' ? 'text' : 'password';
passwordInput.setAttribute('type', type);
confirmPasswordInput.setAttribute('type', type);
// Changer l'icône
const icon = togglePasswordButton.querySelector('svg');
if (type === 'text') {
icon.innerHTML = '<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21" />';
} else {
icon.innerHTML = '<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" /><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" />';
}
});
// Validation en temps réel du mot de passe
passwordInput.addEventListener('input', function() {
const password = passwordInput.value;
let strength = 0;
// Vérifier la longueur
if (password.length >= 8) {
strength += 1;
lengthCheck.classList.remove('text-gray-300');
lengthCheck.classList.add('text-green-500');
} else {
lengthCheck.classList.remove('text-green-500');
lengthCheck.classList.add('text-gray-300');
}
// Vérifier les majuscules
if (/[A-Z]/.test(password)) {
strength += 1;
uppercaseCheck.classList.remove('text-gray-300');
uppercaseCheck.classList.add('text-green-500');
} else {
uppercaseCheck.classList.remove('text-green-500');
uppercaseCheck.classList.add('text-gray-300');
}
// Vérifier les chiffres
if (/[0-9]/.test(password)) {
strength += 1;
numberCheck.classList.remove('text-gray-300');
numberCheck.classList.add('text-green-500');
} else {
numberCheck.classList.remove('text-green-500');
numberCheck.classList.add('text-gray-300');
}
// Vérifier les caractères spéciaux
if (/[^A-Za-z0-9]/.test(password)) {
strength += 1;
}
// Mettre à jour la barre de force
passwordStrengthBar.className = 'password-strength strength-' + strength;
// Valider la confirmation du mot de passe
validateConfirmPassword();
});
// Validation de la confirmation du mot de passe
confirmPasswordInput.addEventListener('input', validateConfirmPassword);
function validateConfirmPassword() {
const password = passwordInput.value;
const confirmPassword = confirmPasswordInput.value;
const errorElement = document.getElementById('confirm-password-error');
if (confirmPassword && password !== confirmPassword) {
confirmPasswordInput.classList.add('input-invalid');
confirmPasswordInput.classList.remove('input-valid');
errorElement.style.display = 'block';
} else if (confirmPassword) {
confirmPasswordInput.classList.add('input-valid');
confirmPasswordInput.classList.remove('input-invalid');
errorElement.style.display = 'none';
} else {
confirmPasswordInput.classList.remove('input-valid', 'input-invalid');
errorElement.style.display = 'none';
}
}
// Validation des termes et conditions
termsCheckbox.addEventListener('change', function() {
const errorElement = document.getElementById('terms-error');
if (termsCheckbox.checked) {
errorElement.style.display = 'none';
} else {
errorElement.style.display = 'block';
}
});
// Validation du formulaire avant soumission
form.addEventListener('submit', function(e) {
e.preventDefault();
let isValid = true;
// Valider le prénom
const firstName = document.getElementById('first-name').value;
const firstNameError = document.getElementById('first-name-error');
if (!firstName || firstName.length < 2) {
firstNameError.style.display = 'block';
isValid = false;
} else {
firstNameError.style.display = 'none';
}
// Valider le nom
const lastName = document.getElementById('last-name').value;
const lastNameError = document.getElementById('last-name-error');
if (!lastName || lastName.length < 2) {
lastNameError.style.display = 'block';
isValid = false;
} else {
lastNameError.style.display = 'none';
}
// Valider l'email
const email = document.getElementById('email').value;
const emailError = document.getElementById('email-error');
if (!email || !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) {
emailError.style.display = 'block';
isValid = false;
} else {
emailError.style.display = 'none';
}
// Valider le mot de passe
const password = passwordInput.value;
const passwordError = document.getElementById('password-error');
if (!password || password.length < 8) {
passwordError.style.display = 'block';
isValid = false;
} else {
passwordError.style.display = 'none';
}
// Valider la confirmation du mot de passe
validateConfirmPassword();
if (password !== confirmPasswordInput.value) {
isValid = false;
}
// Valider les termes et conditions
if (!termsCheckbox.checked) {
document.getElementById('terms-error').style.display = 'block';
isValid = false;
}
// Si tout est valide, soumettre le formulaire
if (isValid) {
// Animation du bouton de soumission
submitButton.innerHTML = '<svg class="animate-spin -ml-1 mr-3 h-5 w-5 text-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg> Création du compte...';
submitButton.disabled = true;
// Simulation d'une requête AJAX
setTimeout(function() {
alert('Formulaire soumis avec succès ! (Ceci est une démonstration)');
submitButton.innerHTML = 'Créer mon compte';
submitButton.disabled = false;
}, 2000);
}
});
// Effets visuels pour les champs au focus
const inputs = form.querySelectorAll('input');
inputs.forEach(input => {
input.addEventListener('focus', function() {
this.parentElement.classList.add('ring-2', 'ring-indigo-200');
});
input.addEventListener('blur', function() {
this.parentElement.classList.remove('ring-2', 'ring-indigo-200');
});
});
});
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Adamchab/formulaire" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>