-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsignup.html
More file actions
45 lines (44 loc) · 1.68 KB
/
signup.html
File metadata and controls
45 lines (44 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sign Up</title>
<style>
body {
font-family: 'Segoe UI', sans-serif;
background: linear-gradient(120deg,#89f7fe,#66a6ff);
height: 100vh;display:flex;justify-content:center;align-items:center;
}
.container {
background:white;padding:30px;border-radius:15px;width:350px;
box-shadow:0 4px 15px rgba(0,0,0,.3);
}
h2{text-align:center;color:#1d3557;}
input,button{width:100%;padding:10px;margin-top:10px;
font-size:16px;border-radius:8px;border:1px solid #ccc;}
button{background:#457b9d;color:white;cursor:pointer;}
button:hover{background:#1d3557;}
.link{text-align:center;margin-top:15px;}
</style>
</head>
<body>
<div class="container">
<h2>Create Account</h2>
<input type="text" id="username" placeholder="Username" required>
<input type="password" id="password" placeholder="Password" required>
<button type="button" id="signupBtn">Sign Up</button>
<div class="link">Already have an account? <a href="login.html">Login</a></div>
</div>
<script>
document.getElementById("signupBtn").addEventListener("click",()=>{
const u=document.getElementById("username").value.trim();
const p=document.getElementById("password").value.trim();
if(!u||!p){alert("Please fill all fields");return;}
if(localStorage.getItem(u)){alert("Username already exists");return;}
localStorage.setItem(u,JSON.stringify({password:p,reminders:[]}));
alert("✅ Account created successfully!");window.location.href="login.html";
});
</script>
</body>
</html>