* Password must be at least 8 characters long, contain at least one uppercase letter, one lowercase letter, one number, and one special character.

Or Sign up with social platforms

Or Sign in with social platforms

New here ?

Discover new experiences with AmbuFlow!
Get access to exclusive content and features.
Create your account.

One of us ?

Welcome to our community

Welcome to our community

// Validate inputs if (username === "" || email === "" || password === "") { alert("Please fill in all fields"); return; } // Generate a UUID const userId = uuid.v4(); console.log("Generated UUID:", userId); const data = JSON.stringify({ id: userId, username, email, password, }); console.log(data); // Uncomment the below code when MongoDB is ready /* try { const response = await fetch("http://localhost:3000/signup", { method: "POST", headers: { "Content-Type": "application/json", }, body: data, }); if (!response.ok) { const errorData = await response.json(); throw new Error(errorData.message || "Signup failed"); } const result = await response.json(); console.log("Server response:", result); alert("Signup successful!"); window.location.href = "login.html"; } catch (error) { alert(error.message); console.error("Error during signup:", error); } */ }); // Toggle password visibility function togglePassword(fieldId, icon) { const field = document.getElementById(fieldId); const isPassword = field.type === "password"; // Toggle between 'password' and 'text' field.type = isPassword ? "text" : "password"; // Change the icon class between eye and eye-slash icon.classList.toggle("fa-lock-open", isPassword); icon.classList.toggle("fa-lock", !isPassword); } document .getElementById("toggle-password") .addEventListener("click", function () { togglePassword("password-input", this); }); document .getElementById("toggle-password-signup") .addEventListener("click", function () { togglePassword("password-input-signup", this); }); // Check password strength function checkPasswordStrength() { const password = document.querySelector( ".sign-up-form input[type='password']" ).value; const strengthWeak = document.getElementById("strength-weak"); const strengthMedium = document.getElementById("strength-medium"); const strengthStrong = document.getElementById("strength-strong"); let strength = 0; if (password.length >= 8) strength++; if (password.match(/[A-Z]/)) strength++; if (password.match(/[a-z]/)) strength++; if (password.match(/[0-9]/)) strength++; if (password.match(/[^a-zA-Z0-9]/)) strength++; strengthWeak.className = ""; strengthMedium.className = ""; strengthStrong.className = ""; if (strength >= 1) strengthWeak.className = "weak"; if (strength >= 3) strengthMedium.className = "medium"; if (strength >= 5) strengthStrong.className = "strong"; } document .querySelector(".sign-up-form input[type='password']") .addEventListener("input", checkPasswordStrength); --> Register & Login

New here ?

Discover new experiences with AmbuFlow!
Get access to exclusive content and features.
Create your account.

One of us ?

Welcome to our community