Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 134 additions & 0 deletions src/frontend/templates/Login_signup
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Budget App Login</title>
<style>
* {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to have a unified style for the whole site, which is in '../static/styles.css'

box-sizing: border-box;
font-family: Arial, sans-serif;
}

body {
margin: 0;
padding: 0;
background-color: #f4f6f8;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}

.container {
width: 350px;
background-color: white;
padding: 30px;
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

h2 {
text-align: center;
margin-bottom: 20px;
color: #333;
}

.form {
display: none;
}

.form.active {
display: block;
}

input {
width: 100%;
padding: 12px;
margin: 8px 0;
border: 1px solid #ccc;
border-radius: 8px;
}

button {
width: 100%;
padding: 12px;
margin-top: 10px;
background-color: #4caf50;
color: white;
border: none;
border-radius: 8px;
cursor: pointer;
font-size: 16px;
}

button:hover {
background-color: #45a049;
}

.switch-text {
text-align: center;
margin-top: 15px;
font-size: 14px;
}

.switch-text a {
color: #4caf50;
text-decoration: none;
font-weight: bold;
cursor: pointer;
}

.logo {
text-align: center;
font-size: 24px;
font-weight: bold;
color: #4caf50;
margin-bottom: 20px;
}
</style>
</head>
<body>

<div class="container">
<div class="logo">Budget App</div>

<div id="loginForm" class="form active">
<h2>Login</h2>
<input type="email" placeholder="Email" />
<input type="password" placeholder="Password" />
<button>Login</button>
<div class="switch-text">
Do not have an account?
<a onclick="showSignup()">Sign Up</a>
</div>
</div>

<div id="signupForm" class="form">
<h2>Sign Up</h2>
<input type="text" placeholder="Full Name" />
<input type="email" placeholder="Email" />
<input type="password" placeholder="Password" />
<input type="password" placeholder="Confirm Password" />
<button>Create Account</button>
<div class="switch-text">
Already have an account?
<a onclick="showLogin()">Login</a>
</div>
</div>
</div>

<script>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Javascript should be separated from the html.

function showSignup() {
document.getElementById("loginForm").classList.remove("active");
document.getElementById("signupForm").classList.add("active");
}

function showLogin() {
document.getElementById("signupForm").classList.remove("active");
document.getElementById("loginForm").classList.add("active");
}
</script>

</body>
</html>