1 Commits

Author SHA1 Message Date
ScriptSorcerer 34dfa118d9 added gradients to backgroudn added functional button animation
chnaged color design (grey style)
2026-03-23 12:55:59 +01:00
3 changed files with 85 additions and 57 deletions
+56 -46
View File
@@ -21,40 +21,11 @@ body {
display: grid; display: grid;
place-items: center; place-items: center;
font-family: "Geist Sans", system-ui, sans-serif; font-family: "Geist Sans", system-ui, sans-serif;
background: linear-gradient(135deg, #c6dff4, #7c8384);
} }
/* MAGNET EFFECT */
.magnetic {
padding: 10px 20px;
border: none;
background: #4facfe;
color: white;
border-radius: 6px;
cursor: pointer;
font-size: 16px;
transition: transform 0.2s ease;
}
.magnetic:hover {
background: #2d8cf0;
}
/* Reset */
* {
box-sizing: border-box;
margin: 0;
padding: 0;
font-family: Arial, Helvetica, sans-serif;
}
/* Page setup */
body {
min-height: 100vh;
background: var(--primary-bg-color);
}
/* Navbar */
nav { nav {
width: 100%; width: 100%;
background: var(--nav-bg-color); background: var(--nav-bg-color);
@@ -93,17 +64,38 @@ main h1 {
margin-bottom: 20px; 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 box */
form { form {
background: var(--secondary-bg-color); background: rgba(255, 255, 255, 0.15);
padding: 30px; backdrop-filter: blur(12px);
border-radius: 8px; padding: 35px;
width: 300px; border-radius: 12px;
width: 320px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
border: 1px solid rgba(255, 255, 255, 0.2);
} }
/* Labels */ /* Labels */
label { label {
margin-top: 10px; margin-top: 10px;
@@ -112,30 +104,48 @@ label {
} }
/* Inputs */ /* Inputs */
input { form {
padding: 10px; background: rgba(255, 255, 255, 0.15);
border: 1px solid #ccc; backdrop-filter: blur(12px);
border-radius: 6px; 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 */
.button { button {
margin-top: 20px; margin-top: 20px;
padding: 10px; padding: 12px;
border: none; border: none;
background: #4facfe; background: linear-gradient(135deg, #e9eff5, #daebf0);
color: white; color: rgb(0, 0, 0);
border-radius: 6px; border-radius: 8px;
cursor: pointer; cursor: pointer;
font-size: 16px; font-size: 16px;
transition: all 0.2s ease;
} }
button:hover { button:hover {
background: #2d8cf0; transform: translateY(-2px);
box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
} }
button:active {
transform: scale(0.97);
}
/* Error message */ /* Error message */
.error { .error {
color: red; color: red;
margin-bottom: 15px; margin-bottom: 15px;
} }
/* button anim */
+27 -9
View File
@@ -1,14 +1,32 @@
const button = document.querySelector(".magnetic") const button = document.querySelector(".magnetic");
button.addEventListener("mousemove", (e) => { button.addEventListener("mousemove", (e) => {
const rect = button.getBoundingClientRect() const rect = button.getBoundingClientRect();
const x = e.clientX - rect.left - rect.width / 2;
const y = e.clientY - rect.top - rect.height / 2;
const x = e.clientX - rect.left - rect.width / 2 button.style.transform = `translate(${x * 0.2}px, ${y * 0.2}px)`;
const y = e.clientY - rect.top - rect.height / 2 });
button.style.transform = `translate(${x * 0.3}px, ${y * 0.3}px)`
})
button.addEventListener("mouseleave", () => { button.addEventListener("mouseleave", () => {
button.style.transform = "translate(0,0)" 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";
});
+1 -1
View File
@@ -14,7 +14,7 @@
<nav> <nav>
<ul> <ul>
<li><a href="{{ url_for('login.login') }}"><span>Login</span></a></li> <li><a href="{{ url_for('login.login') }}"><span>Login</span></a></li>
<li><a href="{{ url_for('login.register') }}"><span></span>Create account</span></a></li> <li><a href="{{ url_for('login.register') }}"><span>Create account</span></a></li>
</ul> </ul>
</nav> </nav>