Login page: newer design from the canvas
- wheel with sample planets, ticks and aspect lines - "Continue with Google" in the site's button style (Google's own button lies invisibly on top and still returns the ID token) - new subtitle and account note Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
@@ -6,6 +6,35 @@ import { useCallback, useEffect, useRef, useState } from "react";
|
||||
|
||||
import { api, errorText } from "@/lib/api";
|
||||
|
||||
/** Google's "G" mark (branding guidelines: unmodified, on the left of the label). */
|
||||
function GoogleMark() {
|
||||
return (
|
||||
<svg width="20" height="20" viewBox="0 0 48 48" aria-hidden="true">
|
||||
<path
|
||||
fill="#EA4335"
|
||||
d="M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z"
|
||||
/>
|
||||
<path
|
||||
fill="#4285F4"
|
||||
d="M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z"
|
||||
/>
|
||||
<path
|
||||
fill="#FBBC05"
|
||||
d="M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z"
|
||||
/>
|
||||
<path
|
||||
fill="#34A853"
|
||||
d="M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z"
|
||||
/>
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* "Continue with Google" in the site's own button style. Google's real
|
||||
* (rendered, invisible) button lies on top of it and receives the click, so
|
||||
* the sign-in still returns an ID token.
|
||||
*/
|
||||
export function GoogleLogin({ clientId, target }: { clientId: string; target: string }) {
|
||||
const router = useRouter();
|
||||
const slot = useRef<HTMLDivElement>(null);
|
||||
@@ -34,7 +63,7 @@ export function GoogleLogin({ clientId, target }: { clientId: string; target: st
|
||||
if (!ready || !google || !slot.current) return;
|
||||
google.accounts.id.initialize({ client_id: clientId, callback: onCredential, ux_mode: "popup", itp_support: true });
|
||||
google.accounts.id.renderButton(slot.current, {
|
||||
theme: "filled_black",
|
||||
theme: "outline",
|
||||
size: "large",
|
||||
text: "continue_with",
|
||||
shape: "rectangular",
|
||||
@@ -51,8 +80,15 @@ export function GoogleLogin({ clientId, target }: { clientId: string; target: st
|
||||
onReady={() => setReady(true)}
|
||||
onError={() => setError("Nem sikerült betölteni a Google-belépést. Ellenőrizd a hálózatot vagy a reklámblokkolót.")}
|
||||
/>
|
||||
<div ref={slot} className="gsi-slot" aria-busy={busy} />
|
||||
{busy && <p className="msg muted">Belépés…</p>}
|
||||
<div className="social-login" data-ready={ready} aria-busy={busy}>
|
||||
<span className="btn-social" aria-hidden="true">
|
||||
<span className="btn-social-icon">
|
||||
<GoogleMark />
|
||||
</span>
|
||||
{busy ? "Belépés…" : "Folytatás Google-fiókkal"}
|
||||
</span>
|
||||
<div ref={slot} className="gsi-overlay" />
|
||||
</div>
|
||||
{error && (
|
||||
<p className="msg msg-error" role="alert">
|
||||
{error}
|
||||
|
||||
@@ -47,7 +47,7 @@ export default async function LoginPage({ searchParams }: { searchParams: Promis
|
||||
<div className="auth-box">
|
||||
<div className="page-head">
|
||||
<h1 style={{ fontSize: 44 }}>Belépés</h1>
|
||||
<p className="muted">Lépj be a Google-fiókoddal. Ha még nincs fiókod, az első belépéskor létrejön.</p>
|
||||
<p className="muted">Üdv újra! Lépj be a fiókodba.</p>
|
||||
</div>
|
||||
{config === null ? (
|
||||
<p className="msg msg-error" role="alert">
|
||||
@@ -60,6 +60,7 @@ export default async function LoginPage({ searchParams }: { searchParams: Promis
|
||||
A Google-belépés még nincs beállítva (a backend <code>GOOGLE_CLIENT_IDS</code> változója üres).
|
||||
</p>
|
||||
)}
|
||||
<p className="auth-foot">Még nincs fiókod? Az első belépéskor létrejön.</p>
|
||||
<p className="hint">
|
||||
A belépéssel elfogadod, hogy a születési adataidat a képleted kiszámításához tároljuk. Bármikor törölheted
|
||||
őket a profilodban.
|
||||
|
||||
@@ -143,9 +143,27 @@ td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
|
||||
}
|
||||
.auth-main { flex: 1 1 480px; display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
|
||||
.auth-box { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 28px; }
|
||||
.wheel { width: min(380px, 80%); aspect-ratio: 1; margin: 0 auto; }
|
||||
.tagline { font-family: var(--font-display); font-size: 36px; font-weight: 600; line-height: 1.1; }
|
||||
.gsi-slot { min-height: 44px; display: flex; justify-content: center; }
|
||||
.wheel { width: min(440px, 80%); aspect-ratio: 1; margin: 0 auto; }
|
||||
.tagline { font-family: var(--font-display); font-size: 38px; font-weight: 600; line-height: 1.1; }
|
||||
.auth-foot { font-size: 15px; color: var(--muted); text-align: center; }
|
||||
|
||||
/* Social login buttons; Google's own button lies invisibly on top (.gsi-overlay). */
|
||||
.social-login { position: relative; }
|
||||
.btn-social {
|
||||
position: relative; width: 100%; min-height: 48px; padding: 0 52px;
|
||||
display: flex; align-items: center; justify-content: center; gap: 12px;
|
||||
border: 1px solid var(--line-2); border-radius: var(--radius); background: transparent;
|
||||
color: var(--ink); font: 500 15px var(--font-body);
|
||||
}
|
||||
.btn-social-icon { position: absolute; left: 16px; top: 50%; margin-top: -10px; width: 20px; height: 20px; display: flex; }
|
||||
.social-login:hover .btn-social { border-color: #5a6790; background: rgba(255, 255, 255, 0.03); }
|
||||
.social-login:focus-within .btn-social { outline: 2px solid var(--gold); outline-offset: 2px; }
|
||||
.social-login[data-ready="false"] .btn-social { opacity: 0.6; }
|
||||
.gsi-overlay {
|
||||
position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
|
||||
opacity: 0.001; overflow: hidden; cursor: pointer;
|
||||
}
|
||||
.gsi-overlay > div, .gsi-overlay iframe { transform: scale(1.06, 1.2); }
|
||||
|
||||
/* Detailed analysis */
|
||||
.analysis-card { gap: 14px; }
|
||||
|
||||
Reference in New Issue
Block a user