fix(auth): rewrite wiki-login page against real design system
The page referenced phantom tokens (--color-guild-*, --color-candlelight-*, --color-ember-400) that don't exist, leaving the card, input, and button transparent with no borders. Rewrote the template and styles using the real design system utilities (.dashed-box, .field, .btn-primary, .section-label, .section-divider) and tokens (--candle, --ember, --bg, --border, --text-*), plus semantic landmarks and aria-live status roles.
This commit is contained in:
parent
e791a0d480
commit
98d3610a08
1 changed files with 105 additions and 163 deletions
|
|
@ -23,7 +23,8 @@ async function sendMagicLink() {
|
||||||
});
|
});
|
||||||
sent.value = true;
|
sent.value = true;
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
error.value = e?.data?.statusMessage || "Something went wrong. Please try again.";
|
error.value =
|
||||||
|
e?.data?.statusMessage || "Something went wrong. Please try again.";
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
}
|
||||||
|
|
@ -31,18 +32,24 @@ async function sendMagicLink() {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="wiki-login">
|
<main class="wiki-login">
|
||||||
<div class="wiki-login-card">
|
<div class="dashed-box wiki-login-box">
|
||||||
<div class="wiki-login-header">
|
<header class="wiki-login-header">
|
||||||
<span class="wiki-login-overline">Ghost Guild</span>
|
<p class="section-label">Ghost Guild</p>
|
||||||
<h1 class="wiki-login-title">Wiki</h1>
|
<h1 class="wiki-login-title">Wiki</h1>
|
||||||
</div>
|
</header>
|
||||||
|
|
||||||
<div class="wiki-login-divider" />
|
<hr class="section-divider" />
|
||||||
|
|
||||||
<Transition name="wiki-fade" mode="out-in">
|
<Transition name="wiki-fade" mode="out-in">
|
||||||
<form v-if="!sent" key="form" @submit.prevent="sendMagicLink" class="wiki-login-form">
|
<form
|
||||||
<label for="email" class="wiki-login-label">Email address</label>
|
v-if="!sent"
|
||||||
|
key="form"
|
||||||
|
class="wiki-login-form"
|
||||||
|
@submit.prevent="sendMagicLink"
|
||||||
|
>
|
||||||
|
<div class="field">
|
||||||
|
<label for="email">Email address</label>
|
||||||
<input
|
<input
|
||||||
id="email"
|
id="email"
|
||||||
v-model="email"
|
v-model="email"
|
||||||
|
|
@ -50,18 +57,29 @@ async function sendMagicLink() {
|
||||||
required
|
required
|
||||||
autocomplete="email"
|
autocomplete="email"
|
||||||
placeholder="you@example.com"
|
placeholder="you@example.com"
|
||||||
class="wiki-login-input"
|
|
||||||
:disabled="loading"
|
:disabled="loading"
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<p v-if="error" class="wiki-login-error">{{ error }}</p>
|
<p
|
||||||
|
v-if="error"
|
||||||
|
class="wiki-login-error"
|
||||||
|
role="alert"
|
||||||
|
aria-live="assertive"
|
||||||
|
>
|
||||||
|
{{ error }}
|
||||||
|
</p>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
|
class="btn btn-primary wiki-login-submit"
|
||||||
:disabled="loading || !email"
|
:disabled="loading || !email"
|
||||||
class="wiki-login-button"
|
|
||||||
>
|
>
|
||||||
<span v-if="loading" class="wiki-login-spinner" />
|
<span
|
||||||
|
v-if="loading"
|
||||||
|
class="wiki-login-spinner"
|
||||||
|
aria-hidden="true"
|
||||||
|
/>
|
||||||
{{ loading ? "Sending" : "Continue" }}
|
{{ loading ? "Sending" : "Continue" }}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
|
@ -70,187 +88,108 @@ async function sendMagicLink() {
|
||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<div v-else key="sent" class="wiki-login-sent">
|
<div
|
||||||
<p class="wiki-login-sent-heading">Check your inbox</p>
|
v-else
|
||||||
|
key="sent"
|
||||||
|
class="wiki-login-sent"
|
||||||
|
role="status"
|
||||||
|
aria-live="polite"
|
||||||
|
>
|
||||||
|
<h2 class="wiki-login-sent-heading">Check your inbox</h2>
|
||||||
<p class="wiki-login-sent-detail">
|
<p class="wiki-login-sent-detail">
|
||||||
A sign-in link was sent to <strong>{{ email }}</strong>
|
A sign-in link was sent to <strong>{{ email }}</strong>
|
||||||
</p>
|
</p>
|
||||||
<button
|
<button
|
||||||
@click="sent = false; email = '';"
|
class="wiki-login-reset"
|
||||||
class="wiki-login-link"
|
@click="
|
||||||
|
sent = false;
|
||||||
|
email = '';
|
||||||
|
"
|
||||||
>
|
>
|
||||||
Try a different email
|
Try a different email
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</Transition>
|
</Transition>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</main>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.wiki-login {
|
.wiki-login {
|
||||||
min-height: 100vh;
|
|
||||||
min-height: 100dvh;
|
|
||||||
display: grid;
|
display: grid;
|
||||||
place-items: center;
|
place-items: center;
|
||||||
padding: 1.5rem;
|
min-height: 100vh;
|
||||||
background:
|
min-height: 100dvh;
|
||||||
radial-gradient(ellipse at 30% 70%, rgba(184, 135, 58, 0.06) 0%, transparent 60%),
|
padding: var(--page-pad-y) var(--page-pad-x);
|
||||||
radial-gradient(ellipse at 70% 30%, rgba(178, 104, 64, 0.04) 0%, transparent 60%),
|
|
||||||
var(--color-guild-900);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.dark .wiki-login {
|
.wiki-login-box {
|
||||||
background:
|
|
||||||
radial-gradient(ellipse at 30% 70%, rgba(224, 184, 110, 0.05) 0%, transparent 60%),
|
|
||||||
radial-gradient(ellipse at 70% 30%, rgba(218, 154, 114, 0.03) 0%, transparent 60%),
|
|
||||||
var(--color-guild-900);
|
|
||||||
}
|
|
||||||
|
|
||||||
.wiki-login-card {
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 360px;
|
max-width: 360px;
|
||||||
padding: 2.5rem 2rem 2rem;
|
padding: 24px 28px;
|
||||||
background: var(--color-guild-800);
|
|
||||||
border: 1px solid var(--color-guild-700);
|
|
||||||
border-radius: 12px;
|
|
||||||
box-shadow:
|
|
||||||
0 1px 2px rgba(0, 0, 0, 0.06),
|
|
||||||
0 8px 24px rgba(0, 0, 0, 0.08);
|
|
||||||
}
|
|
||||||
|
|
||||||
.dark .wiki-login-card {
|
|
||||||
box-shadow:
|
|
||||||
0 1px 2px rgba(0, 0, 0, 0.2),
|
|
||||||
0 8px 32px rgba(0, 0, 0, 0.3);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.wiki-login-header {
|
.wiki-login-header {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wiki-login-overline {
|
|
||||||
font-family: var(--font-mono);
|
|
||||||
font-size: 0.6875rem;
|
|
||||||
letter-spacing: 0.1em;
|
|
||||||
text-transform: uppercase;
|
|
||||||
color: var(--color-guild-400);
|
|
||||||
}
|
|
||||||
|
|
||||||
.wiki-login-title {
|
.wiki-login-title {
|
||||||
font-family: var(--font-sans);
|
font-family: var(--font-display);
|
||||||
font-size: 2rem;
|
font-size: 32px;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
letter-spacing: -0.02em;
|
line-height: 1.1;
|
||||||
line-height: 1.15;
|
letter-spacing: -0.01em;
|
||||||
color: var(--color-candlelight-400);
|
color: var(--candle);
|
||||||
margin-top: 0.25rem;
|
margin: 0;
|
||||||
}
|
|
||||||
|
|
||||||
.wiki-login-divider {
|
|
||||||
height: 1px;
|
|
||||||
background: linear-gradient(
|
|
||||||
to right,
|
|
||||||
transparent,
|
|
||||||
var(--color-guild-600),
|
|
||||||
transparent
|
|
||||||
);
|
|
||||||
margin: 1.5rem 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.wiki-login-form {
|
.wiki-login-form {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 0.75rem;
|
gap: 12px;
|
||||||
}
|
|
||||||
|
|
||||||
.wiki-login-label {
|
|
||||||
font-size: 0.8125rem;
|
|
||||||
font-weight: 500;
|
|
||||||
color: var(--color-guild-300);
|
|
||||||
}
|
|
||||||
|
|
||||||
.wiki-login-input {
|
|
||||||
width: 100%;
|
|
||||||
padding: 0.625rem 0.75rem;
|
|
||||||
font-size: 0.875rem;
|
|
||||||
color: var(--color-guild-100);
|
|
||||||
background: var(--color-guild-900);
|
|
||||||
border: 1px solid var(--color-guild-600);
|
|
||||||
border-radius: 8px;
|
|
||||||
outline: none;
|
|
||||||
transition: border-color 0.15s, box-shadow 0.15s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.wiki-login-input::placeholder {
|
|
||||||
color: var(--color-guild-500);
|
|
||||||
}
|
|
||||||
|
|
||||||
.wiki-login-input:focus {
|
|
||||||
border-color: var(--color-candlelight-500);
|
|
||||||
box-shadow: 0 0 0 3px rgba(184, 135, 58, 0.15);
|
|
||||||
}
|
|
||||||
|
|
||||||
.wiki-login-input:disabled {
|
|
||||||
opacity: 0.5;
|
|
||||||
cursor: not-allowed;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.wiki-login-error {
|
.wiki-login-error {
|
||||||
font-size: 0.8125rem;
|
font-size: 13px;
|
||||||
color: var(--color-ember-400);
|
color: var(--ember);
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wiki-login-button {
|
.wiki-login-submit {
|
||||||
display: flex;
|
width: 100%;
|
||||||
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
gap: 0.5rem;
|
gap: 8px;
|
||||||
width: 100%;
|
margin-top: 4px;
|
||||||
padding: 0.625rem 1rem;
|
|
||||||
margin-top: 0.25rem;
|
|
||||||
font-size: 0.875rem;
|
|
||||||
font-weight: 600;
|
|
||||||
color: var(--color-guild-50);
|
|
||||||
background: var(--color-candlelight-500);
|
|
||||||
border: none;
|
|
||||||
border-radius: 8px;
|
|
||||||
cursor: pointer;
|
|
||||||
transition: background 0.15s, transform 0.1s;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.wiki-login-button:hover:not(:disabled) {
|
.wiki-login-submit:disabled {
|
||||||
background: var(--color-candlelight-400);
|
|
||||||
}
|
|
||||||
|
|
||||||
.wiki-login-button:active:not(:disabled) {
|
|
||||||
transform: scale(0.98);
|
|
||||||
}
|
|
||||||
|
|
||||||
.wiki-login-button:disabled {
|
|
||||||
opacity: 0.45;
|
opacity: 0.45;
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wiki-login-spinner {
|
.wiki-login-spinner {
|
||||||
width: 14px;
|
display: inline-block;
|
||||||
height: 14px;
|
width: 10px;
|
||||||
border: 2px solid rgba(255, 255, 255, 0.25);
|
height: 10px;
|
||||||
border-top-color: white;
|
border: 1.5px solid color-mix(in srgb, var(--bg) 35%, transparent);
|
||||||
|
border-top-color: var(--bg);
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
animation: wiki-spin 0.6s linear infinite;
|
animation: wiki-spin 0.7s linear infinite;
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes wiki-spin {
|
@keyframes wiki-spin {
|
||||||
to { transform: rotate(360deg); }
|
to {
|
||||||
|
transform: rotate(360deg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.wiki-login-hint {
|
.wiki-login-hint {
|
||||||
font-size: 0.75rem;
|
font-size: 11px;
|
||||||
color: var(--color-guild-500);
|
color: var(--text-faint);
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin: 0;
|
margin: 4px 0 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wiki-login-sent {
|
.wiki-login-sent {
|
||||||
|
|
@ -258,45 +197,48 @@ async function sendMagicLink() {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 0.5rem;
|
gap: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wiki-login-sent-heading {
|
.wiki-login-sent-heading {
|
||||||
font-family: var(--font-sans);
|
font-family: var(--font-display);
|
||||||
font-size: 1.25rem;
|
font-size: 20px;
|
||||||
font-weight: 600;
|
font-weight: 700;
|
||||||
color: var(--color-guild-100);
|
color: var(--text-bright);
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wiki-login-sent-detail {
|
.wiki-login-sent-detail {
|
||||||
font-size: 0.8125rem;
|
font-size: 13px;
|
||||||
color: var(--color-guild-400);
|
color: var(--text-dim);
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wiki-login-sent-detail strong {
|
.wiki-login-sent-detail strong {
|
||||||
color: var(--color-guild-200);
|
color: var(--text-bright);
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wiki-login-link {
|
.wiki-login-reset {
|
||||||
font-size: 0.8125rem;
|
font-family: "Commit Mono", monospace;
|
||||||
color: var(--color-candlelight-500);
|
font-size: 12px;
|
||||||
|
color: var(--candle);
|
||||||
background: none;
|
background: none;
|
||||||
border: none;
|
border: none;
|
||||||
cursor: pointer;
|
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin-top: 0.5rem;
|
margin-top: 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
text-decoration: underline;
|
||||||
|
text-underline-offset: 2px;
|
||||||
transition: color 0.15s;
|
transition: color 0.15s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wiki-login-link:hover {
|
.wiki-login-reset:hover {
|
||||||
color: var(--color-candlelight-400);
|
color: var(--candle-dim);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Transition */
|
/* State transition */
|
||||||
.wiki-fade-enter-active,
|
.wiki-fade-enter-active,
|
||||||
.wiki-fade-leave-active {
|
.wiki-fade-leave-active {
|
||||||
transition: opacity 0.2s ease, transform 0.2s ease;
|
transition: opacity 0.2s ease, transform 0.2s ease;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue