forked from HENRYMARTIN5/Clarity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
upload.html
183 lines (149 loc) · 11 KB
/
upload.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
<!DOCTYPE html>
<html>
<title>Clarity Workshop</title>
<meta charset="UTF-8">
<link rel="manifest" href="clarity.webmanifest">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Raleway">
<link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAwAAAAMAAAD/AAAA/wAAAP8AAAD/AAAAAwAAAAMAAAADAAAAA8AAAAPAAAADwAAAA8AAAAPwAAAP8AAAD/wAAD/8AAA//8AD///AA/8=" type="image/x-icon">
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<link href="https://cdn.jsdelivr.net/npm/@sweetalert2/theme-dark@4/dark.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="loaders.css">
<script
src="https://code.jquery.com/jquery-3.6.0.min.js"
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
crossorigin="anonymous"></script>
<style>
body,
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: "Raleway", sans-serif;
color: #FFF
}
textarea {
resize: none;
}
.bkg{
background-color: #1d1b31;
}
.level{
border: 2px solid #d2bdff;
background-color: #3c2d52;
}
</style>
<body class="bkg w3-content" style="max-width:1600px">
<!-- Overlay effect when opening sidebar on small screens -->
<div class="w3-overlay w3-hide-large w3-animate-opacity" onclick="w3_close()" style="cursor:pointer" title="close side menu" id="myOverlay"></div>
<!-- !PAGE CONTENT! -->
<div class="w3-main" style="margin-left:15px">
<!-- Header -->
<header id="portfolio">
<a href="#"><img src="/w3images/avatar_g2.jpg" style="width:65px;" class="w3-circle w3-right w3-margin w3-hide-large w3-hover-opacity"></a>
<span class="w3-button w3-hide-large w3-xxlarge w3-hover-text-grey" onclick="w3_open()"><i class="fa fa-bars"></i></span>
<div class="w3-container">
<h1><b>Clarity Workshop</b></h1><p>Fill in your level information below to upload and publish it!</p><br><br></br><center><a href="account.html">Need an account? Click here!</a></center>
</div>
</header>
<div id="container">
<center>
<p>Level Code:</p>
<input type="text" id="lvlcode">
<p>Level Name:</p>
<input type="text" id="lvlname">
<p>Level Description (Please don't spam, it's just an annoyance):</p>
<textarea type="text" id="lvldesc" rows="4" cols="50"></textarea>
<p>Allow developer commands in level
<input type="checkbox" id="devcommands"></p>
<br></br>
<button class="btn w3-btn w3-ripple w3-blue w3-round-large" id="submitbtn" onclick="submit();">Submit to Workshop</button><br></br><br></br>
</div>
</center>
<!-- End page content -->
</div>
<script>
const submitbtn = document.getElementById("submitbtn");
const lvlcodeinp = document.getElementById("lvlcode");
const lvlnameinp = document.getElementById("lvlname");
const lvldescinp = document.getElementById("lvldesc");
const devcmds = document.getElementById("devcommands");
window.onload = function(){
console.log("Clarity V1.0.1 API/SDK");
}
function httpGet(theUrl)
{
var xmlHttp = new XMLHttpRequest();
xmlHttp.open( "GET", theUrl, false ); // false for synchronous request
xmlHttp.send( null );
return xmlHttp.responseText;
}
function sendJSON(data) {
var json = JSON.stringify(data);
var xhr = new XMLHttpRequest();
xhr.open("POST", "https://clarityworkshop.n3rdl0rd.repl.co/add");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(json);
}
window.onload = function(){
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
if(urlParams.has('lvl')){
lvlcodeinp.value = urlParams.get("lvl");
}
}
function signout(){
localStorage.setItem("user", null);
window.location.href=window.location.href;
}
function signedin(){
return localStorage.getItem("user");
}
function signin(){
Swal.fire({
title: 'Login to Clarity',
html: `<input type="text" id="login" class="swal2-input" placeholder="Username">
<input type="password" id="password" class="swal2-input" placeholder="Password"><br><a href="account.html">No account? Sign up instead!</a>`,
confirmButtonText: 'Login',
focusConfirm: true,
preConfirm: () => {
const login = Swal.getPopup().querySelector('#login').value
const password = Swal.getPopup().querySelector('#password').value
if (!login || !password) {
Swal.showValidationMessage(`Please enter login and password`)
}
return { login: login, password: password }
}
}).then((result) => {
var res = httpGet("https://clarityworkshop.n3rdl0rd.repl.co/login/"+encodeURIComponent(result.value.login)+"/"+encodeURIComponent(result.value.password));
if(res == "ok"){
localStorage.setItem('user', result.value.login);
}else {
Swal.fire({
type: 'error',
title: 'Oops...',
text: 'Incorrect login or password!'
})
}
})
}
function submit(){
if(signedin() == "null" || signedin() == null){
signin();
return;
} else{
var payload = {
"code": lvlcodeinp.value, "name": lvlnameinp.value, "desc": lvldescinp.value, "author": signedin()
}
sendJSON(payload);
alert("Submitted!");
window.location.href="https://discountdevs.github.io/Clarity-Legacy/workshop.html";
}
}
</script>
</body>
</html>