-
Notifications
You must be signed in to change notification settings - Fork 1
/
account.html
162 lines (157 loc) · 3.92 KB
/
account.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
<!DOCTYPE html>
<html>
<head>
<title>Create your TeaBag account</title>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@300&display=swap" rel="stylesheet">
<link rel='icon' href='https://lb123658.github.io/tea/img/favicon.png' type='image/png'/>
<style>
body {
background: #2F3137;
}
* {
font-family: 'Montserrat', sans-serif;
user-select: none;
-webkit-user-select: none;
color: white;
}
#logo {
position: absolute;
top: 20px;
left: 20px;
width: 200px;
height: 50px;
border-radius: 15px;
background: #5765F2;
border: none;
font-size: 30px;
font-weight: bold;
color: white;
cursor: default;
}
#logo:hover {
border-radius: 7px;
}
#noscript {
position: absolute;
top: 40%;
font-size: 25px;
margin: 0px 50px 0px 50px;
}
#directions {
position: absolute;
top: 20%;
font-size: 20px;
margin: 0px 50px 0px 50px;
width: 360px;
visibility: hidden;
}
.input {
width: 350px;
height: 35px;
font-size: 22px;
background: transparent;
border-style: solid;
border-color: #2F3137 #2F3137 grey #2F3137;
margin-top: 40px;
}
.input:focus {
outline-width: 0;
border-color: #2F3137 #2F3137 white #2F3137;
}
#submit {
width: 150px;
height: 45px;
font-size: 22px;
border-radius: 15px;
background: #5765F2;
border: none;
font-weight: bold;
color: white;
cursor: default;
margin-top: 30px;
opacity: 0.6;
pointer-events: none;
}
#submit:hover {
border-radius: 7px;
}
#tea {
position: absolute;
bottom: 0px;
right: 0px;
width: 100%;
user-select: none;
z-index: -1;
max-height: 650px;
}
input {
-webkit-user-select: auto;
}
#warning {
margin-top: 30px;
font-size: 14px;
}
</style>
</head>
<body>
<button id="logo" onclick="changePage()">TeaBag</button>
<noscript id="noscript">Please turn on JavaScript to play TeaBag</noscript>
<div id="directions">
<p id="p">Create a username to set up TeaBag</p>
<input type="text" autocomplete="off" class="input" placeholder="Enter your username" id="username">
<br>
<input type="password" autocomplete="off" class="input" placeholder="Create a password" id="password">
<br>
<p id="warning"><input type="checkbox" onclick="verify()"> I understand that this will erase all progress and in-game purchases on exising accounts. If you are creating your first account you don't need to worry about this.</p>
<button id="submit" onclick="signIn()">Continue</button>
</div>
<!-- photo on side -->
<img src="https://raw.githubusercontent.com/LB123658/tea/main/img/login.png" id="tea">
<script>
document.getElementById("directions").style.visibility = "visible";
document.getElementById("username").focus();
function verify() {
document.getElementById("submit").style.pointerEvents = "auto";
document.getElementById("submit").style.opacity = "1";
}
function signIn() {
var username = document.getElementById("username");
var password = document.getElementById("password");
// Check browser support
if (typeof(Storage) !== "undefined") {
// Store
localStorage.setItem("account", username.value + ":" + password.value);
// open login page
location.replace("login");
} else {
document.getElementById("submit").innerHTML = "Error";
document.getElementById("p").innerHTML = "You browser failed to save your account info. Please turn on local storage.";
}
//create money storage
localStorage.setItem("money", "0");
// create point storage system
localStorage.setItem("points", "0");
// create storage for owned items
localStorage.setItem("Pota", "0");
localStorage.setItem("Potb", "0");
localStorage.setItem("Potc", "0");
localStorage.setItem("Potd", "0");
localStorage.setItem("Boxa", "0");
localStorage.setItem("Boxb", "0");
localStorage.setItem("Boxc", "0");
localStorage.setItem("Boxd", "0");
localStorage.setItem("Cupa", "0");
localStorage.setItem("Cupb", "0");
localStorage.setItem("Cupc", "0");
localStorage.setItem("Cupd", "0");
localStorage.setItem("third", "");
localStorage.setItem("second", "");
localStorage.setItem("third", "");
}
function changePage() {
location.replace("login");
}
</script>
</body>
</html>