Files
co-lite/solvway-customer-portal/app/components/auth/AuthShell.tsx
T
ngqileandClaude Opus 5.5 5ee51d1913 chore: copy kept Tastefully modules and portals into Co-Lite
Backend modules from tastefully 8bd93d15: core-libs, core-session,
api-gateway, mobile-api, services-auth, services-system,
services-counter, services-member, services-log, services-email.
solvway-admin-portal from babyboo f64d096ea, solvway-customer-portal
from tastefully 8bd93d15. Copied as tracked files only.

Literal secrets replaced with environment placeholders:
- services-email: SMTP_PASSWORD, MAILGUN_API_KEY, SENDGRID_API_KEY,
  MAILJET_API_KEY, MAILJET_SECRET_KEY (optional, empty default)
- services-system: JUMIO_TOKEN, JUMIO_SECRET (optional)
- services-auth: USER_AUTH_API_SECRET (required); commented JWT secret removed
- core-libs: JWT_TOKEN default removed (required), XXL_JOB_TOKEN default
  removed, ipgeolocation key read from IPGEOLOCATION_API_KEY
- services-system EkycAppConfig: commented Jumio credentials removed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
2026-11-26 15:55:45 +08:00

122 lines
4.8 KiB
TypeScript

"use client";
import { motion } from "framer-motion";
import TastefullyLogo from "@/app/components/TastefullyLogo";
/* ── Pre-defined floating food icon positions (deterministic — no Math.random) ── */
const FOOD_ICONS = [
{ emoji: "🍜", x: 7, y: 10, dur: 3.6, delay: 0.0, size: 28, rot: -12 },
{ emoji: "🍕", x: 84, y: 20, dur: 4.2, delay: 0.9, size: 24, rot: 15 },
{ emoji: "🥗", x: 14, y: 55, dur: 3.9, delay: 1.6, size: 30, rot: -8 },
{ emoji: "🍱", x: 78, y: 65, dur: 4.6, delay: 0.4, size: 22, rot: 10 },
{ emoji: "🥘", x: 42, y: 14, dur: 3.3, delay: 2.2, size: 34, rot: -5 },
{ emoji: "🍛", x: 91, y: 45, dur: 4.9, delay: 1.1, size: 22, rot: 18 },
{ emoji: "🥩", x: 4, y: 80, dur: 3.7, delay: 0.6, size: 26, rot: -14 },
{ emoji: "🍣", x: 62, y: 82, dur: 4.1, delay: 1.9, size: 22, rot: 8 },
{ emoji: "🥑", x: 26, y: 40, dur: 3.8, delay: 0.7, size: 20, rot: -10 },
{ emoji: "🍋", x: 70, y: 28, dur: 4.4, delay: 2.6, size: 24, rot: 12 },
{ emoji: "🥦", x: 18, y: 90, dur: 3.5, delay: 1.3, size: 26, rot: -6 },
{ emoji: "🍇", x: 52, y: 6, dur: 4.0, delay: 1.0, size: 22, rot: 9 },
{ emoji: "🧆", x: 35, y: 72, dur: 4.3, delay: 0.2, size: 20, rot: -16 },
{ emoji: "🍰", x: 88, y: 88, dur: 3.4, delay: 2.0, size: 24, rot: 14 },
];
interface AuthShellProps {
children: React.ReactNode;
title: string;
subtitle?: string;
}
export default function AuthShell({ children, title, subtitle }: AuthShellProps) {
return (
<div className="min-h-full relative overflow-hidden flex flex-col">
{/* ── App-primary background (adapts to theme) ─────────── */}
<div className="absolute inset-0" style={{ background: "rgba(255, 107, 0, .07)" }} />
{/* ── Subtle brand accent glows ─────────────────────────── */}
<div
className="absolute top-0 right-0 w-80 h-80 rounded-full pointer-events-none"
style={{
background: "radial-gradient(ellipse at top right, rgba(245, 197, 163, 0.12) 0%, transparent 65%)",
filter: "blur(48px)",
}}
/>
<div
className="absolute bottom-0 left-0 w-72 h-72 rounded-full pointer-events-none"
style={{
background: "radial-gradient(ellipse at bottom left, rgba(41,10,129,0.10) 0%, transparent 65%)",
filter: "blur(56px)",
}}
/>
{/* ── Floating food icons (subtle on light bg) ─────────── */}
{FOOD_ICONS.map((item, i) => (
<motion.span
key={i}
className="absolute pointer-events-none select-none"
style={{
left: `${item.x}%`,
top: `${item.y}%`,
fontSize: item.size,
opacity: 0.12,
}}
animate={{
y: [0, -14, 0],
rotate: [item.rot, -item.rot, item.rot],
opacity: [0.07, 0.16, 0.07],
}}
transition={{
duration: item.dur,
repeat: Infinity,
delay: item.delay,
ease: "easeInOut",
}}
>
{item.emoji}
</motion.span>
))}
{/* ── Scrollable content ────────────────────────────────── */}
<div className="relative z-10 flex-1 flex flex-col items-center justify-center px-5 py-8 min-h-full">
{/* Logo + title */}
<motion.div
initial={{ opacity: 0, y: -20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ type: "spring", stiffness: 320, damping: 26 }}
className="flex flex-col items-center gap-3 mb-6"
>
<TastefullyLogo className="h-16 sm:h-20 w-auto" fill="#FF6B00" />
<div className="text-center">
<h1 className="text-2xl font-extrabold tracking-tight leading-tight" style={{ color: "var(--text-primary)" }}>
{title}
</h1>
{subtitle && (
<p className="text-sm mt-1" style={{ color: "var(--text-secondary)" }}>
{subtitle}
</p>
)}
</div>
</motion.div>
{/* Card — matches the app's surface-card style */}
<motion.div
initial={{ opacity: 0, y: 24, scale: 0.97 }}
animate={{ opacity: 1, y: 0, scale: 1 }}
transition={{ type: "spring", stiffness: 300, damping: 28, delay: 0.08 }}
className="w-full max-w-sm rounded-3xl overflow-hidden"
style={{
background: "var(--bg-card)",
border: "1px solid var(--border-color)",
boxShadow: "var(--shadow-card)",
}}
>
<div className="px-6 py-6">
{children}
</div>
</motion.div>
</div>
</div>
);
}