-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
43 lines (40 loc) · 1.4 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<p>Login or register to compare beers</p>
<a id="login" href="/users/login">Login</a>
<a id="register" href="/users/register">Register</a>
<a id="logout" href="/users/logout">Log out</a>
<a id="comparisons" href="/comparisons">All Comparisons</a>
<a id="my_comparisons" href="/comparisons/users">My Comparisons</a>
<h2>Input two valid Untappd usernames</h2>
<p>If you don't know any, you can use i.e. 'pawcio', 'birr0nauta', 'CJOD', 'dreamt12', 'jimmyjames360',
'athingcalledjoe'</p>
<form method="post" action="/comparisons">
<label for="user1">User 1</label>
<input type="text" name="user1" id="user1">
<br>
<label for="user2">User 2</label>
<input type="text" name="user2" id="user2">
<br>
<button type="submit">Submit</button>
</form>
<script>
const cookies = document.cookie.split(';')
const loggedIn = cookies.find(cookie => cookie.includes("loggedIn"))
if (loggedIn) {
login.hidden = true
register.hidden = true
} else {
logout.hidden = true
comparions.hidden = true
my_comparisons.hideen = true
}
</script>
</body>
</html>