Start working on login UI
This commit is contained in:
parent
03e7a5735a
commit
27887c2a72
@ -38,7 +38,7 @@ function createMainWindow() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
mainWindow.loadFile(path.join(__dirname, "index.html"));
|
mainWindow.loadFile(path.join(__dirname, "views", "login.html"));
|
||||||
|
|
||||||
mainWindow.once("ready-to-show", function () {
|
mainWindow.once("ready-to-show", function () {
|
||||||
mainWindow.show();
|
mainWindow.show();
|
||||||
|
1
src/preload.js
Normal file
1
src/preload.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
const electron = require("electron");
|
11
src/sripts/login.js
Normal file
11
src/sripts/login.js
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
let usernameField;
|
||||||
|
let passwordField;
|
||||||
|
|
||||||
|
function tryAuth() {
|
||||||
|
window.authenticate(usernameField.value, passwordField.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener("load", function () {
|
||||||
|
usernameField = document.querySelector("#username-field");
|
||||||
|
passwordField = document.querySelector("#password-field");
|
||||||
|
});
|
4
src/styles/common.css
Normal file
4
src/styles/common.css
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
:root {
|
||||||
|
background-color: #181820;
|
||||||
|
color: #F8F8FC;
|
||||||
|
}
|
23
src/views/login.html
Normal file
23
src/views/login.html
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en" dir="ltr">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Open Plutonium Launcher</title>
|
||||||
|
<link rel="stylesheet" href="../styles/common.css" />
|
||||||
|
<script src="../scripts/login.js" charset="utf-8" type="text/javascript"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<main>
|
||||||
|
<div>
|
||||||
|
<form>
|
||||||
|
<label for="username">Username :</label>
|
||||||
|
<input type="text" name="username" id="username-field" placeholder="Your Plutonium username" minLength="2" maxLength="64">
|
||||||
|
<label for="password">Password :</label>
|
||||||
|
<input type="text" name="password" id="password-field" placeholder="Your Plutonium password" minLength="2" maxLength="64">
|
||||||
|
<span>Create an account at <a href="https://forum.plutonium.pw/register" target="_blank">https://forum.plutonium.pw/register</a> if you don't have one.</span>
|
||||||
|
<input type="button" value="Log in" onclick="tryAuth();">
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in New Issue
Block a user