From 03cc43ef30468373dc9c926fda03c369745e5baa Mon Sep 17 00:00:00 2001 From: yiling Date: Wed, 27 May 2026 16:43:18 +0800 Subject: [PATCH] feat(auth): redesign login and signup pages for premium visual aesthetics --- src/ui/globals.css | 30 +++++ src/ui/routes/login.tsx | 206 ++++++++++++++++++++++------- src/ui/routes/signup.tsx | 278 ++++++++++++++++++++++++++++----------- 3 files changed, 392 insertions(+), 122 deletions(-) diff --git a/src/ui/globals.css b/src/ui/globals.css index d9ab40ca..d65ee976 100644 --- a/src/ui/globals.css +++ b/src/ui/globals.css @@ -1,3 +1,5 @@ +@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap'); + @import 'tailwindcss'; @import 'tw-animate-css'; @@ -67,6 +69,8 @@ } @theme inline { + --font-sans: 'Plus Jakarta Sans', var(--font-sans); + --color-background: var(--background); --color-foreground: var(--foreground); --color-card: var(--card); @@ -100,6 +104,8 @@ --color-sidebar-ring: var(--sidebar-ring); --animate-upload-breathing: upload-breathing 2s cubic-bezier(0.4, 0, 0.6, 1) infinite alternate; + --animate-drift-slow: drift-slow 15s ease-in-out infinite alternate; + --animate-drift-medium: drift-medium 12s ease-in-out infinite alternate; @keyframes upload-breathing { 0% { @@ -111,6 +117,30 @@ transform: scale(1.05); } } + + @keyframes drift-slow { + 0% { + transform: translate(0px, 0px) scale(1); + } + 50% { + transform: translate(40px, -60px) scale(1.15); + } + 100% { + transform: translate(-30px, 30px) scale(0.9); + } + } + + @keyframes drift-medium { + 0% { + transform: translate(0px, 0px) scale(1.1); + } + 50% { + transform: translate(-50px, 40px) scale(0.85); + } + 100% { + transform: translate(30px, -30px) scale(1.05); + } + } } @layer base { diff --git a/src/ui/routes/login.tsx b/src/ui/routes/login.tsx index cfc98ab4..e1ecfadf 100644 --- a/src/ui/routes/login.tsx +++ b/src/ui/routes/login.tsx @@ -1,14 +1,6 @@ import { client } from '@/ui/api/client' import { useQuery } from '@tanstack/react-query' import { Button } from '@/ui/components/ui/button' -import { - Card, - CardContent, - CardDescription, - CardFooter, - CardHeader, - CardTitle, -} from '@/ui/components/ui/card' import { Input } from '@/ui/components/ui/input' import { Label } from '@/ui/components/ui/label' import { useAuthStore } from '@/ui/stores/auth' @@ -18,6 +10,8 @@ import { useEffect, useState } from 'react' import { useForm } from 'react-hook-form' import { z } from 'zod' import { signIn } from '@/ui/lib/auth-client' +import { Loader2, Mail, Lock, ArrowRight, LogIn, CheckCircle2 } from 'lucide-react' +import { ShumaiLogo } from '@/ui/components/ui/icons' const loginSchema = z.object({ email: z.string().email('Invalid email address'), @@ -32,7 +26,7 @@ function LoginPage() { const [error, setError] = useState(null) const [loading, setLoading] = useState(false) - const { data: signupInfo } = useQuery({ + const { data: signupInfo, isLoading: isSignupInfoLoading } = useQuery({ queryKey: ['/signup-info'], queryFn: async () => { const res = await client.api['signup-info'].$get() @@ -71,52 +65,176 @@ function LoginPage() { } } + if (isSignupInfoLoading) { + return ( +
+
+ + +
+
+ ) + } + return ( -
- - - Login - Enter your credentials to access your account. - - -
- {error &&

{error}

} +
+ {/* Drifting Background Mesh Blobs */} +
+
+ + {/* Main Glassmorphic Split-Pane Card */} +
+ {/* Left Pane (Brand Showcase) */} +
+ {/* Subtle Grid Overlay */} +
+ + {/* Logo & Brand */} +
+ + + Shumai + +
+ + {/* Marketing Copy / Feature Points */} +
+

+ One workspace +
+ for all your +
+ + creative assets. + +

+

+ Upload and index your files, enrich them with custom metadata schemas, draw + annotations directly on media, and gather instant feedback — all in one modern + workspace built for creators. +

+ +
    + {[ + 'Instant asset uploads & high-fidelity media players', + 'Custom metadata schemas & drawing canvas reviews', + 'Frictionless team workspaces & secure sharing', + ].map((text, i) => ( +
  • + + {text} +
  • + ))} +
+
+ + {/* Footer Label */} +
+

+ Join our community of developers and designers. +

+
+
+ + {/* Right Pane (Form Container) */} +
+
+

+ Welcome Back +

+

+ Enter your credentials to access your account. +

+
+ + {error && ( +
+ {error} +
+ )} + +
- - + +
+ + +
{form.formState.errors.email && ( -

{form.formState.errors.email.message}

+

+ {form.formState.errors.email.message} +

)}
+
- - + +
+ + +
{form.formState.errors.password && ( -

{form.formState.errors.password.message}

+

+ {form.formState.errors.password.message} +

)}
- - - - Don't have an account?{' '} - - Sign up - - - + +
+ Don't have an account? + + Sign up + +
+
+
) } diff --git a/src/ui/routes/signup.tsx b/src/ui/routes/signup.tsx index 531f84d5..3c33bd89 100644 --- a/src/ui/routes/signup.tsx +++ b/src/ui/routes/signup.tsx @@ -1,17 +1,10 @@ import { client } from '@/ui/api/client' import { useQuery } from '@tanstack/react-query' import { Button } from '@/ui/components/ui/button' -import { - Card, - CardContent, - CardDescription, - CardFooter, - CardHeader, - CardTitle, -} from '@/ui/components/ui/card' +import { Card, CardDescription, CardFooter, CardHeader, CardTitle } from '@/ui/components/ui/card' import { Input } from '@/ui/components/ui/input' import { Label } from '@/ui/components/ui/label' -import { Loader2 } from 'lucide-react' +import { Loader2, Mail, Lock, CheckCircle2, ArrowRight, UserPlus } from 'lucide-react' import { useAuthStore } from '@/ui/stores/auth' import { zodResolver } from '@hookform/resolvers/zod' import { createFileRoute, redirect, useNavigate } from '@tanstack/react-router' @@ -19,11 +12,11 @@ import { useForm } from 'react-hook-form' import { z } from 'zod' import { signUp } from '@/ui/lib/auth-client' import { useState } from 'react' +import { ShumaiLogo } from '@/ui/components/ui/icons' const signupSchema = z.object({ - name: z.string().min(1, 'Name is required'), email: z.string().email('Invalid email address'), - password: z.string().min(1, 'Password is required'), + password: z.string().min(3, 'Password must be at least 3 characters'), inviteCode: z.string().optional(), }) @@ -74,9 +67,8 @@ function SignupPage() { const { data: session, error: signUpError } = await signUp.email({ email: data.email, password: data.password, - name: data.name, + name: data.email, // Use email as the username inviteCode: data.inviteCode, - // Cast to any because inviteCode is a custom field handled in Better Auth hooks // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any) @@ -94,8 +86,11 @@ function SignupPage() { if (isSignupInfoLoading) { return ( -
- +
+
+ + +
) } @@ -105,19 +100,34 @@ function SignupPage() { if (isPublicSignupDisabled) { return ( -
- - - Registration Disabled - - Public registration is disabled. You need an invite code to join. +
+ {/* Background Mesh Blobs */} +
+
+ + + +
+ +
+ + Registration Disabled + + + Public registration is currently disabled. You will need an invite code to join this + team.
- - Already have an account?{' '} - - Login - + +

+ Already have an account?{' '} + + Login here + +

@@ -125,70 +135,182 @@ function SignupPage() { } return ( -
- - - Sign Up - Create an account to get started. - - - {error &&

{error}

} - {isFirstUser && ( -
- You will be the owner of the default team. +
+ {/* Drifting Background Mesh Blobs */} +
+
+ + {/* Main Glassmorphic Split-Pane Card */} +
+ {/* Left Pane (Brand Showcase) */} +
+ {/* Subtle Grid Overlay */} +
+ + {/* Logo & Brand */} +
+ + + Shumai + +
+ + {/* Marketing Copy / Feature Points */} +
+

+ One workspace +
+ for all your +
+ + creative assets. + +

+

+ Upload and index your files, enrich them with custom metadata schemas, draw + annotations directly on media, and gather instant feedback — all in one modern + workspace built for creators. +

+ +
    + {[ + 'Instant asset uploads & high-fidelity media players', + 'Custom metadata schemas & drawing canvas reviews', + 'Frictionless team workspaces & secure sharing', + ].map((text, i) => ( +
  • + + {text} +
  • + ))} +
+
+ + {/* Context Banners (First User / Invite Info) */} +
+ {isFirstUser && ( +
+ 🎉 + You will be the owner of the default workspace as the first user! +
+ )} + {inviteInfo && !('error' in inviteInfo) && ( +
+ 👋 + + {inviteInfo.inviterName} invited you to join{' '} + {inviteInfo.teamName || inviteInfo.projectName} as a{' '} + {inviteInfo.role}. + +
+ )} + {!isFirstUser && !inviteInfo && ( +

+ Join our community of developers and designers. +

+ )} +
+
+ + {/* Right Pane (Form Container) */} +
+
+

+ Create Account +

+

+ Start building and organizing your space. +

+
+ + {error && ( +
+ {error}
)} - {inviteInfo && !('error' in inviteInfo) && ( -
- {inviteInfo.inviterName} invited you to join{' '} - {inviteInfo.teamName || inviteInfo.projectName}{' '} - as {inviteInfo.role}. -
- )} -
+ +
- - - {form.formState.errors.name && ( -

{form.formState.errors.name.message}

- )} -
-
- - + +
+ + +
{form.formState.errors.email && ( -

{form.formState.errors.email.message}

+

+ {form.formState.errors.email.message} +

)}
+
- - + +
+ + +
{form.formState.errors.password && ( -

{form.formState.errors.password.message}

+

+ {form.formState.errors.password.message} +

)}
-
- - - Already have an account?{' '} - - Login - - - + +
+ Already have an account? + + Login + +
+
+
) }