From a45a575f72bf7614633a9766a59169ccc766cebe Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Mon, 17 Aug 2026 22:09:48 +0000 Subject: [PATCH] Login button styling --- frontend/src/assets/pagerite.css | 16 +++++++++++----- frontend/src/pagerite.js | 14 +++++++++----- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/frontend/src/assets/pagerite.css b/frontend/src/assets/pagerite.css index 9cd978a..a02722a 100644 --- a/frontend/src/assets/pagerite.css +++ b/frontend/src/assets/pagerite.css @@ -432,18 +432,24 @@ article h1 .edit-link { opacity: 1; } -/* Login link injected by pagerite.js for anonymous visitors when an auth - server gates /_api (validate answered 401). Same corner as the site pen. */ -a.login-link { +/* Login button injected by pagerite.js for anonymous visitors when an auth + proxy gates /_api (the settings probe answered 401). Same corner as the + site pen, styled like the edit pens. */ +button.login-link { position: absolute; top: 0.6rem; right: 1.25rem; z-index: 10; - font-size: 0.85rem; + font: inherit; + border: none; + cursor: pointer; + background: none; + padding: 0; opacity: 0.7; + text-shadow: 0 0 0.1em black; } -a.login-link:hover { +button.login-link:hover { opacity: 1; } diff --git a/frontend/src/pagerite.js b/frontend/src/pagerite.js index 736e11d..90cb339 100644 --- a/frontend/src/pagerite.js +++ b/frontend/src/pagerite.js @@ -64,11 +64,15 @@ function addLoginLink() { const banner = document.getElementById("page-banner"); if (!banner || banner.parentElement.querySelector(".login-link")) return; - const a = document.createElement("a"); - a.className = "login-link"; - a.href = "/auth/"; - a.textContent = "log in"; - banner.after(a); + const btn = document.createElement("button"); + btn.type = "button"; + btn.className = "login-link"; + btn.title = "log in"; + btn.textContent = "🔑"; + btn.addEventListener("click", () => { + location.href = "/auth/"; + }); + banner.after(btn); } async function setupAuth() {