forked from anuragverma108/WildGuard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Loginpage.html
194 lines (179 loc) · 6.8 KB
/
Loginpage.html
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>WildGuard Sign In / Sign Up</title>
<style>
body {
font-family: 'Arial', sans-serif;
background-image: url(assets/images/zebras.jpg);
background-size:cover;
background-position: center;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
color: #000000;
}
.container {
background: rgba(245, 245, 245, 0.875);
padding: 2.2rem;
border-radius: 12px;
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
width: 350px;
text-align: center;
}
h1 {
color: #016c60;
margin-bottom: 1rem;
font-size: 1.5rem;
}
.form-group {
margin-bottom: 1rem;
text-align: left;
}
label {
display: block;
margin-bottom: 0.5rem;
font-weight: bold;
}
input {
width: 100%;
padding: 0.5rem;
border: 2px solid #ccc;
border-radius: 4px;
transition: border-color 0.3s, box-shadow 0.3s;
}
input:focus {
border-color: #06796b32;
box-shadow: 0 0 5px rgba(0, 121, 107, 0.5);
outline: none;
}
button {
width: 100%;
padding: 0.85rem;
background-color: #00796b;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.3s, transform 0.3s;
}
button:hover {
background-color: #01463a78;
transform: translateY(-2px);
}
/* New Social Login Button Styles */
.social-login { /* <-- added for social login section */
margin-top: 1rem;
}
.social-btn { /* <-- added for social button styling */
width: 100%;
padding: 0.7rem;
margin-bottom: 0.5rem;
border: none;
border-radius: 4px;
cursor: pointer;
}
.google-btn { /* <-- added Google button style */
background-color: #db4437;
color: white;
}
.facebook-btn { /* <-- added Facebook button style */
background-color: #4267b2;
color: white;
}
.twitter-btn { /* <-- added Twitter button style */
background-color: #1da1f2;
color: white;
}
.message {
margin-top: 1rem;
font-weight: bold;
min-height: 1.5rem;
}
.toggle-link {
margin-top: 1rem;
cursor: pointer;
color: #25500a;
}
</style>
</head>
<body>
<div class="container">
<h1 id="formTitle">Sign In</h1>
<form id="authForm">
<div class="form-group">
<label for="username">Username:</label>
<input type="text" id="username" required>
</div>
<div class="form-group">
<label for="password">Password:</label>
<input type="password" id="password" required>
</div>
<button type="submit">Sign In</button>
<p id="message" class="message"></p>
<p class="toggle-link" id="toggleLink">Don't have an account? Sign Up</p>
</form>
<!-- Social Login Buttons (New Section) -->
<div class="social-login"> <!-- Added for social login buttons -->
<button class="social-btn google-btn" id="googleSignIn">Continue with Google</button> <!-- Google button -->
<button class="social-btn facebook-btn" id="facebookSignIn">Continue with Facebook</button> <!-- Facebook button -->
<button class="social-btn twitter-btn" id="twitterSignIn">Continue with Twitter</button> <!-- Twitter button -->
</div>
</div>
<script>
const authForm = document.getElementById('authForm');
const formTitle = document.getElementById('formTitle');
const messageElement = document.getElementById('message');
const toggleLink = document.getElementById('toggleLink');
const validCredentials = { username: 'admin', password: 'password' };
authForm.addEventListener('submit', function(event) {
event.preventDefault();
const username = document.getElementById('username').value;
const password = document.getElementById('password').value;
if (formTitle.textContent === 'Sign In') {
// Sign In Logic
if (username === validCredentials.username && password === validCredentials.password) {
messageElement.textContent = 'Login successful!';
messageElement.style.color = 'green';
} else {
messageElement.textContent = 'Invalid username or password.';
messageElement.style.color = 'red';
}
} else {
// Sign Up Logic (for demonstration purposes)
messageElement.textContent = 'Account created! You can now sign in.';
messageElement.style.color = 'green';
}
});
toggleLink.addEventListener('click', function() {
if (formTitle.textContent === 'Sign In') {
formTitle.textContent = 'Sign Up';
toggleLink.textContent = 'Already have an account? Sign In';
document.querySelector('button').textContent = 'Sign Up';
messageElement.textContent = ''; // Clear message
} else {
formTitle.textContent = 'Sign In';
toggleLink.textContent = "Don't have an account? Sign Up";
document.querySelector('button').textContent = 'Sign In';
messageElement.textContent = ''; // Clear message
}
});
// Placeholder function for Google sign-in
document.getElementById('googleSignIn').addEventListener('click', function () {
alert('Google Sign In functionality coming soon!');
});
// Placeholder function for Facebook sign-in
document.getElementById('facebookSignIn').addEventListener('click', function () {
alert('Facebook Sign In functionality coming soon!');
});
// Placeholder function for Twitter sign-in
document.getElementById('twitterSignIn').addEventListener('click', function () {
alert('Twitter Sign In functionality coming soon!');
});
</script>
</body>
</html>