@@ -0,0 +1,151 @@
|
|||||||
|
:root {
|
||||||
|
--primary-bg-color: #f4f6f8;
|
||||||
|
--secondary-bg-color: white;
|
||||||
|
--nav-bg-color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: "Geist Sans";
|
||||||
|
src: url("https://assets.codepen.io/605876/GeistVF.ttf") format("truetype");
|
||||||
|
}
|
||||||
|
|
||||||
|
*,
|
||||||
|
*::before,
|
||||||
|
*::after {
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
min-height: 100vh;
|
||||||
|
display: grid;
|
||||||
|
place-items: center;
|
||||||
|
font-family: "Geist Sans", system-ui, sans-serif;
|
||||||
|
|
||||||
|
background: linear-gradient(135deg, #c6dff4, #7c8384);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
nav {
|
||||||
|
width: 100%;
|
||||||
|
background: var(--nav-bg-color);
|
||||||
|
padding: 15px 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav ul {
|
||||||
|
list-style: none;
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
gap: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav a {
|
||||||
|
color: white;
|
||||||
|
text-decoration: none;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav a:hover {
|
||||||
|
color: #4facfe;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Center login section */
|
||||||
|
main {
|
||||||
|
min-height: calc(100vh - 60px);
|
||||||
|
/* full screen minus navbar */
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Title */
|
||||||
|
main h1 {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
main {
|
||||||
|
animation: fadeIn 0.8s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes fadeIn {
|
||||||
|
from {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(15px);
|
||||||
|
}
|
||||||
|
|
||||||
|
to {
|
||||||
|
opacity: 1;
|
||||||
|
transform: translateY(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Form box */
|
||||||
|
form {
|
||||||
|
background: rgba(255, 255, 255, 0.15);
|
||||||
|
backdrop-filter: blur(12px);
|
||||||
|
padding: 35px;
|
||||||
|
border-radius: 12px;
|
||||||
|
width: 320px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
|
||||||
|
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Labels */
|
||||||
|
label {
|
||||||
|
margin-top: 10px;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Inputs */
|
||||||
|
form {
|
||||||
|
background: rgba(255, 255, 255, 0.15);
|
||||||
|
backdrop-filter: blur(12px);
|
||||||
|
padding: 35px;
|
||||||
|
border-radius: 12px;
|
||||||
|
width: 320px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
|
||||||
|
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Button */
|
||||||
|
button {
|
||||||
|
margin-top: 20px;
|
||||||
|
padding: 12px;
|
||||||
|
border: none;
|
||||||
|
background: linear-gradient(135deg, #e9eff5, #daebf0);
|
||||||
|
color: rgb(0, 0, 0);
|
||||||
|
border-radius: 8px;
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 16px;
|
||||||
|
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
button:hover {
|
||||||
|
transform: translateY(-2px);
|
||||||
|
box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
button:active {
|
||||||
|
transform: scale(0.97);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Error message */
|
||||||
|
.error {
|
||||||
|
color: red;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* button anim */
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
const button = document.querySelector(".magnetic");
|
||||||
|
|
||||||
|
button.addEventListener("mousemove", (e) => {
|
||||||
|
const rect = button.getBoundingClientRect();
|
||||||
|
const x = e.clientX - rect.left - rect.width / 2;
|
||||||
|
const y = e.clientY - rect.top - rect.height / 2;
|
||||||
|
|
||||||
|
button.style.transform = `translate(${x * 0.2}px, ${y * 0.2}px)`;
|
||||||
|
});
|
||||||
|
|
||||||
|
button.addEventListener("mouseleave", () => {
|
||||||
|
button.style.transform = "translate(0,0)";
|
||||||
|
});
|
||||||
|
|
||||||
|
const inputs = document.querySelectorAll("input");
|
||||||
|
|
||||||
|
inputs.forEach(input => {
|
||||||
|
input.addEventListener("input", () => {
|
||||||
|
input.style.boxShadow = "0 0 8px rgba(79,172,254,0.6)";
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
input.style.boxShadow = "";
|
||||||
|
}, 300);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
const form = document.querySelector("form");
|
||||||
|
|
||||||
|
form.addEventListener("submit", () => {
|
||||||
|
button.innerText = "Logging in...";
|
||||||
|
button.style.opacity = "0.7";
|
||||||
|
});
|
||||||
+20
-22
@@ -5,37 +5,35 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Login</title>
|
<title>Login</title>
|
||||||
<style>
|
<link rel="stylesheet" href="../static/css/login.css">
|
||||||
h1 {
|
<link rel="stylesheet" href="../static/css/login.css">
|
||||||
color: green;
|
</link>
|
||||||
}
|
|
||||||
|
|
||||||
.error {
|
|
||||||
color: red;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<nav>
|
<nav>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="{{ url_for('login.login') }}">Login</a></li>
|
<li><a href="{{ url_for('login.login') }}"><span>Login</span></a></li>
|
||||||
<li><a href="{{ url_for('login.register') }}">Create account</a></li>
|
<li><a href="{{ url_for('login.register') }}"><span>Create account</span></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
<h1>Login to your account</h1>
|
|
||||||
|
|
||||||
{% if error %}
|
<main>
|
||||||
<p class="error">{{ error }}</p>
|
<h1>Login to your account</h1>
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<form action="{{ url_for('login.login') }}" method="post">
|
{% if error %}
|
||||||
<label for="username">Username:</label>
|
<p class="error">{{ error }}</p>
|
||||||
<input type="text" name="username" required />
|
{% endif %}
|
||||||
<label for="password">Password:</label>
|
|
||||||
<input type="password" name="password" required />
|
<form action="{{ url_for('login.login') }}" method="post">
|
||||||
<button type="submit">Login</button>
|
<label for="username">Username:</label>
|
||||||
</form>
|
<input type="text" name="username" required />
|
||||||
|
<label for="password">Password:</label>
|
||||||
|
<input type="password" name="password" required />
|
||||||
|
<button class="magnetic" type="submit">Login</button>
|
||||||
|
</form>
|
||||||
|
</main>
|
||||||
|
<script src="../static/js/login.js" defer></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
+14
-20
@@ -5,15 +5,7 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Sign Up</title>
|
<title>Sign Up</title>
|
||||||
<style>
|
<link rel="stylesheet" href="../static/css/login.css">
|
||||||
h1 {
|
|
||||||
color: green;
|
|
||||||
}
|
|
||||||
|
|
||||||
.error {
|
|
||||||
color: red;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
@@ -23,19 +15,21 @@
|
|||||||
<li><a href="{{ url_for('login.register') }}">Create account</a></li>
|
<li><a href="{{ url_for('login.register') }}">Create account</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
<h1>Create an account</h1>
|
<main>
|
||||||
|
<h1>Create an account</h1>
|
||||||
|
|
||||||
{% if error %}
|
{% if error %}
|
||||||
<p class="error">{{ error }}</p>
|
<p class="error">{{ error }}</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<form action="{{ url_for('login.register') }}" method="post">
|
<form action="{{ url_for('login.register') }}" method="post">
|
||||||
<label for="username">Username:</label>
|
<label for="username">Username:</label>
|
||||||
<input type="text" name="username" required />
|
<input type="text" name="username" required />
|
||||||
<label for="password">Password:</label>
|
<label for="password">Password:</label>
|
||||||
<input type="password" name="password" required />
|
<input type="password" name="password" required />
|
||||||
<button type="submit">Sign Up</button>
|
<button type="submit">Sign Up</button>
|
||||||
</form>
|
</form>
|
||||||
|
</main>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
Reference in New Issue
Block a user