Components99 / 118
Dawn Login
A calm sign-in on borderless frosted glass over a living night landscape. The lavender sways in the wind and shifts in real depth parallax, stars twinkle and shoot, the sun mark breathes; every keystroke sends a gust across the field, the password deepens the night, and signing in brings the dawn.
LoginLoginAuthAuthFrosted glassFrosted glassWebGL2WebGL2Depth parallaxDepth parallaxGSAPGSAP

Welcome back
Sign in to return to your breathing sessions, daily practice and quiet place.
New here?
AType to send wind across the fieldLog in to bring the dawn
Tweak
LIVELIVECopy
Usage
Follows your tweaks.
usage.tsx
import { DawnLogin } from "@/components/inreact/dawn-login";
export function SignIn() {
return (
<div className="h-screen">
<DawnLogin
title="Welcome back"
image="/art/landscape.jpg"
depth="/art/landscape-depth.png"
horizon={0.6}
onSubmit={async ({ email, password, remember }) => {
const res = await fetch("/api/login", { method: "POST", body: JSON.stringify({ email, password, remember }) });
if (!res.ok) throw new Error("wrong details");
}}
/>
</div>
);
}Install with the CLI
TS + Tailwind
npx shadcn@latest add https://inreact.vercel.app/r/dawn-login.jsonOr copy the source
Install the dependencies, then save this as components/inreact/dawn-login.tsx.
terminal
npm install gsapcomponents/inreact/dawn-login.tsx
"use client";
import { gsap } from "gsap";
import { useEffect, useId, useLayoutEffect, useRef, useState, type FormEvent } from "react";
/**
* Dawn Login: a calm sign-in on frosted glass over a living night landscape.
*
* The landscape is a photo with a depth map, drawn in WebGL: it shifts in
* real parallax as you move, the near lavender sways in the wind, stars
* twinkle in the sky and now and then one shoots across. The sun mark on the
* card breathes in slow four-second cycles. Every keystroke sends a soft gust
* of wind across the field; focusing the password deepens the night and
* brightens the stars; a wrong login shakes the card; and signing in brings
* the dawn: the sky warms from the horizon, the stars fade and the sun rises.
* The borderless frosted card tilts gently toward your cursor.
*
* <DawnLogin onSubmit={async ({ email, password }) => { await signIn(email, password) }} />
*/
export interface DawnLoginValues {
email: string;
password: string;
remember: boolean;
}
export interface DawnLoginProps {
/** Throw (or reject) to show the error state. */
onSubmit?: (values: DawnLoginValues) => Promise<void> | void;
onGoogle?: () => void;
onForgot?: () => void;
onSignUp?: () => void;
title?: string;
subtitle?: string;
image?: string;
/** Depth map for the parallax and the wind (white = near). */
depth?: string;
/** Height of the horizon in the image, 0 (bottom) to 1 (top). */
horizon?: number;
className?: string;
}
const reduced = () => typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
const clamp = (a: number, b: number, v: number) => Math.max(a, Math.min(b, v));
const EMAIL = /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/;
const VERT = `#version 300 es
in vec2 aQ;
out vec2 vUv;
void main() { vUv = aQ * 0.5 + 0.5; gl_Position = vec4(aQ, 0.0, 1.0); }`;
const FRAG = `#version 300 es
precision highp float;
in vec2 vUv;
out vec4 o;
uniform sampler2D uImg, uDepth;
uniform vec2 uScale, uMouse, uRes;
uniform float uTime, uGust, uGustX, uDim, uDawn, uHorizon;
uniform vec4 uShoot; // start x, y (uv), angle, progress 0..1 (outside = none)
float hash(vec2 p) { return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453); }
vec2 hash2(vec2 p) { return vec2(hash(p), hash(p + 17.31)); }
float noise(vec2 p) {
vec2 i = floor(p), f = fract(p);
vec2 u = f * f * (3.0 - 2.0 * f);
return mix(mix(hash(i), hash(i + vec2(1, 0)), u.x), mix(hash(i + vec2(0, 1)), hash(i + vec2(1, 1)), u.x), u.y);
}
void main() {
vec2 uv = (vUv - 0.5) * uScale + 0.5; // object-fit: cover
float d = texture(uDepth, uv).r;
// parallax: near things shift further than far ones
vec2 off = uMouse * 0.018 * (d - 0.3);
// wind: the near lavender sways, more in a gust as it travels across the field
float near = smoothstep(0.3, 0.85, d);
float front = exp(-pow((vUv.x - uGustX) * 3.0, 2.0)) * uGust;
float sway = sin(uTime * 1.5 + uv.x * 11.0 + uv.y * 46.0 + noise(uv * 6.0 + uTime * 0.3) * 4.0);
off.x += sway * 0.0032 * near * (0.55 + front * 3.2 + uGust * 0.6);
off.y += cos(uTime * 1.2 + uv.x * 13.0) * 0.0012 * near * (0.4 + front * 2.0);
vec2 p = uv - off * 1.0;
vec3 col = texture(uImg, clamp(p, 0.001, 0.999)).rgb;
// sky: where the depth is far, above the horizon
float sky = (1.0 - smoothstep(0.035, 0.1, d)) * smoothstep(uHorizon + 0.04, uHorizon + 0.12, uv.y);
// stars: a fine grid of points, each twinkling on its own clock
vec2 sp = vUv * uRes / 10.0;
vec2 cell = floor(sp), f = fract(sp);
float h = hash(cell);
vec2 at = 0.2 + 0.6 * hash2(cell);
float r = length(f - at) * 10.0; // in device pixels: round points, never cut off by their cell
float tw = 0.55 + 0.45 * sin(uTime * (1.2 + h * 3.0) + h * 40.0);
float star = step(0.988, h) * exp(-r * r / 1.6) * tw * (0.6 + 0.4 * h);
float big = step(0.997, h) * (exp(-r * r / 3.2) + exp(-r / 2.5) * 0.15) * tw;
float sv = (star + big * 0.8) * sky * (1.0 - uDawn) * (1.0 + uDim * 1.2);
col += vec3(0.86, 0.84, 1.0) * sv;
// a shooting star now and then
if (uShoot.w > 0.0 && uShoot.w < 1.0) {
vec2 dir = vec2(cos(uShoot.z), sin(uShoot.z));
vec2 head = uShoot.xy + dir * uShoot.w * 0.45;
vec2 q = (uv - head) * vec2(uRes.x / uRes.y, 1.0);
vec2 dd = dir * vec2(uRes.x / uRes.y, 1.0);
float along = dot(q, -normalize(dd));
float across = length(q + normalize(dd) * along);
float tail = smoothstep(0.16, 0.0, along) * step(0.0, along);
float life = sin(uShoot.w * 3.14159);
col += vec3(1.0, 0.95, 1.0) * exp(-across * across * 2.6e5) * tail * life * sky * 1.4 * (1.0 - uDawn);
}
// night deepens while the password is typed
col *= 1.0 - uDim * 0.22 * (1.0 - sv);
// dawn: warm light rising from the horizon, the field catching it
float above = uv.y - uHorizon;
vec3 warmSky = mix(vec3(1.0, 0.62, 0.42), mix(vec3(0.96, 0.55, 0.62), vec3(0.55, 0.42, 0.85), smoothstep(0.05, 0.4, above)), smoothstep(0.0, 0.18, above));
col = mix(col, mix(col, warmSky * (0.55 + 0.6 * dot(col, vec3(0.33))) + col * 0.4, 0.75), uDawn * sky);
col += vec3(1.0, 0.6, 0.38) * exp(-pow(above / 0.09, 2.0)) * 0.22 * uDawn;
col = mix(col, col * vec3(1.18, 1.02, 0.9) + vec3(0.05, 0.03, 0.0), uDawn * (1.0 - sky) * 0.7);
o = vec4(col, 1.0);
}`;
export function DawnLogin({
onSubmit = () => new Promise((r) => setTimeout(r, 1000)),
onGoogle,
onForgot,
onSignUp,
title = "Welcome back",
subtitle = "Sign in to return to your breathing sessions, daily practice and quiet place.",
image = "/media/lavender-night.webp",
depth = "/media/lavender-night-depth.webp",
horizon = 0.6,
className,
}: DawnLoginProps) {
const id = useId();
const rootRef = useRef<HTMLDivElement>(null);
const glRef = useRef<HTMLDivElement>(null);
const fitRef = useRef<HTMLDivElement>(null);
const cardRef = useRef<HTMLDivElement>(null);
const sunRef = useRef<SVGSVGElement>(null);
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
const [show, setShow] = useState(false);
const [remember, setRemember] = useState(true);
const [state, setState] = useState<"idle" | "busy" | "ok" | "bad">("idle");
const [error, setError] = useState("");
const fx = useRef({ gust: () => {}, dim: (_on: boolean) => {}, dawn: () => {} });
/* ---- the landscape ---- */
useEffect(() => {
const root = rootRef.current, host = glRef.current;
if (!root || !host) return;
const still = reduced();
const canvas = document.createElement("canvas");
canvas.setAttribute("aria-hidden", "true");
canvas.style.cssText = "position:absolute;inset:0;width:100%;height:100%;";
host.appendChild(canvas);
const gl = canvas.getContext("webgl2", { antialias: false, alpha: false });
if (!gl) {
canvas.remove();
return; // the <img> stays as a still backdrop
}
const sh = (type: number, src: string) => {
const s = gl.createShader(type)!;
gl.shaderSource(s, src);
gl.compileShader(s);
if (!gl.getShaderParameter(s, gl.COMPILE_STATUS)) console.error(gl.getShaderInfoLog(s));
return s;
};
const prog = gl.createProgram()!;
const vs = sh(gl.VERTEX_SHADER, VERT), fs = sh(gl.FRAGMENT_SHADER, FRAG);
gl.attachShader(prog, vs);
gl.attachShader(prog, fs);
gl.bindAttribLocation(prog, 0, "aQ");
gl.linkProgram(prog);
gl.useProgram(prog);
const U = Object.fromEntries(["uImg", "uDepth", "uScale", "uMouse", "uRes", "uTime", "uGust", "uGustX", "uDim", "uDawn", "uHorizon", "uShoot"].map((k) => [k, gl.getUniformLocation(prog, k)]));
const vao = gl.createVertexArray();
gl.bindVertexArray(vao);
const vbo = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, vbo);
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1, -1, 3, -1, -1, 3]), gl.STATIC_DRAW);
gl.enableVertexAttribArray(0);
gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);
const texs: WebGLTexture[] = [];
let iw = 16, ih = 9, ready = 0;
const load = (src: string, unit: number, onSize?: (w: number, h: number) => void) => {
const t = gl.createTexture()!;
texs.push(t);
const im = new Image();
im.decoding = "async";
im.onload = () => {
gl.activeTexture(gl.TEXTURE0 + unit);
gl.bindTexture(gl.TEXTURE_2D, t);
gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true); // image rows top-down, uv bottom-up: keep the picture upright
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, im);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
onSize?.(im.naturalWidth, im.naturalHeight);
ready++;
if (ready === 2) host.dataset.ready = "1";
};
im.src = src;
};
load(image, 0, (w, h) => ((iw = w), (ih = h)));
load(depth, 1);
gl.uniform1i(U.uImg, 0);
gl.uniform1i(U.uDepth, 1);
let W = 1, H = 1, dpr = 1;
const resize = () => {
W = root.clientWidth;
H = root.clientHeight;
dpr = Math.min(2, window.devicePixelRatio || 1);
canvas.width = Math.round(W * dpr);
canvas.height = Math.round(H * dpr);
};
resize();
const ro = new ResizeObserver(resize);
ro.observe(root);
const s = { mx: 0, my: 0, tx: 0, ty: 0, gust: 0, gustX: -0.3, dim: 0, dawn: 0, time: 0, shoot: [0, 0, 0, -1] as number[], nextShoot: 3 + Math.random() * 3 };
fx.current = {
gust: () => {
if (still) return;
// a soft gust of wind runs across the field, left to right
gsap.fromTo(s, { gustX: -0.25 }, { gustX: 1.25, duration: 1.3, ease: "sine.inOut", overwrite: "auto" });
gsap.fromTo(s, { gust: Math.max(s.gust, 0.75) }, { gust: 0, duration: 1.4, ease: "power2.out", overwrite: "auto" });
},
dim: (on) => gsap.to(s, { dim: on ? 1 : 0, duration: still ? 0 : 1.1, ease: "sine.inOut", overwrite: "auto" }),
dawn: () => gsap.to(s, { dawn: 1, dim: 0, duration: still ? 0 : 2.6, ease: "power2.inOut", overwrite: "auto" }),
};
const onMove = (e: PointerEvent) => {
const r = root.getBoundingClientRect();
s.tx = clamp(-1, 1, ((e.clientX - r.left) / r.width - 0.5) * 2);
s.ty = clamp(-1, 1, ((e.clientY - r.top) / r.height - 0.5) * 2);
};
const onLeave = () => ((s.tx = 0), (s.ty = 0));
root.addEventListener("pointermove", onMove);
root.addEventListener("pointerleave", onLeave);
let visible = true;
const io = new IntersectionObserver(([en]) => (visible = en.isIntersecting));
io.observe(root);
const tick = (_t: number, ms: number) => {
if (!visible || ready < 2) return;
const dt = Math.min(ms / 1000, 1 / 30);
if (!still) s.time += dt;
s.mx += (s.tx - s.mx) * (still ? 1 : 1 - Math.exp(-dt * 3));
s.my += (s.ty - s.my) * (still ? 1 : 1 - Math.exp(-dt * 3));
// a shooting star every few seconds
if (!still) {
if (s.shoot[3] >= 0) {
s.shoot[3] += dt / 0.9;
if (s.shoot[3] >= 1) s.shoot[3] = -1;
} else if ((s.nextShoot -= dt) <= 0) {
s.nextShoot = 6 + Math.random() * 6;
s.shoot = [0.15 + Math.random() * 0.5, Math.min(0.97, horizon + 0.3 + Math.random() * 0.15), -0.35 - Math.random() * 0.25, 0];
}
}
const pa = W / H, ta = iw / ih;
gl.viewport(0, 0, canvas.width, canvas.height);
gl.uniform2f(U.uScale, pa > ta ? 1 : pa / ta, pa > ta ? ta / pa : 1);
gl.uniform2f(U.uMouse, -s.mx, s.my);
gl.uniform2f(U.uRes, canvas.width, canvas.height);
gl.uniform1f(U.uTime, s.time);
gl.uniform1f(U.uGust, s.gust);
gl.uniform1f(U.uGustX, s.gustX);
gl.uniform1f(U.uDim, s.dim);
gl.uniform1f(U.uDawn, s.dawn);
gl.uniform1f(U.uHorizon, horizon);
gl.uniform4f(U.uShoot, s.shoot[0], s.shoot[1], s.shoot[2], s.shoot[3]);
gl.drawArrays(gl.TRIANGLES, 0, 3);
};
gsap.ticker.add(tick);
return () => {
gsap.ticker.remove(tick);
ro.disconnect();
io.disconnect();
root.removeEventListener("pointermove", onMove);
root.removeEventListener("pointerleave", onLeave);
gsap.killTweensOf(s);
texs.forEach((t) => gl.deleteTexture(t));
gl.deleteProgram(prog);
gl.deleteShader(vs);
gl.deleteShader(fs);
gl.deleteBuffer(vbo);
gl.deleteVertexArray(vao);
gl.getExtension("WEBGL_lose_context")?.loseContext();
canvas.remove();
};
}, [image, depth, horizon]);
/* ---- the card: fitted to the space, tilting toward the cursor ---- */
useLayoutEffect(() => {
const root = rootRef.current, fit = fitRef.current, card = cardRef.current;
if (!root || !fit || !card) return;
const measure = () => {
const k = Math.min(1, (root.clientHeight * 0.92) / card.offsetHeight, (root.clientWidth * 0.92) / card.offsetWidth);
fit.style.transform = `scale(${k.toFixed(4)})`;
};
measure();
const ro = new ResizeObserver(measure);
ro.observe(root);
ro.observe(card);
if (reduced()) return () => ro.disconnect();
const rx = gsap.quickTo(card, "rotationX", { duration: 0.9, ease: "power3.out" });
const ry = gsap.quickTo(card, "rotationY", { duration: 0.9, ease: "power3.out" });
const onMove = (e: PointerEvent) => {
const r = root.getBoundingClientRect();
ry(clamp(-1, 1, ((e.clientX - r.left) / r.width - 0.5) * 2) * 5);
rx(-clamp(-1, 1, ((e.clientY - r.top) / r.height - 0.5) * 2) * 4);
};
const onLeave = () => (rx(0), ry(0));
root.addEventListener("pointermove", onMove);
root.addEventListener("pointerleave", onLeave);
return () => {
ro.disconnect();
root.removeEventListener("pointermove", onMove);
root.removeEventListener("pointerleave", onLeave);
};
}, []);
/* ---- the sun mark: breathing in slow cycles; rising at dawn ---- */
useEffect(() => {
const sun = sunRef.current;
if (!sun || reduced()) return;
const core = sun.querySelector("[data-core]"), rays = sun.querySelector("[data-rays]");
const tl = gsap.timeline({ repeat: -1, yoyo: true });
tl.fromTo(core, { scale: 0.84, transformOrigin: "50% 50%" }, { scale: 1.06, duration: 4, ease: "sine.inOut" }, 0).fromTo(rays, { scale: 0.86, opacity: 0.55, rotation: 0, transformOrigin: "50% 50%" }, { scale: 1.08, opacity: 1, rotation: 12, duration: 4, ease: "sine.inOut" }, 0);
return () => void tl.kill();
}, []);
const shake = () => {
if (reduced() || !cardRef.current) return;
gsap.fromTo(cardRef.current, { x: -14 }, { x: 0, duration: 0.8, ease: "elastic.out(1, 0.22)" });
};
const submit = async (e: FormEvent) => {
e.preventDefault();
if (state === "busy") return;
if (!EMAIL.test(email.trim()) || !password) {
setError(!EMAIL.test(email.trim()) ? "Enter a valid email address" : "Enter your password");
setState("bad");
shake();
return;
}
setError("");
setState("busy");
try {
await onSubmit({ email: email.trim(), password, remember });
setState("ok");
(document.activeElement as HTMLElement | null)?.blur();
fx.current.dawn();
const sun = sunRef.current;
if (sun && !reduced()) gsap.to(sun, { y: -6, color: "#ffd2a1", duration: 2.4, ease: "power2.inOut" });
} catch {
setError("Those details don't match");
setState("bad");
shake();
}
};
const field = "h-12 w-full rounded-[14px] border-0 bg-white/[0.07] px-4 text-[14px] text-white outline-none transition-[background,box-shadow] duration-300 placeholder:text-white/40 hover:bg-white/[0.1] focus:bg-white/[0.12] focus:shadow-[inset_0_0_0_1px_rgba(255,255,255,0.28)]";
return (
<div ref={rootRef} className={["relative isolate h-full min-h-[520px] w-full overflow-hidden", className].filter(Boolean).join(" ")}>
<div ref={glRef} aria-hidden="true" className="absolute inset-0">
<img src={image} alt="" className="absolute inset-0 size-full object-cover" />
</div>
<div className="absolute inset-0 flex items-center justify-center" style={{ perspective: 1200 }}>
{/* flex centring keeps the card centred even before it is scaled down to fit a small space */}
<div ref={fitRef} className="shrink-0" style={{ transformOrigin: "50% 50%" }}>
<div
ref={cardRef}
className="w-[380px] rounded-[30px] px-8 pt-8 pb-7 text-center text-white will-change-transform"
style={{
// at dawn the sky behind turns light, so the glass deepens a touch to keep the text readable
background:
state === "ok"
? "linear-gradient(180deg, rgba(70,40,120,0.34), rgba(60,36,110,0.3) 45%, rgba(40,28,90,0.32))"
: "linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0.06) 40%, rgba(40,30,80,0.18))",
transition: "background 2.4s ease",
backdropFilter: "blur(22px) saturate(1.5)",
WebkitBackdropFilter: "blur(22px) saturate(1.5)",
boxShadow: "0 30px 60px -20px rgba(10,6,40,0.55), 0 8px 20px -10px rgba(10,6,40,0.35)",
transformStyle: "preserve-3d",
}}
>
<svg ref={sunRef} viewBox="0 0 40 40" width="38" height="38" className="mx-auto block text-white/90" aria-hidden="true">
<circle data-core cx="20" cy="20" r="7.5" fill="none" stroke="currentColor" strokeWidth="1.8" />
<g data-rays stroke="currentColor" strokeWidth="1.8" strokeLinecap="round">
{Array.from({ length: 8 }, (_, i) => {
const a = (i / 8) * Math.PI * 2;
return <line key={i} x1={20 + Math.cos(a) * 12} y1={20 + Math.sin(a) * 12} x2={20 + Math.cos(a) * 16} y2={20 + Math.sin(a) * 16} />;
})}
</g>
</svg>
<h2 className="mt-4 bg-gradient-to-b from-white to-[#d9cdfa] bg-clip-text text-[30px] leading-tight font-medium tracking-[-0.03em] text-transparent">{title}</h2>
<p className="mx-auto mt-2 max-w-[17rem] text-[12.5px] leading-relaxed text-white/65">{subtitle}</p>
<form onSubmit={submit} noValidate className="mt-6 flex flex-col gap-3 text-left">
<label className="block">
<span className="mb-1.5 block text-[11.5px] text-white/60">Email</span>
<input
id={`${id}-email`}
type="email"
autoComplete="email"
value={email}
placeholder="Enter your email"
onChange={(e) => {
setEmail(e.target.value);
if (state === "bad") setState("idle");
fx.current.gust();
}}
className={field}
/>
</label>
<label className="block">
<span className="mb-1.5 block text-[11.5px] text-white/60">Password</span>
<span className="relative block">
<input
id={`${id}-password`}
type={show ? "text" : "password"}
autoComplete="current-password"
value={password}
placeholder="Enter your password"
onChange={(e) => {
setPassword(e.target.value);
if (state === "bad") setState("idle");
fx.current.gust();
}}
onFocus={() => fx.current.dim(true)}
onBlur={() => fx.current.dim(false)}
className={`${field} pr-12`}
/>
<button
type="button"
aria-label={show ? "Hide password" : "Show password"}
aria-pressed={show}
onMouseDown={(e) => e.preventDefault()}
onClick={() => setShow((v) => !v)}
className="absolute top-1/2 right-2 grid size-8 -translate-y-1/2 cursor-pointer place-items-center rounded-full border-0 bg-transparent text-white/60 outline-none hover:text-white focus-visible:ring-2 focus-visible:ring-white/40"
>
<svg viewBox="0 0 24 24" width="17" height="17" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
<path d="M2.5 12s3.5-6.5 9.5-6.5S21.5 12 21.5 12s-3.5 6.5-9.5 6.5S2.5 12 2.5 12z" />
<circle cx="12" cy="12" r="2.8" />
{!show && <path d="M4 20 20 4" />}
</svg>
</button>
</span>
</label>
<div className="mt-1 flex items-center justify-between text-[12px]">
<label className="flex cursor-pointer items-center gap-2 text-white/75">
<input type="checkbox" checked={remember} onChange={(e) => setRemember(e.target.checked)} className="peer sr-only" />
<span aria-hidden="true" className="grid size-4 place-items-center rounded-[5px] transition-colors duration-200 peer-focus-visible:ring-2 peer-focus-visible:ring-white/40" style={{ background: remember ? "#a891ff" : "rgba(255,255,255,0.14)" }}>
<svg viewBox="0 0 16 16" width="11" height="11" aria-hidden="true">
<path d="M3 8.5l3.2 3L13 4.5" fill="none" stroke="#fff" strokeWidth="2.4" strokeLinecap="round" strokeLinejoin="round" style={{ strokeDasharray: 16, strokeDashoffset: remember ? 0 : 16, transition: "stroke-dashoffset .35s cubic-bezier(.34,1.56,.64,1)" }} />
</svg>
</span>
Remember me
</label>
<button type="button" onClick={onForgot} className="cursor-pointer border-0 bg-transparent p-0 text-[12px] text-white/75 outline-none hover:text-white hover:underline focus-visible:underline">
Forgot password?
</button>
</div>
<button
type="submit"
disabled={state === "busy"}
className="mt-2 h-12 cursor-pointer rounded-[14px] border-0 text-[14px] font-semibold text-[#1d1638] outline-none transition-[transform,background] duration-300 ease-[cubic-bezier(0.34,1.56,0.64,1)] hover:-translate-y-0.5 focus-visible:ring-2 focus-visible:ring-white/50 active:translate-y-0 active:scale-[0.97] disabled:cursor-wait"
style={{ background: state === "ok" ? "linear-gradient(180deg,#ffe2bf,#ffc9a0)" : "#ffffff" }}
>
{state === "busy" ? "Signing in…" : state === "ok" ? "Good morning ✓" : "Log in"}
</button>
<div className="flex items-center gap-3 text-[11px] text-white/45" aria-hidden="true">
<span className="h-px flex-1 bg-white/15" />
or
<span className="h-px flex-1 bg-white/15" />
</div>
<button
type="button"
onClick={onGoogle}
className="flex h-12 cursor-pointer items-center justify-center gap-2.5 rounded-[14px] border-0 bg-white/[0.08] text-[13.5px] font-medium text-white outline-none transition-colors duration-200 hover:bg-white/[0.14] focus-visible:ring-2 focus-visible:ring-white/40"
>
<svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true">
<path fill="#4285F4" d="M22.6 12.2c0-.8-.1-1.5-.2-2.2H12v4.2h6c-.3 1.4-1 2.5-2.2 3.3v2.7h3.5c2-1.9 3.3-4.6 3.3-8z" />
<path fill="#34A853" d="M12 23c3 0 5.5-1 7.3-2.7l-3.5-2.7c-1 .7-2.3 1.1-3.8 1.1-2.9 0-5.4-2-6.3-4.6H2.1v2.8C3.9 20.5 7.7 23 12 23z" />
<path fill="#FBBC05" d="M5.7 14.1c-.2-.7-.4-1.4-.4-2.1s.1-1.4.4-2.1V7.1H2.1C1.4 8.6 1 10.3 1 12s.4 3.4 1.1 4.9l3.6-2.8z" />
<path fill="#EA4335" d="M12 5.4c1.6 0 3.1.6 4.2 1.7l3.1-3.1C17.5 2.2 15 1 12 1 7.7 1 3.9 3.5 2.1 7.1l3.6 2.8C6.6 7.3 9.1 5.4 12 5.4z" />
</svg>
Continue with Google
</button>
<p aria-live="polite" className="h-4 text-center text-[12px] text-[#ffb3c1]">
{error}
</p>
</form>
<p className="text-[12px] text-white/60">
New here?{" "}
<button type="button" onClick={onSignUp} className="cursor-pointer border-0 bg-transparent p-0 text-[12px] font-semibold text-white outline-none hover:underline focus-visible:underline">
Create an account
</button>
</p>
</div>
</div>
</div>
</div>
);
}
export default DawnLogin;
One prompt, any AI agent
Paste into Claude Code, Codex, Cursor or Windsurf. It carries your tweaks and the full source, so the agent installs it exactly.
Props
7 propsonSubmit({ email, password, remember }) => Promise<void> | voidSign in; throw or reject to show the error state.onGoogle / onForgot / onSignUp() => voidThe secondary actions.title / subtitlestringHeading and line under it.imagestringThe landscape.depthstringIts depth map, white = near (parallax and wind).horizonnumberHorizon height in the image, 0 bottom to 1 top (stars above, dawn glow at it).default 0.6default 0.6classNamestringExtra classes (give it a full-height container).