-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
104 lines (102 loc) · 3.23 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Hary - Javascript Assignment</title>
<link
rel="shortcut icon"
href="https://hary-portfolio.000webhostapp.com/assets/img/icon-nama.png"
type="image/x-icon"
/>
<link rel="stylesheet" href="./src/css/login.css" />
</head>
<body>
<div class="login-wrap">
<div class="login-html">
<input
id="tab-1"
type="radio"
name="tab"
class="sign-in"
checked
/><label for="tab-1" class="tab">Sign In</label>
<input id="tab-2" type="radio" name="tab" class="sign-up" /><label
for="tab-2"
class="tab"
>Sign Up</label
>
<div class="login-form">
<!-- signin -->
<form id="login-form">
<div class="sign-in-htm">
<div id="login-status" class="alert">Registrasi berhasil.</div>
<div class="group">
<label for="login-username" class="label">Username</label>
<input id="login-username" type="text" class="input" required />
</div>
<div class="group">
<label for="login-password" class="label">Password</label>
<input
id="login-password"
type="password"
class="input"
data-type="password"
/>
</div>
<div class="group">
<button type="submit" class="button">Login</button>
</div>
</div>
</form>
<!-- end signin -->
<!-- register -->
<form id="registration-form">
<div class="sign-up-htm">
<div id="registrationStatus" class="alert">
Registrasi berhasil.
</div>
<div class="group">
<label for="register-username" class="label">Username</label>
<input
id="register-username"
type="text"
class="input"
required
/>
</div>
<div class="group">
<label for="register-password" class="label">Password</label>
<input
id="register-password"
type="password"
class="input"
data-type="password"
required
/>
</div>
<div class="group">
<button type="submit" class="button">Register</button>
</div>
</div>
</form>
<!-- end register -->
</div>
</div>
</div>
<script src="./src/js/signin_up.js"></script>
<script>
// check loggedinUser
function checkLoggedInUser() {
const loggedInUser = localStorage.getItem("loggedInUser");
const user = JSON.parse(loggedInUser);
if (user.status_login == "on") {
if (user.role !== "admin") {
window.location.href = "index.html";
}
}
}
checkLoggedInUser();
</script>
</body>
</html>