auth

Main authentication module for my projects
git clone git://git.finwo.net/app/auth
Log | Files | Refs

commit 31d3c8874ad0549b673372cf29c1d0d3123c8290
parent a47d9fd19f2fcd3aa230c7717e8909ce589125c7
Author: finwo <finwo@pm.me>
Date:   Thu, 22 Oct 2026 02:40:06 +0200

App consent mockup

Diffstat:
Amockup/consent.html | 394+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 394 insertions(+), 0 deletions(-)

diff --git a/mockup/consent.html b/mockup/consent.html @@ -0,0 +1,394 @@ +<!doctype html> +<html lang="en"> + <head> + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1" /> + <title>Consent mockup</title> + <style> + :root { + font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; + --surface: #fff; + --text: #1b1b1b; + --muted: #656a70; + --accent: #25a; + --accent-hover: #2a66cc; + --accent-active: #1b468c; + --accent-text: #25a; + --accent-text-hover: #2a66cc; + --accent-text-active: #1b468c; + --on-accent: #fff; + --row: #00000008; + --shadow: 0 0.125em 0.25em #0008; + --hex: url('./hex-grid-light.svg'); + } + + *, + *::before, + *::after { + box-sizing: border-box; + } + + html, + body { + margin: 0; + padding: 0; + } + + body { + background: var(--surface); + color: var(--text); + -webkit-font-smoothing: antialiased; + } + + .consent-page { + display: grid; + place-items: center; + min-height: 100vh; + padding: 0; + background-color: var(--surface); + } + + .consent-card { + width: min(calc(100% - 2rem), 28rem); + padding: 2rem; + background: var(--surface); + } + + .consent-card h1 { + margin: 0 0 0.5rem; + font-size: 1.5rem; + font-weight: 400; + line-height: 1.3; + } + + .consent-note { + margin: 0; + color: var(--muted); + font-size: 0.875rem; + line-height: 1.6; + } + + .consent-account { + display: flex; + align-items: center; + gap: 0.75rem; + margin-top: 1.5rem; + padding: 0.75rem; + background: var(--row); + } + + .consent-account svg { + flex: none; + width: 1.5rem; + height: 1.5rem; + } + + .consent-account-body { + display: grid; + gap: 0.125rem; + min-width: 0; + } + + .consent-account-name { + font-size: 0.875rem; + font-weight: 500; + line-height: 1.4; + } + + .consent-account-meta { + overflow-wrap: anywhere; + color: var(--muted); + font-size: 0.75rem; + line-height: 1.4; + } + + .consent-account-link { + flex: none; + margin-left: auto; + padding: 0; + border: 0; + background: none; + color: var(--accent-text); + font: inherit; + font-size: 0.8125rem; + cursor: pointer; + } + + .consent-account-link:hover { + color: var(--accent-text-hover); + } + + .consent-account-link:active { + color: var(--accent-text-active); + } + + .consent-section-title { + margin: 1.5rem 0 0; + font-size: 0.875rem; + font-weight: 500; + line-height: 1.5; + } + + .consent-scopes { + display: grid; + gap: 0.5rem; + margin: 0.75rem 0 0; + padding: 0; + list-style: none; + } + + .consent-scope { + display: flex; + align-items: flex-start; + gap: 0.5rem; + color: var(--muted); + font-size: 0.875rem; + line-height: 1.5; + } + + .consent-scope svg { + flex: none; + width: 1rem; + height: 1rem; + margin-top: 0.125rem; + } + + .consent-footer { + margin: 1.5rem 0 0; + color: var(--muted); + font-size: 0.8125rem; + line-height: 1.6; + } + + .consent-actions { + display: flex; + flex-wrap: wrap; + justify-content: flex-end; + align-items: center; + gap: 1rem; + margin-top: 1.5rem; + } + + .button { + display: inline-block; + padding: 0.625rem 1.25rem; + border: 0; + border-radius: 0; + background: var(--accent); + color: var(--on-accent); + font: inherit; + font-size: 0.8125rem; + font-weight: 500; + letter-spacing: 0.05em; + line-height: 1.4; + text-decoration: none; + text-transform: uppercase; + cursor: pointer; + } + + .button:hover { + background: var(--accent-hover); + } + + .button:active { + background: var(--accent-active); + } + + .link-button { + padding: 0.5rem 0; + border: 0; + background: none; + color: var(--accent-text); + font: inherit; + font-size: 0.875rem; + cursor: pointer; + } + + .link-button:hover { + color: var(--accent-text-hover); + } + + .link-button:active { + color: var(--accent-text-active); + } + + .mockup-controls { + position: fixed; + right: 1rem; + bottom: 1rem; + z-index: 100; + display: flex; + flex-wrap: wrap; + align-items: center; + gap: 0.25rem; + max-width: calc(100vw - 2rem); + padding: 0.375rem; + background: #000; + color: #fff; + box-shadow: var(--shadow); + font-size: 0.75rem; + } + + .mockup-label { + padding: 0 0.5rem; + color: rgba(255, 255, 255, 0.5); + font-size: 0.6875rem; + font-weight: 600; + letter-spacing: 0.08em; + text-transform: uppercase; + } + + .mockup-button { + padding: 0.375rem 0.625rem; + border: 0; + background: transparent; + color: rgba(255, 255, 255, 0.76); + font: inherit; + font-size: 0.75rem; + cursor: pointer; + } + + .mockup-button:hover { + background: #8884; + color: #fff; + } + + .mockup-button.is-active { + background: #333; + color: #fff; + } + + a:focus-visible, + button:focus-visible { + outline: 2pt solid var(--accent); + outline-offset: 2pt; + } + + @media (min-width: 35em) { + .consent-page { + background-image: var(--hex); + background-position: center; + background-repeat: no-repeat; + background-size: cover; + } + + .consent-card { + box-shadow: var(--shadow); + } + } + + @media (prefers-color-scheme: dark) { + :root:not([data-theme]) { + --surface: #282828; + --text: #e7e7e7; + --muted: #a0a4a8; + --accent-text: #4d8dff; + --accent-text-hover: #6ea8ff; + --accent-text-active: #3b7cff; + --row: #ffffff0d; + --hex: url('./hex-grid-dark.svg'); + color-scheme: dark; + } + } + + :root[data-theme="dark"] { + --surface: #282828; + --text: #e7e7e7; + --muted: #a0a4a8; + --accent-text: #4d8dff; + --accent-text-hover: #6ea8ff; + --accent-text-active: #3b7cff; + --row: #ffffff0d; + --hex: url('./hex-grid-dark.svg'); + color-scheme: dark; + } + </style> + </head> + <body> + <main class="consent-page"> + <section class="consent-card" aria-labelledby="consent-title"> + <h1 id="consent-title">Authorize Acme Portal</h1> + <p class="consent-note"> + Acme Portal is requesting access to your Acme account. + </p> + + <div class="consent-account"> + <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> + <circle cx="12" cy="12" r="10" /> + <circle cx="12" cy="10" r="3" /> + <path d="M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662" /> + </svg> + <span class="consent-account-body"> + <span class="consent-account-name">Demo User</span> + <span class="consent-account-meta">demo@example.com</span> + </span> + <button class="consent-account-link" type="button">Not you?</button> + </div> + + <p class="consent-section-title">This will allow Acme Portal to:</p> + <ul class="consent-scopes"> + <li class="consent-scope"> + <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> + <path d="m5 12 5 5L20 7" /> + </svg> + <span>Sign you in with your Acme account.</span> + </li> + <li class="consent-scope"> + <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> + <path d="m5 12 5 5L20 7" /> + </svg> + <span>See your name and username.</span> + </li> + <li class="consent-scope"> + <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> + <path d="m5 12 5 5L20 7" /> + </svg> + <span>See your email address.</span> + </li> + </ul> + + <p class="consent-footer"> + You can revoke access at any time from your account settings. + </p> + + <div class="consent-actions"> + <button class="link-button" type="button">Deny</button> + <button class="button" type="button">Allow access</button> + </div> + </section> + </main> + + <div class="mockup-controls" aria-label="Mockup theme"> + <span class="mockup-label">Mockup</span> + <button class="mockup-button is-active" type="button" data-theme-target="auto">Auto</button> + <button class="mockup-button" type="button" data-theme-target="light">Light</button> + <button class="mockup-button" type="button" data-theme-target="dark">Dark</button> + </div> + + <script> + const root = document.documentElement; + const themeButtons = document.querySelectorAll('[data-theme-target]'); + + function setTheme(value) { + if (value === 'auto') { + root.removeAttribute('data-theme'); + } else { + root.setAttribute('data-theme', value); + } + + themeButtons.forEach((button) => { + button.classList.toggle('is-active', button.dataset.themeTarget === value); + }); + } + + themeButtons.forEach((button) => { + button.addEventListener('click', () => setTheme(button.dataset.themeTarget)); + }); + + const initialTheme = new URLSearchParams(window.location.search).get('theme'); + if (['auto', 'light', 'dark'].includes(initialTheme)) { + setTheme(initialTheme); + } + </script> + </body> +</html>