-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
57 lines (53 loc) · 2.37 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login Page</title>
<link rel="stylesheet" href="css/styles.css">
</head>
<body>
<div class="container">
<div class="logo">
<span class="preprod">preprod</span>
<span class="emulet-box"><span class="emulet">Emulet</span></span>
</div>
<div class="login-form">
<form id="loginForm">
<input type="text" id="username" name="username" placeholder="Username" required>
<input type="password" id="password" name="password" placeholder="Password" required><br><br><br>
<div class="error-message" id="errorMessage">Invalid username or password.</div><br>
<input type="submit" value="Sign in">    <br><br>
<!-- <input type="button" value="Sign Up" onclick="window.location.href='signup.html'"> -->
<div class="or-container">
<span class="or-text">OR</span>
<span class="signup-text">If you don't have an account, <a href="signup.html">Sign Up</a></span>
</div>
</form>
</div>
<div class="footer-image">
<span class="powered-by">powered by<br></span>
<strong><img src="https://assets.zyrosite.com/cdn-cgi/image/format=auto,w=404,fit=crop,q=95/AGB32Jx3yetEQB4M/wallpapers-7-AoPGzq981wh4PLnV.png" alt="Footer Image"></strong>
</div>
</div>
<!-- index.html -->
<script>
const { ipcRenderer } = require('electron');
document.getElementById('loginForm').addEventListener('submit', (e) => {
e.preventDefault();
const username = document.getElementById('username').value;
const password = document.getElementById('password').value;
ipcRenderer.send('login', username, password);
});
ipcRenderer.on('login-error', (event, message) => {
const errorMessage = document.getElementById('errorMessage');
errorMessage.textContent = message;
errorMessage.style.display = 'block';
});
ipcRenderer.on('login-success', (event, message) => {
console.log(message);
window.location.href = 'pages.html';
});
</script>
</body>
</html>