-
Notifications
You must be signed in to change notification settings - Fork 0
/
signin.html
206 lines (194 loc) · 8.17 KB
/
signin.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
195
196
197
198
199
200
201
202
203
204
205
206
<!DOCTYPE html>
<html>
<head>
<title>Xylz Challenge List | Sign In</title>
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon-16x16.png">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-3.7.0.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/2.1.4/toastr.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/2.1.4/toastr.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
.form {
background-color: #fff;
padding: 1rem;
max-width: 350px;
border-radius: 0.5rem;
box-shadow: 0 10px 30px 5px rgba(0, 0, 0, 0.2);
}
.form-title {
font-size: 1.25rem;
line-height: 1.75rem;
font-weight: 600;
text-align: center;
color: #000;
}
.input-container {
position: relative;
}
.input-container input, .form button {
outline: none;
border: 1px solid #e5e7eb;
margin: 8px 0;
}
.input-container input {
background-color: #fff;
padding: 1rem;
padding-right: 3rem;
font-size: 0.875rem;
line-height: 1.25rem;
width: 300px;
border-radius: 0.5rem;
}
.submit {
display: block;
padding-top: 0.75rem;
padding-bottom: 0.75rem;
padding-left: 1.25rem;
padding-right: 1.25rem;
background-color: #4F46E5;
color: #ffffff;
font-size: 0.875rem;
line-height: 1.25rem;
font-weight: 500;
width: 100%;
border-radius: 0.5rem;
text-transform: uppercase;
}
.signup-link {
color: #6B7280;
font-size: 0.875rem;
line-height: 1.25rem;
text-align: center;
}
.signup-link a {
text-decoration: underline;
}
</style>
</head>
<body>
<div class="header">
<a id="home-link" href="index.html">
<div class="left-section">
<img class="main-icon" src="icons/xylzicon.png">
<div class="main-title">xylz</div>
</div>
</a>
<div class="middle-section">
<a href="https://www.twitch.tv/xylzlol" target="_blank">
<img src="icons/logo--twitch.svg" alt="Twitch icon" class="twitch-icon">
</a>
<a href="https://www.youtube.com/xylzz" target="_blank">
<img src="icons/logo--youtube.svg" alt="Youtube icon" class="youtube-icon">
</a>
<a href="https://discord.com/invite/HMjWaGh" target="_blank">
<img src="icons/logo--discord.svg" alt="Discord icon" class="discord-icon">
</a>
<a href="https://twitter.com/Xylz97751031" target="_blank">
<img src="icons/logo--twitter.svg" alt="Twitter icon" class="twitter-icon">
</a>
</div>
<div class="right-section">
<button class="button-54" role="button" onclick="window.location.href='legacy.html'">legacy</button>
<button class="button-54" role="button" onclick="window.location.href='/leaderboard.html'">Leaderboard</button>
</div>
<div class="hamburger-menu">
<input type="checkbox" id="checkbox">
<label for="checkbox" class="toggle">
<div class="bar bar--top"></div>
<div class="bar bar--middle"></div>
<div class="bar bar--bottom"></div>
</label>
<ul class="menu">
<li role="button" onclick="window.location.href='/leaderboard.html'">Leaderboard</li>
<li role="button" onclick="window.location.href='/legacy.html'">Legacy</li>
<li role="button" class="loggedOutButtons" onclick="window.location.href='/signin.html'">Sign in</li>
<li role="button" class="loggedOutButtons" onclick="window.location.href='/signup.html'">Sign Up</li>
<li role="button" class="loggedInButton" onclick="window.location.href='/account.html'">Account</li>
</ul>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-6 offset-md-4">
<form class="form" id="signInForm">
<p class="form-title">Sign in to your account</p>
<div class="input-container">
<input type="text" id="username" placeholder="Enter username" class="form-control">
</div>
<div class="input-container">
<input type="password" id="password" placeholder="Enter password" class="form-control">
</div>
<button type="submit" class="submit btn btn-primary">Sign in</button>
<p class="signup-link">
No account?
<a href="/signup.html">Sign up</a>
</p>
</form>
</div>
</div>
</div>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<script type="module">
import { API_URL } from './js/config.js';
document.getElementById('signInForm').addEventListener('submit', function(event) {
event.preventDefault();
var username = document.getElementById('username').value;
var password = document.getElementById('password').value;
fetch(`${API_URL}/rest/sign-in`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
username: username,
password: password
})
})
.then(response => response.json())
.then(data => {
if (data.token) {
localStorage.setItem('userToken', data.token);
localStorage.setItem('justLoggedIn', 'true');
toastr.success('Signed in successfully.');
// Optionally, redirect to a dashboard or main page
window.location.href = '/';
} else {
toastr.error(data.message);
}
})
.catch(() => {
toastr.error('There was an error signing in.');
});
});
</script>
<link rel="stylesheet" href="css/main.css" defer>
<link rel="stylesheet" href="css/header.css" defer>
<link rel="stylesheet" href="css/embed.css" defer>
<link rel="stylesheet" href="css/sidebar.css" defer>
<link rel="stylesheet" href="css/middle.css" defer>
<link rel="stylesheet" href="css/footer.css" defer>
<script type="module" data-cfasync="false" src="js/authCheck.js" defer></script>
<script src='https://unpkg.com/trianglify@^4/dist/trianglify.bundle.js'></script>
<script>
var pattern = trianglify({
width: window.innerWidth,
height: window.innerHeight,
cellSize: 200, // Adjust this value as needed
xColors: ['#ffb727', '#ff6347', '#75ca4e'], // More contrasting colors
colorFunction: trianglify.colorFunctions.interpolateLinear(0.5),
seed: Math.random().toString(36).substring(7)
});
document.body.style.backgroundImage = 'url(' + pattern.toCanvas().toDataURL() + ')';
document.body.style.backgroundColor = '#ffffff'; // Set a background color
</script>
</body>
</html>