From 723bc835eccb5a1f1fa4d009905377b8297c64c4 Mon Sep 17 00:00:00 2001 From: ScriptSorcerer20 Date: Mon, 16 Mar 2026 12:53:57 +0100 Subject: [PATCH 1/2] =?UTF-8?q?CSS=20verbessert=20f=C3=BCr=20Login&Registe?= =?UTF-8?q?r.=20javscsript=20code=20f=C3=BCr=20magnetic=20button=20effect?= =?UTF-8?q?=20noch=20in=20entwicklung.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/static/css/login.css | 141 +++++++++++++++++++++++++++++++++++++ app/static/js/login.js | 14 ++++ app/templates/login.html | 42 ++++++----- app/templates/sign_up.html | 34 ++++----- 4 files changed, 189 insertions(+), 42 deletions(-) create mode 100644 app/static/css/login.css create mode 100644 app/static/js/login.js diff --git a/app/static/css/login.css b/app/static/css/login.css new file mode 100644 index 0000000..2af1be3 --- /dev/null +++ b/app/static/css/login.css @@ -0,0 +1,141 @@ +: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; +} + +/* 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 { + 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; +} + +/* Form box */ +form { + background: var(--secondary-bg-color); + padding: 30px; + border-radius: 8px; + width: 300px; + display: flex; + flex-direction: column; + box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1); +} + +/* Labels */ +label { + margin-top: 10px; + margin-bottom: 5px; + font-size: 14px; +} + +/* Inputs */ +input { + padding: 10px; + border: 1px solid #ccc; + border-radius: 6px; +} + +/* Button */ +.button { + margin-top: 20px; + padding: 10px; + border: none; + background: #4facfe; + color: white; + border-radius: 6px; + cursor: pointer; + font-size: 16px; +} + +button:hover { + background: #2d8cf0; +} + +/* Error message */ +.error { + color: red; + margin-bottom: 15px; +} \ No newline at end of file diff --git a/app/static/js/login.js b/app/static/js/login.js new file mode 100644 index 0000000..72307ee --- /dev/null +++ b/app/static/js/login.js @@ -0,0 +1,14 @@ +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.3}px, ${y * 0.3}px)` +}) + +button.addEventListener("mouseleave", () => { + button.style.transform = "translate(0,0)" +}) \ No newline at end of file diff --git a/app/templates/login.html b/app/templates/login.html index 70581a9..ade61f4 100644 --- a/app/templates/login.html +++ b/app/templates/login.html @@ -5,37 +5,35 @@ Login - + + + -

Login to your account

- {% if error %} -

{{ error }}

- {% endif %} +
+

Login to your account

-
- - - - - -
+ {% if error %} +

{{ error }}

+ {% endif %} + +
+ + + + + +
+
+ \ No newline at end of file diff --git a/app/templates/sign_up.html b/app/templates/sign_up.html index 51fcb5a..88adee1 100644 --- a/app/templates/sign_up.html +++ b/app/templates/sign_up.html @@ -5,15 +5,7 @@ Sign Up - + @@ -23,19 +15,21 @@
  • Create account
  • -

    Create an account

    +
    +

    Create an account

    - {% if error %} -

    {{ error }}

    - {% endif %} + {% if error %} +

    {{ error }}

    + {% endif %} -
    - - - - - -
    +
    + + + + + +
    +
    \ No newline at end of file From 34dfa118d98f435988afd2d407eab801c7172906 Mon Sep 17 00:00:00 2001 From: ScriptSorcerer20 Date: Mon, 23 Mar 2026 12:55:59 +0100 Subject: [PATCH 2/2] added gradients to backgroudn added functional button animation chnaged color design (grey style) --- app/static/css/login.css | 104 +++++++++++++++++++++------------------ app/static/js/login.js | 36 ++++++++++---- app/templates/login.html | 2 +- 3 files changed, 85 insertions(+), 57 deletions(-) diff --git a/app/static/css/login.css b/app/static/css/login.css index 2af1be3..2035741 100644 --- a/app/static/css/login.css +++ b/app/static/css/login.css @@ -21,40 +21,11 @@ body { display: grid; place-items: center; 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 { width: 100%; background: var(--nav-bg-color); @@ -93,17 +64,38 @@ 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: var(--secondary-bg-color); - padding: 30px; - border-radius: 8px; - width: 300px; + 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 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 */ label { margin-top: 10px; @@ -112,30 +104,48 @@ label { } /* Inputs */ -input { - padding: 10px; - border: 1px solid #ccc; - border-radius: 6px; +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 { +button { margin-top: 20px; - padding: 10px; + padding: 12px; border: none; - background: #4facfe; - color: white; - border-radius: 6px; + 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 { - 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 { color: red; margin-bottom: 15px; -} \ No newline at end of file +} + +/* button anim */ \ No newline at end of file diff --git a/app/static/js/login.js b/app/static/js/login.js index 72307ee..7b22fe2 100644 --- a/app/static/js/login.js +++ b/app/static/js/login.js @@ -1,14 +1,32 @@ -const button = document.querySelector(".magnetic") +const button = document.querySelector(".magnetic"); 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 - const y = e.clientY - rect.top - rect.height / 2 - - button.style.transform = `translate(${x * 0.3}px, ${y * 0.3}px)` -}) + button.style.transform = `translate(${x * 0.2}px, ${y * 0.2}px)`; +}); button.addEventListener("mouseleave", () => { - button.style.transform = "translate(0,0)" -}) \ No newline at end of file + 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"; +}); diff --git a/app/templates/login.html b/app/templates/login.html index ade61f4..00152b2 100644 --- a/app/templates/login.html +++ b/app/templates/login.html @@ -14,7 +14,7 @@