94 lines
3.5 KiB
HTML
94 lines
3.5 KiB
HTML
{{define "login"}}
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Login ~ PixelDrain</title>
|
|
<meta charset="UTF-8"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
|
<link rel="stylesheet" href="/global.css"/>
|
|
<link rel="stylesheet" href="/res/style/layout.css"/>
|
|
<link href='https://fonts.googleapis.com/css?family=Ubuntu' rel='stylesheet' type='text/css'/>
|
|
<link href="https://fonts.googleapis.com/css?family=Lato:100" rel="stylesheet" type="text/css"/>
|
|
<link rel="shortcut icon" href="/res/img/tray32.png"/>
|
|
<meta name="theme-color" content="#9FCF6C"/>
|
|
<link rel="icon" sizes="180x180" href="/res/img/pixeldrain.png"/>
|
|
<link rel="icon" sizes="256x256" href="/res/img/pixeldrain_big.png"/>
|
|
{{template "bgpattern"}}
|
|
|
|
<meta name="description" content="PixelDrain is a free file sharing service, you
|
|
can upload any file and you will be given a shareable link right away.
|
|
PixelDrain also supports previews for images, videos, audio, PDFs and much more.
|
|
Uncensored, unmonitored and unmoderated."/>
|
|
<meta property="og:type" content="website" />
|
|
<meta property="og:title" content="Login ~ PixelDrain" />
|
|
<meta property="og:site_name" content="PixelDrain" />
|
|
<meta property="og:description" content="Instant file and screenshot sharing." />
|
|
<meta property="og:url" content="http://pixeldra.in/" />
|
|
<meta property="og:image" content="/res/img/pixeldrain_big.png" />
|
|
<meta property="og:image:type" content="image/png" />
|
|
|
|
<script type="text/javascript">var apiEndpoint = '{{.APIEndpoint}}';</script>
|
|
</head>
|
|
|
|
<body>
|
|
<div id='body' class="body">
|
|
{{template "menu" .}}
|
|
|
|
<h1>Log in to your PixelDrain account</h1>
|
|
<div id="submit_result"></div>
|
|
<form onSubmit="return submitForm();" class="highlight_dark border_top border_bottom">
|
|
<table style="margin-left: auto; margin-right: auto;">
|
|
<tr>
|
|
<td>Username</td>
|
|
<td><input id="username" name="username" type="text" autocomplete="username" value=""/></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Password</td>
|
|
<td><input id="password" name="password" type="password" autocomplete="current-password"/></td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan=2 style="text-align: right;"><input type="submit" value="Login" class="button_highlight"/></td>
|
|
</tr>
|
|
</table>
|
|
</form>
|
|
<br/>
|
|
If you don't have a PixelDrain account yet, you can <a href="/register">register here</a>. No e-mail address is required.<br/>
|
|
{{template "footer"}}
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
|
function submitForm(){
|
|
var req = new XMLHttpRequest();
|
|
req.onreadystatechange = function(){
|
|
if (this.readyState === 4) {
|
|
var response = JSON.parse(req.responseText);
|
|
var resultDiv = document.getElementById("submit_result");
|
|
if (response.success) {
|
|
resultDiv.className = "border_top border_bottom highlight_green";
|
|
resultDiv.innerHTML = 'Success! Proceeding to user portal...<br/>'
|
|
+'<a href="/user">Click here if you are not redirected automatically</a>';
|
|
window.location.href = "/user";
|
|
} else {
|
|
resultDiv.className = "border_top border_bottom highlight_red";
|
|
resultDiv.innerHTML = response.message;
|
|
}
|
|
|
|
console.log(response);
|
|
}
|
|
}
|
|
|
|
var data = new FormData();
|
|
data.append("username", document.getElementById("username").value);
|
|
data.append("password", document.getElementById("password").value);
|
|
|
|
req.open("POST", apiEndpoint+"/user/login", true);
|
|
req.send(data);
|
|
|
|
return false;
|
|
}
|
|
</script>
|
|
{{template "analytics"}}
|
|
</body>
|
|
</html>
|
|
{{end}}
|