forked from avinash201199/To-Do-List
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
143 lines (123 loc) · 3.24 KB
/
index.html
File metadata and controls
143 lines (123 loc) · 3.24 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Signup</title>
<link rel="stylesheet" href="assets/css/style.css">
<style>
body {
font-family: "Montserrat", sans-serif;
background: linear-gradient(135deg, #4a8cb5 0%, #6a11cb 100%);
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
.signup-container {
background: #fff;
padding: 2.5rem;
border-radius: 15px;
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
width: 350px;
text-align: center;
animation: fadeIn 0.8s ease;
}
.signup-container h2 {
margin-bottom: 1.5rem;
color: #333;
font-weight: 700;
}
label {
display: block;
margin: 10px 0 5px;
text-align: left;
font-size: 0.9rem;
font-weight: 600;
color: #444;
}
input {
width: 100%;
padding: 10px 12px;
margin-bottom: 15px;
border: 1px solid #ddd;
border-radius: 8px;
font-size: 1rem;
outline: none;
transition: 0.2s;
}
input:focus {
border-color: #6a11cb;
box-shadow: 0 0 5px rgba(106, 17, 203, 0.3);
}
button {
width: 100%;
padding: 12px;
border: none;
background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
color: #fff;
border-radius: 8px;
font-size: 1rem;
font-weight: bold;
cursor: pointer;
transition: background 0.3s ease;
}
button:hover {
opacity: 0.9;
}
p {
margin-top: 1rem;
font-size: 0.9rem;
color: #555;
}
p a {
color: #2575fc;
text-decoration: none;
font-weight: 600;
}
p a:hover {
text-decoration: underline;
}
@keyframes fadeIn {
from {opacity: 0; transform: translateY(-10px);}
to {opacity: 1; transform: translateY(0);}
}
</style>
</head>
<body>
<div class="signup-container">
<h2>Create Account</h2>
<form id="signupForm">
<label for="username">Username</label>
<input type="text" id="username" placeholder="Enter your username" required />
<label for="password">Password</label>
<input type="password" id="password" placeholder="Enter your password" required />
<button type="submit">Sign Up</button>
</form>
<p>Already have an account? <a href="login.html">Login here</a></p>
</div>
<script>
document.getElementById("signupForm").addEventListener("submit", function(e) {
e.preventDefault();
const username = document.getElementById("username").value.trim();
const password = document.getElementById("password").value.trim();
if (!username || !password) {
alert("Please enter both username and password");
return;
}
let users = JSON.parse(localStorage.getItem("users") || "{}");
if (users[username]) {
alert("Username already exists. Please choose another one.");
return;
}
users[username] = {
password: password,
tasks: []
};
localStorage.setItem("users", JSON.stringify(users));
alert("Signup successful! Redirecting to login...");
window.location.href = "login.html";
});
</script>
</body>
</html>