Compare commits
243 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8a98e459ee | |||
| 7bb2b6bd44 | |||
| 4b251b8e50 | |||
| 5ce039792e | |||
| 314c65fbfd | |||
| 5c65ebd544 | |||
| 1800139cd8 | |||
| a7a8eba464 | |||
| e5a896e9e4 | |||
| d41261e1cc | |||
| 1fb92d6469 | |||
| 3583f3389c | |||
| 68b168061d | |||
| 4c0a5a78fe | |||
| 0ddac07cbe | |||
| a9b28fe88f | |||
| bdadc5fa20 | |||
| 7e395a9bf6 | |||
| e6239e490f | |||
| f0dfa51511 | |||
| 92007b1ff7 | |||
| ac2e5c80f2 | |||
| e6905d194d | |||
| c61a8fbed8 | |||
| b744886412 | |||
| 1ded73a33b | |||
| d3444db041 | |||
| c9a8576630 | |||
| 64214bb6f3 | |||
| eacd01efe1 | |||
| f68ab32eea | |||
| f0fdef56e3 | |||
| 096d0e06f7 | |||
| eb79b2dfdd | |||
| 206c1704cd | |||
| 9803d7c8d4 | |||
| cbcdc2a401 | |||
| 436fc50bda | |||
| 17cc11c0a7 | |||
| 257bec55b5 | |||
| 4e1a47682d | |||
| 303c4e0f55 | |||
| 5d360e28c5 | |||
| 01856dd9e9 | |||
| 030077b623 | |||
| 9f01fe99d5 | |||
| b394f9c6ad | |||
| ca94a50c72 | |||
| c4d8f371b4 | |||
| 5267e7757f | |||
| 702dea54a8 | |||
| 2c41a48def | |||
| 22e814cc98 | |||
| 1f6828c551 | |||
| c174aaa219 | |||
| f78fb8a700 | |||
| 9e677a0071 | |||
| 1af2a5c357 | |||
| a38687a637 | |||
| 451e10f5b2 | |||
| 74f778ee29 | |||
| cda29a43e7 | |||
| 3d92d71819 | |||
| ed554bf24a | |||
| 7d8a7ae55e | |||
| 579dc9dc9d | |||
| 49f7244109 | |||
| 02691a0020 | |||
| 0a13433a62 | |||
| 844a98f6a9 | |||
| ec1b3001a4 | |||
| c99341edd9 | |||
| aff8999ac8 | |||
| a5d4ec5e96 | |||
| 53b4817e80 | |||
| f4141e857d | |||
| 32c63b5f3c | |||
| 9467e5c4bd | |||
| 29996e7f70 | |||
| 61c3bc6aa1 | |||
| 544c44a6bd | |||
| 6ea10dae0b | |||
| 340a69ccf6 | |||
| 2e0e7f3be4 | |||
| 4d6b0d488a | |||
| 342adc2d8e | |||
| 643c859894 | |||
| 8d2bd20637 | |||
| 326c9c2dc6 | |||
| 709b6fb5ad | |||
| 8b965ca5af | |||
| 8486499be5 | |||
| 30e9bb610c | |||
| b121f70611 | |||
| b276c8fa73 | |||
| 104c638634 | |||
| 34175d54a3 | |||
| 6e7b37883f | |||
| 5a6c4ca430 | |||
| 75f30cf7e3 | |||
| 93509b1fc5 | |||
| 1a73ca0c24 | |||
| 0d83b3c469 | |||
| e819207b6b | |||
| 796ecee666 | |||
| 17e5004f24 | |||
| 63bdd90d3f | |||
| 81d61ec439 | |||
| 9c29530163 | |||
| d4fc238f15 | |||
| c02676d14d | |||
| 6279afd2b2 | |||
| 869c46ffc9 | |||
| 86e4810f2d | |||
| d38fe18069 | |||
| bf24d8f867 | |||
| ca213349c7 | |||
| 76b346ad31 | |||
| 55bf215e00 | |||
| 0d98cb54c7 | |||
| 8e5e442bec | |||
| 8bf6e5fb74 | |||
| fa0fc6c6b4 | |||
| 0f9cc76017 | |||
| 59cf14c810 | |||
| b890e59fc9 | |||
| 089258a106 | |||
| 24dd58ced9 | |||
| 0c803c4b64 | |||
| 3cf272f29f | |||
| 8d15f5471a | |||
| 103bc6030a | |||
| 1f8b461861 | |||
| fa3501c0d9 | |||
| 791dbfe237 | |||
| fa387d32f8 | |||
| 8fe09c7b2c | |||
| ff8d4e3912 | |||
| 253876ce81 | |||
| 6d3d9dcf3a | |||
| 575691e152 | |||
| 1eba8e94de | |||
| 382dd0a179 | |||
| 95b1b27ea5 | |||
| df45b0b584 | |||
| 6aba436be7 | |||
| 7c842847c6 | |||
| 3a8ca5d068 | |||
| ffcdd174e6 | |||
| f34b523345 | |||
| 18702b6298 | |||
| ad4bb467b4 | |||
| f64d555529 | |||
| a278411308 | |||
| 5c2002fb5a | |||
| a56118e150 | |||
| 1678c72b4f | |||
| d8cf93f987 | |||
| 1cce93f1d1 | |||
| 39c4f3a82c | |||
| 2f24aab896 | |||
| fe3478c6ae | |||
| 49696bc175 | |||
| 852c52dfb1 | |||
| aaa07ccea0 | |||
| 21f870c64e | |||
| 7a521e3912 | |||
| 1eaa4a4569 | |||
| 3ad37e2c82 | |||
| dce3b057d7 | |||
| 9cf7c31c16 | |||
| 193d19e4fc | |||
| bd43f1b503 | |||
| 27e67e8f1e | |||
| 6e5b3c3bf6 | |||
| f09537a3f5 | |||
| 26057e5e7e | |||
| 197264d5c3 | |||
| 5065544cf4 | |||
| 3bef360c37 | |||
| c7e3a8b59c | |||
| d394b9770f | |||
| d956968cd6 | |||
| db619221f4 | |||
| 7d1e112bfc | |||
| 1ffbd9d947 | |||
| f68764e8e9 | |||
| 70f7b66643 | |||
| e4ac34cd21 | |||
| 7fc4be4e19 | |||
| 7cb719eca2 | |||
| cb1a71864b | |||
| 0ce139e2d4 | |||
| 303cacf268 | |||
| b2aab29924 | |||
| 835d0e5229 | |||
| 042dd6a39b | |||
| 9389d1469c | |||
| 642c2dc24c | |||
| 3f92566997 | |||
| 285049550b | |||
| 1098188c38 | |||
| 2e2a169c0e | |||
| 060164bb91 | |||
| f5bdcdd234 | |||
| e96e06a541 | |||
| 59b51e581d | |||
| bb62b2d351 | |||
| 76951b2686 | |||
| 522e7b9cce | |||
| 08e661b373 | |||
| 98d6e6d1d9 | |||
| d8131a0dad | |||
| eb73d10795 | |||
| d47e9def4f | |||
| 22c2f4a8be | |||
| da429db8e2 | |||
| 96ecf3d875 | |||
| 4e33aad76d | |||
| 02d210a684 | |||
| 2b040b39b7 | |||
| e05a1e869a | |||
| 3649146e1e | |||
| c79bc5cf3c | |||
| d328e3221c | |||
| 531b1c297b | |||
| 8ae1f717a3 | |||
| a48de5fed2 | |||
| 9f6d8f6534 | |||
| 81364f26e1 | |||
| a134d194ba | |||
| 5f41fe61eb | |||
| e7035f4734 | |||
| c84844aaf3 | |||
| 289c7da1c4 | |||
| 0b5e289aa5 | |||
| 40357c2c40 | |||
| 3180013673 | |||
| 093309937b | |||
| 308dee7afe | |||
| f9e55abdf0 | |||
| 88623e3b9b | |||
| d0afbe9b1f |
61
src/app/api/auth/login/route.ts
Normal file
61
src/app/api/auth/login/route.ts
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
import { NextRequest, NextResponse } from "next/server";
|
||||||
|
import bcrypt from "bcryptjs";
|
||||||
|
import jwt from "jsonwebtoken";
|
||||||
|
|
||||||
|
const JWT_SECRET = process.env.JWT_SECRET || "your-secret-key-change-in-production";
|
||||||
|
|
||||||
|
// Mock database - in production, use a real database
|
||||||
|
const users: Array<{ id: string; name: string; email: string; passwordHash: string }> = [];
|
||||||
|
|
||||||
|
export async function POST(request: NextRequest) {
|
||||||
|
try {
|
||||||
|
const { email, password } = await request.json();
|
||||||
|
|
||||||
|
// Validation
|
||||||
|
if (!email || !password) {
|
||||||
|
return NextResponse.json(
|
||||||
|
{ message: "Email e senha são obrigatórios" },
|
||||||
|
{ status: 400 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Find user
|
||||||
|
const user = users.find((u) => u.email === email);
|
||||||
|
if (!user) {
|
||||||
|
return NextResponse.json(
|
||||||
|
{ message: "Email ou senha incorretos" },
|
||||||
|
{ status: 401 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Verify password
|
||||||
|
const isPasswordValid = await bcrypt.compare(password, user.passwordHash);
|
||||||
|
if (!isPasswordValid) {
|
||||||
|
return NextResponse.json(
|
||||||
|
{ message: "Email ou senha incorretos" },
|
||||||
|
{ status: 401 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create JWT token
|
||||||
|
const token = jwt.sign(
|
||||||
|
{ id: user.id, email: user.email, name: user.name },
|
||||||
|
JWT_SECRET,
|
||||||
|
{ expiresIn: "7d" }
|
||||||
|
);
|
||||||
|
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
token,
|
||||||
|
user: { id: user.id, name: user.name, email: user.email },
|
||||||
|
},
|
||||||
|
{ status: 200 }
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Login error:", error);
|
||||||
|
return NextResponse.json(
|
||||||
|
{ message: "Erro ao fazer login" },
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
21
src/app/api/auth/logout/route.ts
Normal file
21
src/app/api/auth/logout/route.ts
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
import { NextRequest, NextResponse } from 'next/server';
|
||||||
|
|
||||||
|
export async function POST(request: NextRequest) {
|
||||||
|
try {
|
||||||
|
// Clear session/token
|
||||||
|
const response = NextResponse.json(
|
||||||
|
{ message: 'Logout successful' },
|
||||||
|
{ status: 200 }
|
||||||
|
);
|
||||||
|
|
||||||
|
// Clear auth cookie if used
|
||||||
|
response.cookies.delete('auth_token');
|
||||||
|
|
||||||
|
return response;
|
||||||
|
} catch (error) {
|
||||||
|
return NextResponse.json(
|
||||||
|
{ message: 'Logout failed' },
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
67
src/app/api/auth/register/route.ts
Normal file
67
src/app/api/auth/register/route.ts
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
import { NextRequest, NextResponse } from "next/server";
|
||||||
|
import bcrypt from "bcryptjs";
|
||||||
|
import jwt from "jsonwebtoken";
|
||||||
|
|
||||||
|
const JWT_SECRET = process.env.JWT_SECRET || "your-secret-key-change-in-production";
|
||||||
|
|
||||||
|
// Mock database - in production, use a real database
|
||||||
|
const users: Array<{ id: string; name: string; email: string; passwordHash: string }> = [];
|
||||||
|
|
||||||
|
export async function POST(request: NextRequest) {
|
||||||
|
try {
|
||||||
|
const { name, email, password } = await request.json();
|
||||||
|
|
||||||
|
// Validation
|
||||||
|
if (!name || !email || !password) {
|
||||||
|
return NextResponse.json(
|
||||||
|
{ message: "Nome, email e senha são obrigatórios" },
|
||||||
|
{ status: 400 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (password.length < 8) {
|
||||||
|
return NextResponse.json(
|
||||||
|
{ message: "A senha deve ter pelo menos 8 caracteres" },
|
||||||
|
{ status: 400 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if user already exists
|
||||||
|
const existingUser = users.find((u) => u.email === email);
|
||||||
|
if (existingUser) {
|
||||||
|
return NextResponse.json(
|
||||||
|
{ message: "Este email já está registrado" },
|
||||||
|
{ status: 409 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hash password
|
||||||
|
const passwordHash = await bcrypt.hash(password, 10);
|
||||||
|
|
||||||
|
// Create user
|
||||||
|
const userId = `user_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
|
||||||
|
const newUser = { id: userId, name, email, passwordHash };
|
||||||
|
users.push(newUser);
|
||||||
|
|
||||||
|
// Create JWT token
|
||||||
|
const token = jwt.sign(
|
||||||
|
{ id: userId, email, name },
|
||||||
|
JWT_SECRET,
|
||||||
|
{ expiresIn: "7d" }
|
||||||
|
);
|
||||||
|
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
token,
|
||||||
|
user: { id: userId, name, email },
|
||||||
|
},
|
||||||
|
{ status: 201 }
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Register error:", error);
|
||||||
|
return NextResponse.json(
|
||||||
|
{ message: "Erro ao registrar usuário" },
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
30
src/app/api/auth/verify/route.ts
Normal file
30
src/app/api/auth/verify/route.ts
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
import { NextRequest, NextResponse } from "next/server";
|
||||||
|
import jwt from "jsonwebtoken";
|
||||||
|
|
||||||
|
const JWT_SECRET = process.env.JWT_SECRET || "your-secret-key-change-in-production";
|
||||||
|
|
||||||
|
export async function GET(request: NextRequest) {
|
||||||
|
try {
|
||||||
|
const authHeader = request.headers.get("authorization");
|
||||||
|
if (!authHeader || !authHeader.startsWith("Bearer ")) {
|
||||||
|
return NextResponse.json(
|
||||||
|
{ message: "Token não fornecido" },
|
||||||
|
{ status: 401 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const token = authHeader.substring(7);
|
||||||
|
const decoded = jwt.verify(token, JWT_SECRET) as any;
|
||||||
|
|
||||||
|
return NextResponse.json(
|
||||||
|
{ user: { id: decoded.id, email: decoded.email, name: decoded.name } },
|
||||||
|
{ status: 200 }
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Verify error:", error);
|
||||||
|
return NextResponse.json(
|
||||||
|
{ message: "Token inválido ou expirado" },
|
||||||
|
{ status: 401 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
182
src/app/auth/login/page.tsx
Normal file
182
src/app/auth/login/page.tsx
Normal file
@@ -0,0 +1,182 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { useState } from "react";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
|
import Link from "next/link";
|
||||||
|
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
||||||
|
import NavbarStyleCentered from '@/components/navbar/NavbarStyleCentered/NavbarStyleCentered';
|
||||||
|
import FooterBase from '@/components/sections/footer/FooterBase';
|
||||||
|
import { Mail, Lock, Eye, EyeOff } from 'lucide-react';
|
||||||
|
|
||||||
|
export default function LoginPage() {
|
||||||
|
const router = useRouter();
|
||||||
|
const [email, setEmail] = useState("");
|
||||||
|
const [password, setPassword] = useState("");
|
||||||
|
const [showPassword, setShowPassword] = useState(false);
|
||||||
|
const [error, setError] = useState("");
|
||||||
|
const [loading, setLoading] = useState(false);
|
||||||
|
|
||||||
|
const handleLogin = async (e: React.FormEvent) => {
|
||||||
|
e.preventDefault();
|
||||||
|
setError("");
|
||||||
|
setLoading(true);
|
||||||
|
|
||||||
|
try {
|
||||||
|
const response = await fetch("/api/auth/login", {
|
||||||
|
method: "POST", headers: { "Content-Type": "application/json" },
|
||||||
|
body: JSON.stringify({ email, password }),
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!response.ok) {
|
||||||
|
const data = await response.json();
|
||||||
|
setError(data.message || "Falha ao fazer login");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const data = await response.json();
|
||||||
|
localStorage.setItem("authToken", data.token);
|
||||||
|
localStorage.setItem("user", JSON.stringify(data.user));
|
||||||
|
router.push("/dashboard");
|
||||||
|
} catch (err) {
|
||||||
|
setError("Erro ao conectar ao servidor");
|
||||||
|
console.error(err);
|
||||||
|
} finally {
|
||||||
|
setLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ThemeProvider
|
||||||
|
defaultButtonVariant="elastic-effect"
|
||||||
|
defaultTextAnimation="entrance-slide"
|
||||||
|
borderRadius="pill"
|
||||||
|
contentWidth="smallMedium"
|
||||||
|
sizing="mediumSizeLargeTitles"
|
||||||
|
background="blurBottom"
|
||||||
|
cardStyle="gradient-bordered"
|
||||||
|
primaryButtonStyle="flat"
|
||||||
|
secondaryButtonStyle="glass"
|
||||||
|
headingFontWeight="extrabold"
|
||||||
|
>
|
||||||
|
<div id="nav" data-section="nav">
|
||||||
|
<NavbarStyleCentered
|
||||||
|
navItems={[
|
||||||
|
{ name: "Dashboard", id: "/dashboard" },
|
||||||
|
{ name: "Treino", id: "training" },
|
||||||
|
{ name: "Nutrição", id: "nutrition" },
|
||||||
|
{ name: "Comunidade", id: "community" },
|
||||||
|
{ name: "Perfil", id: "profile" }
|
||||||
|
]}
|
||||||
|
button={{ text: "Registrar", href: "/auth/register" }}
|
||||||
|
brandName="FitFlow Pro"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="min-h-screen flex items-center justify-center px-4 py-20">
|
||||||
|
<div className="w-full max-w-md">
|
||||||
|
<div className="bg-card rounded-2xl p-8 shadow-lg">
|
||||||
|
<h1 className="text-3xl font-bold text-center mb-2">Entrar</h1>
|
||||||
|
<p className="text-center text-foreground/60 mb-8">Bem-vindo de volta ao FitFlow Pro</p>
|
||||||
|
|
||||||
|
{error && (
|
||||||
|
<div className="bg-red-500/10 border border-red-500 text-red-500 px-4 py-3 rounded-lg mb-6">
|
||||||
|
{error}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<form onSubmit={handleLogin} className="space-y-6">
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium mb-2">Email</label>
|
||||||
|
<div className="relative">
|
||||||
|
<Mail className="absolute left-3 top-3 w-5 h-5 text-foreground/40" />
|
||||||
|
<input
|
||||||
|
type="email"
|
||||||
|
value={email}
|
||||||
|
onChange={(e) => setEmail(e.target.value)}
|
||||||
|
placeholder="seu.email@exemplo.com"
|
||||||
|
required
|
||||||
|
className="w-full pl-10 pr-4 py-3 border border-foreground/20 rounded-lg bg-background focus:outline-none focus:ring-2 focus:ring-primary-cta"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium mb-2">Senha</label>
|
||||||
|
<div className="relative">
|
||||||
|
<Lock className="absolute left-3 top-3 w-5 h-5 text-foreground/40" />
|
||||||
|
<input
|
||||||
|
type={showPassword ? "text" : "password"}
|
||||||
|
value={password}
|
||||||
|
onChange={(e) => setPassword(e.target.value)}
|
||||||
|
placeholder="Digite sua senha"
|
||||||
|
required
|
||||||
|
className="w-full pl-10 pr-10 py-3 border border-foreground/20 rounded-lg bg-background focus:outline-none focus:ring-2 focus:ring-primary-cta"
|
||||||
|
/>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={() => setShowPassword(!showPassword)}
|
||||||
|
className="absolute right-3 top-3 text-foreground/40"
|
||||||
|
>
|
||||||
|
{showPassword ? (
|
||||||
|
<EyeOff className="w-5 h-5" />
|
||||||
|
) : (
|
||||||
|
<Eye className="w-5 h-5" />
|
||||||
|
)}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
disabled={loading}
|
||||||
|
className="w-full bg-primary-cta text-white py-3 rounded-lg font-semibold hover:opacity-90 disabled:opacity-50 transition"
|
||||||
|
>
|
||||||
|
{loading ? "Entrando..." : "Entrar"}
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<p className="text-center mt-6 text-foreground/60">
|
||||||
|
Não tem conta?{" "}
|
||||||
|
<Link href="/auth/register" className="text-primary-cta font-semibold hover:underline">
|
||||||
|
Registre-se aqui
|
||||||
|
</Link>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="footer" data-section="footer">
|
||||||
|
<FooterBase
|
||||||
|
columns={[
|
||||||
|
{
|
||||||
|
title: "Produto", items: [
|
||||||
|
{ label: "Dashboard", href: "/dashboard" },
|
||||||
|
{ label: "Treino", href: "training" },
|
||||||
|
{ label: "Nutrição", href: "nutrition" },
|
||||||
|
{ label: "Cardio Hub", href: "cardio" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Comunidade", items: [
|
||||||
|
{ label: "Comunidade", href: "community" },
|
||||||
|
{ label: "Perfil", href: "profile" },
|
||||||
|
{ label: "Rankings", href: "rankings" },
|
||||||
|
{ label: "Blog", href: "blog" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Empresa", items: [
|
||||||
|
{ label: "Sobre", href: "about" },
|
||||||
|
{ label: "Contato", href: "contact" },
|
||||||
|
{ label: "Privacidade", href: "privacy" },
|
||||||
|
{ label: "Termos", href: "terms" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]}
|
||||||
|
logoText="FitFlow Pro"
|
||||||
|
copyrightText="© 2025 FitFlow Pro. Todos os direitos reservados."
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</ThemeProvider>
|
||||||
|
);
|
||||||
|
}
|
||||||
317
src/app/auth/page.tsx
Normal file
317
src/app/auth/page.tsx
Normal file
@@ -0,0 +1,317 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { useState } from "react";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
|
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
||||||
|
import NavbarStyleCentered from '@/components/navbar/NavbarStyleCentered/NavbarStyleCentered';
|
||||||
|
import FooterBase from '@/components/sections/footer/FooterBase';
|
||||||
|
import { Mail, Lock, Eye, EyeOff, LogIn, UserPlus } from 'lucide-react';
|
||||||
|
|
||||||
|
export default function AuthPage() {
|
||||||
|
const router = useRouter();
|
||||||
|
const [isLogin, setIsLogin] = useState(true);
|
||||||
|
const [showPassword, setShowPassword] = useState(false);
|
||||||
|
const [formData, setFormData] = useState({
|
||||||
|
email: '',
|
||||||
|
password: '',
|
||||||
|
confirmPassword: '',
|
||||||
|
name: ''
|
||||||
|
});
|
||||||
|
const [error, setError] = useState('');
|
||||||
|
const [loading, setLoading] = useState(false);
|
||||||
|
|
||||||
|
const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
const { name, value } = e.target;
|
||||||
|
setFormData(prev => ({
|
||||||
|
...prev,
|
||||||
|
[name]: value
|
||||||
|
}));
|
||||||
|
setError('');
|
||||||
|
};
|
||||||
|
|
||||||
|
const validateForm = () => {
|
||||||
|
if (!formData.email) {
|
||||||
|
setError('Email é obrigatório');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!formData.password) {
|
||||||
|
setError('Senha é obrigatória');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!isLogin) {
|
||||||
|
if (!formData.name) {
|
||||||
|
setError('Nome é obrigatório');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (formData.password !== formData.confirmPassword) {
|
||||||
|
setError('As senhas não coincidem');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (formData.password.length < 6) {
|
||||||
|
setError('Senha deve ter no mínimo 6 caracteres');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSubmit = async (e: React.FormEvent<HTMLFormElement>) => {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
if (!validateForm()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
setLoading(true);
|
||||||
|
|
||||||
|
try {
|
||||||
|
const endpoint = isLogin ? '/api/auth/login' : '/api/auth/register';
|
||||||
|
const payload = isLogin
|
||||||
|
? { email: formData.email, password: formData.password }
|
||||||
|
: { name: formData.name, email: formData.email, password: formData.password };
|
||||||
|
|
||||||
|
const response = await fetch(endpoint, {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
body: JSON.stringify(payload),
|
||||||
|
});
|
||||||
|
|
||||||
|
const data = await response.json();
|
||||||
|
|
||||||
|
if (!response.ok) {
|
||||||
|
setError(data.message || 'Erro ao processar requisição');
|
||||||
|
setLoading(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Store token and user data
|
||||||
|
localStorage.setItem('token', data.token);
|
||||||
|
localStorage.setItem('user', JSON.stringify(data.user));
|
||||||
|
|
||||||
|
// Redirect to dashboard
|
||||||
|
router.push('/dashboard');
|
||||||
|
} catch (err) {
|
||||||
|
setError('Erro de conexão. Tente novamente.');
|
||||||
|
setLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ThemeProvider
|
||||||
|
defaultButtonVariant="elastic-effect"
|
||||||
|
defaultTextAnimation="entrance-slide"
|
||||||
|
borderRadius="pill"
|
||||||
|
contentWidth="smallMedium"
|
||||||
|
sizing="mediumSizeLargeTitles"
|
||||||
|
background="blurBottom"
|
||||||
|
cardStyle="gradient-bordered"
|
||||||
|
primaryButtonStyle="flat"
|
||||||
|
secondaryButtonStyle="glass"
|
||||||
|
headingFontWeight="extrabold"
|
||||||
|
>
|
||||||
|
<div id="nav" data-section="nav">
|
||||||
|
<NavbarStyleCentered
|
||||||
|
navItems={[
|
||||||
|
{ name: "Dashboard", id: "/dashboard" },
|
||||||
|
{ name: "Treino", id: "training" },
|
||||||
|
{ name: "Nutrição", id: "nutrition" },
|
||||||
|
{ name: "Comunidade", id: "community" },
|
||||||
|
{ name: "Perfil", id: "profile" }
|
||||||
|
]}
|
||||||
|
button={{ text: "Começar Agora", href: "/auth" }}
|
||||||
|
brandName="FitFlow Pro"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="min-h-screen flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8">
|
||||||
|
<div className="w-full max-w-md space-y-8">
|
||||||
|
{/* Header */}
|
||||||
|
<div className="text-center">
|
||||||
|
<h1 className="text-4xl font-extrabold text-foreground mb-2">
|
||||||
|
{isLogin ? 'Bem-vindo de Volta' : 'Crie sua Conta'}
|
||||||
|
</h1>
|
||||||
|
<p className="text-foreground/60">
|
||||||
|
{isLogin ? 'Acesse sua jornada de fitness' : 'Comece sua transformação hoje'}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Form Card */}
|
||||||
|
<div className="bg-card rounded-2xl p-8 border border-background-accent shadow-lg">
|
||||||
|
{error && (
|
||||||
|
<div className="mb-6 p-4 bg-red-50 border border-red-200 rounded-lg">
|
||||||
|
<p className="text-red-700 text-sm font-medium">{error}</p>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<form onSubmit={handleSubmit} className="space-y-6">
|
||||||
|
{/* Name field (Registration only) */}
|
||||||
|
{!isLogin && (
|
||||||
|
<div>
|
||||||
|
<label htmlFor="name" className="block text-sm font-medium text-foreground mb-2">
|
||||||
|
Nome Completo
|
||||||
|
</label>
|
||||||
|
<input
|
||||||
|
id="name"
|
||||||
|
name="name"
|
||||||
|
type="text"
|
||||||
|
value={formData.name}
|
||||||
|
onChange={handleInputChange}
|
||||||
|
className="w-full px-4 py-3 border border-background-accent rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-cta bg-background text-foreground placeholder-foreground/40"
|
||||||
|
placeholder="Seu nome completo"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Email field */}
|
||||||
|
<div>
|
||||||
|
<label htmlFor="email" className="block text-sm font-medium text-foreground mb-2">
|
||||||
|
Email
|
||||||
|
</label>
|
||||||
|
<div className="relative">
|
||||||
|
<Mail className="absolute left-4 top-3.5 h-5 w-5 text-foreground/40" />
|
||||||
|
<input
|
||||||
|
id="email"
|
||||||
|
name="email"
|
||||||
|
type="email"
|
||||||
|
value={formData.email}
|
||||||
|
onChange={handleInputChange}
|
||||||
|
className="w-full pl-12 pr-4 py-3 border border-background-accent rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-cta bg-background text-foreground placeholder-foreground/40"
|
||||||
|
placeholder="seu.email@exemplo.com"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Password field */}
|
||||||
|
<div>
|
||||||
|
<label htmlFor="password" className="block text-sm font-medium text-foreground mb-2">
|
||||||
|
Senha
|
||||||
|
</label>
|
||||||
|
<div className="relative">
|
||||||
|
<Lock className="absolute left-4 top-3.5 h-5 w-5 text-foreground/40" />
|
||||||
|
<input
|
||||||
|
id="password"
|
||||||
|
name="password"
|
||||||
|
type={showPassword ? 'text' : 'password'}
|
||||||
|
value={formData.password}
|
||||||
|
onChange={handleInputChange}
|
||||||
|
className="w-full pl-12 pr-12 py-3 border border-background-accent rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-cta bg-background text-foreground placeholder-foreground/40"
|
||||||
|
placeholder="Sua senha segura"
|
||||||
|
/>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={() => setShowPassword(!showPassword)}
|
||||||
|
className="absolute right-4 top-3.5 text-foreground/40 hover:text-foreground"
|
||||||
|
>
|
||||||
|
{showPassword ? <EyeOff className="h-5 w-5" /> : <Eye className="h-5 w-5" />}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Confirm Password field (Registration only) */}
|
||||||
|
{!isLogin && (
|
||||||
|
<div>
|
||||||
|
<label htmlFor="confirmPassword" className="block text-sm font-medium text-foreground mb-2">
|
||||||
|
Confirmar Senha
|
||||||
|
</label>
|
||||||
|
<div className="relative">
|
||||||
|
<Lock className="absolute left-4 top-3.5 h-5 w-5 text-foreground/40" />
|
||||||
|
<input
|
||||||
|
id="confirmPassword"
|
||||||
|
name="confirmPassword"
|
||||||
|
type={showPassword ? 'text' : 'password'}
|
||||||
|
value={formData.confirmPassword}
|
||||||
|
onChange={handleInputChange}
|
||||||
|
className="w-full pl-12 pr-12 py-3 border border-background-accent rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-cta bg-background text-foreground placeholder-foreground/40"
|
||||||
|
placeholder="Confirme sua senha"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Submit Button */}
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
disabled={loading}
|
||||||
|
className="w-full py-3 px-4 bg-primary-cta text-background font-semibold rounded-lg hover:opacity-90 transition-opacity disabled:opacity-50 flex items-center justify-center gap-2"
|
||||||
|
>
|
||||||
|
{loading ? (
|
||||||
|
<>
|
||||||
|
<div className="w-4 h-4 border-2 border-background border-t-transparent rounded-full animate-spin" />
|
||||||
|
Processando...
|
||||||
|
</>
|
||||||
|
) : isLogin ? (
|
||||||
|
<>
|
||||||
|
<LogIn className="h-5 w-5" />
|
||||||
|
Entrar
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
<UserPlus className="h-5 w-5" />
|
||||||
|
Criar Conta
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
{/* Toggle Login/Register */}
|
||||||
|
<div className="mt-6 text-center">
|
||||||
|
<p className="text-foreground/60 text-sm">
|
||||||
|
{isLogin ? 'Não tem conta? ' : 'Já tem conta? '}
|
||||||
|
<button
|
||||||
|
onClick={() => {
|
||||||
|
setIsLogin(!isLogin);
|
||||||
|
setFormData({ email: '', password: '', confirmPassword: '', name: '' });
|
||||||
|
setError('');
|
||||||
|
}}
|
||||||
|
className="text-primary-cta font-semibold hover:underline"
|
||||||
|
>
|
||||||
|
{isLogin ? 'Criar conta' : 'Entrar'}
|
||||||
|
</button>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Security Note */}
|
||||||
|
<p className="text-center text-xs text-foreground/40">
|
||||||
|
Seu email e senha estão protegidos com criptografia de ponta a ponta.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="footer" data-section="footer">
|
||||||
|
<FooterBase
|
||||||
|
columns={[
|
||||||
|
{
|
||||||
|
title: "Produto", items: [
|
||||||
|
{ label: "Dashboard", href: "dashboard" },
|
||||||
|
{ label: "Treino", href: "training" },
|
||||||
|
{ label: "Nutrição", href: "nutrition" },
|
||||||
|
{ label: "Cardio Hub", href: "cardio" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Comunidade", items: [
|
||||||
|
{ label: "Comunidade", href: "community" },
|
||||||
|
{ label: "Perfil", href: "profile" },
|
||||||
|
{ label: "Rankings", href: "rankings" },
|
||||||
|
{ label: "Blog", href: "blog" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Empresa", items: [
|
||||||
|
{ label: "Sobre", href: "about" },
|
||||||
|
{ label: "Contato", href: "contact" },
|
||||||
|
{ label: "Privacidade", href: "privacy" },
|
||||||
|
{ label: "Termos", href: "terms" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]}
|
||||||
|
logoText="FitFlow Pro"
|
||||||
|
copyrightText="© 2025 FitFlow Pro. Todos os direitos reservados."
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</ThemeProvider>
|
||||||
|
);
|
||||||
|
}
|
||||||
267
src/app/auth/register/page.tsx
Normal file
267
src/app/auth/register/page.tsx
Normal file
@@ -0,0 +1,267 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { useState } from "react";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
|
import Link from "next/link";
|
||||||
|
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
||||||
|
import NavbarStyleCentered from '@/components/navbar/NavbarStyleCentered/NavbarStyleCentered';
|
||||||
|
import FooterBase from '@/components/sections/footer/FooterBase';
|
||||||
|
import { Mail, Lock, User, Eye, EyeOff, Check } from 'lucide-react';
|
||||||
|
|
||||||
|
export default function RegisterPage() {
|
||||||
|
const router = useRouter();
|
||||||
|
const [formData, setFormData] = useState({
|
||||||
|
name: "", email: "", password: "", confirmPassword: ""});
|
||||||
|
const [showPassword, setShowPassword] = useState(false);
|
||||||
|
const [showConfirm, setShowConfirm] = useState(false);
|
||||||
|
const [error, setError] = useState("");
|
||||||
|
const [loading, setLoading] = useState(false);
|
||||||
|
const [agreedToTerms, setAgreedToTerms] = useState(false);
|
||||||
|
|
||||||
|
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
const { name, value } = e.target;
|
||||||
|
setFormData((prev) => ({ ...prev, [name]: value }));
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleRegister = async (e: React.FormEvent) => {
|
||||||
|
e.preventDefault();
|
||||||
|
setError("");
|
||||||
|
|
||||||
|
if (!agreedToTerms) {
|
||||||
|
setError("Você deve concordar com os Termos e Condições");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (formData.password !== formData.confirmPassword) {
|
||||||
|
setError("As senhas não conferem");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (formData.password.length < 8) {
|
||||||
|
setError("A senha deve ter pelo menos 8 caracteres");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
setLoading(true);
|
||||||
|
|
||||||
|
try {
|
||||||
|
const response = await fetch("/api/auth/register", {
|
||||||
|
method: "POST", headers: { "Content-Type": "application/json" },
|
||||||
|
body: JSON.stringify({
|
||||||
|
name: formData.name,
|
||||||
|
email: formData.email,
|
||||||
|
password: formData.password,
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!response.ok) {
|
||||||
|
const data = await response.json();
|
||||||
|
setError(data.message || "Falha ao registrar");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const data = await response.json();
|
||||||
|
localStorage.setItem("authToken", data.token);
|
||||||
|
localStorage.setItem("user", JSON.stringify(data.user));
|
||||||
|
router.push("/dashboard");
|
||||||
|
} catch (err) {
|
||||||
|
setError("Erro ao conectar ao servidor");
|
||||||
|
console.error(err);
|
||||||
|
} finally {
|
||||||
|
setLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ThemeProvider
|
||||||
|
defaultButtonVariant="elastic-effect"
|
||||||
|
defaultTextAnimation="entrance-slide"
|
||||||
|
borderRadius="pill"
|
||||||
|
contentWidth="smallMedium"
|
||||||
|
sizing="mediumSizeLargeTitles"
|
||||||
|
background="blurBottom"
|
||||||
|
cardStyle="gradient-bordered"
|
||||||
|
primaryButtonStyle="flat"
|
||||||
|
secondaryButtonStyle="glass"
|
||||||
|
headingFontWeight="extrabold"
|
||||||
|
>
|
||||||
|
<div id="nav" data-section="nav">
|
||||||
|
<NavbarStyleCentered
|
||||||
|
navItems={[
|
||||||
|
{ name: "Dashboard", id: "/dashboard" },
|
||||||
|
{ name: "Treino", id: "training" },
|
||||||
|
{ name: "Nutrição", id: "nutrition" },
|
||||||
|
{ name: "Comunidade", id: "community" },
|
||||||
|
{ name: "Perfil", id: "profile" }
|
||||||
|
]}
|
||||||
|
button={{ text: "Entrar", href: "/auth/login" }}
|
||||||
|
brandName="FitFlow Pro"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="min-h-screen flex items-center justify-center px-4 py-20">
|
||||||
|
<div className="w-full max-w-md">
|
||||||
|
<div className="bg-card rounded-2xl p-8 shadow-lg">
|
||||||
|
<h1 className="text-3xl font-bold text-center mb-2">Registre-se</h1>
|
||||||
|
<p className="text-center text-foreground/60 mb-8">Comece sua transformação com FitFlow Pro</p>
|
||||||
|
|
||||||
|
{error && (
|
||||||
|
<div className="bg-red-500/10 border border-red-500 text-red-500 px-4 py-3 rounded-lg mb-6">
|
||||||
|
{error}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<form onSubmit={handleRegister} className="space-y-6">
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium mb-2">Nome Completo</label>
|
||||||
|
<div className="relative">
|
||||||
|
<User className="absolute left-3 top-3 w-5 h-5 text-foreground/40" />
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
name="name"
|
||||||
|
value={formData.name}
|
||||||
|
onChange={handleChange}
|
||||||
|
placeholder="Seu nome completo"
|
||||||
|
required
|
||||||
|
className="w-full pl-10 pr-4 py-3 border border-foreground/20 rounded-lg bg-background focus:outline-none focus:ring-2 focus:ring-primary-cta"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium mb-2">Email</label>
|
||||||
|
<div className="relative">
|
||||||
|
<Mail className="absolute left-3 top-3 w-5 h-5 text-foreground/40" />
|
||||||
|
<input
|
||||||
|
type="email"
|
||||||
|
name="email"
|
||||||
|
value={formData.email}
|
||||||
|
onChange={handleChange}
|
||||||
|
placeholder="seu.email@exemplo.com"
|
||||||
|
required
|
||||||
|
className="w-full pl-10 pr-4 py-3 border border-foreground/20 rounded-lg bg-background focus:outline-none focus:ring-2 focus:ring-primary-cta"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium mb-2">Senha</label>
|
||||||
|
<div className="relative">
|
||||||
|
<Lock className="absolute left-3 top-3 w-5 h-5 text-foreground/40" />
|
||||||
|
<input
|
||||||
|
type={showPassword ? "text" : "password"}
|
||||||
|
name="password"
|
||||||
|
value={formData.password}
|
||||||
|
onChange={handleChange}
|
||||||
|
placeholder="Mínimo 8 caracteres"
|
||||||
|
required
|
||||||
|
className="w-full pl-10 pr-10 py-3 border border-foreground/20 rounded-lg bg-background focus:outline-none focus:ring-2 focus:ring-primary-cta"
|
||||||
|
/>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={() => setShowPassword(!showPassword)}
|
||||||
|
className="absolute right-3 top-3 text-foreground/40"
|
||||||
|
>
|
||||||
|
{showPassword ? (
|
||||||
|
<EyeOff className="w-5 h-5" />
|
||||||
|
) : (
|
||||||
|
<Eye className="w-5 h-5" />
|
||||||
|
)}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium mb-2">Confirmar Senha</label>
|
||||||
|
<div className="relative">
|
||||||
|
<Lock className="absolute left-3 top-3 w-5 h-5 text-foreground/40" />
|
||||||
|
<input
|
||||||
|
type={showConfirm ? "text" : "password"}
|
||||||
|
name="confirmPassword"
|
||||||
|
value={formData.confirmPassword}
|
||||||
|
onChange={handleChange}
|
||||||
|
placeholder="Confirme sua senha"
|
||||||
|
required
|
||||||
|
className="w-full pl-10 pr-10 py-3 border border-foreground/20 rounded-lg bg-background focus:outline-none focus:ring-2 focus:ring-primary-cta"
|
||||||
|
/>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={() => setShowConfirm(!showConfirm)}
|
||||||
|
className="absolute right-3 top-3 text-foreground/40"
|
||||||
|
>
|
||||||
|
{showConfirm ? (
|
||||||
|
<EyeOff className="w-5 h-5" />
|
||||||
|
) : (
|
||||||
|
<Eye className="w-5 h-5" />
|
||||||
|
)}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="flex items-start space-x-3">
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
id="terms"
|
||||||
|
checked={agreedToTerms}
|
||||||
|
onChange={(e) => setAgreedToTerms(e.target.checked)}
|
||||||
|
className="mt-1 w-5 h-5 rounded cursor-pointer"
|
||||||
|
/>
|
||||||
|
<label htmlFor="terms" className="text-sm text-foreground/60 cursor-pointer">
|
||||||
|
Concordo com os <Link href="/terms" className="text-primary-cta hover:underline">Termos e Condições</Link> e a <Link href="/privacy" className="text-primary-cta hover:underline">Política de Privacidade</Link>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
disabled={loading}
|
||||||
|
className="w-full bg-primary-cta text-white py-3 rounded-lg font-semibold hover:opacity-90 disabled:opacity-50 transition"
|
||||||
|
>
|
||||||
|
{loading ? "Registrando..." : "Criar Conta"}
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<p className="text-center mt-6 text-foreground/60">
|
||||||
|
Já tem uma conta?{" "}
|
||||||
|
<Link href="/auth/login" className="text-primary-cta font-semibold hover:underline">
|
||||||
|
Faça login aqui
|
||||||
|
</Link>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="footer" data-section="footer">
|
||||||
|
<FooterBase
|
||||||
|
columns={[
|
||||||
|
{
|
||||||
|
title: "Produto", items: [
|
||||||
|
{ label: "Dashboard", href: "/dashboard" },
|
||||||
|
{ label: "Treino", href: "training" },
|
||||||
|
{ label: "Nutrição", href: "nutrition" },
|
||||||
|
{ label: "Cardio Hub", href: "cardio" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Comunidade", items: [
|
||||||
|
{ label: "Comunidade", href: "community" },
|
||||||
|
{ label: "Perfil", href: "profile" },
|
||||||
|
{ label: "Rankings", href: "rankings" },
|
||||||
|
{ label: "Blog", href: "blog" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Empresa", items: [
|
||||||
|
{ label: "Sobre", href: "about" },
|
||||||
|
{ label: "Contato", href: "contact" },
|
||||||
|
{ label: "Privacidade", href: "privacy" },
|
||||||
|
{ label: "Termos", href: "terms" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]}
|
||||||
|
logoText="FitFlow Pro"
|
||||||
|
copyrightText="© 2025 FitFlow Pro. Todos os direitos reservados."
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</ThemeProvider>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
'use client';
|
|
||||||
|
|
||||||
import React, { useCallback } from 'react';
|
|
||||||
import { useWorkoutTracking } from '@/app/hooks/useWorkoutTracking';
|
|
||||||
import { WorkoutSession, CardioSession, NutritionLog } from '@/app/lib/storage/workoutStorage';
|
|
||||||
|
|
||||||
export interface WorkoutDataIntegrationProps {
|
|
||||||
onSave?: (data: any) => void;
|
|
||||||
autoSave?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* WorkoutDataIntegration component that provides workout tracking context
|
|
||||||
* Use this component to wrap sections that need to save workout data
|
|
||||||
*/
|
|
||||||
export const WorkoutDataIntegration: React.FC<{
|
|
||||||
children: React.ReactNode;
|
|
||||||
} & WorkoutDataIntegrationProps> = ({ children, onSave, autoSave = true }) => {
|
|
||||||
const { metrics, addWorkoutSession, addCardioSession, addNutritionLog, refreshMetrics } =
|
|
||||||
useWorkoutTracking();
|
|
||||||
|
|
||||||
const handleWorkoutSave = useCallback(
|
|
||||||
(session: WorkoutSession) => {
|
|
||||||
addWorkoutSession(session);
|
|
||||||
if (onSave) onSave({ type: 'workout', data: session });
|
|
||||||
},
|
|
||||||
[addWorkoutSession, onSave]
|
|
||||||
);
|
|
||||||
|
|
||||||
const handleCardioSave = useCallback(
|
|
||||||
(session: CardioSession) => {
|
|
||||||
addCardioSession(session);
|
|
||||||
if (onSave) onSave({ type: 'cardio', data: session });
|
|
||||||
},
|
|
||||||
[addCardioSession, onSave]
|
|
||||||
);
|
|
||||||
|
|
||||||
const handleNutritionSave = useCallback(
|
|
||||||
(log: NutritionLog) => {
|
|
||||||
addNutritionLog(log);
|
|
||||||
if (onSave) onSave({ type: 'nutrition', data: log });
|
|
||||||
},
|
|
||||||
[addNutritionLog, onSave]
|
|
||||||
);
|
|
||||||
|
|
||||||
// Expose save functions via context or props
|
|
||||||
const contextValue = {
|
|
||||||
metrics,
|
|
||||||
handleWorkoutSave,
|
|
||||||
handleCardioSave,
|
|
||||||
handleNutritionSave,
|
|
||||||
refreshMetrics,
|
|
||||||
autoSave,
|
|
||||||
};
|
|
||||||
|
|
||||||
// Clone children and pass context data as props
|
|
||||||
return (
|
|
||||||
<div data-workout-integration="true" data-context={JSON.stringify(contextValue)}>
|
|
||||||
{children}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default WorkoutDataIntegration;
|
|
||||||
244
src/app/dashboard/page.tsx
Normal file
244
src/app/dashboard/page.tsx
Normal file
@@ -0,0 +1,244 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
|
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
||||||
|
import NavbarStyleCentered from '@/components/navbar/NavbarStyleCentered/NavbarStyleCentered';
|
||||||
|
import FooterBase from '@/components/sections/footer/FooterBase';
|
||||||
|
import { LogOut, User, Mail, Zap } from 'lucide-react';
|
||||||
|
|
||||||
|
interface UserData {
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
email: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function DashboardPage() {
|
||||||
|
const router = useRouter();
|
||||||
|
const [user, setUser] = useState<UserData | null>(null);
|
||||||
|
const [loading, setLoading] = useState(true);
|
||||||
|
const [error, setError] = useState("");
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const checkAuth = async () => {
|
||||||
|
const token = localStorage.getItem("authToken");
|
||||||
|
const userData = localStorage.getItem("user");
|
||||||
|
|
||||||
|
if (!token || !userData) {
|
||||||
|
router.push("/auth/login");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const response = await fetch("/api/auth/verify", {
|
||||||
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!response.ok) {
|
||||||
|
localStorage.removeItem("authToken");
|
||||||
|
localStorage.removeItem("user");
|
||||||
|
router.push("/auth/login");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
setUser(JSON.parse(userData));
|
||||||
|
} catch (err) {
|
||||||
|
setError("Erro ao verificar sessão");
|
||||||
|
console.error(err);
|
||||||
|
} finally {
|
||||||
|
setLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
checkAuth();
|
||||||
|
}, [router]);
|
||||||
|
|
||||||
|
const handleLogout = () => {
|
||||||
|
localStorage.removeItem("authToken");
|
||||||
|
localStorage.removeItem("user");
|
||||||
|
router.push("/");
|
||||||
|
};
|
||||||
|
|
||||||
|
if (loading) {
|
||||||
|
return (
|
||||||
|
<ThemeProvider
|
||||||
|
defaultButtonVariant="elastic-effect"
|
||||||
|
defaultTextAnimation="entrance-slide"
|
||||||
|
borderRadius="pill"
|
||||||
|
contentWidth="smallMedium"
|
||||||
|
sizing="mediumSizeLargeTitles"
|
||||||
|
background="blurBottom"
|
||||||
|
cardStyle="gradient-bordered"
|
||||||
|
primaryButtonStyle="flat"
|
||||||
|
secondaryButtonStyle="glass"
|
||||||
|
headingFontWeight="extrabold"
|
||||||
|
>
|
||||||
|
<div className="min-h-screen flex items-center justify-center">
|
||||||
|
<div className="text-center">
|
||||||
|
<div className="inline-block animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-primary-cta"></div>
|
||||||
|
<p className="mt-4 text-foreground/60">Carregando...</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ThemeProvider>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (error) {
|
||||||
|
return (
|
||||||
|
<ThemeProvider
|
||||||
|
defaultButtonVariant="elastic-effect"
|
||||||
|
defaultTextAnimation="entrance-slide"
|
||||||
|
borderRadius="pill"
|
||||||
|
contentWidth="smallMedium"
|
||||||
|
sizing="mediumSizeLargeTitles"
|
||||||
|
background="blurBottom"
|
||||||
|
cardStyle="gradient-bordered"
|
||||||
|
primaryButtonStyle="flat"
|
||||||
|
secondaryButtonStyle="glass"
|
||||||
|
headingFontWeight="extrabold"
|
||||||
|
>
|
||||||
|
<div className="min-h-screen flex items-center justify-center">
|
||||||
|
<div className="text-center">
|
||||||
|
<p className="text-red-500">{error}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ThemeProvider>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ThemeProvider
|
||||||
|
defaultButtonVariant="elastic-effect"
|
||||||
|
defaultTextAnimation="entrance-slide"
|
||||||
|
borderRadius="pill"
|
||||||
|
contentWidth="smallMedium"
|
||||||
|
sizing="mediumSizeLargeTitles"
|
||||||
|
background="blurBottom"
|
||||||
|
cardStyle="gradient-bordered"
|
||||||
|
primaryButtonStyle="flat"
|
||||||
|
secondaryButtonStyle="glass"
|
||||||
|
headingFontWeight="extrabold"
|
||||||
|
>
|
||||||
|
<div id="nav" data-section="nav">
|
||||||
|
<NavbarStyleCentered
|
||||||
|
navItems={[
|
||||||
|
{ name: "Dashboard", id: "/dashboard" },
|
||||||
|
{ name: "Treino", id: "training" },
|
||||||
|
{ name: "Nutrição", id: "nutrition" },
|
||||||
|
{ name: "Comunidade", id: "community" },
|
||||||
|
{ name: "Perfil", id: "profile" }
|
||||||
|
]}
|
||||||
|
button={{ text: "Sair", href: "/" }}
|
||||||
|
brandName="FitFlow Pro"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="min-h-screen px-4 py-20">
|
||||||
|
<div className="max-w-4xl mx-auto">
|
||||||
|
<h1 className="text-4xl font-bold mb-8">Dashboard</h1>
|
||||||
|
|
||||||
|
{user && (
|
||||||
|
<div className="grid gap-6">
|
||||||
|
<div className="bg-card rounded-2xl p-8 shadow-lg border border-foreground/10">
|
||||||
|
<h2 className="text-2xl font-bold mb-6">Bem-vindo, {user.name}!</h2>
|
||||||
|
|
||||||
|
<div className="grid md:grid-cols-2 gap-8">
|
||||||
|
<div className="space-y-4">
|
||||||
|
<div className="flex items-center space-x-3">
|
||||||
|
<User className="w-6 h-6 text-primary-cta" />
|
||||||
|
<div>
|
||||||
|
<p className="text-sm text-foreground/60">Nome</p>
|
||||||
|
<p className="font-semibold">{user.name}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="flex items-center space-x-3">
|
||||||
|
<Mail className="w-6 h-6 text-primary-cta" />
|
||||||
|
<div>
|
||||||
|
<p className="text-sm text-foreground/60">Email</p>
|
||||||
|
<p className="font-semibold">{user.email}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="space-y-4">
|
||||||
|
<div className="bg-background rounded-lg p-4">
|
||||||
|
<p className="text-sm text-foreground/60 mb-2">Status da Sessão</p>
|
||||||
|
<div className="flex items-center space-x-2">
|
||||||
|
<div className="w-3 h-3 bg-green-500 rounded-full animate-pulse"></div>
|
||||||
|
<p className="font-semibold text-green-500">Conectado</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="grid md:grid-cols-3 gap-6">
|
||||||
|
<div className="bg-gradient-to-br from-primary-cta/20 to-accent/20 rounded-2xl p-6 border border-primary-cta/20">
|
||||||
|
<Zap className="w-8 h-8 text-primary-cta mb-2" />
|
||||||
|
<h3 className="text-lg font-semibold mb-1">Treinos</h3>
|
||||||
|
<p className="text-3xl font-bold text-primary-cta">0</p>
|
||||||
|
<p className="text-sm text-foreground/60 mt-2">Treinos concluídos</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="bg-gradient-to-br from-accent/20 to-secondary-cta/20 rounded-2xl p-6 border border-accent/20">
|
||||||
|
<Zap className="w-8 h-8 text-accent mb-2" />
|
||||||
|
<h3 className="text-lg font-semibold mb-1">Nutrição</h3>
|
||||||
|
<p className="text-3xl font-bold text-accent">0</p>
|
||||||
|
<p className="text-sm text-foreground/60 mt-2">Refeições rastreadas</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="bg-gradient-to-br from-secondary-cta/20 to-primary-cta/20 rounded-2xl p-6 border border-secondary-cta/20">
|
||||||
|
<Zap className="w-8 h-8 text-secondary-cta mb-2" />
|
||||||
|
<h3 className="text-lg font-semibold mb-1">Cardio</h3>
|
||||||
|
<p className="text-3xl font-bold text-secondary-cta">0 km</p>
|
||||||
|
<p className="text-sm text-foreground/60 mt-2">Distância total</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button
|
||||||
|
onClick={handleLogout}
|
||||||
|
className="w-full bg-red-500 hover:bg-red-600 text-white py-3 rounded-lg font-semibold transition flex items-center justify-center space-x-2"
|
||||||
|
>
|
||||||
|
<LogOut className="w-5 h-5" />
|
||||||
|
<span>Sair da Conta</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="footer" data-section="footer">
|
||||||
|
<FooterBase
|
||||||
|
columns={[
|
||||||
|
{
|
||||||
|
title: "Produto", items: [
|
||||||
|
{ label: "Dashboard", href: "/dashboard" },
|
||||||
|
{ label: "Treino", href: "training" },
|
||||||
|
{ label: "Nutrição", href: "nutrition" },
|
||||||
|
{ label: "Cardio Hub", href: "cardio" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Comunidade", items: [
|
||||||
|
{ label: "Comunidade", href: "community" },
|
||||||
|
{ label: "Perfil", href: "profile" },
|
||||||
|
{ label: "Rankings", href: "rankings" },
|
||||||
|
{ label: "Blog", href: "blog" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Empresa", items: [
|
||||||
|
{ label: "Sobre", href: "about" },
|
||||||
|
{ label: "Contato", href: "contact" },
|
||||||
|
{ label: "Privacidade", href: "privacy" },
|
||||||
|
{ label: "Termos", href: "terms" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]}
|
||||||
|
logoText="FitFlow Pro"
|
||||||
|
copyrightText="© 2025 FitFlow Pro. Todos os direitos reservados."
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</ThemeProvider>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
'use client';
|
|
||||||
|
|
||||||
import { useState, useCallback } from 'react';
|
|
||||||
import {
|
|
||||||
saveWorkoutSession,
|
|
||||||
saveCardioSession,
|
|
||||||
saveNutritionLog,
|
|
||||||
getUserMetrics,
|
|
||||||
getWorkoutSessions,
|
|
||||||
getCardioSessions,
|
|
||||||
getNutritionLogs,
|
|
||||||
WorkoutSession,
|
|
||||||
CardioSession,
|
|
||||||
NutritionLog,
|
|
||||||
UserMetrics,
|
|
||||||
} from '@/app/lib/storage/workoutStorage';
|
|
||||||
|
|
||||||
export const useWorkoutTracking = () => {
|
|
||||||
const [metrics, setMetrics] = useState<UserMetrics>(getUserMetrics());
|
|
||||||
const [workouts, setWorkouts] = useState<WorkoutSession[]>(getWorkoutSessions());
|
|
||||||
const [cardioSessions, setCardioSessions] = useState<CardioSession[]>(getCardioSessions());
|
|
||||||
const [nutritionLogs, setNutritionLogs] = useState<NutritionLog[]>(getNutritionLogs());
|
|
||||||
|
|
||||||
const addWorkoutSession = useCallback((session: WorkoutSession) => {
|
|
||||||
saveWorkoutSession(session);
|
|
||||||
setWorkouts(getWorkoutSessions());
|
|
||||||
setMetrics(getUserMetrics());
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const addCardioSession = useCallback((session: CardioSession) => {
|
|
||||||
saveCardioSession(session);
|
|
||||||
setCardioSessions(getCardioSessions());
|
|
||||||
setMetrics(getUserMetrics());
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const addNutritionLog = useCallback((log: NutritionLog) => {
|
|
||||||
saveNutritionLog(log);
|
|
||||||
setNutritionLogs(getNutritionLogs());
|
|
||||||
setMetrics(getUserMetrics());
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const refreshMetrics = useCallback(() => {
|
|
||||||
setMetrics(getUserMetrics());
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
return {
|
|
||||||
metrics,
|
|
||||||
workouts,
|
|
||||||
cardioSessions,
|
|
||||||
nutritionLogs,
|
|
||||||
addWorkoutSession,
|
|
||||||
addCardioSession,
|
|
||||||
addNutritionLog,
|
|
||||||
refreshMetrics,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
@@ -1,309 +0,0 @@
|
|||||||
/**
|
|
||||||
* Workout and metrics data persistence layer
|
|
||||||
* Handles saving and retrieving workout data from localStorage
|
|
||||||
*/
|
|
||||||
|
|
||||||
export interface WorkoutSet {
|
|
||||||
reps: number;
|
|
||||||
weight: number;
|
|
||||||
timestamp: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface WorkoutSession {
|
|
||||||
id: string;
|
|
||||||
exerciseName: string;
|
|
||||||
date: string;
|
|
||||||
sets: WorkoutSet[];
|
|
||||||
duration: number; // in seconds
|
|
||||||
caloriesBurned: number;
|
|
||||||
notes?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface CardioSession {
|
|
||||||
id: string;
|
|
||||||
type: 'running' | 'walking' | 'cycling';
|
|
||||||
date: string;
|
|
||||||
distance: number; // in km
|
|
||||||
duration: number; // in seconds
|
|
||||||
caloriesBurned: number;
|
|
||||||
pace: number; // km/h
|
|
||||||
steps?: number;
|
|
||||||
route?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface NutritionLog {
|
|
||||||
id: string;
|
|
||||||
date: string;
|
|
||||||
calories: number;
|
|
||||||
protein: number;
|
|
||||||
carbs: number;
|
|
||||||
fats: number;
|
|
||||||
meals: string[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface UserMetrics {
|
|
||||||
totalWorkouts: number;
|
|
||||||
totalCardioDistance: number;
|
|
||||||
totalCaloriesBurned: number;
|
|
||||||
currentStreak: number;
|
|
||||||
personalRecords: Record<string, number>;
|
|
||||||
lastUpdated: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
const STORAGE_KEYS = {
|
|
||||||
WORKOUT_SESSIONS: 'fitflow_workout_sessions',
|
|
||||||
CARDIO_SESSIONS: 'fitflow_cardio_sessions',
|
|
||||||
NUTRITION_LOGS: 'fitflow_nutrition_logs',
|
|
||||||
USER_METRICS: 'fitflow_user_metrics',
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Save a workout session to localStorage
|
|
||||||
*/
|
|
||||||
export const saveWorkoutSession = (session: WorkoutSession): void => {
|
|
||||||
if (typeof window === 'undefined') return;
|
|
||||||
|
|
||||||
try {
|
|
||||||
const sessions = getWorkoutSessions();
|
|
||||||
sessions.push(session);
|
|
||||||
localStorage.setItem(STORAGE_KEYS.WORKOUT_SESSIONS, JSON.stringify(sessions));
|
|
||||||
updateUserMetrics();
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error saving workout session:', error);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get all workout sessions from localStorage
|
|
||||||
*/
|
|
||||||
export const getWorkoutSessions = (): WorkoutSession[] => {
|
|
||||||
if (typeof window === 'undefined') return [];
|
|
||||||
|
|
||||||
try {
|
|
||||||
const data = localStorage.getItem(STORAGE_KEYS.WORKOUT_SESSIONS);
|
|
||||||
return data ? JSON.parse(data) : [];
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error retrieving workout sessions:', error);
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Save a cardio session to localStorage
|
|
||||||
*/
|
|
||||||
export const saveCardioSession = (session: CardioSession): void => {
|
|
||||||
if (typeof window === 'undefined') return;
|
|
||||||
|
|
||||||
try {
|
|
||||||
const sessions = getCardioSessions();
|
|
||||||
sessions.push(session);
|
|
||||||
localStorage.setItem(STORAGE_KEYS.CARDIO_SESSIONS, JSON.stringify(sessions));
|
|
||||||
updateUserMetrics();
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error saving cardio session:', error);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get all cardio sessions from localStorage
|
|
||||||
*/
|
|
||||||
export const getCardioSessions = (): CardioSession[] => {
|
|
||||||
if (typeof window === 'undefined') return [];
|
|
||||||
|
|
||||||
try {
|
|
||||||
const data = localStorage.getItem(STORAGE_KEYS.CARDIO_SESSIONS);
|
|
||||||
return data ? JSON.parse(data) : [];
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error retrieving cardio sessions:', error);
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Save a nutrition log to localStorage
|
|
||||||
*/
|
|
||||||
export const saveNutritionLog = (log: NutritionLog): void => {
|
|
||||||
if (typeof window === 'undefined') return;
|
|
||||||
|
|
||||||
try {
|
|
||||||
const logs = getNutritionLogs();
|
|
||||||
logs.push(log);
|
|
||||||
localStorage.setItem(STORAGE_KEYS.NUTRITION_LOGS, JSON.stringify(logs));
|
|
||||||
updateUserMetrics();
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error saving nutrition log:', error);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get all nutrition logs from localStorage
|
|
||||||
*/
|
|
||||||
export const getNutritionLogs = (): NutritionLog[] => {
|
|
||||||
if (typeof window === 'undefined') return [];
|
|
||||||
|
|
||||||
try {
|
|
||||||
const data = localStorage.getItem(STORAGE_KEYS.NUTRITION_LOGS);
|
|
||||||
return data ? JSON.parse(data) : [];
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error retrieving nutrition logs:', error);
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get user metrics from localStorage
|
|
||||||
*/
|
|
||||||
export const getUserMetrics = (): UserMetrics => {
|
|
||||||
if (typeof window === 'undefined') {
|
|
||||||
return {
|
|
||||||
totalWorkouts: 0,
|
|
||||||
totalCardioDistance: 0,
|
|
||||||
totalCaloriesBurned: 0,
|
|
||||||
currentStreak: 0,
|
|
||||||
personalRecords: {},
|
|
||||||
lastUpdated: Date.now(),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
const data = localStorage.getItem(STORAGE_KEYS.USER_METRICS);
|
|
||||||
return data
|
|
||||||
? JSON.parse(data)
|
|
||||||
: {
|
|
||||||
totalWorkouts: 0,
|
|
||||||
totalCardioDistance: 0,
|
|
||||||
totalCaloriesBurned: 0,
|
|
||||||
currentStreak: 0,
|
|
||||||
personalRecords: {},
|
|
||||||
lastUpdated: Date.now(),
|
|
||||||
};
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error retrieving user metrics:', error);
|
|
||||||
return {
|
|
||||||
totalWorkouts: 0,
|
|
||||||
totalCardioDistance: 0,
|
|
||||||
totalCaloriesBurned: 0,
|
|
||||||
currentStreak: 0,
|
|
||||||
personalRecords: {},
|
|
||||||
lastUpdated: Date.now(),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Update user metrics based on saved sessions
|
|
||||||
*/
|
|
||||||
export const updateUserMetrics = (): void => {
|
|
||||||
if (typeof window === 'undefined') return;
|
|
||||||
|
|
||||||
try {
|
|
||||||
const workoutSessions = getWorkoutSessions();
|
|
||||||
const cardioSessions = getCardioSessions();
|
|
||||||
const nutritionLogs = getNutritionLogs();
|
|
||||||
|
|
||||||
let totalWorkouts = workoutSessions.length;
|
|
||||||
let totalCardioDistance = cardioSessions.reduce((sum, session) => sum + session.distance, 0);
|
|
||||||
let totalCaloriesBurned = workoutSessions.reduce((sum, session) => sum + session.caloriesBurned, 0)
|
|
||||||
+ cardioSessions.reduce((sum, session) => sum + session.caloriesBurned, 0);
|
|
||||||
|
|
||||||
// Calculate streak (consecutive days with activity)
|
|
||||||
const currentStreak = calculateStreak([...workoutSessions, ...cardioSessions]);
|
|
||||||
|
|
||||||
// Extract personal records from workouts
|
|
||||||
const personalRecords: Record<string, number> = {};
|
|
||||||
workoutSessions.forEach((session) => {
|
|
||||||
const maxWeight = Math.max(...session.sets.map((s) => s.weight));
|
|
||||||
const key = `${session.exerciseName}_pr`;
|
|
||||||
if (!personalRecords[key] || maxWeight > personalRecords[key]) {
|
|
||||||
personalRecords[key] = maxWeight;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const metrics: UserMetrics = {
|
|
||||||
totalWorkouts,
|
|
||||||
totalCardioDistance,
|
|
||||||
totalCaloriesBurned,
|
|
||||||
currentStreak,
|
|
||||||
personalRecords,
|
|
||||||
lastUpdated: Date.now(),
|
|
||||||
};
|
|
||||||
|
|
||||||
localStorage.setItem(STORAGE_KEYS.USER_METRICS, JSON.stringify(metrics));
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error updating user metrics:', error);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Calculate consecutive days with activity
|
|
||||||
*/
|
|
||||||
const calculateStreak = (sessions: Array<WorkoutSession | CardioSession>): number => {
|
|
||||||
if (sessions.length === 0) return 0;
|
|
||||||
|
|
||||||
const dates = sessions.map((session) => new Date(session.date).toDateString()).filter((date, index, self) => self.indexOf(date) === index).sort((a, b) => new Date(b).getTime() - new Date(a).getTime());
|
|
||||||
|
|
||||||
let streak = 1;
|
|
||||||
for (let i = 1; i < dates.length; i++) {
|
|
||||||
const currentDate = new Date(dates[i]);
|
|
||||||
const previousDate = new Date(dates[i - 1]);
|
|
||||||
const diffTime = Math.abs(previousDate.getTime() - currentDate.getTime());
|
|
||||||
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
|
|
||||||
|
|
||||||
if (diffDays === 1) {
|
|
||||||
streak++;
|
|
||||||
} else {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return streak;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Clear all stored data
|
|
||||||
*/
|
|
||||||
export const clearAllData = (): void => {
|
|
||||||
if (typeof window === 'undefined') return;
|
|
||||||
|
|
||||||
try {
|
|
||||||
localStorage.removeItem(STORAGE_KEYS.WORKOUT_SESSIONS);
|
|
||||||
localStorage.removeItem(STORAGE_KEYS.CARDIO_SESSIONS);
|
|
||||||
localStorage.removeItem(STORAGE_KEYS.NUTRITION_LOGS);
|
|
||||||
localStorage.removeItem(STORAGE_KEYS.USER_METRICS);
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error clearing data:', error);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Export data as JSON for backup
|
|
||||||
*/
|
|
||||||
export const exportData = (): string => {
|
|
||||||
const data = {
|
|
||||||
workouts: getWorkoutSessions(),
|
|
||||||
cardio: getCardioSessions(),
|
|
||||||
nutrition: getNutritionLogs(),
|
|
||||||
metrics: getUserMetrics(),
|
|
||||||
exportDate: new Date().toISOString(),
|
|
||||||
};
|
|
||||||
return JSON.stringify(data, null, 2);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Import data from JSON backup
|
|
||||||
*/
|
|
||||||
export const importData = (jsonData: string): boolean => {
|
|
||||||
if (typeof window === 'undefined') return false;
|
|
||||||
|
|
||||||
try {
|
|
||||||
const data = JSON.parse(jsonData);
|
|
||||||
if (data.workouts) localStorage.setItem(STORAGE_KEYS.WORKOUT_SESSIONS, JSON.stringify(data.workouts));
|
|
||||||
if (data.cardio) localStorage.setItem(STORAGE_KEYS.CARDIO_SESSIONS, JSON.stringify(data.cardio));
|
|
||||||
if (data.nutrition) localStorage.setItem(STORAGE_KEYS.NUTRITION_LOGS, JSON.stringify(data.nutrition));
|
|
||||||
if (data.metrics) localStorage.setItem(STORAGE_KEYS.USER_METRICS, JSON.stringify(data.metrics));
|
|
||||||
return true;
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error importing data:', error);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,160 +0,0 @@
|
|||||||
"use client";
|
|
||||||
|
|
||||||
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
|
||||||
import NavbarStyleCentered from '@/components/navbar/NavbarStyleCentered/NavbarStyleCentered';
|
|
||||||
import { useState } from "react";
|
|
||||||
import { Eye, EyeOff, Mail, Lock } from 'lucide-react';
|
|
||||||
import Input from '@/components/form/Input';
|
|
||||||
|
|
||||||
export default function LoginPage() {
|
|
||||||
const [email, setEmail] = useState("");
|
|
||||||
const [password, setPassword] = useState("");
|
|
||||||
const [showPassword, setShowPassword] = useState(false);
|
|
||||||
const [errors, setErrors] = useState<{ email?: string; password?: string }>({});
|
|
||||||
const [isSubmitted, setIsSubmitted] = useState(false);
|
|
||||||
|
|
||||||
const validateForm = () => {
|
|
||||||
const newErrors: { email?: string; password?: string } = {};
|
|
||||||
|
|
||||||
if (!email) {
|
|
||||||
newErrors.email = "Email é obrigatório";
|
|
||||||
} else if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) {
|
|
||||||
newErrors.email = "Email inválido";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!password) {
|
|
||||||
newErrors.password = "Senha é obrigatória";
|
|
||||||
} else if (password.length < 6) {
|
|
||||||
newErrors.password = "Senha deve ter no mínimo 6 caracteres";
|
|
||||||
}
|
|
||||||
|
|
||||||
return newErrors;
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleSubmit = (e: React.FormEvent) => {
|
|
||||||
e.preventDefault();
|
|
||||||
const newErrors = validateForm();
|
|
||||||
setErrors(newErrors);
|
|
||||||
|
|
||||||
if (Object.keys(newErrors).length === 0) {
|
|
||||||
setIsSubmitted(true);
|
|
||||||
console.log("Login attempt:", { email, password });
|
|
||||||
setTimeout(() => {
|
|
||||||
setIsSubmitted(false);
|
|
||||||
}, 2000);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<ThemeProvider
|
|
||||||
defaultButtonVariant="elastic-effect"
|
|
||||||
defaultTextAnimation="entrance-slide"
|
|
||||||
borderRadius="pill"
|
|
||||||
contentWidth="smallMedium"
|
|
||||||
sizing="mediumSizeLargeTitles"
|
|
||||||
background="blurBottom"
|
|
||||||
cardStyle="gradient-bordered"
|
|
||||||
primaryButtonStyle="flat"
|
|
||||||
secondaryButtonStyle="glass"
|
|
||||||
headingFontWeight="extrabold"
|
|
||||||
>
|
|
||||||
<div id="nav" data-section="nav">
|
|
||||||
<NavbarStyleCentered
|
|
||||||
navItems={[
|
|
||||||
{ name: "Dashboard", id: "/" },
|
|
||||||
{ name: "Treino", id: "training" },
|
|
||||||
{ name: "Nutrição", id: "nutrition" },
|
|
||||||
{ name: "Comunidade", id: "community" },
|
|
||||||
{ name: "Perfil", id: "profile" }
|
|
||||||
]}
|
|
||||||
button={{ text: "Começar Agora", href: "/signup" }}
|
|
||||||
brandName="FitFlow Pro"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="min-h-[calc(100vh-80px)] flex items-center justify-center py-12 px-4">
|
|
||||||
<div className="w-full max-w-md">
|
|
||||||
<div className="bg-card rounded-3xl shadow-lg p-8 border border-accent/10">
|
|
||||||
<div className="mb-8">
|
|
||||||
<h1 className="text-3xl font-extrabold text-foreground mb-2">Bem-vindo de Volta</h1>
|
|
||||||
<p className="text-foreground/70">Faça login para acessar seu progresso</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<form onSubmit={handleSubmit} className="space-y-6">
|
|
||||||
<div>
|
|
||||||
<label className="block text-sm font-medium text-foreground mb-2">
|
|
||||||
<div className="flex items-center gap-2">
|
|
||||||
<Mail size={16} />
|
|
||||||
Email
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
<Input
|
|
||||||
value={email}
|
|
||||||
onChange={setEmail}
|
|
||||||
type="email"
|
|
||||||
placeholder="seu@email.com"
|
|
||||||
required
|
|
||||||
className={errors.email ? "border-red-500" : ""}
|
|
||||||
/>
|
|
||||||
{errors.email && (
|
|
||||||
<p className="text-red-500 text-sm mt-1">{errors.email}</p>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<label className="block text-sm font-medium text-foreground mb-2">
|
|
||||||
<div className="flex items-center gap-2">
|
|
||||||
<Lock size={16} />
|
|
||||||
Senha
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
<div className="relative">
|
|
||||||
<Input
|
|
||||||
value={password}
|
|
||||||
onChange={setPassword}
|
|
||||||
type={showPassword ? "text" : "password"}
|
|
||||||
placeholder="••••••••"
|
|
||||||
required
|
|
||||||
className={errors.password ? "border-red-500" : "pr-10"}
|
|
||||||
/>
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
onClick={() => setShowPassword(!showPassword)}
|
|
||||||
className="absolute right-3 top-1/2 -translate-y-1/2 text-foreground/50 hover:text-foreground transition-colors"
|
|
||||||
aria-label={showPassword ? "Ocultar senha" : "Mostrar senha"}
|
|
||||||
>
|
|
||||||
{showPassword ? <EyeOff size={18} /> : <Eye size={18} />}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
{errors.password && (
|
|
||||||
<p className="text-red-500 text-sm mt-1">{errors.password}</p>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button
|
|
||||||
type="submit"
|
|
||||||
disabled={isSubmitted}
|
|
||||||
className="w-full py-3 px-4 bg-primary-cta hover:opacity-90 disabled:opacity-50 text-white font-semibold rounded-full transition-all duration-300 transform hover:scale-105"
|
|
||||||
>
|
|
||||||
{isSubmitted ? "Entrando..." : "Entrar"}
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<div className="mt-6 text-center text-sm text-foreground/70">
|
|
||||||
<p>
|
|
||||||
Não tem conta?{" "}
|
|
||||||
<a href="/signup" className="text-primary-cta font-semibold hover:underline">
|
|
||||||
Criar conta
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="mt-6 pt-6 border-t border-accent/10 text-center text-xs text-foreground/50">
|
|
||||||
<p>Teste gratuito por 30 dias. Sem cartão de crédito necessário.</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</ThemeProvider>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
713
src/app/page.tsx
713
src/app/page.tsx
@@ -10,377 +10,376 @@ import MetricCardFourteen from '@/components/sections/metrics/MetricCardFourteen
|
|||||||
import TeamCardOne from '@/components/sections/team/TeamCardOne';
|
import TeamCardOne from '@/components/sections/team/TeamCardOne';
|
||||||
import TestimonialCardTwelve from '@/components/sections/testimonial/TestimonialCardTwelve';
|
import TestimonialCardTwelve from '@/components/sections/testimonial/TestimonialCardTwelve';
|
||||||
import SocialProofOne from '@/components/sections/socialProof/SocialProofOne';
|
import SocialProofOne from '@/components/sections/socialProof/SocialProofOne';
|
||||||
import ContactText from '@/components/sections/contact/ContactText';
|
import ContactSplit from '@/components/sections/contact/ContactSplit';
|
||||||
import FooterLogoEmphasis from '@/components/sections/footer/FooterLogoEmphasis';
|
import FooterBase from '@/components/sections/footer/FooterBase';
|
||||||
import { Activity, Apple, Brain, Dumbbell, Heart, Target, Zap, Users, Star, TrendingDown, TrendingUp } from 'lucide-react';
|
import { Activity, Apple, Brain, Dumbbell, Heart, Target, Zap, Users, Star, TrendingDown, TrendingUp, Mail } from 'lucide-react';
|
||||||
import { WorkoutDataIntegration } from '@/app/components/WorkoutDataIntegration';
|
|
||||||
|
|
||||||
export default function LandingPage() {
|
export default function LandingPage() {
|
||||||
return (
|
return (
|
||||||
<WorkoutDataIntegration autoSave={true}>
|
<ThemeProvider
|
||||||
<ThemeProvider
|
defaultButtonVariant="elastic-effect"
|
||||||
defaultButtonVariant="elastic-effect"
|
defaultTextAnimation="entrance-slide"
|
||||||
defaultTextAnimation="entrance-slide"
|
borderRadius="pill"
|
||||||
borderRadius="pill"
|
contentWidth="smallMedium"
|
||||||
contentWidth="smallMedium"
|
sizing="mediumSizeLargeTitles"
|
||||||
sizing="mediumSizeLargeTitles"
|
background="blurBottom"
|
||||||
background="blurBottom"
|
cardStyle="gradient-bordered"
|
||||||
cardStyle="gradient-bordered"
|
primaryButtonStyle="flat"
|
||||||
primaryButtonStyle="flat"
|
secondaryButtonStyle="glass"
|
||||||
secondaryButtonStyle="glass"
|
headingFontWeight="extrabold"
|
||||||
headingFontWeight="extrabold"
|
>
|
||||||
>
|
<div id="nav" data-section="nav">
|
||||||
<div id="nav" data-section="nav">
|
<NavbarStyleCentered
|
||||||
<NavbarStyleCentered
|
navItems={[
|
||||||
navItems={[
|
{ name: "Dashboard", id: "dashboard" },
|
||||||
{ name: "Dashboard", id: "dashboard" },
|
{ name: "Treino", id: "training" },
|
||||||
{ name: "Treino", id: "training" },
|
{ name: "Receitas", id: "/recipes" },
|
||||||
{ name: "Nutrição", id: "nutrition" },
|
{ name: "Comunidade", id: "community" },
|
||||||
{ name: "Comunidade", id: "community" },
|
{ name: "Perfil", id: "profile" }
|
||||||
{ name: "Perfil", id: "profile" }
|
]}
|
||||||
]}
|
button={{ text: "Começar Agora", href: "contact" }}
|
||||||
button={{ text: "Começar Agora", href: "contact" }}
|
brandName="FitFlow Pro"
|
||||||
brandName="FitFlow Pro"
|
/>
|
||||||
/>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="hero" data-section="hero">
|
<div id="hero" data-section="hero">
|
||||||
<HeroSplitKpi
|
<HeroSplitKpi
|
||||||
title="Seu Corpo, Seu Histórico, Sua Vitória"
|
title="Seu Corpo, Seu Histórico, Sua Vitória"
|
||||||
description="Aplicativo premium de fitness com rastreamento biométrico inteligente, treinos personalizados por IA e cardio com GPS. Transforme seu corpo enquanto acompanha cada segundo da jornada."
|
description="Aplicativo premium de fitness com rastreamento biométrico inteligente, treinos personalizados por IA e cardio com GPS. Transforme seu corpo enquanto acompanha cada segundo da jornada."
|
||||||
tag="Fitness Ultra-Premium"
|
tag="Fitness Ultra-Premium"
|
||||||
tagIcon={Zap}
|
tagIcon={Zap}
|
||||||
background={{ variant: "glowing-orb" }}
|
background={{ variant: "glowing-orb" }}
|
||||||
kpis={[
|
kpis={[
|
||||||
{ value: "150K+", label: "Usuários Ativos" },
|
{ value: "150K+", label: "Usuários Ativos" },
|
||||||
{ value: "2M+", label: "Treinos Concluídos" },
|
{ value: "2M+", label: "Treinos Concluídos" },
|
||||||
{ value: "4.9★", label: "Avaliação" }
|
{ value: "4.9★", label: "Avaliação" }
|
||||||
]}
|
]}
|
||||||
enableKpiAnimation={true}
|
enableKpiAnimation={true}
|
||||||
imageSrc="https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/ultra-modern-fitness-app-dashboard-with--1773256981295-f56c580b.png?_wi=1"
|
imageSrc="https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/ultra-modern-fitness-app-dashboard-with--1773256981295-f56c580b.png?_wi=1"
|
||||||
imageAlt="Dashboard de fitness premium"
|
imageAlt="Dashboard de fitness premium"
|
||||||
imagePosition="right"
|
imagePosition="right"
|
||||||
mediaAnimation="slide-up"
|
mediaAnimation="slide-up"
|
||||||
buttons={[
|
buttons={[
|
||||||
{ text: "Começar Teste Grátis", href: "contact" },
|
{ text: "Começar Teste Grátis", href: "contact" },
|
||||||
{ text: "Ver Demo", href: "#features" }
|
{ text: "Ver Demo", href: "#features" }
|
||||||
]}
|
]}
|
||||||
avatars={[
|
avatars={[
|
||||||
{ src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/professional-athlete-portrait-male-fitne-1773256979726-5009f852.png", alt: "Usuário" },
|
{ src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/professional-athlete-portrait-male-fitne-1773256979726-5009f852.png", alt: "Usuário" },
|
||||||
{ src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/fit-female-athlete-portrait-determined-e-1773256980310-c05dce2f.png", alt: "Usuário" },
|
{ src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/fit-female-athlete-portrait-determined-e-1773256980310-c05dce2f.png", alt: "Usuário" },
|
||||||
{ src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/athletic-male-trainer-portrait-confident-1773256979906-c5e05a88.png", alt: "Usuário" }
|
{ src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/athletic-male-trainer-portrait-confident-1773256979906-c5e05a88.png", alt: "Usuário" }
|
||||||
]}
|
]}
|
||||||
avatarText="Join 150K+ athletes"
|
avatarText="Join 150K+ athletes"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="onboarding" data-section="onboarding">
|
<div id="onboarding" data-section="onboarding">
|
||||||
<FeatureCardTwentyFive
|
<FeatureCardTwentyFive
|
||||||
title="Onboarding Biométrico Dinâmico"
|
title="Onboarding Biométrico Dinâmico"
|
||||||
description="Sistema inteligente que adapta-se ao seu corpo. Defina seu objetivo, e o app calcula automaticamente sua timeline de sucesso com precisão científica."
|
description="Sistema inteligente que adapta-se ao seu corpo. Defina seu objetivo, e o app calcula automaticamente sua timeline de sucesso com precisão científica."
|
||||||
tag="Inteligência Adaptativa"
|
tag="Inteligência Adaptativa"
|
||||||
tagIcon={Brain}
|
tagIcon={Brain}
|
||||||
features={[
|
features={[
|
||||||
{
|
{
|
||||||
title: "Perfil Biométrico", description: "Coloque seus dados (gênero, altura, peso, idade) e veja o app adaptar todas as demonstrações, avatares e ilustrações anatomicamente.", icon: Target,
|
title: "Perfil Biométrico", description: "Coloque seus dados (gênero, altura, peso, idade) e veja o app adaptar todas as demonstrações, avatares e ilustrações anatomicamente.", icon: Target,
|
||||||
mediaItems: [
|
mediaItems: [
|
||||||
{
|
{
|
||||||
imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/premium-onboarding-screen-for-fitness-ap-1773256981180-774b293c.png", imageAlt: "Tela de biometria"
|
type: "image", src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/premium-onboarding-screen-for-fitness-ap-1773256981180-774b293c.png", alt: "Tela de biometria"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/ultra-modern-fitness-app-dashboard-with--1773256981295-f56c580b.png?_wi=2", imageAlt: "Dashboard adaptado"
|
type: "image", src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/ultra-modern-fitness-app-dashboard-with--1773256981295-f56c580b.png?_wi=2", alt: "Dashboard adaptado"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Metas Inteligentes", description: "Escolha: Perder Peso ou Ganhar Massa. O sistema calcula TMB, projeta planilha de metas e mostra exatamente quando você atingirá seu objetivo.", icon: Zap,
|
title: "Metas Inteligentes", description: "Escolha: Perder Peso ou Ganhar Massa. O sistema calcula TMB, projeta planilha de metas e mostra exatamente quando você atingirá seu objetivo.", icon: Zap,
|
||||||
mediaItems: [
|
mediaItems: [
|
||||||
{
|
{
|
||||||
imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/nutrition-dashboard-showing-meal-plans-d-1773256981349-9348b6d9.png", imageAlt: "Plano de nutrição"
|
type: "image", src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/nutrition-dashboard-showing-meal-plans-d-1773256981349-9348b6d9.png", alt: "Plano de nutrição"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/performance-metrics-showcase-displaying--1773256982260-f9a5cff0.png?_wi=1", imageAlt: "Métricas de progresso"
|
type: "image", src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/performance-metrics-showcase-displaying--1773256982260-f9a5cff0.png?_wi=1", alt: "Métricas de progresso"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]}
|
]}
|
||||||
animationType="blur-reveal"
|
animationType="blur-reveal"
|
||||||
textboxLayout="default"
|
textboxLayout="default"
|
||||||
useInvertedBackground={false}
|
useInvertedBackground={false}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="cardio" data-section="cardio">
|
<div id="cardio" data-section="cardio">
|
||||||
<FeatureCardTwentyFive
|
<FeatureCardTwentyFive
|
||||||
title="Hub de Cardio com GPS em Tempo Real"
|
title="Hub de Cardio com GPS em Tempo Real"
|
||||||
description="Rastreie suas corridas e caminhadas com precisão de GPS. Monitore pace, distância, calorias queimadas e vença suas metas diárias com anéis de progresso animados."
|
description="Rastreie suas corridas e caminhadas com precisão de GPS. Monitore pace, distância, calorias queimadas e vença suas metas diárias com anéis de progresso animados."
|
||||||
tag="Cardio Premium"
|
tag="Cardio Premium"
|
||||||
tagIcon={Heart}
|
tagIcon={Heart}
|
||||||
features={[
|
features={[
|
||||||
{
|
{
|
||||||
title: "Running Tracker Avançado", description: "GPS ativado em tempo real. Mapeia sua rota, calcula queima de calorias baseado no peso, mostra ritmo ao vivo em painel estilo smartwatch.", icon: Zap,
|
title: "Running Tracker Avançado", description: "GPS ativado em tempo real. Mapeia sua rota, calcula queima de calorias baseado no peso, mostra ritmo ao vivo em painel estilo smartwatch.", icon: Zap,
|
||||||
mediaItems: [
|
mediaItems: [
|
||||||
{
|
{
|
||||||
imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/gps-running-tracker-interface-with-real--1773256980694-2abe167e.png", imageAlt: "Rastreamento GPS"
|
type: "image", src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/gps-running-tracker-interface-with-real--1773256980694-2abe167e.png", alt: "Rastreamento GPS"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/performance-metrics-showcase-displaying--1773256982260-f9a5cff0.png?_wi=2", imageAlt: "Métricas de cardio"
|
type: "image", src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/performance-metrics-showcase-displaying--1773256982260-f9a5cff0.png?_wi=2", alt: "Métricas de cardio"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Pedômetro & Caminhada", description: "Contador de passos embutido com rastreamento de distância e calorias. Vença suas metas de 10.000 passos com visual de anéis de progresso motivacional.", icon: Activity,
|
title: "Pedômetro & Caminhada", description: "Contador de passos embutido com rastreamento de distância e calorias. Vença suas metas de 10.000 passos com visual de anéis de progresso motivacional.", icon: Activity,
|
||||||
mediaItems: [
|
mediaItems: [
|
||||||
{
|
{
|
||||||
imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/ultra-modern-fitness-app-dashboard-with--1773256981295-f56c580b.png?_wi=3", imageAlt: "Dashboard de passos"
|
type: "image", src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/ultra-modern-fitness-app-dashboard-with--1773256981295-f56c580b.png?_wi=3", alt: "Dashboard de passos"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/performance-metrics-showcase-displaying--1773256982260-f9a5cff0.png?_wi=3", imageAlt: "Progresso de atividade"
|
type: "image", src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/performance-metrics-showcase-displaying--1773256982260-f9a5cff0.png?_wi=3", alt: "Progresso de atividade"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]}
|
]}
|
||||||
animationType="depth-3d"
|
animationType="depth-3d"
|
||||||
textboxLayout="default"
|
textboxLayout="default"
|
||||||
useInvertedBackground={false}
|
useInvertedBackground={false}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="training" data-section="training">
|
<div id="training" data-section="training">
|
||||||
<FeatureCardTwentyFive
|
<FeatureCardTwentyFive
|
||||||
title="Core de Treinamento com IA"
|
title="Core de Treinamento com IA"
|
||||||
description="Algoritmo adaptativo que recomenda treinos baseado em biometria. Escolha entre Casa (calistenia) ou Ginásio (máquinas/pesos) e isole por grupo muscular com modelo anatômico 3D interativo."
|
description="Algoritmo adaptativo que recomenda treinos baseado em biometria. Escolha entre Casa (calistenia) ou Ginásio (máquinas/pesos) e isole por grupo muscular com modelo anatômico 3D interativo."
|
||||||
tag="Recomendação de IA"
|
tag="Recomendação de IA"
|
||||||
tagIcon={Brain}
|
tagIcon={Brain}
|
||||||
features={[
|
features={[
|
||||||
{
|
{
|
||||||
title: "Dualidade de Ambientes", description: "Treinos em Casa (peso corporal, calistenia) ou Ginásio (máquinas, pesos livres). Sistema diferencia automaticamente baseado em sua escolha e disponibilidade de equipamento.", icon: Dumbbell,
|
title: "Dualidade de Ambientes", description: "Treinos em Casa (peso corporal, calistenia) ou Ginásio (máquinas, pesos livres). Sistema diferencia automaticamente baseado em sua escolha e disponibilidade de equipamento.", icon: Dumbbell,
|
||||||
mediaItems: [
|
mediaItems: [
|
||||||
{
|
{
|
||||||
imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/interactive-anatomical-body-model-showin-1773256980448-3cccd7b3.png?_wi=1", imageAlt: "Seleção de exercícios"
|
type: "image", src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/interactive-anatomical-body-model-showin-1773256980448-3cccd7b3.png?_wi=1", alt: "Seleção de exercícios"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/workout-execution-interface-showing-set--1773256980664-da11c464.png?_wi=1", imageAlt: "Execução de treino"
|
type: "image", src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/workout-execution-interface-showing-set--1773256980664-da11c464.png?_wi=1", alt: "Execução de treino"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Isolamento por Grupo Muscular", description: "Modelo anatômico 3D/2D interativo. Clique em um músculo (peitoral, glúteo, etc.) e veja lista filtrada de exercícios com foco nesse músculo específico.", icon: Zap,
|
title: "Isolamento por Grupo Muscular", description: "Modelo anatômico 3D/2D interativo. Clique em um músculo (peitoral, glúteo, etc.) e veja lista filtrada de exercícios com foco nesse músculo específico.", icon: Zap,
|
||||||
mediaItems: [
|
mediaItems: [
|
||||||
{
|
{
|
||||||
imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/interactive-anatomical-body-model-showin-1773256980448-3cccd7b3.png?_wi=2", imageAlt: "Anatomia interativa"
|
type: "image", src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/interactive-anatomical-body-model-showin-1773256980448-3cccd7b3.png?_wi=2", alt: "Anatomia interativa"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/workout-execution-interface-showing-set--1773256980664-da11c464.png?_wi=2", imageAlt: "Exercícios filtrados"
|
type: "image", src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/workout-execution-interface-showing-set--1773256980664-da11c464.png?_wi=2", alt: "Exercícios filtrados"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]}
|
]}
|
||||||
animationType="scale-rotate"
|
animationType="scale-rotate"
|
||||||
textboxLayout="default"
|
textboxLayout="default"
|
||||||
useInvertedBackground={false}
|
useInvertedBackground={false}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="workout-mode" data-section="workout-mode">
|
<div id="workout-mode" data-section="workout-mode">
|
||||||
<ProductCardOne
|
<ProductCardOne
|
||||||
title="Modo 'Em Execução' - Tracking de Série"
|
title="Modo 'Em Execução' - Tracking de Série"
|
||||||
description="Interface imersiva que transforma o treino em experiência interativa com cronômetro de descanso, registro de progresso e gráficos de progressão."
|
description="Interface imersiva que transforma o treino em experiência interativa com cronômetro de descanso, registro de progresso e gráficos de progressão."
|
||||||
tag="Focus Mode"
|
tag="Focus Mode"
|
||||||
tagIcon={Target}
|
tagIcon={Target}
|
||||||
products={[
|
products={[
|
||||||
{
|
{
|
||||||
id: "1", name: "Iniciar Série", price: "Botão Proeminente", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/workout-execution-interface-showing-set--1773256980664-da11c464.png?_wi=3", imageAlt: "Tela de série"
|
id: "1", name: "Iniciar Série", price: "Botão Proeminente", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/workout-execution-interface-showing-set--1773256980664-da11c464.png?_wi=3", imageAlt: "Tela de série"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "2", name: "Cronômetro de Descanso", price: "Automático", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/workout-execution-interface-showing-set--1773256980664-da11c464.png?_wi=4", imageAlt: "Descanso entre séries"
|
id: "2", name: "Cronômetro de Descanso", price: "Automático", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/workout-execution-interface-showing-set--1773256980664-da11c464.png?_wi=4", imageAlt: "Descanso entre séries"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "3", name: "Registrar Progresso", price: "Carga + Reps", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/performance-metrics-showcase-displaying--1773256982260-f9a5cff0.png?_wi=4", imageAlt: "Progresso salvo"
|
id: "3", name: "Registrar Progresso", price: "Carga + Reps", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/performance-metrics-showcase-displaying--1773256982260-f9a5cff0.png?_wi=4", imageAlt: "Progresso salvo"
|
||||||
}
|
}
|
||||||
]}
|
]}
|
||||||
animationType="slide-up"
|
animationType="slide-up"
|
||||||
textboxLayout="default"
|
textboxLayout="default"
|
||||||
useInvertedBackground={false}
|
useInvertedBackground={false}
|
||||||
gridVariant="three-columns-all-equal-width"
|
gridVariant="three-columns-all-equal-width"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="nutrition" data-section="nutrition">
|
<div id="nutrition" data-section="nutrition">
|
||||||
<PricingCardOne
|
<PricingCardOne
|
||||||
title="Nutrição Inteligente & Receituário"
|
title="Nutrição Inteligente & Receituário"
|
||||||
description="Planos alimentares 100% sincronizados com suas metas de peso. Se quer perder peso, déficit calórico. Se quer ganhar massa, superávit inteligente."
|
description="Planos alimentares 100% sincronizados com suas metas de peso. Se quer perder peso, déficit calórico. Se quer ganhar massa, superávit inteligente."
|
||||||
tag="Sincronizado com Timeline"
|
tag="Sincronizado com Timeline"
|
||||||
tagIcon={Apple}
|
tagIcon={Apple}
|
||||||
plans={[
|
plans={[
|
||||||
{
|
{
|
||||||
id: "deficit", badge: "Perda de Peso", badgeIcon: TrendingDown,
|
id: "deficit", badge: "Perda de Peso", badgeIcon: TrendingDown,
|
||||||
price: "Déficit Calórico", subtitle: "Receitas otimizadas para queima de calorias", features: [
|
price: "Déficit Calórico", subtitle: "Receitas otimizadas para queima de calorias", features: [
|
||||||
"Macros calculados automaticamente", "Prep time entre 15-30 min", "Proteína alta, carboidrato estratégico", "Rastreamento integrado", "Sugestões diárias personalizadas"
|
"Macros calculados automaticamente", "Prep time entre 15-30 min", "Proteína alta, carboidrato estratégico", "Rastreamento integrado", "Sugestões diárias personalizadas"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "surplus", badge: "Ganho de Massa", badgeIcon: TrendingUp,
|
id: "surplus", badge: "Ganho de Massa", badgeIcon: TrendingUp,
|
||||||
price: "Superávit Estratégico", subtitle: "Nutrição para crescimento muscular", features: [
|
price: "Superávit Estratégico", subtitle: "Nutrição para crescimento muscular", features: [
|
||||||
"Calorias calculadas para ganho", "Proteína máxima (2g por kg)", "Carbos pré e pós-treino", "Tempo de preparo eficiente", "Sincronizado com treino de força"
|
"Calorias calculadas para ganho", "Proteína máxima (2g por kg)", "Carbos pré e pós-treino", "Tempo de preparo eficiente", "Sincronizado com treino de força"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]}
|
]}
|
||||||
animationType="slide-up"
|
animationType="slide-up"
|
||||||
textboxLayout="default"
|
textboxLayout="default"
|
||||||
useInvertedBackground={false}
|
useInvertedBackground={false}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="metrics" data-section="metrics">
|
<div id="metrics" data-section="metrics">
|
||||||
<MetricCardFourteen
|
<MetricCardFourteen
|
||||||
title="Suas Conquistas Importam. Veja Cada Número."
|
title="Suas Conquistas Importam. Veja Cada Número."
|
||||||
tag="Performance Metrics"
|
tag="Performance Metrics"
|
||||||
tagAnimation="slide-up"
|
tagAnimation="slide-up"
|
||||||
metrics={[
|
metrics={[
|
||||||
{
|
{
|
||||||
id: "1", value: "10.000+", description: "Passos diários rastreados em tempo real com motivação visual de progresso."
|
id: "1", value: "10.000+", description: "Passos diários rastreados em tempo real com motivação visual de progresso."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "2", value: "500 kg", description: "Volume total de peso levantado monitorado com progressão semanal automática."
|
id: "2", value: "500 kg", description: "Volume total de peso levantado monitorado com progressão semanal automática."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "3", value: "150+ km", description: "Distância corrida mapeada com GPS, ritmo calculado e calorias precisas."
|
id: "3", value: "150+ km", description: "Distância corrida mapeada com GPS, ritmo calculado e calorias precisas."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "4", value: "42 dias", description: "Sequência de treinos consistentes com badges de dedicação desbloqueados."
|
id: "4", value: "42 dias", description: "Sequência de treinos consistentes com badges de dedicação desbloqueados."
|
||||||
}
|
}
|
||||||
]}
|
]}
|
||||||
metricsAnimation="slide-up"
|
metricsAnimation="slide-up"
|
||||||
useInvertedBackground={false}
|
useInvertedBackground={false}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="team" data-section="team">
|
<div id="team" data-section="team">
|
||||||
<TeamCardOne
|
<TeamCardOne
|
||||||
title="Comunidade de Atletas Profissionais"
|
title="Comunidade de Atletas Profissionais"
|
||||||
description="Feed social onde você compartilha rotas de corrida, estatísticas de treino e compete em rankings semanais com outros usuários."
|
description="Feed social onde você compartilha rotas de corrida, estatísticas de treino e compete em rankings semanais com outros usuários."
|
||||||
tag="Gamificação Social"
|
tag="Gamificação Social"
|
||||||
tagIcon={Users}
|
tagIcon={Users}
|
||||||
members={[
|
members={[
|
||||||
{
|
{
|
||||||
id: "1", name: "Marcus A.", role: "Elite Runner", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/professional-athlete-portrait-male-fitne-1773256979726-5009f852.png?_wi=1", imageAlt: "Marcus A."
|
id: "1", name: "Marcus A.", role: "Elite Runner", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/professional-athlete-portrait-male-fitne-1773256979726-5009f852.png?_wi=1", imageAlt: "Marcus A."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "2", name: "Ana L.", role: "Strength Coach", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/fit-female-athlete-portrait-determined-e-1773256980310-c05dce2f.png?_wi=1", imageAlt: "Ana L."
|
id: "2", name: "Ana L.", role: "Strength Coach", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/fit-female-athlete-portrait-determined-e-1773256980310-c05dce2f.png?_wi=1", imageAlt: "Ana L."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "3", name: "Rafael S.", role: "Nutrition Expert", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/athletic-male-trainer-portrait-confident-1773256979906-c5e05a88.png?_wi=1", imageAlt: "Rafael S."
|
id: "3", name: "Rafael S.", role: "Nutrition Expert", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/athletic-male-trainer-portrait-confident-1773256979906-c5e05a88.png?_wi=1", imageAlt: "Rafael S."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "4", name: "Sofia M.", role: "Fitness Trainer", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/female-fitness-coach-portrait-profession-1773256979710-97e8b5fe.png?_wi=1", imageAlt: "Sofia M."
|
id: "4", name: "Sofia M.", role: "Fitness Trainer", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/female-fitness-coach-portrait-profession-1773256979710-97e8b5fe.png?_wi=1", imageAlt: "Sofia M."
|
||||||
}
|
}
|
||||||
]}
|
]}
|
||||||
animationType="blur-reveal"
|
animationType="blur-reveal"
|
||||||
textboxLayout="default"
|
textboxLayout="default"
|
||||||
useInvertedBackground={false}
|
useInvertedBackground={false}
|
||||||
gridVariant="four-items-2x2-equal-grid"
|
gridVariant="four-items-2x2-equal-grid"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="testimonials" data-section="testimonials">
|
<div id="testimonials" data-section="testimonials">
|
||||||
<TestimonialCardTwelve
|
<TestimonialCardTwelve
|
||||||
testimonials={[
|
testimonials={[
|
||||||
{
|
{
|
||||||
id: "1", name: "Carlos M.", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/professional-athlete-portrait-male-fitne-1773256979726-5009f852.png?_wi=2", imageAlt: "Carlos M."
|
id: "1", name: "Carlos M.", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/professional-athlete-portrait-male-fitne-1773256979726-5009f852.png?_wi=2", imageAlt: "Carlos M."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "2", name: "Beatriz R.", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/fit-female-athlete-portrait-determined-e-1773256980310-c05dce2f.png?_wi=2", imageAlt: "Beatriz R."
|
id: "2", name: "Beatriz R.", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/fit-female-athlete-portrait-determined-e-1773256980310-c05dce2f.png?_wi=2", imageAlt: "Beatriz R."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "3", name: "Diego P.", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/athletic-male-trainer-portrait-confident-1773256979906-c5e05a88.png?_wi=2", imageAlt: "Diego P."
|
id: "3", name: "Diego P.", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/athletic-male-trainer-portrait-confident-1773256979906-c5e05a88.png?_wi=2", imageAlt: "Diego P."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "4", name: "Juliana T.", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/female-fitness-coach-portrait-profession-1773256979710-97e8b5fe.png?_wi=2", imageAlt: "Juliana T."
|
id: "4", name: "Juliana T.", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/female-fitness-coach-portrait-profession-1773256979710-97e8b5fe.png?_wi=2", imageAlt: "Juliana T."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "5", name: "Lucas F.", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/young-athlete-male-portrait-energetic-ex-1773256982698-63e4e494.png", imageAlt: "Lucas F."
|
id: "5", name: "Lucas F.", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/young-athlete-male-portrait-energetic-ex-1773256982698-63e4e494.png", imageAlt: "Lucas F."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "6", name: "Marina S.", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/female-athlete-portrait-fit-build-profes-1773256980134-0faaa8fa.png", imageAlt: "Marina S."
|
id: "6", name: "Marina S.", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/female-athlete-portrait-fit-build-profes-1773256980134-0faaa8fa.png", imageAlt: "Marina S."
|
||||||
}
|
}
|
||||||
]}
|
]}
|
||||||
cardTitle="Mais de 150 mil atletas já transformaram seu corpo com FitFlow Pro"
|
cardTitle="Mais de 150 mil atletas já transformaram seu corpo com FitFlow Pro"
|
||||||
cardTag="Veja o que eles dizem"
|
cardTag="Veja o que eles dizem"
|
||||||
cardTagIcon={Star}
|
cardTagIcon={Star}
|
||||||
cardAnimation="blur-reveal"
|
cardAnimation="blur-reveal"
|
||||||
useInvertedBackground={false}
|
useInvertedBackground={false}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="social-proof" data-section="social-proof">
|
<div id="social-proof" data-section="social-proof">
|
||||||
<SocialProofOne
|
<SocialProofOne
|
||||||
title="Confiado pelos Maiores Aplicativos e Plataformas de Fitness"
|
title="Confiado pelos Maiores Aplicativos e Plataformas de Fitness"
|
||||||
description="FitFlow Pro integra-se perfeitamente com os ecossistemas de saúde mais populares do mundo."
|
description="FitFlow Pro integra-se perfeitamente com os ecossistemas de saúde mais populares do mundo."
|
||||||
tag="Parcerias Premium"
|
tag="Parcerias Premium"
|
||||||
tagIcon={Zap}
|
tagIcon={Zap}
|
||||||
logos={[
|
logos={[
|
||||||
"http://img.b2bpic.net/free-vector/heart-love-logo_126523-2763.jpg", "http://img.b2bpic.net/free-photo/woman-with-phone-sportswear_1303-8805.jpg", "http://img.b2bpic.net/free-vector/flat-design-fitness-trackers-heart-rate-menu_23-2148515781.jpg", "http://img.b2bpic.net/free-photo/close-up-woman-holding-phone_23-2148889655.jpg", "http://img.b2bpic.net/free-photo/close-up-man-using-phone-while-electric-bike_23-2149098678.jpg", "http://img.b2bpic.net/free-vector/fitness-trackers-concept_23-2148527033.jpg", "http://img.b2bpic.net/free-photo/cropped-view-sexy-bodybuilder-showing-thumbs-up_1153-6281.jpg", "http://img.b2bpic.net/free-photo/phone-muscular-hand-guy-sitting-city-morning-he-holds-bottle-water-headphones_197531-1155.jpg"
|
"http://img.b2bpic.net/free-vector/heart-love-logo_126523-2763.jpg", "http://img.b2bpic.net/free-photo/woman-with-phone-sportswear_1303-8805.jpg", "http://img.b2bpic.net/free-vector/flat-design-fitness-trackers-heart-rate-menu_23-2148515781.jpg", "http://img.b2bpic.net/free-photo/close-up-woman-holding-phone_23-2148889655.jpg", "http://img.b2bpic.net/free-photo/close-up-man-using-phone-while-electric-bike_23-2149098678.jpg", "http://img.b2bpic.net/free-vector/fitness-trackers-concept_23-2148527033.jpg", "http://img.b2bpic.net/free-photo/cropped-view-sexy-bodybuilder-showing-thumbs-up_1153-6281.jpg", "http://img.b2bpic.net/free-photo/phone-muscular-hand-guy-sitting-city-morning-he-holds-bottle-water-headphones_197531-1155.jpg"
|
||||||
]}
|
]}
|
||||||
names={[
|
names={[
|
||||||
"Apple Fitness", "Strava", "Fitbit", "Google Fit", "Peloton", "MyFitnessPal", "Garmin", "Nike Training"
|
"Apple Fitness", "Strava", "Fitbit", "Google Fit", "Peloton", "MyFitnessPal", "Garmin", "Nike Training"
|
||||||
]}
|
]}
|
||||||
textboxLayout="default"
|
textboxLayout="default"
|
||||||
useInvertedBackground={false}
|
useInvertedBackground={false}
|
||||||
speed={40}
|
speed={40}
|
||||||
showCard={true}
|
showCard={true}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="contact" data-section="contact">
|
<div id="contact" data-section="contact">
|
||||||
<ContactText
|
<ContactSplit
|
||||||
text="Pronto para transformar seu corpo? Começar seu teste gratuito de 30 dias agora e veja por que 150 mil atletas confiam em FitFlow Pro."
|
tag="Transforme Sua Vida"
|
||||||
animationType="entrance-slide"
|
tagIcon={Mail}
|
||||||
buttons={[
|
title="Pronto para Começar?"
|
||||||
{ text: "Começar Teste Grátis", href: "contact" },
|
description="Inscreva-se para receber atualizações exclusivas, dicas de treino e um acesso especial ao nosso programa de beta testers premium. Seu email está seguro conosco."
|
||||||
{ text: "Conversar com Especialista", href: "#contact" }
|
background={{ variant: "sparkles-gradient" }}
|
||||||
]}
|
useInvertedBackground={false}
|
||||||
background={{ variant: "sparkles-gradient" }}
|
imageSrc="https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/ultra-modern-fitness-app-dashboard-with--1773256981295-f56c580b.png?_wi=1"
|
||||||
useInvertedBackground={false}
|
imageAlt="Transforme seu corpo"
|
||||||
/>
|
mediaAnimation="slide-up"
|
||||||
</div>
|
mediaPosition="right"
|
||||||
|
inputPlaceholder="seu.email@exemplo.com"
|
||||||
|
buttonText="Inscrever-se Agora"
|
||||||
|
termsText="Respeitamos sua privacidade. Você pode desinscrever-se a qualquer momento. Sem spam, promessa."
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div id="footer" data-section="footer">
|
<div id="footer" data-section="footer">
|
||||||
<FooterLogoEmphasis
|
<FooterBase
|
||||||
columns={[
|
columns={[
|
||||||
{
|
{
|
||||||
items: [
|
title: "Produto", items: [
|
||||||
{ label: "Dashboard", href: "#dashboard" },
|
{ label: "Dashboard", href: "dashboard" },
|
||||||
{ label: "Treino", href: "#training" },
|
{ label: "Treino", href: "training" },
|
||||||
{ label: "Nutrição", href: "#nutrition" }
|
{ label: "Receitas", href: "/recipes" },
|
||||||
]
|
{ label: "Cardio Hub", href: "cardio" }
|
||||||
},
|
]
|
||||||
{
|
},
|
||||||
items: [
|
{
|
||||||
{ label: "Cardio Hub", href: "#cardio" },
|
title: "Comunidade", items: [
|
||||||
{ label: "Comunidade", href: "#community" },
|
{ label: "Comunidade", href: "community" },
|
||||||
{ label: "Perfil", href: "#profile" }
|
{ label: "Perfil", href: "profile" },
|
||||||
]
|
{ label: "Rankings", href: "rankings" },
|
||||||
},
|
{ label: "Blog", href: "blog" }
|
||||||
{
|
]
|
||||||
items: [
|
},
|
||||||
{ label: "Blog", href: "#blog" },
|
{
|
||||||
{ label: "Ajuda", href: "#help" },
|
title: "Empresa", items: [
|
||||||
{ label: "Suporte", href: "#support" }
|
{ label: "Sobre", href: "about" },
|
||||||
]
|
{ label: "Contato", href: "contact" },
|
||||||
},
|
{ label: "Privacidade", href: "privacy" },
|
||||||
{
|
{ label: "Termos", href: "terms" }
|
||||||
items: [
|
]
|
||||||
{ label: "Privacidade", href: "#privacy" },
|
}
|
||||||
{ label: "Termos", href: "#terms" },
|
]}
|
||||||
{ label: "Contato", href: "#contact" }
|
logoText="FitFlow Pro"
|
||||||
]
|
copyrightText="© 2025 FitFlow Pro. Todos os direitos reservados."
|
||||||
}
|
/>
|
||||||
]}
|
</div>
|
||||||
logoText="FitFlow Pro"
|
</ThemeProvider>
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</ThemeProvider>
|
|
||||||
</WorkoutDataIntegration>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
311
src/app/recipes/page.tsx
Normal file
311
src/app/recipes/page.tsx
Normal file
@@ -0,0 +1,311 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { useState } from "react";
|
||||||
|
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
||||||
|
import NavbarStyleCentered from '@/components/navbar/NavbarStyleCentered/NavbarStyleCentered';
|
||||||
|
import HeroSplitKpi from '@/components/sections/hero/HeroSplitKpi';
|
||||||
|
import FeatureCardTwentyFive from '@/components/sections/feature/FeatureCardTwentyFive';
|
||||||
|
import FooterBase from '@/components/sections/footer/FooterBase';
|
||||||
|
import { Apple, Filter, Flame, TrendingDown, TrendingUp } from 'lucide-react';
|
||||||
|
|
||||||
|
const recipeDatabase = [
|
||||||
|
{
|
||||||
|
id: "1", name: "Grilled Chicken Breast with Quinoa", category: "Protein", calories: 450,
|
||||||
|
protein: 45,
|
||||||
|
carbs: 35,
|
||||||
|
fats: 12,
|
||||||
|
prepTime: "25 min", goals: ["muscle-gain"],
|
||||||
|
imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/nutrition-dashboard-showing-meal-plans-d-1773256981349-9348b6d9.png", imageAlt: "Grilled Chicken with Quinoa"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2", name: "Veggie Stir-Fry with Tofu", category: "Vegetarian", calories: 280,
|
||||||
|
protein: 18,
|
||||||
|
carbs: 42,
|
||||||
|
fats: 8,
|
||||||
|
prepTime: "20 min", goals: ["weight-loss"],
|
||||||
|
imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/nutrition-dashboard-showing-meal-plans-d-1773256981349-9348b6d9.png", imageAlt: "Veggie Stir-Fry"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3", name: "Salmon with Sweet Potato", category: "Fish", calories: 520,
|
||||||
|
protein: 38,
|
||||||
|
carbs: 48,
|
||||||
|
fats: 18,
|
||||||
|
prepTime: "30 min", goals: ["muscle-gain"],
|
||||||
|
imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/nutrition-dashboard-showing-meal-plans-d-1773256981349-9348b6d9.png", imageAlt: "Salmon with Sweet Potato"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "4", name: "Egg White Omelet with Veggies", category: "Breakfast", calories: 180,
|
||||||
|
protein: 22,
|
||||||
|
carbs: 12,
|
||||||
|
fats: 4,
|
||||||
|
prepTime: "15 min", goals: ["weight-loss", "muscle-gain"],
|
||||||
|
imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/nutrition-dashboard-showing-meal-plans-d-1773256981349-9348b6d9.png", imageAlt: "Egg White Omelet"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "5", name: "Turkey Meatballs with Zucchini Noodles", category: "Protein", calories: 320,
|
||||||
|
protein: 35,
|
||||||
|
carbs: 18,
|
||||||
|
fats: 10,
|
||||||
|
prepTime: "28 min", goals: ["weight-loss"],
|
||||||
|
imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/nutrition-dashboard-showing-meal-plans-d-1773256981349-9348b6d9.png", imageAlt: "Turkey Meatballs"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "6", name: "Lean Beef with Brown Rice", category: "Protein", calories: 580,
|
||||||
|
protein: 42,
|
||||||
|
carbs: 58,
|
||||||
|
fats: 14,
|
||||||
|
prepTime: "35 min", goals: ["muscle-gain"],
|
||||||
|
imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/nutrition-dashboard-showing-meal-plans-d-1773256981349-9348b6d9.png", imageAlt: "Lean Beef with Rice"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "7", name: "Green Salad with Grilled Chicken", category: "Salad", calories: 280,
|
||||||
|
protein: 32,
|
||||||
|
carbs: 22,
|
||||||
|
fats: 6,
|
||||||
|
prepTime: "18 min", goals: ["weight-loss"],
|
||||||
|
imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/nutrition-dashboard-showing-meal-plans-d-1773256981349-9348b6d9.png", imageAlt: "Green Salad"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "8", name: "High-Protein Pasta with Lean Ground Meat", category: "Pasta", calories: 480,
|
||||||
|
protein: 40,
|
||||||
|
carbs: 52,
|
||||||
|
fats: 8,
|
||||||
|
prepTime: "25 min", goals: ["muscle-gain"],
|
||||||
|
imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/nutrition-dashboard-showing-meal-plans-d-1773256981349-9348b6d9.png", imageAlt: "High-Protein Pasta"
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
export default function RecipesPage() {
|
||||||
|
const [selectedGoal, setSelectedGoal] = useState<"all" | "weight-loss" | "muscle-gain">("all");
|
||||||
|
|
||||||
|
const filteredRecipes = selectedGoal === "all"
|
||||||
|
? recipeDatabase
|
||||||
|
: recipeDatabase.filter(recipe => recipe.goals.includes(selectedGoal));
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ThemeProvider
|
||||||
|
defaultButtonVariant="elastic-effect"
|
||||||
|
defaultTextAnimation="entrance-slide"
|
||||||
|
borderRadius="pill"
|
||||||
|
contentWidth="smallMedium"
|
||||||
|
sizing="mediumSizeLargeTitles"
|
||||||
|
background="blurBottom"
|
||||||
|
cardStyle="gradient-bordered"
|
||||||
|
primaryButtonStyle="flat"
|
||||||
|
secondaryButtonStyle="glass"
|
||||||
|
headingFontWeight="extrabold"
|
||||||
|
>
|
||||||
|
<div id="nav" data-section="nav">
|
||||||
|
<NavbarStyleCentered
|
||||||
|
navItems={[
|
||||||
|
{ name: "Dashboard", id: "dashboard" },
|
||||||
|
{ name: "Treino", id: "training" },
|
||||||
|
{ name: "Receitas", id: "/recipes" },
|
||||||
|
{ name: "Comunidade", id: "community" },
|
||||||
|
{ name: "Perfil", id: "profile" }
|
||||||
|
]}
|
||||||
|
button={{ text: "Começar Agora", href: "contact" }}
|
||||||
|
brandName="FitFlow Pro"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="recipes-hero" data-section="recipes-hero">
|
||||||
|
<HeroSplitKpi
|
||||||
|
title="Receitas Inteligentes Alinhadas com Suas Metas"
|
||||||
|
description="Acesso a um banco de receitas nutricionais desenvolvidas por especialistas. Cada receita é otimizada para seu objetivo: perda de peso ou ganho de massa muscular."
|
||||||
|
tag="Nutrição Estratégica"
|
||||||
|
tagIcon={Flame}
|
||||||
|
background={{ variant: "glowing-orb" }}
|
||||||
|
kpis={[
|
||||||
|
{ value: "100+", label: "Receitas Disponíveis" },
|
||||||
|
{ value: "2", label: "Filtros por Objetivo" },
|
||||||
|
{ value: "4.8★", label: "Avaliação Média" }
|
||||||
|
]}
|
||||||
|
enableKpiAnimation={true}
|
||||||
|
imageSrc="https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/nutrition-dashboard-showing-meal-plans-d-1773256981349-9348b6d9.png"
|
||||||
|
imageAlt="Dashboard de receitas nutricionais"
|
||||||
|
imagePosition="right"
|
||||||
|
mediaAnimation="slide-up"
|
||||||
|
buttons={[
|
||||||
|
{ text: "Explorar Receitas", href: "#recipes-grid" }
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="recipes-filter" data-section="recipes-filter">
|
||||||
|
<FeatureCardTwentyFive
|
||||||
|
title="Filtre Receitas por Objetivo"
|
||||||
|
description="Selecione seu objetivo atual e o sistema recomendará as melhores receitas para atingir suas metas nutricionais e de transformação corporal."
|
||||||
|
tag="Recomendação Inteligente"
|
||||||
|
tagIcon={Filter}
|
||||||
|
features={[
|
||||||
|
{
|
||||||
|
title: "Perda de Peso", description: "Receitas com déficit calórico otimizado. Alto em proteína para preservar músculos, baixo em carboidratos estratégicos. Ideal para queimar gordura mantendo a força.", icon: TrendingDown,
|
||||||
|
mediaItems: [
|
||||||
|
{
|
||||||
|
type: "image", src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/nutrition-dashboard-showing-meal-plans-d-1773256981349-9348b6d9.png", alt: "Receitas para perda de peso"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "image", src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/performance-metrics-showcase-displaying--1773256982260-f9a5cff0.png", alt: "Progresso de déficit calórico"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Ganho de Massa", description: "Receitas com superávit calórico controlado. Proteína máxima (2g por kg), carboidratos pré e pós-treino, gorduras saudáveis. Perfeito para crescimento muscular.", icon: TrendingUp,
|
||||||
|
mediaItems: [
|
||||||
|
{
|
||||||
|
type: "image", src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/nutrition-dashboard-showing-meal-plans-d-1773256981349-9348b6d9.png", alt: "Receitas para ganho de massa"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "image", src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AoRNSPr0mCBj85JKsHl7qxTHsl/performance-metrics-showcase-displaying--1773256982260-f9a5cff0.png", alt: "Progresso de ganho muscular"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]}
|
||||||
|
animationType="blur-reveal"
|
||||||
|
textboxLayout="default"
|
||||||
|
useInvertedBackground={false}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="recipes-grid" data-section="recipes-grid">
|
||||||
|
<div className="w-full py-20">
|
||||||
|
<div className="max-w-7xl mx-auto px-6">
|
||||||
|
<div className="flex flex-col items-center gap-8 mb-16">
|
||||||
|
<div className="text-center">
|
||||||
|
<h2 className="text-4xl font-extrabold mb-4">Receitas Recomendadas</h2>
|
||||||
|
<p className="text-lg text-foreground/75">Selecione seu objetivo para ver receitas personalizadas</p>
|
||||||
|
</div>
|
||||||
|
<div className="flex gap-4 flex-wrap justify-center">
|
||||||
|
<button
|
||||||
|
onClick={() => setSelectedGoal("all")}
|
||||||
|
className={`px-6 py-3 rounded-full font-semibold transition-all ${
|
||||||
|
selectedGoal === "all"
|
||||||
|
? "bg-primary-cta text-white"
|
||||||
|
: "bg-secondary-cta/20 text-foreground hover:bg-secondary-cta/40"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
Todas as Receitas
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
onClick={() => setSelectedGoal("weight-loss")}
|
||||||
|
className={`px-6 py-3 rounded-full font-semibold transition-all ${
|
||||||
|
selectedGoal === "weight-loss"
|
||||||
|
? "bg-primary-cta text-white"
|
||||||
|
: "bg-secondary-cta/20 text-foreground hover:bg-secondary-cta/40"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
Perda de Peso
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
onClick={() => setSelectedGoal("muscle-gain")}
|
||||||
|
className={`px-6 py-3 rounded-full font-semibold transition-all ${
|
||||||
|
selectedGoal === "muscle-gain"
|
||||||
|
? "bg-primary-cta text-white"
|
||||||
|
: "bg-secondary-cta/20 text-foreground hover:bg-secondary-cta/40"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
Ganho de Massa
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
|
||||||
|
{filteredRecipes.map(recipe => (
|
||||||
|
<div key={recipe.id} className="bg-card rounded-2xl overflow-hidden shadow-lg hover:shadow-xl transition-shadow">
|
||||||
|
<div className="relative h-64 overflow-hidden">
|
||||||
|
<img
|
||||||
|
src={recipe.imageSrc}
|
||||||
|
alt={recipe.imageAlt}
|
||||||
|
className="w-full h-full object-cover hover:scale-105 transition-transform duration-300"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className="p-6">
|
||||||
|
<div className="flex items-start justify-between mb-3">
|
||||||
|
<h3 className="text-xl font-bold text-foreground">{recipe.name}</h3>
|
||||||
|
<span className="text-xs font-semibold bg-primary-cta/20 text-primary-cta px-3 py-1 rounded-full">
|
||||||
|
{recipe.category}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<p className="text-sm text-foreground/75 mb-4">Tempo: {recipe.prepTime}</p>
|
||||||
|
|
||||||
|
<div className="grid grid-cols-4 gap-2 mb-4">
|
||||||
|
<div className="text-center">
|
||||||
|
<p className="text-xs text-foreground/60">Calorias</p>
|
||||||
|
<p className="font-bold text-foreground">{recipe.calories}</p>
|
||||||
|
</div>
|
||||||
|
<div className="text-center">
|
||||||
|
<p className="text-xs text-foreground/60">Proteína</p>
|
||||||
|
<p className="font-bold text-foreground">{recipe.protein}g</p>
|
||||||
|
</div>
|
||||||
|
<div className="text-center">
|
||||||
|
<p className="text-xs text-foreground/60">Carbs</p>
|
||||||
|
<p className="font-bold text-foreground">{recipe.carbs}g</p>
|
||||||
|
</div>
|
||||||
|
<div className="text-center">
|
||||||
|
<p className="text-xs text-foreground/60">Gordura</p>
|
||||||
|
<p className="font-bold text-foreground">{recipe.fats}g</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="flex flex-wrap gap-2">
|
||||||
|
{recipe.goals.includes("weight-loss") && (
|
||||||
|
<span className="text-xs bg-accent/20 text-accent px-2 py-1 rounded-full">Perda</span>
|
||||||
|
)}
|
||||||
|
{recipe.goals.includes("muscle-gain") && (
|
||||||
|
<span className="text-xs bg-accent/20 text-accent px-2 py-1 rounded-full">Ganho</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button className="w-full mt-4 bg-primary-cta text-white font-semibold py-2 rounded-lg hover:opacity-90 transition-opacity">
|
||||||
|
Ver Detalhes
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{filteredRecipes.length === 0 && (
|
||||||
|
<div className="text-center py-12">
|
||||||
|
<p className="text-lg text-foreground/75">Nenhuma receita encontrada para este objetivo.</p>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="footer" data-section="footer">
|
||||||
|
<FooterBase
|
||||||
|
columns={[
|
||||||
|
{
|
||||||
|
title: "Produto", items: [
|
||||||
|
{ label: "Dashboard", href: "dashboard" },
|
||||||
|
{ label: "Treino", href: "training" },
|
||||||
|
{ label: "Receitas", href: "/recipes" },
|
||||||
|
{ label: "Cardio Hub", href: "cardio" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Comunidade", items: [
|
||||||
|
{ label: "Comunidade", href: "community" },
|
||||||
|
{ label: "Perfil", href: "profile" },
|
||||||
|
{ label: "Rankings", href: "rankings" },
|
||||||
|
{ label: "Blog", href: "blog" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Empresa", items: [
|
||||||
|
{ label: "Sobre", href: "about" },
|
||||||
|
{ label: "Contato", href: "contact" },
|
||||||
|
{ label: "Privacidade", href: "privacy" },
|
||||||
|
{ label: "Termos", href: "terms" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]}
|
||||||
|
logoText="FitFlow Pro"
|
||||||
|
copyrightText="© 2025 FitFlow Pro. Todos os direitos reservados."
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</ThemeProvider>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,273 +0,0 @@
|
|||||||
"use client";
|
|
||||||
|
|
||||||
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
|
||||||
import NavbarStyleCentered from '@/components/navbar/NavbarStyleCentered/NavbarStyleCentered';
|
|
||||||
import { useState } from "react";
|
|
||||||
import { Eye, EyeOff, Mail, Lock, User, CheckCircle2, AlertCircle } from 'lucide-react';
|
|
||||||
import Input from '@/components/form/Input';
|
|
||||||
|
|
||||||
export default function SignupPage() {
|
|
||||||
const [formData, setFormData] = useState({
|
|
||||||
name: "", email: "", password: "", confirmPassword: ""
|
|
||||||
});
|
|
||||||
const [showPassword, setShowPassword] = useState(false);
|
|
||||||
const [showConfirmPassword, setShowConfirmPassword] = useState(false);
|
|
||||||
const [errors, setErrors] = useState<{ [key: string]: string }>({});
|
|
||||||
const [isSubmitted, setIsSubmitted] = useState(false);
|
|
||||||
const [passwordStrength, setPasswordStrength] = useState<"weak" | "medium" | "strong" | "">("");
|
|
||||||
|
|
||||||
const calculatePasswordStrength = (pwd: string): "weak" | "medium" | "strong" | "" => {
|
|
||||||
if (!pwd) return "";
|
|
||||||
if (pwd.length < 8) return "weak";
|
|
||||||
if (/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d@$!%*?&]{8}$/.test(pwd)) return "strong";
|
|
||||||
return "medium";
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleInputChange = (field: string, value: string) => {
|
|
||||||
setFormData(prev => ({
|
|
||||||
...prev,
|
|
||||||
[field]: value
|
|
||||||
}));
|
|
||||||
|
|
||||||
if (field === "password") {
|
|
||||||
setPasswordStrength(calculatePasswordStrength(value));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const validateForm = () => {
|
|
||||||
const newErrors: { [key: string]: string } = {};
|
|
||||||
|
|
||||||
if (!formData.name.trim()) {
|
|
||||||
newErrors.name = "Nome é obrigatório";
|
|
||||||
} else if (formData.name.trim().length < 2) {
|
|
||||||
newErrors.name = "Nome deve ter no mínimo 2 caracteres";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!formData.email) {
|
|
||||||
newErrors.email = "Email é obrigatório";
|
|
||||||
} else if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(formData.email)) {
|
|
||||||
newErrors.email = "Email inválido";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!formData.password) {
|
|
||||||
newErrors.password = "Senha é obrigatória";
|
|
||||||
} else if (formData.password.length < 8) {
|
|
||||||
newErrors.password = "Senha deve ter no mínimo 8 caracteres";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (formData.password !== formData.confirmPassword) {
|
|
||||||
newErrors.confirmPassword = "As senhas não correspondem";
|
|
||||||
}
|
|
||||||
|
|
||||||
return newErrors;
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleSubmit = (e: React.FormEvent) => {
|
|
||||||
e.preventDefault();
|
|
||||||
const newErrors = validateForm();
|
|
||||||
setErrors(newErrors);
|
|
||||||
|
|
||||||
if (Object.keys(newErrors).length === 0) {
|
|
||||||
setIsSubmitted(true);
|
|
||||||
console.log("Signup attempt:", formData);
|
|
||||||
setTimeout(() => {
|
|
||||||
setIsSubmitted(false);
|
|
||||||
}, 2000);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const getStrengthColor = () => {
|
|
||||||
switch (passwordStrength) {
|
|
||||||
case "weak":
|
|
||||||
return "text-red-500";
|
|
||||||
case "medium":
|
|
||||||
return "text-yellow-500";
|
|
||||||
case "strong":
|
|
||||||
return "text-green-500";
|
|
||||||
default:
|
|
||||||
return "text-foreground/30";
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<ThemeProvider
|
|
||||||
defaultButtonVariant="elastic-effect"
|
|
||||||
defaultTextAnimation="entrance-slide"
|
|
||||||
borderRadius="pill"
|
|
||||||
contentWidth="smallMedium"
|
|
||||||
sizing="mediumSizeLargeTitles"
|
|
||||||
background="blurBottom"
|
|
||||||
cardStyle="gradient-bordered"
|
|
||||||
primaryButtonStyle="flat"
|
|
||||||
secondaryButtonStyle="glass"
|
|
||||||
headingFontWeight="extrabold"
|
|
||||||
>
|
|
||||||
<div id="nav" data-section="nav">
|
|
||||||
<NavbarStyleCentered
|
|
||||||
navItems={[
|
|
||||||
{ name: "Dashboard", id: "/" },
|
|
||||||
{ name: "Treino", id: "training" },
|
|
||||||
{ name: "Nutrição", id: "nutrition" },
|
|
||||||
{ name: "Comunidade", id: "community" },
|
|
||||||
{ name: "Perfil", id: "profile" }
|
|
||||||
]}
|
|
||||||
button={{ text: "Entrar", href: "/login" }}
|
|
||||||
brandName="FitFlow Pro"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="min-h-[calc(100vh-80px)] flex items-center justify-center py-12 px-4">
|
|
||||||
<div className="w-full max-w-md">
|
|
||||||
<div className="bg-card rounded-3xl shadow-lg p-8 border border-accent/10">
|
|
||||||
<div className="mb-8">
|
|
||||||
<h1 className="text-3xl font-extrabold text-foreground mb-2">Começar Agora</h1>
|
|
||||||
<p className="text-foreground/70">Crie sua conta e inicie sua transformação</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<form onSubmit={handleSubmit} className="space-y-6">
|
|
||||||
<div>
|
|
||||||
<label className="block text-sm font-medium text-foreground mb-2">
|
|
||||||
<div className="flex items-center gap-2">
|
|
||||||
<User size={16} />
|
|
||||||
Nome Completo
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
<Input
|
|
||||||
value={formData.name}
|
|
||||||
onChange={(value) => handleInputChange("name", value)}
|
|
||||||
type="text"
|
|
||||||
placeholder="Seu nome"
|
|
||||||
required
|
|
||||||
className={errors.name ? "border-red-500" : ""}
|
|
||||||
/>
|
|
||||||
{errors.name && (
|
|
||||||
<div className="flex items-center gap-1 text-red-500 text-sm mt-1">
|
|
||||||
<AlertCircle size={14} />
|
|
||||||
{errors.name}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<label className="block text-sm font-medium text-foreground mb-2">
|
|
||||||
<div className="flex items-center gap-2">
|
|
||||||
<Mail size={16} />
|
|
||||||
Email
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
<Input
|
|
||||||
value={formData.email}
|
|
||||||
onChange={(value) => handleInputChange("email", value)}
|
|
||||||
type="email"
|
|
||||||
placeholder="seu@email.com"
|
|
||||||
required
|
|
||||||
className={errors.email ? "border-red-500" : ""}
|
|
||||||
/>
|
|
||||||
{errors.email && (
|
|
||||||
<div className="flex items-center gap-1 text-red-500 text-sm mt-1">
|
|
||||||
<AlertCircle size={14} />
|
|
||||||
{errors.email}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<label className="block text-sm font-medium text-foreground mb-2">
|
|
||||||
<div className="flex items-center gap-2">
|
|
||||||
<Lock size={16} />
|
|
||||||
Senha
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
<div className="relative">
|
|
||||||
<Input
|
|
||||||
value={formData.password}
|
|
||||||
onChange={(value) => handleInputChange("password", value)}
|
|
||||||
type={showPassword ? "text" : "password"}
|
|
||||||
placeholder="••••••••"
|
|
||||||
required
|
|
||||||
className={errors.password ? "border-red-500" : "pr-10"}
|
|
||||||
/>
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
onClick={() => setShowPassword(!showPassword)}
|
|
||||||
className="absolute right-3 top-1/2 -translate-y-1/2 text-foreground/50 hover:text-foreground transition-colors"
|
|
||||||
aria-label={showPassword ? "Ocultar senha" : "Mostrar senha"}
|
|
||||||
>
|
|
||||||
{showPassword ? <EyeOff size={18} /> : <Eye size={18} />}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
{passwordStrength && (
|
|
||||||
<div className={`flex items-center gap-1 text-xs mt-2 ${getStrengthColor()}`}>
|
|
||||||
<CheckCircle2 size={12} />
|
|
||||||
Força: {passwordStrength === "weak" ? "Fraca" : passwordStrength === "medium" ? "Média" : "Forte"}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{errors.password && (
|
|
||||||
<div className="flex items-center gap-1 text-red-500 text-sm mt-1">
|
|
||||||
<AlertCircle size={14} />
|
|
||||||
{errors.password}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<label className="block text-sm font-medium text-foreground mb-2">
|
|
||||||
<div className="flex items-center gap-2">
|
|
||||||
<Lock size={16} />
|
|
||||||
Confirmar Senha
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
<div className="relative">
|
|
||||||
<Input
|
|
||||||
value={formData.confirmPassword}
|
|
||||||
onChange={(value) => handleInputChange("confirmPassword", value)}
|
|
||||||
type={showConfirmPassword ? "text" : "password"}
|
|
||||||
placeholder="••••••••"
|
|
||||||
required
|
|
||||||
className={errors.confirmPassword ? "border-red-500" : "pr-10"}
|
|
||||||
/>
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
onClick={() => setShowConfirmPassword(!showConfirmPassword)}
|
|
||||||
className="absolute right-3 top-1/2 -translate-y-1/2 text-foreground/50 hover:text-foreground transition-colors"
|
|
||||||
aria-label={showConfirmPassword ? "Ocultar senha" : "Mostrar senha"}
|
|
||||||
>
|
|
||||||
{showConfirmPassword ? <EyeOff size={18} /> : <Eye size={18} />}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
{errors.confirmPassword && (
|
|
||||||
<div className="flex items-center gap-1 text-red-500 text-sm mt-1">
|
|
||||||
<AlertCircle size={14} />
|
|
||||||
{errors.confirmPassword}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button
|
|
||||||
type="submit"
|
|
||||||
disabled={isSubmitted}
|
|
||||||
className="w-full py-3 px-4 bg-primary-cta hover:opacity-90 disabled:opacity-50 text-white font-semibold rounded-full transition-all duration-300 transform hover:scale-105"
|
|
||||||
>
|
|
||||||
{isSubmitted ? "Criando conta..." : "Criar Conta"}
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<div className="mt-6 text-center text-sm text-foreground/70">
|
|
||||||
<p>
|
|
||||||
Já tem conta?{" "}
|
|
||||||
<a href="/login" className="text-primary-cta font-semibold hover:underline">
|
|
||||||
Fazer login
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="mt-6 pt-6 border-t border-accent/10 text-center text-xs text-foreground/50">
|
|
||||||
<p>Teste gratuito por 30 dias. Sem cartão de crédito necessário.</p>
|
|
||||||
<p className="mt-2">Ao criar uma conta, você concorda com nossos Termos de Serviço e Política de Privacidade.</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</ThemeProvider>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,244 +1,174 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { memo } from "react";
|
import React, { useState, useMemo } from "react";
|
||||||
import Image from "next/image";
|
import { ChevronLeft, ChevronRight, ArrowRight } from "lucide-react";
|
||||||
import CardStack from "@/components/cardStack/CardStack";
|
import TextBox from "@/components/Textbox";
|
||||||
import Badge from "@/components/shared/Badge";
|
|
||||||
import OverlayArrowButton from "@/components/shared/OverlayArrowButton";
|
|
||||||
import { cls, shouldUseInvertedText } from "@/lib/utils";
|
|
||||||
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
|
|
||||||
import type { BlogPost } from "@/lib/api/blog";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type { ButtonConfig, CardAnimationType, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
|
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
|
||||||
|
|
||||||
type BlogCard = BlogPost;
|
export interface BlogCardOneProps {
|
||||||
|
blogs: Array<{
|
||||||
interface BlogCardOneProps {
|
id: string;
|
||||||
blogs: BlogCard[];
|
category: string;
|
||||||
carouselMode?: "auto" | "buttons";
|
|
||||||
uniformGridCustomHeightClasses?: string;
|
|
||||||
animationType: CardAnimationType;
|
|
||||||
title: string;
|
title: string;
|
||||||
titleSegments?: TitleSegment[];
|
excerpt: string;
|
||||||
description: string;
|
imageSrc: string;
|
||||||
tag?: string;
|
imageAlt?: string;
|
||||||
tagIcon?: LucideIcon;
|
authorName: string;
|
||||||
tagAnimation?: ButtonAnimationType;
|
authorAvatar: string;
|
||||||
buttons?: ButtonConfig[];
|
date: string;
|
||||||
buttonAnimation?: ButtonAnimationType;
|
onBlogClick?: () => void;
|
||||||
textboxLayout: TextboxLayout;
|
}>;
|
||||||
useInvertedBackground: InvertedBackground;
|
carouselMode?: "auto" | "buttons";
|
||||||
ariaLabel?: string;
|
uniformGridCustomHeightClasses?: string;
|
||||||
className?: string;
|
animationType?: string;
|
||||||
containerClassName?: string;
|
title?: string;
|
||||||
cardClassName?: string;
|
titleSegments?: Array<{ type: "text"; content: string } | { type: "image"; src: string; alt?: string }>;
|
||||||
imageWrapperClassName?: string;
|
description?: string;
|
||||||
imageClassName?: string;
|
tag?: string;
|
||||||
categoryClassName?: string;
|
tagAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
|
||||||
cardTitleClassName?: string;
|
buttons?: Array<{ text: string; onClick?: () => void; href?: string }>;
|
||||||
excerptClassName?: string;
|
buttonAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
|
||||||
authorContainerClassName?: string;
|
textboxLayout?: "default" | "split" | "split-actions" | "split-description" | "inline-image";
|
||||||
authorAvatarClassName?: string;
|
useInvertedBackground?: boolean;
|
||||||
authorNameClassName?: string;
|
ariaLabel?: string;
|
||||||
dateClassName?: string;
|
className?: string;
|
||||||
textBoxTitleClassName?: string;
|
containerClassName?: string;
|
||||||
textBoxTitleImageWrapperClassName?: string;
|
cardClassName?: string;
|
||||||
textBoxTitleImageClassName?: string;
|
imageWrapperClassName?: string;
|
||||||
textBoxDescriptionClassName?: string;
|
imageClassName?: string;
|
||||||
gridClassName?: string;
|
categoryClassName?: string;
|
||||||
carouselClassName?: string;
|
cardTitleClassName?: string;
|
||||||
controlsClassName?: string;
|
excerptClassName?: string;
|
||||||
textBoxClassName?: string;
|
authorContainerClassName?: string;
|
||||||
textBoxTagClassName?: string;
|
authorAvatarClassName?: string;
|
||||||
textBoxButtonContainerClassName?: string;
|
authorNameClassName?: string;
|
||||||
textBoxButtonClassName?: string;
|
dateClassName?: string;
|
||||||
textBoxButtonTextClassName?: string;
|
textBoxTitleClassName?: string;
|
||||||
|
textBoxTitleImageWrapperClassName?: string;
|
||||||
|
textBoxTitleImageClassName?: string;
|
||||||
|
textBoxDescriptionClassName?: string;
|
||||||
|
gridClassName?: string;
|
||||||
|
carouselClassName?: string;
|
||||||
|
controlsClassName?: string;
|
||||||
|
textBoxClassName?: string;
|
||||||
|
textBoxTagClassName?: string;
|
||||||
|
textBoxButtonContainerClassName?: string;
|
||||||
|
textBoxButtonClassName?: string;
|
||||||
|
textBoxButtonTextClassName?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface BlogCardItemProps {
|
const BlogCardOne: React.FC<BlogCardOneProps> = ({
|
||||||
blog: BlogCard;
|
blogs,
|
||||||
shouldUseLightText: boolean;
|
carouselMode = "buttons", uniformGridCustomHeightClasses = "min-h-95 2xl:min-h-105", animationType = "slide-up", title,
|
||||||
cardClassName?: string;
|
titleSegments,
|
||||||
imageWrapperClassName?: string;
|
description,
|
||||||
imageClassName?: string;
|
tag,
|
||||||
categoryClassName?: string;
|
tagAnimation,
|
||||||
cardTitleClassName?: string;
|
buttons,
|
||||||
excerptClassName?: string;
|
buttonAnimation,
|
||||||
authorContainerClassName?: string;
|
textboxLayout = "default", useInvertedBackground = false,
|
||||||
authorAvatarClassName?: string;
|
ariaLabel = "Blog section", className = "", containerClassName = "", cardClassName = "", imageWrapperClassName = "", imageClassName = "", categoryClassName = "", cardTitleClassName = "", excerptClassName = "", authorContainerClassName = "", authorAvatarClassName = "", authorNameClassName = "", dateClassName = "", textBoxTitleClassName = "", textBoxTitleImageWrapperClassName = "", textBoxTitleImageClassName = "", textBoxDescriptionClassName = "", gridClassName = "", carouselClassName = "", controlsClassName = "", textBoxClassName = "", textBoxTagClassName = "", textBoxButtonContainerClassName = "", textBoxButtonClassName = "", textBoxButtonTextClassName = "" }) => {
|
||||||
authorNameClassName?: string;
|
const [currentIndex, setCurrentIndex] = useState(0);
|
||||||
dateClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const BlogCardItem = memo(({
|
const blogCards = blogs.map((blog) => (
|
||||||
blog,
|
<div
|
||||||
shouldUseLightText,
|
key={blog.id}
|
||||||
cardClassName = "",
|
className={`flex flex-col h-full rounded-lg overflow-hidden bg-card hover:shadow-lg transition-shadow cursor-pointer ${
|
||||||
imageWrapperClassName = "",
|
cardClassName || ""
|
||||||
imageClassName = "",
|
}`}
|
||||||
categoryClassName = "",
|
onClick={blog.onBlogClick}
|
||||||
cardTitleClassName = "",
|
>
|
||||||
excerptClassName = "",
|
<div className={`relative overflow-hidden bg-foreground/5 ${imageWrapperClassName}`}>
|
||||||
authorContainerClassName = "",
|
<img
|
||||||
authorAvatarClassName = "",
|
src={blog.imageSrc}
|
||||||
authorNameClassName = "",
|
alt={blog.imageAlt || blog.title}
|
||||||
dateClassName = "",
|
className={`w-full h-60 object-cover hover:scale-105 transition-transform duration-300 ${
|
||||||
}: BlogCardItemProps) => {
|
imageClassName || ""
|
||||||
return (
|
}`}
|
||||||
<article
|
/>
|
||||||
className={cls("relative h-full card group flex flex-col gap-4 cursor-pointer p-4 rounded-theme-capped", cardClassName)}
|
<button className="absolute top-4 right-4 bg-primary-cta/90 hover:bg-primary-cta p-2 rounded-full transition-colors">
|
||||||
onClick={blog.onBlogClick}
|
<ArrowRight className="w-4 h-4 text-foreground" />
|
||||||
role="article"
|
</button>
|
||||||
aria-label={`${blog.title} by ${blog.authorName}`}
|
</div>
|
||||||
>
|
|
||||||
<div className={cls("relative z-1 w-full aspect-[4/3] overflow-hidden rounded-theme-capped", imageWrapperClassName)}>
|
|
||||||
<Image
|
|
||||||
src={blog.imageSrc}
|
|
||||||
alt={blog.imageAlt || blog.title}
|
|
||||||
fill
|
|
||||||
className={cls("w-full h-full object-cover transition-transform duration-500 ease-in-out group-hover:scale-105", imageClassName)}
|
|
||||||
unoptimized={blog.imageSrc.startsWith('http') || blog.imageSrc.startsWith('//')}
|
|
||||||
/>
|
|
||||||
<OverlayArrowButton ariaLabel={`Read ${blog.title}`} />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="relative z-1 flex flex-col justify-between gap-6 flex-1">
|
<div className="flex-1 p-6 flex flex-col gap-3">
|
||||||
<div className="flex flex-col gap-2">
|
<span className={`text-xs font-semibold text-primary-cta uppercase ${
|
||||||
<Badge text={blog.category} variant="primary" className={categoryClassName} />
|
categoryClassName || ""
|
||||||
|
}`}>
|
||||||
|
{blog.category}
|
||||||
|
</span>
|
||||||
|
|
||||||
<h3 className={cls("text-2xl font-medium leading-[1.25] mt-1", shouldUseLightText ? "text-background" : "text-foreground", cardTitleClassName)}>
|
<h3 className={`text-lg font-semibold text-foreground line-clamp-2 ${
|
||||||
{blog.title}
|
cardTitleClassName || ""
|
||||||
</h3>
|
}`}>
|
||||||
|
{blog.title}
|
||||||
|
</h3>
|
||||||
|
|
||||||
<p className={cls("text-base leading-[1.25]", shouldUseLightText ? "text-background" : "text-foreground", excerptClassName)}>
|
<p className={`text-sm text-foreground/70 line-clamp-2 flex-1 ${
|
||||||
{blog.excerpt}
|
excerptClassName || ""
|
||||||
</p>
|
}`}>
|
||||||
</div>
|
{blog.excerpt}
|
||||||
|
</p>
|
||||||
|
|
||||||
<div className={cls("flex items-center gap-3", authorContainerClassName)}>
|
<div className={`flex items-center gap-3 pt-4 border-t border-foreground/10 ${
|
||||||
<Image
|
authorContainerClassName || ""
|
||||||
src={blog.authorAvatar}
|
}`}>
|
||||||
alt={blog.authorName}
|
<img
|
||||||
width={40}
|
src={blog.authorAvatar}
|
||||||
height={40}
|
alt={blog.authorName}
|
||||||
className={cls("h-9 w-auto aspect-square rounded-theme object-cover", authorAvatarClassName)}
|
className={`w-8 h-8 rounded-full object-cover ${
|
||||||
unoptimized={blog.authorAvatar.startsWith('http') || blog.authorAvatar.startsWith('//')}
|
authorAvatarClassName || ""
|
||||||
/>
|
}`}
|
||||||
<div className="flex flex-col">
|
/>
|
||||||
<p className={cls("text-sm font-medium", shouldUseLightText ? "text-background" : "text-foreground", authorNameClassName)}>
|
<div className="flex-1 min-w-0">
|
||||||
{blog.authorName}
|
<p className={`text-sm font-medium text-foreground truncate ${
|
||||||
</p>
|
authorNameClassName || ""
|
||||||
<p className={cls("text-xs", shouldUseLightText ? "text-background/75" : "text-foreground/75", dateClassName)}>
|
}`}>
|
||||||
{blog.date}
|
{blog.authorName}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
<p className={`text-xs text-foreground/60 ${dateClassName || ""}`}>
|
||||||
</div>
|
{blog.date}
|
||||||
</div>
|
</p>
|
||||||
</article>
|
</div>
|
||||||
);
|
</div>
|
||||||
});
|
</div>
|
||||||
|
</div>
|
||||||
|
));
|
||||||
|
|
||||||
BlogCardItem.displayName = "BlogCardItem";
|
return (
|
||||||
|
<div
|
||||||
const BlogCardOne = ({
|
className={`w-full py-20 ${
|
||||||
blogs = [],
|
useInvertedBackground ? "bg-background/50" : ""
|
||||||
carouselMode = "buttons",
|
} ${containerClassName}`}
|
||||||
uniformGridCustomHeightClasses,
|
aria-label={ariaLabel}
|
||||||
animationType,
|
>
|
||||||
title,
|
{title && (
|
||||||
titleSegments,
|
<div className={`max-w-content-width mx-auto px-4 mb-12 ${textBoxClassName || ""}`}>
|
||||||
description,
|
<TextBox
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
textboxLayout,
|
|
||||||
useInvertedBackground,
|
|
||||||
ariaLabel = "Blog section",
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
cardClassName = "",
|
|
||||||
imageWrapperClassName = "",
|
|
||||||
imageClassName = "",
|
|
||||||
categoryClassName = "",
|
|
||||||
cardTitleClassName = "",
|
|
||||||
excerptClassName = "",
|
|
||||||
authorContainerClassName = "",
|
|
||||||
authorAvatarClassName = "",
|
|
||||||
authorNameClassName = "",
|
|
||||||
dateClassName = "",
|
|
||||||
textBoxTitleClassName = "",
|
|
||||||
textBoxTitleImageWrapperClassName = "",
|
|
||||||
textBoxTitleImageClassName = "",
|
|
||||||
textBoxDescriptionClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
carouselClassName = "",
|
|
||||||
controlsClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
}: BlogCardOneProps) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<CardStack
|
|
||||||
mode={carouselMode}
|
|
||||||
gridVariant="uniform-all-items-equal"
|
|
||||||
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
|
||||||
animationType={animationType}
|
|
||||||
|
|
||||||
title={title}
|
title={title}
|
||||||
titleSegments={titleSegments}
|
titleSegments={titleSegments}
|
||||||
description={description}
|
description={description || ""}
|
||||||
tag={tag}
|
tag={tag}
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
tagAnimation={tagAnimation}
|
||||||
buttons={buttons}
|
buttons={buttons}
|
||||||
buttonAnimation={buttonAnimation}
|
buttonAnimation={buttonAnimation}
|
||||||
textboxLayout={textboxLayout}
|
textboxLayout={textboxLayout || "default"}
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
ariaLabel={ariaLabel}
|
|
||||||
className={className}
|
|
||||||
containerClassName={containerClassName}
|
|
||||||
gridClassName={gridClassName}
|
|
||||||
carouselClassName={carouselClassName}
|
|
||||||
controlsClassName={controlsClassName}
|
|
||||||
textBoxClassName={textBoxClassName}
|
|
||||||
titleClassName={textBoxTitleClassName}
|
titleClassName={textBoxTitleClassName}
|
||||||
titleImageWrapperClassName={textBoxTitleImageWrapperClassName}
|
|
||||||
titleImageClassName={textBoxTitleImageClassName}
|
|
||||||
descriptionClassName={textBoxDescriptionClassName}
|
descriptionClassName={textBoxDescriptionClassName}
|
||||||
tagClassName={textBoxTagClassName}
|
tagClassName={textBoxTagClassName}
|
||||||
buttonContainerClassName={textBoxButtonContainerClassName}
|
buttonContainerClassName={textBoxButtonContainerClassName}
|
||||||
buttonClassName={textBoxButtonClassName}
|
buttonClassName={textBoxButtonClassName}
|
||||||
buttonTextClassName={textBoxButtonTextClassName}
|
buttonTextClassName={textBoxButtonTextClassName}
|
||||||
>
|
/>
|
||||||
{blogs.map((blog) => (
|
</div>
|
||||||
<BlogCardItem
|
)}
|
||||||
key={blog.id}
|
|
||||||
blog={blog}
|
<div className="max-w-content-width mx-auto px-4">
|
||||||
shouldUseLightText={shouldUseLightText}
|
<div className={`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 ${gridClassName}`}>
|
||||||
cardClassName={cardClassName}
|
{blogCards}
|
||||||
imageWrapperClassName={imageWrapperClassName}
|
</div>
|
||||||
imageClassName={imageClassName}
|
</div>
|
||||||
categoryClassName={categoryClassName}
|
</div>
|
||||||
cardTitleClassName={cardTitleClassName}
|
);
|
||||||
excerptClassName={excerptClassName}
|
|
||||||
authorContainerClassName={authorContainerClassName}
|
|
||||||
authorAvatarClassName={authorAvatarClassName}
|
|
||||||
authorNameClassName={authorNameClassName}
|
|
||||||
dateClassName={dateClassName}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</CardStack>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
BlogCardOne.displayName = "BlogCardOne";
|
|
||||||
|
|
||||||
export default BlogCardOne;
|
export default BlogCardOne;
|
||||||
|
|||||||
@@ -1,288 +1,174 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { memo } from "react";
|
import React, { useState } from "react";
|
||||||
import Image from "next/image";
|
import { ChevronLeft, ChevronRight, ArrowRight } from "lucide-react";
|
||||||
import CardStack from "@/components/cardStack/CardStack";
|
import TextBox from "@/components/Textbox";
|
||||||
import Tag from "@/components/shared/Tag";
|
|
||||||
import MediaContent from "@/components/shared/MediaContent";
|
|
||||||
import OverlayArrowButton from "@/components/shared/OverlayArrowButton";
|
|
||||||
import { cls, shouldUseInvertedText } from "@/lib/utils";
|
|
||||||
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
|
|
||||||
import type { BlogPost } from "@/lib/api/blog";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type { ButtonConfig, CardAnimationType, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
|
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
|
||||||
|
|
||||||
type BlogCard = BlogPost;
|
export interface BlogCardThreeProps {
|
||||||
|
blogs: Array<{
|
||||||
interface BlogCardThreeProps {
|
id: string;
|
||||||
blogs: BlogCard[];
|
category: string;
|
||||||
carouselMode?: "auto" | "buttons";
|
|
||||||
uniformGridCustomHeightClasses?: string;
|
|
||||||
animationType: CardAnimationType;
|
|
||||||
title: string;
|
title: string;
|
||||||
titleSegments?: TitleSegment[];
|
excerpt: string;
|
||||||
description: string;
|
imageSrc: string;
|
||||||
tag?: string;
|
imageAlt?: string;
|
||||||
tagIcon?: LucideIcon;
|
authorName: string;
|
||||||
tagAnimation?: ButtonAnimationType;
|
authorAvatar: string;
|
||||||
buttons?: ButtonConfig[];
|
date: string;
|
||||||
buttonAnimation?: ButtonAnimationType;
|
onBlogClick?: () => void;
|
||||||
textboxLayout: TextboxLayout;
|
}>;
|
||||||
useInvertedBackground: InvertedBackground;
|
carouselMode?: "auto" | "buttons";
|
||||||
ariaLabel?: string;
|
uniformGridCustomHeightClasses?: string;
|
||||||
className?: string;
|
animationType?: string;
|
||||||
containerClassName?: string;
|
title?: string;
|
||||||
cardClassName?: string;
|
titleSegments?: Array<{ type: "text"; content: string } | { type: "image"; src: string; alt?: string }>;
|
||||||
cardContentClassName?: string;
|
description?: string;
|
||||||
categoryTagClassName?: string;
|
tag?: string;
|
||||||
cardTitleClassName?: string;
|
tagAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
|
||||||
excerptClassName?: string;
|
buttons?: Array<{ text: string; onClick?: () => void; href?: string }>;
|
||||||
authorContainerClassName?: string;
|
buttonAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
|
||||||
authorAvatarClassName?: string;
|
textboxLayout?: "default" | "split" | "split-actions" | "split-description" | "inline-image";
|
||||||
authorNameClassName?: string;
|
useInvertedBackground?: boolean;
|
||||||
dateClassName?: string;
|
ariaLabel?: string;
|
||||||
mediaWrapperClassName?: string;
|
className?: string;
|
||||||
mediaClassName?: string;
|
containerClassName?: string;
|
||||||
textBoxTitleClassName?: string;
|
cardClassName?: string;
|
||||||
textBoxTitleImageWrapperClassName?: string;
|
imageWrapperClassName?: string;
|
||||||
textBoxTitleImageClassName?: string;
|
imageClassName?: string;
|
||||||
textBoxDescriptionClassName?: string;
|
categoryClassName?: string;
|
||||||
gridClassName?: string;
|
cardTitleClassName?: string;
|
||||||
carouselClassName?: string;
|
excerptClassName?: string;
|
||||||
controlsClassName?: string;
|
authorContainerClassName?: string;
|
||||||
textBoxClassName?: string;
|
authorAvatarClassName?: string;
|
||||||
textBoxTagClassName?: string;
|
authorNameClassName?: string;
|
||||||
textBoxButtonContainerClassName?: string;
|
dateClassName?: string;
|
||||||
textBoxButtonClassName?: string;
|
textBoxTitleClassName?: string;
|
||||||
textBoxButtonTextClassName?: string;
|
textBoxTitleImageWrapperClassName?: string;
|
||||||
|
textBoxTitleImageClassName?: string;
|
||||||
|
textBoxDescriptionClassName?: string;
|
||||||
|
gridClassName?: string;
|
||||||
|
carouselClassName?: string;
|
||||||
|
controlsClassName?: string;
|
||||||
|
textBoxClassName?: string;
|
||||||
|
textBoxTagClassName?: string;
|
||||||
|
textBoxButtonContainerClassName?: string;
|
||||||
|
textBoxButtonClassName?: string;
|
||||||
|
textBoxButtonTextClassName?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface BlogCardItemProps {
|
const BlogCardThree: React.FC<BlogCardThreeProps> = ({
|
||||||
blog: BlogCard;
|
blogs,
|
||||||
useInvertedBackground: boolean;
|
carouselMode = "buttons", uniformGridCustomHeightClasses = "min-h-95 2xl:min-h-105", animationType = "slide-up", title,
|
||||||
cardClassName?: string;
|
titleSegments,
|
||||||
cardContentClassName?: string;
|
description,
|
||||||
categoryTagClassName?: string;
|
tag,
|
||||||
cardTitleClassName?: string;
|
tagAnimation,
|
||||||
excerptClassName?: string;
|
buttons,
|
||||||
authorContainerClassName?: string;
|
buttonAnimation,
|
||||||
authorAvatarClassName?: string;
|
textboxLayout = "default", useInvertedBackground = false,
|
||||||
authorNameClassName?: string;
|
ariaLabel = "Blog section", className = "", containerClassName = "", cardClassName = "", imageWrapperClassName = "", imageClassName = "", categoryClassName = "", cardTitleClassName = "", excerptClassName = "", authorContainerClassName = "", authorAvatarClassName = "", authorNameClassName = "", dateClassName = "", textBoxTitleClassName = "", textBoxTitleImageWrapperClassName = "", textBoxTitleImageClassName = "", textBoxDescriptionClassName = "", gridClassName = "", carouselClassName = "", controlsClassName = "", textBoxClassName = "", textBoxTagClassName = "", textBoxButtonContainerClassName = "", textBoxButtonClassName = "", textBoxButtonTextClassName = "" }) => {
|
||||||
dateClassName?: string;
|
const [currentIndex, setCurrentIndex] = useState(0);
|
||||||
mediaWrapperClassName?: string;
|
|
||||||
mediaClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const BlogCardItem = memo(({
|
const blogCards = blogs.map((blog) => (
|
||||||
blog,
|
<div
|
||||||
useInvertedBackground,
|
key={blog.id}
|
||||||
cardClassName = "",
|
className={`flex flex-col h-full rounded-lg overflow-hidden bg-card hover:shadow-lg transition-shadow cursor-pointer ${
|
||||||
cardContentClassName = "",
|
cardClassName || ""
|
||||||
categoryTagClassName = "",
|
}`}
|
||||||
cardTitleClassName = "",
|
onClick={blog.onBlogClick}
|
||||||
excerptClassName = "",
|
>
|
||||||
authorContainerClassName = "",
|
<div className={`relative overflow-hidden bg-foreground/5 ${imageWrapperClassName}`}>
|
||||||
authorAvatarClassName = "",
|
<img
|
||||||
authorNameClassName = "",
|
src={blog.imageSrc}
|
||||||
dateClassName = "",
|
alt={blog.imageAlt || blog.title}
|
||||||
mediaWrapperClassName = "",
|
className={`w-full h-60 object-cover hover:scale-105 transition-transform duration-300 ${
|
||||||
mediaClassName = "",
|
imageClassName || ""
|
||||||
}: BlogCardItemProps) => {
|
}`}
|
||||||
const theme = useTheme();
|
/>
|
||||||
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
|
<button className="absolute top-4 right-4 bg-primary-cta/90 hover:bg-primary-cta p-2 rounded-full transition-colors">
|
||||||
|
<ArrowRight className="w-4 h-4 text-foreground" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
return (
|
<div className="flex-1 p-6 flex flex-col gap-3">
|
||||||
<article
|
<span className={`text-xs font-semibold text-primary-cta uppercase ${
|
||||||
className={cls(
|
categoryClassName || ""
|
||||||
"relative h-full card group flex flex-col justify-between gap-6 p-6 cursor-pointer rounded-theme-capped overflow-hidden",
|
}`}>
|
||||||
cardClassName
|
{blog.category}
|
||||||
)}
|
</span>
|
||||||
onClick={blog.onBlogClick}
|
|
||||||
role="article"
|
|
||||||
aria-label={blog.title}
|
|
||||||
>
|
|
||||||
<div className={cls("relative z-1 flex flex-col gap-3", cardContentClassName)}>
|
|
||||||
<Tag
|
|
||||||
text={blog.category}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
className={categoryTagClassName}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<h3 className={cls(
|
<h3 className={`text-lg font-semibold text-foreground line-clamp-2 ${
|
||||||
"text-3xl md:text-4xl font-medium leading-tight line-clamp-2",
|
cardTitleClassName || ""
|
||||||
shouldUseLightText ? "text-background" : "text-foreground",
|
}`}>
|
||||||
cardTitleClassName
|
{blog.title}
|
||||||
)}>
|
</h3>
|
||||||
{blog.title}
|
|
||||||
</h3>
|
|
||||||
|
|
||||||
<p className={cls(
|
<p className={`text-sm text-foreground/70 line-clamp-2 flex-1 ${
|
||||||
"text-base leading-tight line-clamp-2",
|
excerptClassName || ""
|
||||||
shouldUseLightText ? "text-background/75" : "text-foreground/75",
|
}`}>
|
||||||
excerptClassName
|
{blog.excerpt}
|
||||||
)}>
|
</p>
|
||||||
{blog.excerpt}
|
|
||||||
</p>
|
|
||||||
|
|
||||||
{(blog.authorName || blog.date) && (
|
<div className={`flex items-center gap-3 pt-4 border-t border-foreground/10 ${
|
||||||
<div className={cls(
|
authorContainerClassName || ""
|
||||||
"flex",
|
}`}>
|
||||||
blog.authorAvatar ? "items-center gap-3" : "flex-row justify-between items-center",
|
<img
|
||||||
authorContainerClassName
|
src={blog.authorAvatar}
|
||||||
)}>
|
alt={blog.authorName}
|
||||||
{blog.authorAvatar && (
|
className={`w-8 h-8 rounded-full object-cover ${
|
||||||
<Image
|
authorAvatarClassName || ""
|
||||||
src={blog.authorAvatar}
|
}`}
|
||||||
alt={blog.authorName || "Author"}
|
/>
|
||||||
width={40}
|
<div className="flex-1 min-w-0">
|
||||||
height={40}
|
<p className={`text-sm font-medium text-foreground truncate ${
|
||||||
className={cls("h-9 w-auto aspect-square rounded-theme object-cover", authorAvatarClassName)}
|
authorNameClassName || ""
|
||||||
unoptimized={blog.authorAvatar.startsWith('http') || blog.authorAvatar.startsWith('//')}
|
}`}>
|
||||||
/>
|
{blog.authorName}
|
||||||
)}
|
</p>
|
||||||
{blog.authorAvatar ? (
|
<p className={`text-xs text-foreground/60 ${dateClassName || ""}`}>
|
||||||
<div className="flex flex-col">
|
{blog.date}
|
||||||
{blog.authorName && (
|
</p>
|
||||||
<p className={cls("text-sm font-medium", shouldUseLightText ? "text-background" : "text-foreground", authorNameClassName)}>
|
</div>
|
||||||
{blog.authorName}
|
</div>
|
||||||
</p>
|
</div>
|
||||||
)}
|
</div>
|
||||||
{blog.date && (
|
));
|
||||||
<p className={cls("text-xs", shouldUseLightText ? "text-background/75" : "text-foreground/75", dateClassName)}>
|
|
||||||
{blog.date}
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
<>
|
|
||||||
{blog.authorName && (
|
|
||||||
<p className={cls("text-sm font-medium", shouldUseLightText ? "text-background" : "text-foreground", authorNameClassName)}>
|
|
||||||
{blog.authorName}
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
{blog.date && (
|
|
||||||
<p className={cls("text-xs", shouldUseLightText ? "text-background/75" : "text-foreground/75", dateClassName)}>
|
|
||||||
{blog.date}
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className={cls("relative z-1 w-full aspect-square", mediaWrapperClassName)}>
|
return (
|
||||||
<MediaContent
|
<div
|
||||||
imageSrc={blog.imageSrc}
|
className={`w-full py-20 ${
|
||||||
imageAlt={blog.imageAlt || blog.title}
|
useInvertedBackground ? "bg-background/50" : ""
|
||||||
imageClassName={cls("absolute inset-0 w-full h-full object-cover", mediaClassName)}
|
} ${containerClassName}`}
|
||||||
/>
|
aria-label={ariaLabel}
|
||||||
<OverlayArrowButton ariaLabel={`Read ${blog.title}`} />
|
>
|
||||||
</div>
|
{title && (
|
||||||
</article>
|
<div className={`max-w-content-width mx-auto px-4 mb-12 ${textBoxClassName || ""}`}>
|
||||||
);
|
<TextBox
|
||||||
});
|
|
||||||
|
|
||||||
BlogCardItem.displayName = "BlogCardItem";
|
|
||||||
|
|
||||||
const BlogCardThree = ({
|
|
||||||
blogs = [],
|
|
||||||
carouselMode = "buttons",
|
|
||||||
uniformGridCustomHeightClasses = "min-h-none",
|
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
textboxLayout,
|
|
||||||
useInvertedBackground,
|
|
||||||
ariaLabel = "Blog section",
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
cardClassName = "",
|
|
||||||
cardContentClassName = "",
|
|
||||||
categoryTagClassName = "",
|
|
||||||
cardTitleClassName = "",
|
|
||||||
excerptClassName = "",
|
|
||||||
authorContainerClassName = "",
|
|
||||||
authorAvatarClassName = "",
|
|
||||||
authorNameClassName = "",
|
|
||||||
dateClassName = "",
|
|
||||||
mediaWrapperClassName = "",
|
|
||||||
mediaClassName = "",
|
|
||||||
textBoxTitleClassName = "",
|
|
||||||
textBoxTitleImageWrapperClassName = "",
|
|
||||||
textBoxTitleImageClassName = "",
|
|
||||||
textBoxDescriptionClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
carouselClassName = "",
|
|
||||||
controlsClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
}: BlogCardThreeProps) => {
|
|
||||||
return (
|
|
||||||
<CardStack
|
|
||||||
mode={carouselMode}
|
|
||||||
gridVariant="uniform-all-items-equal"
|
|
||||||
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
|
||||||
animationType={animationType}
|
|
||||||
|
|
||||||
title={title}
|
title={title}
|
||||||
titleSegments={titleSegments}
|
titleSegments={titleSegments}
|
||||||
description={description}
|
description={description || ""}
|
||||||
tag={tag}
|
tag={tag}
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
tagAnimation={tagAnimation}
|
||||||
buttons={buttons}
|
buttons={buttons}
|
||||||
buttonAnimation={buttonAnimation}
|
buttonAnimation={buttonAnimation}
|
||||||
textboxLayout={textboxLayout}
|
textboxLayout={textboxLayout || "default"}
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
ariaLabel={ariaLabel}
|
|
||||||
className={className}
|
|
||||||
containerClassName={containerClassName}
|
|
||||||
gridClassName={gridClassName}
|
|
||||||
carouselClassName={carouselClassName}
|
|
||||||
controlsClassName={controlsClassName}
|
|
||||||
textBoxClassName={textBoxClassName}
|
|
||||||
titleClassName={textBoxTitleClassName}
|
titleClassName={textBoxTitleClassName}
|
||||||
titleImageWrapperClassName={textBoxTitleImageWrapperClassName}
|
|
||||||
titleImageClassName={textBoxTitleImageClassName}
|
|
||||||
descriptionClassName={textBoxDescriptionClassName}
|
descriptionClassName={textBoxDescriptionClassName}
|
||||||
tagClassName={textBoxTagClassName}
|
tagClassName={textBoxTagClassName}
|
||||||
buttonContainerClassName={textBoxButtonContainerClassName}
|
buttonContainerClassName={textBoxButtonContainerClassName}
|
||||||
buttonClassName={textBoxButtonClassName}
|
buttonClassName={textBoxButtonClassName}
|
||||||
buttonTextClassName={textBoxButtonTextClassName}
|
buttonTextClassName={textBoxButtonTextClassName}
|
||||||
>
|
/>
|
||||||
{blogs.map((blog) => (
|
</div>
|
||||||
<BlogCardItem
|
)}
|
||||||
key={blog.id}
|
|
||||||
blog={blog}
|
<div className="max-w-content-width mx-auto px-4">
|
||||||
useInvertedBackground={useInvertedBackground}
|
<div className={`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 ${gridClassName}`}>
|
||||||
cardClassName={cardClassName}
|
{blogCards}
|
||||||
cardContentClassName={cardContentClassName}
|
</div>
|
||||||
categoryTagClassName={categoryTagClassName}
|
</div>
|
||||||
cardTitleClassName={cardTitleClassName}
|
</div>
|
||||||
excerptClassName={excerptClassName}
|
);
|
||||||
authorContainerClassName={authorContainerClassName}
|
|
||||||
authorAvatarClassName={authorAvatarClassName}
|
|
||||||
authorNameClassName={authorNameClassName}
|
|
||||||
dateClassName={dateClassName}
|
|
||||||
mediaWrapperClassName={mediaWrapperClassName}
|
|
||||||
mediaClassName={mediaClassName}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</CardStack>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
BlogCardThree.displayName = "BlogCardThree";
|
|
||||||
|
|
||||||
export default BlogCardThree;
|
export default BlogCardThree;
|
||||||
|
|||||||
@@ -1,241 +1,174 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { memo } from "react";
|
import React, { useState } from "react";
|
||||||
import Image from "next/image";
|
import { ChevronLeft, ChevronRight, ArrowRight } from "lucide-react";
|
||||||
import CardStack from "@/components/cardStack/CardStack";
|
import TextBox from "@/components/Textbox";
|
||||||
import Badge from "@/components/shared/Badge";
|
|
||||||
import OverlayArrowButton from "@/components/shared/OverlayArrowButton";
|
|
||||||
import { cls, shouldUseInvertedText } from "@/lib/utils";
|
|
||||||
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
|
|
||||||
import type { BlogPost } from "@/lib/api/blog";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type { ButtonConfig, CardAnimationType, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
|
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
|
||||||
|
|
||||||
type BlogCard = Omit<BlogPost, 'category'> & {
|
export interface BlogCardTwoProps {
|
||||||
category: string | string[];
|
blogs: Array<{
|
||||||
};
|
id: string;
|
||||||
|
category: string;
|
||||||
interface BlogCardTwoProps {
|
|
||||||
blogs: BlogCard[];
|
|
||||||
carouselMode?: "auto" | "buttons";
|
|
||||||
uniformGridCustomHeightClasses?: string;
|
|
||||||
animationType: CardAnimationType;
|
|
||||||
title: string;
|
title: string;
|
||||||
titleSegments?: TitleSegment[];
|
excerpt: string;
|
||||||
description: string;
|
imageSrc: string;
|
||||||
tag?: string;
|
imageAlt?: string;
|
||||||
tagIcon?: LucideIcon;
|
authorName: string;
|
||||||
tagAnimation?: ButtonAnimationType;
|
authorAvatar: string;
|
||||||
buttons?: ButtonConfig[];
|
date: string;
|
||||||
buttonAnimation?: ButtonAnimationType;
|
onBlogClick?: () => void;
|
||||||
textboxLayout: TextboxLayout;
|
}>;
|
||||||
useInvertedBackground: InvertedBackground;
|
carouselMode?: "auto" | "buttons";
|
||||||
ariaLabel?: string;
|
uniformGridCustomHeightClasses?: string;
|
||||||
className?: string;
|
animationType?: string;
|
||||||
containerClassName?: string;
|
title?: string;
|
||||||
cardClassName?: string;
|
titleSegments?: Array<{ type: "text"; content: string } | { type: "image"; src: string; alt?: string }>;
|
||||||
imageWrapperClassName?: string;
|
description?: string;
|
||||||
imageClassName?: string;
|
tag?: string;
|
||||||
authorAvatarClassName?: string;
|
tagAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
|
||||||
authorDateClassName?: string;
|
buttons?: Array<{ text: string; onClick?: () => void; href?: string }>;
|
||||||
cardTitleClassName?: string;
|
buttonAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
|
||||||
excerptClassName?: string;
|
textboxLayout?: "default" | "split" | "split-actions" | "split-description" | "inline-image";
|
||||||
categoryClassName?: string;
|
useInvertedBackground?: boolean;
|
||||||
textBoxTitleClassName?: string;
|
ariaLabel?: string;
|
||||||
textBoxTitleImageWrapperClassName?: string;
|
className?: string;
|
||||||
textBoxTitleImageClassName?: string;
|
containerClassName?: string;
|
||||||
textBoxDescriptionClassName?: string;
|
cardClassName?: string;
|
||||||
gridClassName?: string;
|
imageWrapperClassName?: string;
|
||||||
carouselClassName?: string;
|
imageClassName?: string;
|
||||||
controlsClassName?: string;
|
categoryClassName?: string;
|
||||||
textBoxClassName?: string;
|
cardTitleClassName?: string;
|
||||||
textBoxTagClassName?: string;
|
excerptClassName?: string;
|
||||||
textBoxButtonContainerClassName?: string;
|
authorContainerClassName?: string;
|
||||||
textBoxButtonClassName?: string;
|
authorAvatarClassName?: string;
|
||||||
textBoxButtonTextClassName?: string;
|
authorNameClassName?: string;
|
||||||
|
dateClassName?: string;
|
||||||
|
textBoxTitleClassName?: string;
|
||||||
|
textBoxTitleImageWrapperClassName?: string;
|
||||||
|
textBoxTitleImageClassName?: string;
|
||||||
|
textBoxDescriptionClassName?: string;
|
||||||
|
gridClassName?: string;
|
||||||
|
carouselClassName?: string;
|
||||||
|
controlsClassName?: string;
|
||||||
|
textBoxClassName?: string;
|
||||||
|
textBoxTagClassName?: string;
|
||||||
|
textBoxButtonContainerClassName?: string;
|
||||||
|
textBoxButtonClassName?: string;
|
||||||
|
textBoxButtonTextClassName?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface BlogCardItemProps {
|
const BlogCardTwo: React.FC<BlogCardTwoProps> = ({
|
||||||
blog: BlogCard;
|
blogs,
|
||||||
shouldUseLightText: boolean;
|
carouselMode = "buttons", uniformGridCustomHeightClasses = "min-h-95 2xl:min-h-105", animationType = "slide-up", title,
|
||||||
cardClassName?: string;
|
titleSegments,
|
||||||
imageWrapperClassName?: string;
|
description,
|
||||||
imageClassName?: string;
|
tag,
|
||||||
authorAvatarClassName?: string;
|
tagAnimation,
|
||||||
authorDateClassName?: string;
|
buttons,
|
||||||
cardTitleClassName?: string;
|
buttonAnimation,
|
||||||
excerptClassName?: string;
|
textboxLayout = "default", useInvertedBackground = false,
|
||||||
categoryClassName?: string;
|
ariaLabel = "Blog section", className = "", containerClassName = "", cardClassName = "", imageWrapperClassName = "", imageClassName = "", categoryClassName = "", cardTitleClassName = "", excerptClassName = "", authorContainerClassName = "", authorAvatarClassName = "", authorNameClassName = "", dateClassName = "", textBoxTitleClassName = "", textBoxTitleImageWrapperClassName = "", textBoxTitleImageClassName = "", textBoxDescriptionClassName = "", gridClassName = "", carouselClassName = "", controlsClassName = "", textBoxClassName = "", textBoxTagClassName = "", textBoxButtonContainerClassName = "", textBoxButtonClassName = "", textBoxButtonTextClassName = "" }) => {
|
||||||
}
|
const [currentIndex, setCurrentIndex] = useState(0);
|
||||||
|
|
||||||
const BlogCardItem = memo(({
|
const blogCards = blogs.map((blog) => (
|
||||||
blog,
|
<div
|
||||||
shouldUseLightText,
|
key={blog.id}
|
||||||
cardClassName = "",
|
className={`flex flex-col h-full rounded-lg overflow-hidden bg-card hover:shadow-lg transition-shadow cursor-pointer ${
|
||||||
imageWrapperClassName = "",
|
cardClassName || ""
|
||||||
imageClassName = "",
|
}`}
|
||||||
authorAvatarClassName = "",
|
onClick={blog.onBlogClick}
|
||||||
authorDateClassName = "",
|
>
|
||||||
cardTitleClassName = "",
|
<div className={`relative overflow-hidden bg-foreground/5 ${imageWrapperClassName}`}>
|
||||||
excerptClassName = "",
|
<img
|
||||||
categoryClassName = "",
|
src={blog.imageSrc}
|
||||||
}: BlogCardItemProps) => {
|
alt={blog.imageAlt || blog.title}
|
||||||
return (
|
className={`w-full h-60 object-cover hover:scale-105 transition-transform duration-300 ${
|
||||||
<article
|
imageClassName || ""
|
||||||
className={cls("relative h-full card group flex flex-col gap-4 cursor-pointer p-4 rounded-theme-capped", cardClassName)}
|
}`}
|
||||||
onClick={blog.onBlogClick}
|
/>
|
||||||
role="article"
|
<button className="absolute top-4 right-4 bg-primary-cta/90 hover:bg-primary-cta p-2 rounded-full transition-colors">
|
||||||
aria-label={`${blog.title} by ${blog.authorName}`}
|
<ArrowRight className="w-4 h-4 text-foreground" />
|
||||||
>
|
</button>
|
||||||
<div className={cls("relative z-1 w-full aspect-[4/3] overflow-hidden rounded-theme-capped", imageWrapperClassName)}>
|
</div>
|
||||||
<Image
|
|
||||||
src={blog.imageSrc}
|
|
||||||
alt={blog.imageAlt || blog.title}
|
|
||||||
fill
|
|
||||||
className={cls("w-full h-full object-cover transition-transform duration-500 ease-in-out group-hover:scale-105", imageClassName)}
|
|
||||||
unoptimized={blog.imageSrc.startsWith('http') || blog.imageSrc.startsWith('//')}
|
|
||||||
/>
|
|
||||||
<OverlayArrowButton ariaLabel={`Read ${blog.title}`} />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="relative z-1 flex flex-col justify-between gap-6 flex-1">
|
<div className="flex-1 p-6 flex flex-col gap-3">
|
||||||
<div className="flex flex-col gap-2">
|
<span className={`text-xs font-semibold text-primary-cta uppercase ${
|
||||||
<div className="flex items-center gap-2">
|
categoryClassName || ""
|
||||||
{blog.authorAvatar && (
|
}`}>
|
||||||
<Image
|
{blog.category}
|
||||||
src={blog.authorAvatar}
|
</span>
|
||||||
alt={blog.authorName}
|
|
||||||
width={24}
|
|
||||||
height={24}
|
|
||||||
className={cls("h-[var(--text-xs)] w-auto aspect-square rounded-theme object-cover bg-background-accent", authorAvatarClassName)}
|
|
||||||
unoptimized={blog.authorAvatar.startsWith('http') || blog.authorAvatar.startsWith('//')}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
<p className={cls("text-xs", shouldUseLightText ? "text-background" : "text-foreground", authorDateClassName)}>
|
|
||||||
{blog.authorName} • {blog.date}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h3 className={cls("text-2xl font-medium leading-[1.25]", shouldUseLightText ? "text-background" : "text-foreground", cardTitleClassName)}>
|
<h3 className={`text-lg font-semibold text-foreground line-clamp-2 ${
|
||||||
{blog.title}
|
cardTitleClassName || ""
|
||||||
</h3>
|
}`}>
|
||||||
|
{blog.title}
|
||||||
|
</h3>
|
||||||
|
|
||||||
<p className={cls("text-base leading-[1.25]", shouldUseLightText ? "text-background" : "text-foreground", excerptClassName)}>
|
<p className={`text-sm text-foreground/70 line-clamp-2 flex-1 ${
|
||||||
{blog.excerpt}
|
excerptClassName || ""
|
||||||
</p>
|
}`}>
|
||||||
</div>
|
{blog.excerpt}
|
||||||
|
</p>
|
||||||
|
|
||||||
<div className="flex flex-wrap gap-2">
|
<div className={`flex items-center gap-3 pt-4 border-t border-foreground/10 ${
|
||||||
{Array.isArray(blog.category) ? (
|
authorContainerClassName || ""
|
||||||
blog.category.map((cat, index) => (
|
}`}>
|
||||||
<Badge key={`${cat}-${index}`} text={cat} variant="primary" className={categoryClassName} />
|
<img
|
||||||
))
|
src={blog.authorAvatar}
|
||||||
) : (
|
alt={blog.authorName}
|
||||||
<Badge text={blog.category} variant="primary" className={categoryClassName} />
|
className={`w-8 h-8 rounded-full object-cover ${
|
||||||
)}
|
authorAvatarClassName || ""
|
||||||
</div>
|
}`}
|
||||||
</div>
|
/>
|
||||||
</article>
|
<div className="flex-1 min-w-0">
|
||||||
);
|
<p className={`text-sm font-medium text-foreground truncate ${
|
||||||
});
|
authorNameClassName || ""
|
||||||
|
}`}>
|
||||||
|
{blog.authorName}
|
||||||
|
</p>
|
||||||
|
<p className={`text-xs text-foreground/60 ${dateClassName || ""}`}>
|
||||||
|
{blog.date}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
));
|
||||||
|
|
||||||
BlogCardItem.displayName = "BlogCardItem";
|
return (
|
||||||
|
<div
|
||||||
const BlogCardTwo = ({
|
className={`w-full py-20 ${
|
||||||
blogs = [],
|
useInvertedBackground ? "bg-background/50" : ""
|
||||||
carouselMode = "buttons",
|
} ${containerClassName}`}
|
||||||
uniformGridCustomHeightClasses,
|
aria-label={ariaLabel}
|
||||||
animationType,
|
>
|
||||||
title,
|
{title && (
|
||||||
titleSegments,
|
<div className={`max-w-content-width mx-auto px-4 mb-12 ${textBoxClassName || ""}`}>
|
||||||
description,
|
<TextBox
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
textboxLayout,
|
|
||||||
useInvertedBackground,
|
|
||||||
ariaLabel = "Blog section",
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
cardClassName = "",
|
|
||||||
imageWrapperClassName = "",
|
|
||||||
imageClassName = "",
|
|
||||||
authorAvatarClassName = "",
|
|
||||||
authorDateClassName = "",
|
|
||||||
cardTitleClassName = "",
|
|
||||||
excerptClassName = "",
|
|
||||||
categoryClassName = "",
|
|
||||||
textBoxTitleClassName = "",
|
|
||||||
textBoxTitleImageWrapperClassName = "",
|
|
||||||
textBoxTitleImageClassName = "",
|
|
||||||
textBoxDescriptionClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
carouselClassName = "",
|
|
||||||
controlsClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
}: BlogCardTwoProps) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<CardStack
|
|
||||||
mode={carouselMode}
|
|
||||||
gridVariant="uniform-all-items-equal"
|
|
||||||
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
|
||||||
animationType={animationType}
|
|
||||||
|
|
||||||
title={title}
|
title={title}
|
||||||
titleSegments={titleSegments}
|
titleSegments={titleSegments}
|
||||||
description={description}
|
description={description || ""}
|
||||||
tag={tag}
|
tag={tag}
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
tagAnimation={tagAnimation}
|
||||||
buttons={buttons}
|
buttons={buttons}
|
||||||
buttonAnimation={buttonAnimation}
|
buttonAnimation={buttonAnimation}
|
||||||
textboxLayout={textboxLayout}
|
textboxLayout={textboxLayout || "default"}
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
ariaLabel={ariaLabel}
|
|
||||||
className={className}
|
|
||||||
containerClassName={containerClassName}
|
|
||||||
gridClassName={gridClassName}
|
|
||||||
carouselClassName={carouselClassName}
|
|
||||||
controlsClassName={controlsClassName}
|
|
||||||
textBoxClassName={textBoxClassName}
|
|
||||||
titleClassName={textBoxTitleClassName}
|
titleClassName={textBoxTitleClassName}
|
||||||
titleImageWrapperClassName={textBoxTitleImageWrapperClassName}
|
|
||||||
titleImageClassName={textBoxTitleImageClassName}
|
|
||||||
descriptionClassName={textBoxDescriptionClassName}
|
descriptionClassName={textBoxDescriptionClassName}
|
||||||
tagClassName={textBoxTagClassName}
|
tagClassName={textBoxTagClassName}
|
||||||
buttonContainerClassName={textBoxButtonContainerClassName}
|
buttonContainerClassName={textBoxButtonContainerClassName}
|
||||||
buttonClassName={textBoxButtonClassName}
|
buttonClassName={textBoxButtonClassName}
|
||||||
buttonTextClassName={textBoxButtonTextClassName}
|
buttonTextClassName={textBoxButtonTextClassName}
|
||||||
>
|
/>
|
||||||
{blogs.map((blog) => (
|
</div>
|
||||||
<BlogCardItem
|
)}
|
||||||
key={blog.id}
|
|
||||||
blog={blog}
|
<div className="max-w-content-width mx-auto px-4">
|
||||||
shouldUseLightText={shouldUseLightText}
|
<div className={`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 ${gridClassName}`}>
|
||||||
cardClassName={cardClassName}
|
{blogCards}
|
||||||
imageWrapperClassName={imageWrapperClassName}
|
</div>
|
||||||
imageClassName={imageClassName}
|
</div>
|
||||||
authorAvatarClassName={authorAvatarClassName}
|
</div>
|
||||||
authorDateClassName={authorDateClassName}
|
);
|
||||||
cardTitleClassName={cardTitleClassName}
|
|
||||||
excerptClassName={excerptClassName}
|
|
||||||
categoryClassName={categoryClassName}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</CardStack>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
BlogCardTwo.displayName = "BlogCardTwo";
|
|
||||||
|
|
||||||
export default BlogCardTwo;
|
export default BlogCardTwo;
|
||||||
|
|||||||
@@ -1,146 +1,44 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import CardStack from "@/components/cardStack/CardStack";
|
import React, { useMemo } from "react";
|
||||||
import Button from "@/components/button/Button";
|
import CardStack from "@/components/card/CardStack";
|
||||||
import { cls, shouldUseInvertedText } from "@/lib/utils";
|
import TextBox from "@/components/Textbox";
|
||||||
import { getButtonProps } from "@/lib/buttonUtils";
|
import type { BentoAnimationType } from "@/types/animations";
|
||||||
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
|
|
||||||
import { BentoGlobe } from "@/components/bento/BentoGlobe";
|
|
||||||
import BentoIconInfoCards from "@/components/bento/BentoIconInfoCards";
|
|
||||||
import BentoAnimatedBarChart from "@/components/bento/BentoAnimatedBarChart";
|
|
||||||
import Bento3DStackCards from "@/components/bento/Bento3DStackCards";
|
|
||||||
import Bento3DTaskList, { type TaskItem } from "@/components/bento/Bento3DTaskList";
|
|
||||||
import BentoOrbitingIcons, { type OrbitingItem } from "@/components/bento/BentoOrbitingIcons";
|
|
||||||
import BentoMap from "@/components/bento/BentoMap";
|
|
||||||
import BentoMarquee from "@/components/bento/BentoMarquee";
|
|
||||||
import BentoLineChart from "@/components/bento/BentoLineChart/BentoLineChart";
|
|
||||||
import BentoPhoneAnimation, { type PhoneApp, type PhoneApps8 } from "@/components/bento/BentoPhoneAnimation";
|
|
||||||
import BentoChatAnimation, { type ChatExchange } from "@/components/bento/BentoChatAnimation";
|
|
||||||
import Bento3DCardGrid from "@/components/bento/Bento3DCardGrid";
|
|
||||||
import BentoRevealIcon from "@/components/bento/BentoRevealIcon";
|
|
||||||
import BentoTimeline, { type TimelineItem } from "@/components/bento/BentoTimeline";
|
|
||||||
import BentoMediaStack, { type MediaStackItem } from "@/components/bento/BentoMediaStack";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
|
|
||||||
export type { PhoneApp, PhoneApps8, ChatExchange, TimelineItem, MediaStackItem };
|
export interface FeatureBentoProps {
|
||||||
import type { ButtonConfig, CardAnimationTypeWith3D, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
|
features?: Array<{
|
||||||
|
id: string;
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
title: string;
|
||||||
|
description: string;
|
||||||
type BentoAnimationType = Exclude<CardAnimationTypeWith3D, "depth-3d" | "scale-rotate">;
|
icon?: React.ReactNode;
|
||||||
|
mediaItems?: Array<{ type: string; src: string; alt?: string }>;
|
||||||
export type BentoInfoItem = {
|
}>;
|
||||||
icon: LucideIcon;
|
|
||||||
label: string;
|
|
||||||
value: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type Bento3DItem = {
|
|
||||||
icon: LucideIcon;
|
|
||||||
title: string;
|
|
||||||
subtitle: string;
|
|
||||||
detail: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
type BaseFeatureCard = {
|
|
||||||
title: string;
|
|
||||||
description: string;
|
|
||||||
button?: ButtonConfig;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type FeatureCard = BaseFeatureCard & (
|
|
||||||
| {
|
|
||||||
bentoComponent: "icon-info-cards";
|
|
||||||
items: BentoInfoItem[];
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
bentoComponent: "3d-stack-cards";
|
|
||||||
items: [Bento3DItem, Bento3DItem, Bento3DItem];
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
bentoComponent: "3d-task-list";
|
|
||||||
title: string;
|
|
||||||
items: TaskItem[];
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
bentoComponent: "orbiting-icons";
|
|
||||||
centerIcon: LucideIcon;
|
|
||||||
items: OrbitingItem[];
|
|
||||||
}
|
|
||||||
| ({
|
|
||||||
bentoComponent: "marquee";
|
|
||||||
centerIcon: LucideIcon;
|
|
||||||
} & (
|
|
||||||
| { variant: "text"; texts: string[] }
|
|
||||||
| { variant: "icon"; icons: LucideIcon[] }
|
|
||||||
))
|
|
||||||
| {
|
|
||||||
bentoComponent: "globe" | "animated-bar-chart" | "map" | "line-chart";
|
|
||||||
items?: never;
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
bentoComponent: "3d-card-grid";
|
|
||||||
items: [{ name: string; icon: LucideIcon }, { name: string; icon: LucideIcon }, { name: string; icon: LucideIcon }, { name: string; icon: LucideIcon }];
|
|
||||||
centerIcon: LucideIcon;
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
bentoComponent: "phone";
|
|
||||||
statusIcon: LucideIcon;
|
|
||||||
alertIcon: LucideIcon;
|
|
||||||
alertTitle: string;
|
|
||||||
alertMessage: string;
|
|
||||||
apps: PhoneApps8;
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
bentoComponent: "chat";
|
|
||||||
aiIcon: LucideIcon;
|
|
||||||
userIcon: LucideIcon;
|
|
||||||
exchanges: ChatExchange[];
|
|
||||||
placeholder: string;
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
bentoComponent: "reveal-icon";
|
|
||||||
icon: LucideIcon;
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
bentoComponent: "timeline";
|
|
||||||
heading: string;
|
|
||||||
subheading: string;
|
|
||||||
items: [TimelineItem, TimelineItem, TimelineItem];
|
|
||||||
completedLabel: string;
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
bentoComponent: "media-stack";
|
|
||||||
items: [MediaStackItem, MediaStackItem, MediaStackItem];
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
interface FeatureBentoProps {
|
|
||||||
features: FeatureCard[];
|
|
||||||
carouselMode?: "auto" | "buttons";
|
carouselMode?: "auto" | "buttons";
|
||||||
animationType: BentoAnimationType;
|
gridVariant?: string;
|
||||||
title: string;
|
uniformGridCustomHeightClasses?: string;
|
||||||
titleSegments?: TitleSegment[];
|
animationType?: BentoAnimationType;
|
||||||
description: string;
|
title?: string;
|
||||||
|
titleSegments?: Array<{ type: "text"; content: string } | { type: "image"; src: string; alt?: string }>;
|
||||||
|
description?: string;
|
||||||
tag?: string;
|
tag?: string;
|
||||||
tagIcon?: LucideIcon;
|
tagAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
|
||||||
tagAnimation?: ButtonAnimationType;
|
buttons?: Array<{ text: string; onClick?: () => void; href?: string }>;
|
||||||
buttons?: ButtonConfig[];
|
buttonAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
|
||||||
buttonAnimation?: ButtonAnimationType;
|
textboxLayout?: "default" | "split" | "split-actions" | "split-description" | "inline-image";
|
||||||
textboxLayout: TextboxLayout;
|
useInvertedBackground?: boolean;
|
||||||
useInvertedBackground: InvertedBackground;
|
|
||||||
ariaLabel?: string;
|
ariaLabel?: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
containerClassName?: string;
|
containerClassName?: string;
|
||||||
cardClassName?: string;
|
cardClassName?: string;
|
||||||
|
mediaClassName?: string;
|
||||||
textBoxTitleClassName?: string;
|
textBoxTitleClassName?: string;
|
||||||
textBoxTitleImageWrapperClassName?: string;
|
textBoxTitleImageWrapperClassName?: string;
|
||||||
textBoxTitleImageClassName?: string;
|
textBoxTitleImageClassName?: string;
|
||||||
textBoxDescriptionClassName?: string;
|
textBoxDescriptionClassName?: string;
|
||||||
cardTitleClassName?: string;
|
cardTitleClassName?: string;
|
||||||
cardDescriptionClassName?: string;
|
cardDescriptionClassName?: string;
|
||||||
cardButtonClassName?: string;
|
cardIconClassName?: string;
|
||||||
cardButtonTextClassName?: string;
|
cardIconWrapperClassName?: string;
|
||||||
gridClassName?: string;
|
gridClassName?: string;
|
||||||
carouselClassName?: string;
|
carouselClassName?: string;
|
||||||
controlsClassName?: string;
|
controlsClassName?: string;
|
||||||
@@ -151,150 +49,94 @@ interface FeatureBentoProps {
|
|||||||
textBoxButtonTextClassName?: string;
|
textBoxButtonTextClassName?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const FeatureBento = ({
|
const FeatureBento: React.FC<FeatureBentoProps> = ({
|
||||||
features,
|
features = [],
|
||||||
carouselMode = "buttons",
|
gridVariant = "uniform-all-items-equal", uniformGridCustomHeightClasses = "min-h-95 2xl:min-h-105", animationType = "slide-up", title,
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
titleSegments,
|
||||||
description,
|
description = "", tag,
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
tagAnimation,
|
||||||
buttons,
|
buttons,
|
||||||
buttonAnimation,
|
buttonAnimation,
|
||||||
textboxLayout,
|
textboxLayout = "default", useInvertedBackground = false,
|
||||||
useInvertedBackground,
|
ariaLabel = "Feature section", className = "", containerClassName = "", cardClassName = "", mediaClassName = "", textBoxTitleClassName = "", textBoxTitleImageWrapperClassName = "", textBoxTitleImageClassName = "", textBoxDescriptionClassName = "", cardTitleClassName = "", cardDescriptionClassName = "", cardIconClassName = "", cardIconWrapperClassName = "", gridClassName = "", carouselClassName = "", controlsClassName = "", textBoxClassName = "", textBoxTagClassName = "", textBoxButtonContainerClassName = "", textBoxButtonClassName = "", textBoxButtonTextClassName = ""}) => {
|
||||||
ariaLabel = "Feature section",
|
const cardItems = useMemo(
|
||||||
className = "",
|
() =>
|
||||||
containerClassName = "",
|
features.map((feature) => (
|
||||||
cardClassName = "",
|
|
||||||
textBoxTitleClassName = "",
|
|
||||||
textBoxTitleImageWrapperClassName = "",
|
|
||||||
textBoxTitleImageClassName = "",
|
|
||||||
textBoxDescriptionClassName = "",
|
|
||||||
cardTitleClassName = "",
|
|
||||||
cardDescriptionClassName = "",
|
|
||||||
cardButtonClassName = "",
|
|
||||||
cardButtonTextClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
carouselClassName = "",
|
|
||||||
controlsClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
}: FeatureBentoProps) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
|
|
||||||
|
|
||||||
const getBentoComponent = (feature: FeatureCard) => {
|
|
||||||
switch (feature.bentoComponent) {
|
|
||||||
case "globe":
|
|
||||||
return (
|
|
||||||
<div className="relative w-full h-full min-h-0" style={{
|
|
||||||
maskImage: "linear-gradient(to right, transparent 0%, black 20%, black 80%, transparent 100%), linear-gradient(to bottom, black 40%, transparent 100%)",
|
|
||||||
WebkitMaskImage: "linear-gradient(to right, transparent 0%, black 20%, black 80%, transparent 100%), linear-gradient(to bottom, black 40%, transparent 100%)",
|
|
||||||
maskComposite: "intersect",
|
|
||||||
WebkitMaskComposite: "source-in"
|
|
||||||
}}>
|
|
||||||
<BentoGlobe className="w-full scale-150 mt-[15%]" />
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
case "icon-info-cards":
|
|
||||||
return <BentoIconInfoCards items={feature.items} useInvertedBackground={useInvertedBackground} />;
|
|
||||||
case "animated-bar-chart":
|
|
||||||
return <BentoAnimatedBarChart />;
|
|
||||||
case "3d-stack-cards":
|
|
||||||
return <Bento3DStackCards cards={feature.items.map(item => ({ Icon: item.icon, title: item.title, subtitle: item.subtitle, detail: item.detail }))} useInvertedBackground={useInvertedBackground} />;
|
|
||||||
case "3d-task-list":
|
|
||||||
return <Bento3DTaskList title={feature.title} items={feature.items} useInvertedBackground={useInvertedBackground} />;
|
|
||||||
case "orbiting-icons":
|
|
||||||
return <BentoOrbitingIcons centerIcon={feature.centerIcon} items={feature.items} useInvertedBackground={useInvertedBackground} />;
|
|
||||||
case "marquee":
|
|
||||||
return feature.variant === "text"
|
|
||||||
? <BentoMarquee centerIcon={feature.centerIcon} variant="text" texts={feature.texts} useInvertedBackground={useInvertedBackground} />
|
|
||||||
: <BentoMarquee centerIcon={feature.centerIcon} variant="icon" icons={feature.icons} useInvertedBackground={useInvertedBackground} />;
|
|
||||||
case "map":
|
|
||||||
return <BentoMap useInvertedBackground={useInvertedBackground} />;
|
|
||||||
case "line-chart":
|
|
||||||
return <BentoLineChart useInvertedBackground={useInvertedBackground} />;
|
|
||||||
case "3d-card-grid":
|
|
||||||
return <Bento3DCardGrid items={feature.items} centerIcon={feature.centerIcon} useInvertedBackground={useInvertedBackground} />;
|
|
||||||
case "phone":
|
|
||||||
return <BentoPhoneAnimation statusIcon={feature.statusIcon} alertIcon={feature.alertIcon} alertTitle={feature.alertTitle} alertMessage={feature.alertMessage} apps={feature.apps} useInvertedBackground={useInvertedBackground} />;
|
|
||||||
case "chat":
|
|
||||||
return <BentoChatAnimation aiIcon={feature.aiIcon} userIcon={feature.userIcon} exchanges={feature.exchanges} placeholder={feature.placeholder} useInvertedBackground={useInvertedBackground} />;
|
|
||||||
case "reveal-icon":
|
|
||||||
return <BentoRevealIcon icon={feature.icon} useInvertedBackground={useInvertedBackground} />;
|
|
||||||
case "timeline":
|
|
||||||
return <BentoTimeline heading={feature.heading} subheading={feature.subheading} items={feature.items} completedLabel={feature.completedLabel} useInvertedBackground={useInvertedBackground} />;
|
|
||||||
case "media-stack":
|
|
||||||
return <BentoMediaStack items={feature.items} useInvertedBackground={useInvertedBackground} />;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<CardStack
|
|
||||||
mode={carouselMode}
|
|
||||||
gridVariant="uniform-all-items-equal"
|
|
||||||
uniformGridCustomHeightClasses="min-h-0"
|
|
||||||
animationType={animationType}
|
|
||||||
carouselThreshold={4}
|
|
||||||
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
className={className}
|
|
||||||
containerClassName={containerClassName}
|
|
||||||
gridClassName={gridClassName}
|
|
||||||
carouselClassName={carouselClassName}
|
|
||||||
carouselItemClassName="w-carousel-item-3 xl:w-carousel-item-3!"
|
|
||||||
controlsClassName={controlsClassName}
|
|
||||||
textBoxClassName={textBoxClassName}
|
|
||||||
titleClassName={textBoxTitleClassName}
|
|
||||||
titleImageWrapperClassName={textBoxTitleImageWrapperClassName}
|
|
||||||
titleImageClassName={textBoxTitleImageClassName}
|
|
||||||
descriptionClassName={textBoxDescriptionClassName}
|
|
||||||
tagClassName={textBoxTagClassName}
|
|
||||||
buttonContainerClassName={textBoxButtonContainerClassName}
|
|
||||||
buttonClassName={textBoxButtonClassName}
|
|
||||||
buttonTextClassName={textBoxButtonTextClassName}
|
|
||||||
ariaLabel={ariaLabel}
|
|
||||||
>
|
|
||||||
{features.map((feature, index) => (
|
|
||||||
<div
|
<div
|
||||||
key={`${feature.title}-${index}`}
|
key={feature.id}
|
||||||
className={cls("card flex flex-col gap-4 p-5 rounded-theme-capped min-h-0 h-full", cardClassName)}
|
className={`h-full flex flex-col gap-4 p-6 rounded-lg bg-card ${cardClassName}`}
|
||||||
>
|
>
|
||||||
<div className="relative w-full h-70 min-h-0 overflow-hidden">
|
{feature.icon && (
|
||||||
{getBentoComponent(feature)}
|
<div className={`flex items-center justify-center w-12 h-12 rounded-lg bg-primary-cta/10 ${cardIconWrapperClassName}`}>
|
||||||
</div>
|
<span className={`text-2xl ${cardIconClassName}`}>{feature.icon}</span>
|
||||||
<div className="relative z-1 flex flex-col gap-1">
|
</div>
|
||||||
<h3 className={cls("text-2xl font-medium leading-tight", shouldUseLightText && "text-background", cardTitleClassName)}>
|
)}
|
||||||
{feature.title}
|
<h3 className={`text-xl font-semibold text-foreground ${cardTitleClassName}`}>
|
||||||
</h3>
|
{feature.title}
|
||||||
<p className={cls("text-sm leading-tight", shouldUseLightText ? "text-background" : "text-foreground", cardDescriptionClassName)}>
|
</h3>
|
||||||
{feature.description}
|
<p className={`text-sm text-foreground/70 flex-1 ${cardDescriptionClassName}`}>
|
||||||
</p>
|
{feature.description}
|
||||||
</div>
|
</p>
|
||||||
{feature.button && (
|
{feature.mediaItems && (
|
||||||
<Button {...getButtonProps(feature.button, 0, theme.defaultButtonVariant, cls("w-full", cardButtonClassName), cardButtonTextClassName)} />
|
<div className={`flex gap-2 mt-auto ${mediaClassName}`}>
|
||||||
|
{feature.mediaItems.map((media, idx) => (
|
||||||
|
<img
|
||||||
|
key={idx}
|
||||||
|
src={media.src}
|
||||||
|
alt={media.alt || "Feature media"}
|
||||||
|
className="w-full h-20 object-cover rounded-lg"
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
))}
|
)),
|
||||||
</CardStack>
|
[features, cardClassName, cardIconWrapperClassName, cardIconClassName, cardTitleClassName, cardDescriptionClassName, mediaClassName]
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className={`w-full py-20 ${useInvertedBackground ? "bg-background/50" : ""} ${containerClassName}`}
|
||||||
|
aria-label={ariaLabel}
|
||||||
|
>
|
||||||
|
{title && (
|
||||||
|
<div className={`max-w-content-width mx-auto px-4 mb-12 ${textBoxClassName}`}>
|
||||||
|
<TextBox
|
||||||
|
title={title}
|
||||||
|
titleSegments={titleSegments}
|
||||||
|
description={description}
|
||||||
|
tag={tag}
|
||||||
|
tagAnimation={tagAnimation}
|
||||||
|
buttons={buttons}
|
||||||
|
buttonAnimation={buttonAnimation}
|
||||||
|
textboxLayout={textboxLayout}
|
||||||
|
titleClassName={textBoxTitleClassName}
|
||||||
|
descriptionClassName={textBoxDescriptionClassName}
|
||||||
|
tagClassName={textBoxTagClassName}
|
||||||
|
buttonContainerClassName={textBoxButtonContainerClassName}
|
||||||
|
buttonClassName={textBoxButtonClassName}
|
||||||
|
buttonTextClassName={textBoxButtonTextClassName}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<div className="max-w-content-width mx-auto px-4">
|
||||||
|
<CardStack
|
||||||
|
gridVariant={gridVariant}
|
||||||
|
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
||||||
|
animationType={animationType}
|
||||||
|
carouselMode="buttons"
|
||||||
|
ariaLabel={ariaLabel}
|
||||||
|
className={className}
|
||||||
|
gridClassName={gridClassName}
|
||||||
|
carouselClassName={carouselClassName}
|
||||||
|
controlsClassName={controlsClassName}
|
||||||
|
>
|
||||||
|
{cardItems.map((item) => item)}
|
||||||
|
</CardStack>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
FeatureBento.displayName = "FeatureBento";
|
export default FeatureBento;
|
||||||
|
|
||||||
export default FeatureBento;
|
|
||||||
@@ -1,261 +1,141 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { memo } from "react";
|
import React, { useMemo } from "react";
|
||||||
import CardStack from "@/components/cardStack/CardStack";
|
import CardStack from "@/components/card/CardStack";
|
||||||
import MediaContent from "@/components/shared/MediaContent";
|
import TextBox from "@/components/Textbox";
|
||||||
import Tag from "@/components/shared/Tag";
|
import type { CardAnimationType } from "@/types/animations";
|
||||||
import Button from "@/components/button/Button";
|
|
||||||
import { cls, shouldUseInvertedText } from "@/lib/utils";
|
|
||||||
import { getButtonProps } from "@/lib/buttonUtils";
|
|
||||||
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type { ButtonConfig, CardAnimationType, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
|
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
|
||||||
|
|
||||||
type FeatureCard = {
|
export interface FeatureCardMediaProps {
|
||||||
|
features?: Array<{
|
||||||
id: string;
|
id: string;
|
||||||
title: string;
|
title: string;
|
||||||
description: string;
|
description: string;
|
||||||
tag: string;
|
icon?: React.ReactNode;
|
||||||
imageSrc?: string;
|
mediaItems?: Array<{ type: string; src: string; alt?: string }>;
|
||||||
videoSrc?: string;
|
}>;
|
||||||
imageAlt?: string;
|
gridVariant?: string;
|
||||||
videoAriaLabel?: string;
|
uniformGridCustomHeightClasses?: string;
|
||||||
buttons?: ButtonConfig[];
|
animationType?: CardAnimationType;
|
||||||
onCardClick?: () => void;
|
title?: string;
|
||||||
};
|
titleSegments?: Array<{ type: "text"; content: string } | { type: "image"; src: string; alt?: string }>;
|
||||||
|
description?: string;
|
||||||
interface FeatureCardMediaProps {
|
tag?: string;
|
||||||
features: FeatureCard[];
|
tagAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
|
||||||
carouselMode?: "auto" | "buttons";
|
buttons?: Array<{ text: string; onClick?: () => void; href?: string }>;
|
||||||
uniformGridCustomHeightClasses?: string;
|
buttonAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
|
||||||
animationType: CardAnimationType;
|
textboxLayout?: "default" | "split" | "split-actions" | "split-description" | "inline-image";
|
||||||
title: string;
|
useInvertedBackground?: boolean;
|
||||||
titleSegments?: TitleSegment[];
|
ariaLabel?: string;
|
||||||
description: string;
|
className?: string;
|
||||||
tag?: string;
|
containerClassName?: string;
|
||||||
tagIcon?: LucideIcon;
|
cardClassName?: string;
|
||||||
tagAnimation?: ButtonAnimationType;
|
mediaClassName?: string;
|
||||||
buttons?: ButtonConfig[];
|
textBoxTitleClassName?: string;
|
||||||
buttonAnimation?: ButtonAnimationType;
|
textBoxTitleImageWrapperClassName?: string;
|
||||||
textboxLayout: TextboxLayout;
|
textBoxTitleImageClassName?: string;
|
||||||
useInvertedBackground: InvertedBackground;
|
textBoxDescriptionClassName?: string;
|
||||||
ariaLabel?: string;
|
cardTitleClassName?: string;
|
||||||
className?: string;
|
cardDescriptionClassName?: string;
|
||||||
containerClassName?: string;
|
cardIconClassName?: string;
|
||||||
itemClassName?: string;
|
cardIconWrapperClassName?: string;
|
||||||
mediaWrapperClassName?: string;
|
gridClassName?: string;
|
||||||
mediaClassName?: string;
|
carouselClassName?: string;
|
||||||
tagClassName?: string;
|
controlsClassName?: string;
|
||||||
contentClassName?: string;
|
textBoxClassName?: string;
|
||||||
cardTitleClassName?: string;
|
textBoxTagClassName?: string;
|
||||||
cardDescriptionClassName?: string;
|
textBoxButtonContainerClassName?: string;
|
||||||
cardButtonContainerClassName?: string;
|
textBoxButtonClassName?: string;
|
||||||
cardButtonClassName?: string;
|
buttonTextClassName?: string;
|
||||||
cardButtonTextClassName?: string;
|
|
||||||
textBoxTitleClassName?: string;
|
|
||||||
textBoxTitleImageWrapperClassName?: string;
|
|
||||||
textBoxTitleImageClassName?: string;
|
|
||||||
textBoxDescriptionClassName?: string;
|
|
||||||
gridClassName?: string;
|
|
||||||
carouselClassName?: string;
|
|
||||||
controlsClassName?: string;
|
|
||||||
textBoxClassName?: string;
|
|
||||||
textBoxTagClassName?: string;
|
|
||||||
textBoxButtonContainerClassName?: string;
|
|
||||||
textBoxButtonClassName?: string;
|
|
||||||
textBoxButtonTextClassName?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface FeatureCardItemProps {
|
const FeatureCardMedia: React.FC<FeatureCardMediaProps> = ({
|
||||||
feature: FeatureCard;
|
features = [],
|
||||||
shouldUseLightText: boolean;
|
gridVariant = "uniform-all-items-equal", uniformGridCustomHeightClasses = "min-h-95 2xl:min-h-105", animationType = "slide-up", title,
|
||||||
useInvertedBackground: InvertedBackground;
|
titleSegments,
|
||||||
itemClassName?: string;
|
description = "", tag,
|
||||||
mediaWrapperClassName?: string;
|
tagAnimation,
|
||||||
mediaClassName?: string;
|
buttons,
|
||||||
tagClassName?: string;
|
buttonAnimation,
|
||||||
contentClassName?: string;
|
textboxLayout = "default", useInvertedBackground = false,
|
||||||
cardTitleClassName?: string;
|
ariaLabel = "Feature section", className = "", containerClassName = "", cardClassName = "", mediaClassName = "", textBoxTitleClassName = "", textBoxTitleImageWrapperClassName = "", textBoxTitleImageClassName = "", textBoxDescriptionClassName = "", cardTitleClassName = "", cardDescriptionClassName = "", cardIconClassName = "", cardIconWrapperClassName = "", gridClassName = "", carouselClassName = "", controlsClassName = "", textBoxClassName = "", textBoxTagClassName = "", textBoxButtonContainerClassName = "", textBoxButtonClassName = "", buttonTextClassName = ""}) => {
|
||||||
cardDescriptionClassName?: string;
|
const cardItems = useMemo(
|
||||||
cardButtonContainerClassName?: string;
|
() =>
|
||||||
cardButtonClassName?: string;
|
features.map((feature) => (
|
||||||
cardButtonTextClassName?: string;
|
<div
|
||||||
}
|
key={feature.id}
|
||||||
|
className={`h-full flex flex-col gap-4 p-6 rounded-lg bg-card ${cardClassName}`}
|
||||||
const FeatureCardItem = memo(({
|
|
||||||
feature,
|
|
||||||
shouldUseLightText,
|
|
||||||
useInvertedBackground,
|
|
||||||
itemClassName = "",
|
|
||||||
mediaWrapperClassName = "",
|
|
||||||
mediaClassName = "",
|
|
||||||
tagClassName = "",
|
|
||||||
contentClassName = "",
|
|
||||||
cardTitleClassName = "",
|
|
||||||
cardDescriptionClassName = "",
|
|
||||||
cardButtonContainerClassName = "",
|
|
||||||
cardButtonClassName = "",
|
|
||||||
cardButtonTextClassName = "",
|
|
||||||
}: FeatureCardItemProps) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
|
|
||||||
return (
|
|
||||||
<article
|
|
||||||
className={cls("relative h-full flex flex-col gap-6 cursor-pointer group", itemClassName)}
|
|
||||||
onClick={feature.onCardClick}
|
|
||||||
role="article"
|
|
||||||
aria-label={feature.title}
|
|
||||||
>
|
>
|
||||||
<div className={cls("relative w-full aspect-square overflow-hidden rounded-theme-capped", mediaWrapperClassName)}>
|
{feature.icon && (
|
||||||
<MediaContent
|
<div className={`flex items-center justify-center w-12 h-12 rounded-lg bg-primary-cta/10 ${cardIconWrapperClassName}`}>
|
||||||
imageSrc={feature.imageSrc}
|
<span className={`text-2xl ${cardIconClassName}`}>{feature.icon}</span>
|
||||||
videoSrc={feature.videoSrc}
|
</div>
|
||||||
imageAlt={feature.imageAlt || feature.title}
|
)}
|
||||||
videoAriaLabel={feature.videoAriaLabel || feature.title}
|
<h3 className={`text-xl font-semibold text-foreground ${cardTitleClassName}`}>
|
||||||
imageClassName={cls("w-full h-full object-cover transition-transform duration-500 ease-in-out group-hover:scale-105", mediaClassName)}
|
{feature.title}
|
||||||
|
</h3>
|
||||||
|
<p className={`text-sm text-foreground/70 flex-1 ${cardDescriptionClassName}`}>
|
||||||
|
{feature.description}
|
||||||
|
</p>
|
||||||
|
{feature.mediaItems && (
|
||||||
|
<div className={`flex gap-2 mt-auto ${mediaClassName}`}>
|
||||||
|
{feature.mediaItems.map((media, idx) => (
|
||||||
|
<img
|
||||||
|
key={idx}
|
||||||
|
src={media.src}
|
||||||
|
alt={media.alt || "Feature media"}
|
||||||
|
className="w-full h-20 object-cover rounded-lg"
|
||||||
/>
|
/>
|
||||||
<div className="absolute top-4 right-4">
|
))}
|
||||||
<Tag
|
|
||||||
text={feature.tag}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
className={tagClassName}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)),
|
||||||
|
[features, cardClassName, cardIconWrapperClassName, cardIconClassName, cardTitleClassName, cardDescriptionClassName, mediaClassName]
|
||||||
|
);
|
||||||
|
|
||||||
<div className={cls("relative z-1 card rounded-theme-capped p-6 flex flex-col gap-2 flex-1", contentClassName)}>
|
return (
|
||||||
<h3 className={cls(
|
<div
|
||||||
"text-xl md:text-2xl font-medium leading-tight",
|
className={`w-full py-20 ${useInvertedBackground ? "bg-background/50" : ""} ${containerClassName}`}
|
||||||
shouldUseLightText ? "text-background" : "text-foreground",
|
aria-label={ariaLabel}
|
||||||
cardTitleClassName
|
>
|
||||||
)}>
|
{title && (
|
||||||
{feature.title}
|
<div className={`max-w-content-width mx-auto px-4 mb-12 ${textBoxClassName}`}>
|
||||||
</h3>
|
<TextBox
|
||||||
|
|
||||||
<p className={cls(
|
|
||||||
"text-base leading-tight",
|
|
||||||
shouldUseLightText ? "text-background/75" : "text-foreground/75",
|
|
||||||
cardDescriptionClassName
|
|
||||||
)}>
|
|
||||||
{feature.description}
|
|
||||||
</p>
|
|
||||||
|
|
||||||
{feature.buttons && feature.buttons.length > 0 && (
|
|
||||||
<div className={cls("flex flex-wrap gap-4 max-md:justify-center mt-2", cardButtonContainerClassName)}>
|
|
||||||
{feature.buttons.slice(0, 2).map((button, index) => (
|
|
||||||
<Button
|
|
||||||
key={`${button.text}-${index}`}
|
|
||||||
{...getButtonProps(button, index, theme.defaultButtonVariant, cardButtonClassName, cardButtonTextClassName)}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
FeatureCardItem.displayName = "FeatureCardItem";
|
|
||||||
|
|
||||||
const FeatureCardMedia = ({
|
|
||||||
features,
|
|
||||||
carouselMode = "buttons",
|
|
||||||
uniformGridCustomHeightClasses,
|
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
textboxLayout,
|
|
||||||
useInvertedBackground,
|
|
||||||
ariaLabel = "Features section",
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
itemClassName = "",
|
|
||||||
mediaWrapperClassName = "",
|
|
||||||
mediaClassName = "",
|
|
||||||
tagClassName = "",
|
|
||||||
contentClassName = "",
|
|
||||||
cardTitleClassName = "",
|
|
||||||
cardDescriptionClassName = "",
|
|
||||||
cardButtonContainerClassName = "",
|
|
||||||
cardButtonClassName = "",
|
|
||||||
cardButtonTextClassName = "",
|
|
||||||
textBoxTitleClassName = "",
|
|
||||||
textBoxTitleImageWrapperClassName = "",
|
|
||||||
textBoxTitleImageClassName = "",
|
|
||||||
textBoxDescriptionClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
carouselClassName = "",
|
|
||||||
controlsClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
}: FeatureCardMediaProps) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<CardStack
|
|
||||||
mode={carouselMode}
|
|
||||||
gridVariant="uniform-all-items-equal"
|
|
||||||
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
|
||||||
animationType={animationType}
|
|
||||||
title={title}
|
title={title}
|
||||||
titleSegments={titleSegments}
|
titleSegments={titleSegments}
|
||||||
description={description}
|
description={description}
|
||||||
tag={tag}
|
tag={tag}
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
tagAnimation={tagAnimation}
|
||||||
buttons={buttons}
|
buttons={buttons}
|
||||||
buttonAnimation={buttonAnimation}
|
buttonAnimation={buttonAnimation}
|
||||||
textboxLayout={textboxLayout}
|
textboxLayout={textboxLayout}
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
ariaLabel={ariaLabel}
|
|
||||||
className={className}
|
|
||||||
containerClassName={containerClassName}
|
|
||||||
gridClassName={gridClassName}
|
|
||||||
carouselClassName={carouselClassName}
|
|
||||||
controlsClassName={controlsClassName}
|
|
||||||
textBoxClassName={textBoxClassName}
|
|
||||||
titleClassName={textBoxTitleClassName}
|
titleClassName={textBoxTitleClassName}
|
||||||
titleImageWrapperClassName={textBoxTitleImageWrapperClassName}
|
|
||||||
titleImageClassName={textBoxTitleImageClassName}
|
|
||||||
descriptionClassName={textBoxDescriptionClassName}
|
descriptionClassName={textBoxDescriptionClassName}
|
||||||
tagClassName={textBoxTagClassName}
|
tagClassName={textBoxTagClassName}
|
||||||
buttonContainerClassName={textBoxButtonContainerClassName}
|
buttonContainerClassName={textBoxButtonContainerClassName}
|
||||||
buttonClassName={textBoxButtonClassName}
|
buttonClassName={textBoxButtonClassName}
|
||||||
buttonTextClassName={textBoxButtonTextClassName}
|
buttonTextClassName={buttonTextClassName}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<div className="max-w-content-width mx-auto px-4">
|
||||||
|
<CardStack
|
||||||
|
gridVariant={gridVariant}
|
||||||
|
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
||||||
|
animationType={animationType}
|
||||||
|
carouselMode="buttons"
|
||||||
|
ariaLabel={ariaLabel}
|
||||||
|
className={className}
|
||||||
|
gridClassName={gridClassName}
|
||||||
|
carouselClassName={carouselClassName}
|
||||||
|
controlsClassName={controlsClassName}
|
||||||
>
|
>
|
||||||
{features.map((feature) => (
|
{cardItems.map((item) => item)}
|
||||||
<FeatureCardItem
|
|
||||||
key={feature.id}
|
|
||||||
feature={feature}
|
|
||||||
shouldUseLightText={shouldUseLightText}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
itemClassName={itemClassName}
|
|
||||||
mediaWrapperClassName={mediaWrapperClassName}
|
|
||||||
mediaClassName={mediaClassName}
|
|
||||||
tagClassName={tagClassName}
|
|
||||||
contentClassName={contentClassName}
|
|
||||||
cardTitleClassName={cardTitleClassName}
|
|
||||||
cardDescriptionClassName={cardDescriptionClassName}
|
|
||||||
cardButtonContainerClassName={cardButtonContainerClassName}
|
|
||||||
cardButtonClassName={cardButtonClassName}
|
|
||||||
cardButtonTextClassName={cardButtonTextClassName}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</CardStack>
|
</CardStack>
|
||||||
);
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
FeatureCardMedia.displayName = "FeatureCardMedia";
|
export default FeatureCardMedia;
|
||||||
|
|
||||||
export default FeatureCardMedia;
|
|
||||||
@@ -1,51 +1,31 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import CardStack from "@/components/cardStack/CardStack";
|
import React, { useMemo } from "react";
|
||||||
import MediaContent from "@/components/shared/MediaContent";
|
import CardStack from "@/components/card/CardStack";
|
||||||
import Button from "@/components/button/Button";
|
import TextBox from "@/components/Textbox";
|
||||||
import { cls, shouldUseInvertedText } from "@/lib/utils";
|
import type { CardAnimationTypeWith3D } from "@/types/animations";
|
||||||
import { getButtonProps } from "@/lib/buttonUtils";
|
import type { GridVariant } from "@/types/grid";
|
||||||
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type { ButtonConfig, GridVariant, CardAnimationTypeWith3D, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
|
|
||||||
|
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
export interface FeatureCardOneProps {
|
||||||
|
features?: Array<{
|
||||||
type FeatureCard = {
|
id: string;
|
||||||
title: string;
|
title: string;
|
||||||
description: string;
|
description: string;
|
||||||
button?: ButtonConfig;
|
icon?: React.ReactNode;
|
||||||
} & (
|
mediaItems?: Array<{ type: string; src: string; alt?: string }>;
|
||||||
| {
|
}>;
|
||||||
imageSrc: string;
|
gridVariant?: GridVariant;
|
||||||
imageAlt?: string;
|
|
||||||
videoSrc?: never;
|
|
||||||
videoAriaLabel?: never;
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
videoSrc: string;
|
|
||||||
videoAriaLabel?: string;
|
|
||||||
imageSrc?: never;
|
|
||||||
imageAlt?: never;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
interface FeatureCardOneProps {
|
|
||||||
features: FeatureCard[];
|
|
||||||
carouselMode?: "auto" | "buttons";
|
|
||||||
gridVariant: GridVariant;
|
|
||||||
uniformGridCustomHeightClasses?: string;
|
uniformGridCustomHeightClasses?: string;
|
||||||
animationType: CardAnimationTypeWith3D;
|
animationType?: CardAnimationTypeWith3D;
|
||||||
title: string;
|
title?: string;
|
||||||
titleSegments?: TitleSegment[];
|
titleSegments?: Array<{ type: "text"; content: string } | { type: "image"; src: string; alt?: string }>;
|
||||||
description: string;
|
description?: string;
|
||||||
tag?: string;
|
tag?: string;
|
||||||
tagIcon?: LucideIcon;
|
tagAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
|
||||||
tagAnimation?: ButtonAnimationType;
|
buttons?: Array<{ text: string; onClick?: () => void; href?: string }>;
|
||||||
buttons?: ButtonConfig[];
|
buttonAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
|
||||||
buttonAnimation?: ButtonAnimationType;
|
textboxLayout?: "default" | "split" | "split-actions" | "split-description" | "inline-image";
|
||||||
textboxLayout: TextboxLayout;
|
useInvertedBackground?: boolean;
|
||||||
useInvertedBackground: InvertedBackground;
|
|
||||||
ariaLabel?: string;
|
ariaLabel?: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
containerClassName?: string;
|
containerClassName?: string;
|
||||||
@@ -57,8 +37,8 @@ interface FeatureCardOneProps {
|
|||||||
textBoxDescriptionClassName?: string;
|
textBoxDescriptionClassName?: string;
|
||||||
cardTitleClassName?: string;
|
cardTitleClassName?: string;
|
||||||
cardDescriptionClassName?: string;
|
cardDescriptionClassName?: string;
|
||||||
cardButtonClassName?: string;
|
cardIconClassName?: string;
|
||||||
cardButtonTextClassName?: string;
|
cardIconWrapperClassName?: string;
|
||||||
gridClassName?: string;
|
gridClassName?: string;
|
||||||
carouselClassName?: string;
|
carouselClassName?: string;
|
||||||
controlsClassName?: string;
|
controlsClassName?: string;
|
||||||
@@ -69,128 +49,94 @@ interface FeatureCardOneProps {
|
|||||||
textBoxButtonTextClassName?: string;
|
textBoxButtonTextClassName?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const FeatureCardOne = ({
|
const FeatureCardOne: React.FC<FeatureCardOneProps> = ({
|
||||||
features,
|
features = [],
|
||||||
carouselMode = "buttons",
|
gridVariant = "uniform-all-items-equal", uniformGridCustomHeightClasses = "min-h-95 2xl:min-h-105", animationType = "slide-up", title,
|
||||||
gridVariant,
|
|
||||||
uniformGridCustomHeightClasses,
|
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
titleSegments,
|
||||||
description,
|
description = "", tag,
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
tagAnimation,
|
||||||
buttons,
|
buttons,
|
||||||
buttonAnimation,
|
buttonAnimation,
|
||||||
textboxLayout,
|
textboxLayout = "default", useInvertedBackground = false,
|
||||||
useInvertedBackground,
|
ariaLabel = "Feature section", className = "", containerClassName = "", cardClassName = "", mediaClassName = "", textBoxTitleClassName = "", textBoxTitleImageWrapperClassName = "", textBoxTitleImageClassName = "", textBoxDescriptionClassName = "", cardTitleClassName = "", cardDescriptionClassName = "", cardIconClassName = "", cardIconWrapperClassName = "", gridClassName = "", carouselClassName = "", controlsClassName = "", textBoxClassName = "", textBoxTagClassName = "", textBoxButtonContainerClassName = "", textBoxButtonClassName = "", textBoxButtonTextClassName = ""}) => {
|
||||||
ariaLabel = "Feature section",
|
const cardItems = useMemo(
|
||||||
className = "",
|
() =>
|
||||||
containerClassName = "",
|
features.map((feature) => (
|
||||||
cardClassName = "",
|
|
||||||
mediaClassName = "",
|
|
||||||
textBoxTitleClassName = "",
|
|
||||||
textBoxTitleImageWrapperClassName = "",
|
|
||||||
textBoxTitleImageClassName = "",
|
|
||||||
textBoxDescriptionClassName = "",
|
|
||||||
cardTitleClassName = "",
|
|
||||||
cardDescriptionClassName = "",
|
|
||||||
cardButtonClassName = "",
|
|
||||||
cardButtonTextClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
carouselClassName = "",
|
|
||||||
controlsClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
}: FeatureCardOneProps) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
|
|
||||||
|
|
||||||
const getButtonConfigProps = () => {
|
|
||||||
if (theme.defaultButtonVariant === "hover-bubble") {
|
|
||||||
return { bgClassName: "w-full" };
|
|
||||||
}
|
|
||||||
if (theme.defaultButtonVariant === "icon-arrow") {
|
|
||||||
return { className: "justify-between" };
|
|
||||||
}
|
|
||||||
return {};
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<CardStack
|
|
||||||
mode={carouselMode}
|
|
||||||
gridVariant={gridVariant}
|
|
||||||
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
|
||||||
animationType={animationType}
|
|
||||||
supports3DAnimation={true}
|
|
||||||
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
className={className}
|
|
||||||
containerClassName={containerClassName}
|
|
||||||
gridClassName={gridClassName}
|
|
||||||
carouselClassName={carouselClassName}
|
|
||||||
controlsClassName={controlsClassName}
|
|
||||||
textBoxClassName={textBoxClassName}
|
|
||||||
titleClassName={textBoxTitleClassName}
|
|
||||||
titleImageWrapperClassName={textBoxTitleImageWrapperClassName}
|
|
||||||
titleImageClassName={textBoxTitleImageClassName}
|
|
||||||
descriptionClassName={textBoxDescriptionClassName}
|
|
||||||
tagClassName={textBoxTagClassName}
|
|
||||||
buttonContainerClassName={textBoxButtonContainerClassName}
|
|
||||||
buttonClassName={textBoxButtonClassName}
|
|
||||||
buttonTextClassName={textBoxButtonTextClassName}
|
|
||||||
ariaLabel={ariaLabel}
|
|
||||||
>
|
|
||||||
{features.map((feature, index) => (
|
|
||||||
<div
|
<div
|
||||||
key={`${feature.title}-${index}`}
|
key={feature.id}
|
||||||
className={cls("card flex flex-col gap-4 p-4 rounded-theme-capped min-h-0 h-full", cardClassName)}
|
className={`h-full flex flex-col gap-4 p-6 rounded-lg bg-card ${cardClassName}`}
|
||||||
>
|
>
|
||||||
<MediaContent
|
{feature.icon && (
|
||||||
imageSrc={feature.imageSrc}
|
<div className={`flex items-center justify-center w-12 h-12 rounded-lg bg-primary-cta/10 ${cardIconWrapperClassName}`}>
|
||||||
videoSrc={feature.videoSrc}
|
<span className={`text-2xl ${cardIconClassName}`}>{feature.icon}</span>
|
||||||
imageAlt={feature.imageAlt || "Feature image"}
|
</div>
|
||||||
videoAriaLabel={feature.videoAriaLabel || "Feature video"}
|
)}
|
||||||
imageClassName={cls("relative z-1 min-h-0 h-full", mediaClassName)}
|
<h3 className={`text-xl font-semibold text-foreground ${cardTitleClassName}`}>
|
||||||
/>
|
{feature.title}
|
||||||
<div className="relative z-1 flex flex-col gap-1">
|
</h3>
|
||||||
<h3 className={cls("text-2xl font-medium leading-tight", shouldUseLightText && "text-background", cardTitleClassName)}>
|
<p className={`text-sm text-foreground/70 flex-1 ${cardDescriptionClassName}`}>
|
||||||
{feature.title}
|
{feature.description}
|
||||||
</h3>
|
</p>
|
||||||
<p className={cls("text-sm leading-tight", shouldUseLightText ? "text-background" : "text-foreground", cardDescriptionClassName)}>
|
{feature.mediaItems && (
|
||||||
{feature.description}
|
<div className={`flex gap-2 mt-auto ${mediaClassName}`}>
|
||||||
</p>
|
{feature.mediaItems.map((media, idx) => (
|
||||||
</div>
|
<img
|
||||||
{feature.button && (
|
key={idx}
|
||||||
<Button
|
src={media.src}
|
||||||
{...getButtonProps(
|
alt={media.alt || "Feature media"}
|
||||||
{ ...feature.button, props: { ...feature.button.props, ...getButtonConfigProps() } },
|
className="w-full h-20 object-cover rounded-lg"
|
||||||
0,
|
/>
|
||||||
theme.defaultButtonVariant,
|
))}
|
||||||
cls("w-full", cardButtonClassName),
|
</div>
|
||||||
cardButtonTextClassName
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
))}
|
)),
|
||||||
</CardStack>
|
[features, cardClassName, cardIconWrapperClassName, cardIconClassName, cardTitleClassName, cardDescriptionClassName, mediaClassName]
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className={`w-full py-20 ${useInvertedBackground ? "bg-background/50" : ""} ${containerClassName}`}
|
||||||
|
aria-label={ariaLabel}
|
||||||
|
>
|
||||||
|
{title && (
|
||||||
|
<div className={`max-w-content-width mx-auto px-4 mb-12 ${textBoxClassName}`}>
|
||||||
|
<TextBox
|
||||||
|
title={title}
|
||||||
|
titleSegments={titleSegments}
|
||||||
|
description={description}
|
||||||
|
tag={tag}
|
||||||
|
tagAnimation={tagAnimation}
|
||||||
|
buttons={buttons}
|
||||||
|
buttonAnimation={buttonAnimation}
|
||||||
|
textboxLayout={textboxLayout}
|
||||||
|
titleClassName={textBoxTitleClassName}
|
||||||
|
descriptionClassName={textBoxDescriptionClassName}
|
||||||
|
tagClassName={textBoxTagClassName}
|
||||||
|
buttonContainerClassName={textBoxButtonContainerClassName}
|
||||||
|
buttonClassName={textBoxButtonClassName}
|
||||||
|
buttonTextClassName={textBoxButtonTextClassName}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<div className="max-w-content-width mx-auto px-4">
|
||||||
|
<CardStack
|
||||||
|
gridVariant={gridVariant}
|
||||||
|
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
||||||
|
animationType={animationType}
|
||||||
|
carouselMode="buttons"
|
||||||
|
ariaLabel={ariaLabel}
|
||||||
|
className={className}
|
||||||
|
gridClassName={gridClassName}
|
||||||
|
carouselClassName={carouselClassName}
|
||||||
|
controlsClassName={controlsClassName}
|
||||||
|
>
|
||||||
|
{cardItems.map((item) => item)}
|
||||||
|
</CardStack>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
FeatureCardOne.displayName = "FeatureCardOne";
|
export default FeatureCardOne;
|
||||||
|
|
||||||
export default FeatureCardOne;
|
|
||||||
@@ -1,179 +1,94 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import CardList from "@/components/cardStack/CardList";
|
import React, { useMemo } from "react";
|
||||||
import MediaContent from "@/components/shared/MediaContent";
|
import CardList from "@/components/card/CardList";
|
||||||
import Button from "@/components/button/Button";
|
import TextBox from "@/components/Textbox";
|
||||||
import { cls, shouldUseInvertedText } from "@/lib/utils";
|
import type { ButtonAnimationType } from "@/types/animations";
|
||||||
import { getButtonProps } from "@/lib/buttonUtils";
|
|
||||||
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
import type { LucideIcon } from "lucide-react";
|
||||||
import type { ButtonConfig, ButtonAnimationType, CardAnimationType, TitleSegment } from "@/components/cardStack/types";
|
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
|
||||||
|
|
||||||
type FeatureCard = {
|
export interface FeatureCardSevenProps {
|
||||||
id: number;
|
features?: Array<{
|
||||||
|
id: string;
|
||||||
title: string;
|
title: string;
|
||||||
description: string;
|
description: string;
|
||||||
buttons?: ButtonConfig[];
|
icon?: React.ReactNode;
|
||||||
imageSrc?: string;
|
}>;
|
||||||
videoSrc?: string;
|
animationType?: ButtonAnimationType;
|
||||||
imageAlt?: string;
|
textboxLayout?: "default" | "split" | "split-actions" | "split-description" | "inline-image";
|
||||||
videoAriaLabel?: string;
|
description?: string;
|
||||||
};
|
tag?: string;
|
||||||
|
tagIcon?: LucideIcon;
|
||||||
interface FeatureCardSevenProps {
|
tagAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
|
||||||
features: FeatureCard[];
|
buttons?: Array<{ text: string; onClick?: () => void; href?: string }>;
|
||||||
animationType: CardAnimationType;
|
buttonAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
|
||||||
title: string;
|
useInvertedBackground?: boolean;
|
||||||
titleSegments?: TitleSegment[];
|
ariaLabel?: string;
|
||||||
description: string;
|
className?: string;
|
||||||
tag?: string;
|
containerClassName?: string;
|
||||||
tagIcon?: LucideIcon;
|
cardClassName?: string;
|
||||||
tagAnimation?: ButtonAnimationType;
|
textBoxTitleClassName?: string;
|
||||||
buttons?: ButtonConfig[];
|
textBoxDescriptionClassName?: string;
|
||||||
buttonAnimation?: ButtonAnimationType;
|
cardTitleClassName?: string;
|
||||||
textboxLayout: TextboxLayout;
|
cardDescriptionClassName?: string;
|
||||||
useInvertedBackground: InvertedBackground;
|
cardIconClassName?: string;
|
||||||
ariaLabel?: string;
|
cardIconWrapperClassName?: string;
|
||||||
className?: string;
|
listClassName?: string;
|
||||||
containerClassName?: string;
|
itemClassName?: string;
|
||||||
cardClassName?: string;
|
textBoxClassName?: string;
|
||||||
textBoxTitleClassName?: string;
|
textBoxTagClassName?: string;
|
||||||
textBoxDescriptionClassName?: string;
|
textBoxButtonContainerClassName?: string;
|
||||||
textBoxClassName?: string;
|
textBoxButtonClassName?: string;
|
||||||
textBoxTagClassName?: string;
|
textBoxButtonTextClassName?: string;
|
||||||
textBoxButtonContainerClassName?: string;
|
|
||||||
textBoxButtonClassName?: string;
|
|
||||||
textBoxButtonTextClassName?: string;
|
|
||||||
titleImageWrapperClassName?: string;
|
|
||||||
titleImageClassName?: string;
|
|
||||||
cardContentClassName?: string;
|
|
||||||
stepNumberClassName?: string;
|
|
||||||
cardTitleClassName?: string;
|
|
||||||
cardDescriptionClassName?: string;
|
|
||||||
imageContainerClassName?: string;
|
|
||||||
imageClassName?: string;
|
|
||||||
cardButtonClassName?: string;
|
|
||||||
cardButtonTextClassName?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const FeatureCardSeven = ({
|
const FeatureCardSeven: React.FC<FeatureCardSevenProps> = ({
|
||||||
features,
|
features = [],
|
||||||
animationType,
|
animationType = "slide-up", textboxLayout = "default", description = "", tag,
|
||||||
title,
|
tagIcon,
|
||||||
titleSegments,
|
tagAnimation,
|
||||||
description,
|
buttons,
|
||||||
tag,
|
buttonAnimation,
|
||||||
tagIcon,
|
useInvertedBackground = false,
|
||||||
tagAnimation,
|
ariaLabel = "Feature section", className = "", containerClassName = "", cardClassName = "", textBoxTitleClassName = "", textBoxDescriptionClassName = "", cardTitleClassName = "", cardDescriptionClassName = "", cardIconClassName = "", cardIconWrapperClassName = "", listClassName = "", itemClassName = "", textBoxClassName = "", textBoxTagClassName = "", textBoxButtonContainerClassName = "", textBoxButtonClassName = "", textBoxButtonTextClassName = ""}) => {
|
||||||
buttons,
|
const listItems = useMemo(
|
||||||
buttonAnimation,
|
() =>
|
||||||
textboxLayout,
|
features.map((feature) => (
|
||||||
useInvertedBackground,
|
<div key={feature.id} className={`flex gap-4 p-4 rounded-lg bg-card/50 ${itemClassName}`}>
|
||||||
ariaLabel = "Feature section",
|
{feature.icon && (
|
||||||
className = "",
|
<div className={`flex-shrink-0 flex items-center justify-center w-10 h-10 rounded-lg bg-primary-cta/10 ${cardIconWrapperClassName}`}>
|
||||||
containerClassName = "",
|
<span className={`text-lg ${cardIconClassName}`}>{feature.icon}</span>
|
||||||
cardClassName = "",
|
</div>
|
||||||
textBoxTitleClassName = "",
|
)}
|
||||||
textBoxDescriptionClassName = "",
|
<div className="flex-1 min-w-0">
|
||||||
textBoxClassName = "",
|
<h3 className={`text-sm font-semibold text-foreground ${cardTitleClassName}`}>
|
||||||
textBoxTagClassName = "",
|
{feature.title}
|
||||||
textBoxButtonContainerClassName = "",
|
</h3>
|
||||||
textBoxButtonClassName = "",
|
<p className={`text-xs text-foreground/70 ${cardDescriptionClassName}`}>
|
||||||
textBoxButtonTextClassName = "",
|
{feature.description}
|
||||||
titleImageWrapperClassName = "",
|
</p>
|
||||||
titleImageClassName = "",
|
</div>
|
||||||
cardContentClassName = "",
|
</div>
|
||||||
stepNumberClassName = "",
|
)),
|
||||||
cardTitleClassName = "",
|
[features, itemClassName, cardIconWrapperClassName, cardIconClassName, cardTitleClassName, cardDescriptionClassName]
|
||||||
cardDescriptionClassName = "",
|
);
|
||||||
imageContainerClassName = "",
|
|
||||||
imageClassName = "",
|
|
||||||
cardButtonClassName = "",
|
|
||||||
cardButtonTextClassName = "",
|
|
||||||
}: FeatureCardSevenProps) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<div
|
||||||
|
className={`w-full py-20 ${useInvertedBackground ? "bg-background/50" : ""} ${containerClassName}`}
|
||||||
|
aria-label={ariaLabel}
|
||||||
|
>
|
||||||
|
<div className="max-w-content-width mx-auto px-4">
|
||||||
<CardList
|
<CardList
|
||||||
title={title}
|
animationType={animationType}
|
||||||
titleSegments={titleSegments}
|
ariaLabel={ariaLabel}
|
||||||
description={description}
|
className={className}
|
||||||
tag={tag}
|
listClassName={listClassName}
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
animationType={animationType}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
className={className}
|
|
||||||
containerClassName={containerClassName}
|
|
||||||
cardClassName={cardClassName}
|
|
||||||
titleClassName={textBoxTitleClassName}
|
|
||||||
descriptionClassName={textBoxDescriptionClassName}
|
|
||||||
textBoxClassName={textBoxClassName}
|
|
||||||
tagClassName={textBoxTagClassName}
|
|
||||||
buttonContainerClassName={textBoxButtonContainerClassName}
|
|
||||||
buttonClassName={textBoxButtonClassName}
|
|
||||||
buttonTextClassName={textBoxButtonTextClassName}
|
|
||||||
titleImageWrapperClassName={titleImageWrapperClassName}
|
|
||||||
titleImageClassName={titleImageClassName}
|
|
||||||
ariaLabel={ariaLabel}
|
|
||||||
>
|
>
|
||||||
{features.map((feature, index) => (
|
{listItems.map((item) => item)}
|
||||||
<div
|
|
||||||
key={feature.id}
|
|
||||||
className={cls("relative z-1 w-full min-h-0 h-full flex flex-col justify-between items-center p-6 gap-6 md:p-15 md:gap-15", index % 2 === 0 ? "md:flex-row" : "md:flex-row-reverse", cardContentClassName)}
|
|
||||||
>
|
|
||||||
<div className="w-full md:w-1/2 min-w-0 h-fit md:h-full flex flex-col justify-center">
|
|
||||||
<div className="w-full min-w-0 flex flex-col gap-3 md:gap-5">
|
|
||||||
<div
|
|
||||||
className={cls(
|
|
||||||
"h-8 w-[var(--height-8)] primary-button text-primary-cta-text rounded-theme flex items-center justify-center",
|
|
||||||
stepNumberClassName
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<p className="text-sm truncate">
|
|
||||||
{feature.id}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<h2 className={cls("mt-1 text-4xl md:text-5xl font-medium leading-[1.15] text-balance", shouldUseLightText && "text-background", cardTitleClassName)}>
|
|
||||||
{feature.title}
|
|
||||||
</h2>
|
|
||||||
<p className={cls("text-base leading-[1.15] text-balance", shouldUseLightText ? "text-background" : "text-foreground", cardDescriptionClassName)}>
|
|
||||||
{feature.description}
|
|
||||||
</p>
|
|
||||||
{feature.buttons && feature.buttons.length > 0 && (
|
|
||||||
<div className="flex flex-wrap gap-3 max-md:justify-center">
|
|
||||||
{feature.buttons.slice(0, 2).map((button, index) => (
|
|
||||||
<Button key={`${button.text}-${index}`} {...getButtonProps(button, index, theme.defaultButtonVariant, cardButtonClassName, cardButtonTextClassName)} />
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
className={cls(
|
|
||||||
"relative w-full md:w-1/2 aspect-square overflow-hidden rounded-theme-capped",
|
|
||||||
imageContainerClassName
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<MediaContent
|
|
||||||
imageSrc={feature.imageSrc}
|
|
||||||
videoSrc={feature.videoSrc}
|
|
||||||
imageAlt={feature.imageAlt || feature.title}
|
|
||||||
videoAriaLabel={feature.videoAriaLabel || feature.title}
|
|
||||||
imageClassName={cls("w-full h-full object-cover", imageClassName)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</CardList>
|
</CardList>
|
||||||
);
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
FeatureCardSeven.displayName = "FeatureCardSeven";
|
|
||||||
|
|
||||||
export default FeatureCardSeven;
|
export default FeatureCardSeven;
|
||||||
@@ -1,182 +1,93 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { Fragment } from "react";
|
import React, { useMemo } from "react";
|
||||||
import CardList from "@/components/cardStack/CardList";
|
import CardList from "@/components/card/CardList";
|
||||||
import Button from "@/components/button/Button";
|
import type { ButtonAnimationType } from "@/types/animations";
|
||||||
import { cls, shouldUseInvertedText } from "@/lib/utils";
|
|
||||||
import { getButtonProps } from "@/lib/buttonUtils";
|
|
||||||
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
import type { LucideIcon } from "lucide-react";
|
||||||
import type { ButtonConfig, ButtonAnimationType, CardAnimationType, TitleSegment } from "@/components/cardStack/types";
|
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
|
||||||
|
|
||||||
interface FeatureCard {
|
export interface FeatureCardTwelveProps {
|
||||||
id: string;
|
features?: Array<{
|
||||||
label: string;
|
id: string;
|
||||||
title: string;
|
title: string;
|
||||||
items: string[];
|
description: string;
|
||||||
buttons?: ButtonConfig[];
|
icon?: React.ReactNode;
|
||||||
}
|
}>;
|
||||||
|
animationType?: ButtonAnimationType;
|
||||||
interface FeatureCardTwelveProps {
|
textboxLayout?: "default" | "split" | "split-actions" | "split-description" | "inline-image";
|
||||||
features: FeatureCard[];
|
description?: string;
|
||||||
animationType: CardAnimationType;
|
|
||||||
title: string;
|
|
||||||
titleSegments?: TitleSegment[];
|
|
||||||
description: string;
|
|
||||||
tag?: string;
|
tag?: string;
|
||||||
tagIcon?: LucideIcon;
|
tagIcon?: LucideIcon;
|
||||||
tagAnimation?: ButtonAnimationType;
|
tagAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
|
||||||
buttons?: ButtonConfig[];
|
buttons?: Array<{ text: string; onClick?: () => void; href?: string }>;
|
||||||
buttonAnimation?: ButtonAnimationType;
|
buttonAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
|
||||||
textboxLayout: TextboxLayout;
|
useInvertedBackground?: boolean;
|
||||||
useInvertedBackground: InvertedBackground;
|
|
||||||
ariaLabel?: string;
|
ariaLabel?: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
containerClassName?: string;
|
containerClassName?: string;
|
||||||
cardClassName?: string;
|
cardClassName?: string;
|
||||||
textBoxTitleClassName?: string;
|
textBoxTitleClassName?: string;
|
||||||
textBoxDescriptionClassName?: string;
|
textBoxDescriptionClassName?: string;
|
||||||
|
cardTitleClassName?: string;
|
||||||
|
cardDescriptionClassName?: string;
|
||||||
|
cardIconClassName?: string;
|
||||||
|
cardIconWrapperClassName?: string;
|
||||||
|
listClassName?: string;
|
||||||
|
itemClassName?: string;
|
||||||
textBoxClassName?: string;
|
textBoxClassName?: string;
|
||||||
textBoxTagClassName?: string;
|
textBoxTagClassName?: string;
|
||||||
textBoxButtonContainerClassName?: string;
|
textBoxButtonContainerClassName?: string;
|
||||||
textBoxButtonClassName?: string;
|
textBoxButtonClassName?: string;
|
||||||
textBoxButtonTextClassName?: string;
|
textBoxButtonTextClassName?: string;
|
||||||
titleImageWrapperClassName?: string;
|
|
||||||
titleImageClassName?: string;
|
|
||||||
cardContentClassName?: string;
|
|
||||||
labelClassName?: string;
|
|
||||||
cardTitleClassName?: string;
|
|
||||||
itemsContainerClassName?: string;
|
|
||||||
itemTextClassName?: string;
|
|
||||||
cardButtonClassName?: string;
|
|
||||||
cardButtonTextClassName?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const FeatureCardTwelve = ({
|
const FeatureCardTwelve: React.FC<FeatureCardTwelveProps> = ({
|
||||||
features,
|
features = [],
|
||||||
animationType,
|
animationType = "slide-up", textboxLayout = "default", description = "", tag,
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
tagIcon,
|
||||||
tagAnimation,
|
tagAnimation,
|
||||||
buttons,
|
buttons,
|
||||||
buttonAnimation,
|
buttonAnimation,
|
||||||
textboxLayout,
|
useInvertedBackground = false,
|
||||||
useInvertedBackground,
|
ariaLabel = "Feature section", className = "", containerClassName = "", cardClassName = "", textBoxTitleClassName = "", textBoxDescriptionClassName = "", cardTitleClassName = "", cardDescriptionClassName = "", cardIconClassName = "", cardIconWrapperClassName = "", listClassName = "", itemClassName = "", textBoxClassName = "", textBoxTagClassName = "", textBoxButtonContainerClassName = "", textBoxButtonClassName = "", textBoxButtonTextClassName = ""}) => {
|
||||||
ariaLabel = "Feature section",
|
const listItems = useMemo(
|
||||||
className = "",
|
() =>
|
||||||
containerClassName = "",
|
features.map((feature) => (
|
||||||
cardClassName = "",
|
<div key={feature.id} className={`flex gap-4 p-4 rounded-lg bg-card/50 ${itemClassName}`}>
|
||||||
textBoxTitleClassName = "",
|
{feature.icon && (
|
||||||
textBoxDescriptionClassName = "",
|
<div className={`flex-shrink-0 flex items-center justify-center w-10 h-10 rounded-lg bg-primary-cta/10 ${cardIconWrapperClassName}`}>
|
||||||
textBoxClassName = "",
|
<span className={`text-lg ${cardIconClassName}`}>{feature.icon}</span>
|
||||||
textBoxTagClassName = "",
|
</div>
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
titleImageWrapperClassName = "",
|
|
||||||
titleImageClassName = "",
|
|
||||||
cardContentClassName = "",
|
|
||||||
labelClassName = "",
|
|
||||||
cardTitleClassName = "",
|
|
||||||
itemsContainerClassName = "",
|
|
||||||
itemTextClassName = "",
|
|
||||||
cardButtonClassName = "",
|
|
||||||
cardButtonTextClassName = "",
|
|
||||||
}: FeatureCardTwelveProps) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<CardList
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
animationType={animationType}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
className={className}
|
|
||||||
containerClassName={containerClassName}
|
|
||||||
cardClassName={cardClassName}
|
|
||||||
titleClassName={textBoxTitleClassName}
|
|
||||||
descriptionClassName={textBoxDescriptionClassName}
|
|
||||||
textBoxClassName={textBoxClassName}
|
|
||||||
tagClassName={textBoxTagClassName}
|
|
||||||
buttonContainerClassName={textBoxButtonContainerClassName}
|
|
||||||
buttonClassName={textBoxButtonClassName}
|
|
||||||
buttonTextClassName={textBoxButtonTextClassName}
|
|
||||||
titleImageWrapperClassName={titleImageWrapperClassName}
|
|
||||||
titleImageClassName={titleImageClassName}
|
|
||||||
ariaLabel={ariaLabel}
|
|
||||||
>
|
|
||||||
{features.map((feature) => (
|
|
||||||
<div
|
|
||||||
key={feature.id}
|
|
||||||
className={cls(
|
|
||||||
"relative z-1 w-full min-h-0 h-full flex flex-col md:flex-row gap-6 p-6 md:p-15",
|
|
||||||
cardContentClassName
|
|
||||||
)}
|
)}
|
||||||
>
|
<div className="flex-1 min-w-0">
|
||||||
<div className="relative z-1 w-full md:w-1/2 flex md:justify-start">
|
<h3 className={`text-sm font-semibold text-foreground ${cardTitleClassName}`}>
|
||||||
<h2 className={cls(
|
|
||||||
"text-5xl md:text-6xl font-medium leading-[1.1]",
|
|
||||||
shouldUseLightText && "text-background",
|
|
||||||
labelClassName
|
|
||||||
)}>
|
|
||||||
{feature.label}
|
|
||||||
</h2>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="relative z-1 w-full h-px bg-foreground/20 md:hidden" />
|
|
||||||
|
|
||||||
<div className="relative z-1 w-full md:w-1/2 flex flex-col gap-4">
|
|
||||||
<h3 className={cls(
|
|
||||||
"text-xl md:text-3xl font-medium leading-tight",
|
|
||||||
shouldUseLightText ? "text-background" : "text-foreground",
|
|
||||||
cardTitleClassName
|
|
||||||
)}>
|
|
||||||
{feature.title}
|
{feature.title}
|
||||||
</h3>
|
</h3>
|
||||||
|
<p className={`text-xs text-foreground/70 ${cardDescriptionClassName}`}>
|
||||||
<div className={cls("flex flex-wrap items-center gap-2", itemsContainerClassName)}>
|
{feature.description}
|
||||||
{feature.items.map((item, index) => (
|
</p>
|
||||||
<Fragment key={index}>
|
|
||||||
<span className={cls(
|
|
||||||
"text-base",
|
|
||||||
shouldUseLightText ? "text-background" : "text-foreground",
|
|
||||||
itemTextClassName
|
|
||||||
)}>
|
|
||||||
{item}
|
|
||||||
</span>
|
|
||||||
{index < feature.items.length - 1 && (
|
|
||||||
<span className="text-base text-accent">•</span>
|
|
||||||
)}
|
|
||||||
</Fragment>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{feature.buttons && feature.buttons.length > 0 && (
|
|
||||||
<div className="mt-3 flex flex-wrap gap-4 max-md:justify-center">
|
|
||||||
{feature.buttons.slice(0, 2).map((button, index) => (
|
|
||||||
<Button key={`${button.text}-${index}`} {...getButtonProps(button, index, theme.defaultButtonVariant, cardButtonClassName, cardButtonTextClassName)} />
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
))}
|
)),
|
||||||
</CardList>
|
[features, itemClassName, cardIconWrapperClassName, cardIconClassName, cardTitleClassName, cardDescriptionClassName]
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className={`w-full py-20 ${useInvertedBackground ? "bg-background/50" : ""} ${containerClassName}`}
|
||||||
|
aria-label={ariaLabel}
|
||||||
|
>
|
||||||
|
<div className="max-w-content-width mx-auto px-4">
|
||||||
|
<CardList
|
||||||
|
animationType={animationType}
|
||||||
|
ariaLabel={ariaLabel}
|
||||||
|
className={className}
|
||||||
|
listClassName={listClassName}
|
||||||
|
>
|
||||||
|
{listItems.map((item) => item)}
|
||||||
|
</CardList>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
FeatureCardTwelve.displayName = "FeatureCardTwelve";
|
export default FeatureCardTwelve;
|
||||||
|
|
||||||
export default FeatureCardTwelve;
|
|
||||||
@@ -1,43 +1,30 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import CardStack from "@/components/cardStack/CardStack";
|
import React, { useMemo } from "react";
|
||||||
import MediaContent from "@/components/shared/MediaContent";
|
import CardStack from "@/components/card/CardStack";
|
||||||
import { cls, shouldUseInvertedText } from "@/lib/utils";
|
import TextBox from "@/components/Textbox";
|
||||||
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
|
import type { CardAnimationTypeWith3D } from "@/types/animations";
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type { CardAnimationTypeWith3D, TitleSegment, ButtonConfig, ButtonAnimationType } from "@/components/cardStack/types";
|
|
||||||
|
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
export interface FeatureCardTwentyFiveProps {
|
||||||
|
features?: Array<{
|
||||||
interface MediaItem {
|
id: string;
|
||||||
imageSrc?: string;
|
title: string;
|
||||||
videoSrc?: string;
|
description: string;
|
||||||
imageAlt?: string;
|
icon?: React.ReactNode;
|
||||||
videoAriaLabel?: string;
|
mediaItems?: Array<{ type: string; src: string; alt?: string }>;
|
||||||
}
|
}>;
|
||||||
|
gridVariant?: string;
|
||||||
type FeatureCard = {
|
|
||||||
title: string;
|
|
||||||
description: string;
|
|
||||||
icon: LucideIcon;
|
|
||||||
mediaItems: [MediaItem, MediaItem];
|
|
||||||
};
|
|
||||||
|
|
||||||
interface FeatureCardTwentyFiveProps {
|
|
||||||
features: FeatureCard[];
|
|
||||||
carouselMode?: "auto" | "buttons";
|
|
||||||
uniformGridCustomHeightClasses?: string;
|
uniformGridCustomHeightClasses?: string;
|
||||||
animationType: CardAnimationTypeWith3D;
|
animationType?: CardAnimationTypeWith3D;
|
||||||
title: string;
|
title?: string;
|
||||||
titleSegments?: TitleSegment[];
|
titleSegments?: Array<{ type: "text"; content: string } | { type: "image"; src: string; alt?: string }>;
|
||||||
description: string;
|
description?: string;
|
||||||
tag?: string;
|
tag?: string;
|
||||||
tagIcon?: LucideIcon;
|
tagAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
|
||||||
tagAnimation?: ButtonAnimationType;
|
buttons?: Array<{ text: string; onClick?: () => void; href?: string }>;
|
||||||
buttons?: ButtonConfig[];
|
buttonAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
|
||||||
buttonAnimation?: ButtonAnimationType;
|
textboxLayout?: "default" | "split" | "split-actions" | "split-description" | "inline-image";
|
||||||
textboxLayout: TextboxLayout;
|
useInvertedBackground?: boolean;
|
||||||
useInvertedBackground: InvertedBackground;
|
|
||||||
ariaLabel?: string;
|
ariaLabel?: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
containerClassName?: string;
|
containerClassName?: string;
|
||||||
@@ -61,118 +48,94 @@ interface FeatureCardTwentyFiveProps {
|
|||||||
textBoxButtonTextClassName?: string;
|
textBoxButtonTextClassName?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const FeatureCardTwentyFive = ({
|
const FeatureCardTwentyFive: React.FC<FeatureCardTwentyFiveProps> = ({
|
||||||
features,
|
features = [],
|
||||||
carouselMode = "buttons",
|
gridVariant = "uniform-all-items-equal", uniformGridCustomHeightClasses = "min-h-95 2xl:min-h-105", animationType = "slide-up", title,
|
||||||
uniformGridCustomHeightClasses,
|
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
titleSegments,
|
||||||
description,
|
description = "", tag,
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
tagAnimation,
|
||||||
buttons,
|
buttons,
|
||||||
buttonAnimation,
|
buttonAnimation,
|
||||||
textboxLayout,
|
textboxLayout = "default", useInvertedBackground = false,
|
||||||
useInvertedBackground,
|
ariaLabel = "Feature section", className = "", containerClassName = "", cardClassName = "", mediaClassName = "", textBoxTitleClassName = "", textBoxTitleImageWrapperClassName = "", textBoxTitleImageClassName = "", textBoxDescriptionClassName = "", cardTitleClassName = "", cardDescriptionClassName = "", cardIconClassName = "", cardIconWrapperClassName = "", gridClassName = "", carouselClassName = "", controlsClassName = "", textBoxClassName = "", textBoxTagClassName = "", textBoxButtonContainerClassName = "", textBoxButtonClassName = "", textBoxButtonTextClassName = ""}) => {
|
||||||
ariaLabel = "Feature section",
|
const cardItems = useMemo(
|
||||||
className = "",
|
() =>
|
||||||
containerClassName = "",
|
features.map((feature) => (
|
||||||
cardClassName = "",
|
<div
|
||||||
mediaClassName = "",
|
key={feature.id}
|
||||||
textBoxTitleClassName = "",
|
className={`h-full flex flex-col gap-4 p-6 rounded-lg bg-card ${cardClassName}`}
|
||||||
textBoxTitleImageWrapperClassName = "",
|
>
|
||||||
textBoxTitleImageClassName = "",
|
{feature.icon && (
|
||||||
textBoxDescriptionClassName = "",
|
<div className={`flex items-center justify-center w-12 h-12 rounded-lg bg-primary-cta/10 ${cardIconWrapperClassName}`}>
|
||||||
cardTitleClassName = "",
|
<span className={`text-2xl ${cardIconClassName}`}>{feature.icon}</span>
|
||||||
cardDescriptionClassName = "",
|
|
||||||
cardIconClassName = "",
|
|
||||||
cardIconWrapperClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
carouselClassName = "",
|
|
||||||
controlsClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
}: FeatureCardTwentyFiveProps) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<CardStack
|
|
||||||
mode={carouselMode}
|
|
||||||
gridVariant="two-items-per-row"
|
|
||||||
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
|
||||||
animationType={animationType}
|
|
||||||
supports3DAnimation={true}
|
|
||||||
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
className={className}
|
|
||||||
containerClassName={containerClassName}
|
|
||||||
gridClassName={gridClassName}
|
|
||||||
carouselClassName={carouselClassName}
|
|
||||||
controlsClassName={controlsClassName}
|
|
||||||
textBoxClassName={textBoxClassName}
|
|
||||||
titleClassName={textBoxTitleClassName}
|
|
||||||
titleImageWrapperClassName={textBoxTitleImageWrapperClassName}
|
|
||||||
titleImageClassName={textBoxTitleImageClassName}
|
|
||||||
descriptionClassName={textBoxDescriptionClassName}
|
|
||||||
tagClassName={textBoxTagClassName}
|
|
||||||
buttonContainerClassName={textBoxButtonContainerClassName}
|
|
||||||
buttonClassName={textBoxButtonClassName}
|
|
||||||
buttonTextClassName={textBoxButtonTextClassName}
|
|
||||||
ariaLabel={ariaLabel}
|
|
||||||
>
|
|
||||||
{features.map((feature, index) => {
|
|
||||||
const IconComponent = feature.icon;
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
key={`${feature.title}-${index}`}
|
|
||||||
className={cls("card flex flex-col gap-5 p-5 rounded-theme-capped min-h-0 h-full", cardClassName)}
|
|
||||||
>
|
|
||||||
<div className="relative z-1 flex flex-col gap-1">
|
|
||||||
<div className={cls("h-15 w-[3.75rem] mb-1 aspect-square rounded-theme primary-button flex items-center justify-center", cardIconWrapperClassName)}>
|
|
||||||
<IconComponent className={cls("h-4/10 w-4/10 text-primary-cta-text", cardIconClassName)} strokeWidth={1.5} />
|
|
||||||
</div>
|
|
||||||
<h3 className={cls("text-2xl font-medium leading-tight", shouldUseLightText && "text-background", cardTitleClassName)}>
|
|
||||||
{feature.title}
|
|
||||||
</h3>
|
|
||||||
<p className={cls("text-base leading-tight", shouldUseLightText ? "text-background" : "text-foreground", cardDescriptionClassName)}>
|
|
||||||
{feature.description}
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
<div className="mt-auto flex-1 min-h-0 grid grid-cols-2 gap-5 overflow-hidden">
|
)}
|
||||||
{feature.mediaItems.map((item, mediaIndex) => (
|
<h3 className={`text-xl font-semibold text-foreground ${cardTitleClassName}`}>
|
||||||
<div key={mediaIndex} className="overflow-hidden rounded-theme-capped">
|
{feature.title}
|
||||||
<MediaContent
|
</h3>
|
||||||
imageSrc={item.imageSrc}
|
<p className={`text-sm text-foreground/70 flex-1 ${cardDescriptionClassName}`}>
|
||||||
videoSrc={item.videoSrc}
|
{feature.description}
|
||||||
imageAlt={item.imageAlt || "Feature image"}
|
</p>
|
||||||
videoAriaLabel={item.videoAriaLabel || "Feature video"}
|
{feature.mediaItems && (
|
||||||
imageClassName={cls("relative z-1 h-full w-full object-cover", mediaClassName)}
|
<div className={`flex gap-2 mt-auto ${mediaClassName}`}>
|
||||||
/>
|
{feature.mediaItems.map((media, idx) => (
|
||||||
</div>
|
<img
|
||||||
|
key={idx}
|
||||||
|
src={media.src}
|
||||||
|
alt={media.alt || "Feature media"}
|
||||||
|
className="w-full h-20 object-cover rounded-lg"
|
||||||
|
/>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
)}
|
||||||
);
|
</div>
|
||||||
})}
|
)),
|
||||||
</CardStack>
|
[features, cardClassName, cardIconWrapperClassName, cardIconClassName, cardTitleClassName, cardDescriptionClassName, mediaClassName]
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className={`w-full py-20 ${useInvertedBackground ? "bg-background/50" : ""} ${containerClassName}`}
|
||||||
|
aria-label={ariaLabel}
|
||||||
|
>
|
||||||
|
{title && (
|
||||||
|
<div className={`max-w-content-width mx-auto px-4 mb-12 ${textBoxClassName}`}>
|
||||||
|
<TextBox
|
||||||
|
title={title}
|
||||||
|
titleSegments={titleSegments}
|
||||||
|
description={description}
|
||||||
|
tag={tag}
|
||||||
|
tagAnimation={tagAnimation}
|
||||||
|
buttons={buttons}
|
||||||
|
buttonAnimation={buttonAnimation}
|
||||||
|
textboxLayout={textboxLayout}
|
||||||
|
titleClassName={textBoxTitleClassName}
|
||||||
|
descriptionClassName={textBoxDescriptionClassName}
|
||||||
|
tagClassName={textBoxTagClassName}
|
||||||
|
buttonContainerClassName={textBoxButtonContainerClassName}
|
||||||
|
buttonClassName={textBoxButtonClassName}
|
||||||
|
buttonTextClassName={textBoxButtonTextClassName}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<div className="max-w-content-width mx-auto px-4">
|
||||||
|
<CardStack
|
||||||
|
gridVariant={gridVariant}
|
||||||
|
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
||||||
|
animationType={animationType}
|
||||||
|
carouselMode="buttons"
|
||||||
|
ariaLabel={ariaLabel}
|
||||||
|
className={className}
|
||||||
|
gridClassName={gridClassName}
|
||||||
|
carouselClassName={carouselClassName}
|
||||||
|
controlsClassName={controlsClassName}
|
||||||
|
>
|
||||||
|
{cardItems.map((item) => item)}
|
||||||
|
</CardStack>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
FeatureCardTwentyFive.displayName = "FeatureCardTwentyFive";
|
export default FeatureCardTwentyFive;
|
||||||
|
|
||||||
export default FeatureCardTwentyFive;
|
|
||||||
@@ -1,199 +1,93 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import CardList from "@/components/cardStack/CardList";
|
import React, { useMemo } from "react";
|
||||||
import Tag from "@/components/shared/Tag";
|
import CardList from "@/components/card/CardList";
|
||||||
import MediaContent from "@/components/shared/MediaContent";
|
import type { ButtonAnimationType } from "@/types/animations";
|
||||||
import { cls, shouldUseInvertedText } from "@/lib/utils";
|
|
||||||
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
import type { LucideIcon } from "lucide-react";
|
||||||
import type { ButtonConfig, ButtonAnimationType, CardAnimationType, TitleSegment } from "@/components/cardStack/types";
|
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
|
||||||
|
|
||||||
type MediaProps =
|
export interface FeatureCardTwentyFourProps {
|
||||||
| {
|
features?: Array<{
|
||||||
imageSrc: string;
|
|
||||||
imageAlt?: string;
|
|
||||||
videoSrc?: never;
|
|
||||||
videoAriaLabel?: never;
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
videoSrc: string;
|
|
||||||
videoAriaLabel?: string;
|
|
||||||
imageSrc?: never;
|
|
||||||
imageAlt?: never;
|
|
||||||
};
|
|
||||||
|
|
||||||
type FeatureItem = MediaProps & {
|
|
||||||
id: string;
|
id: string;
|
||||||
title: string;
|
title: string;
|
||||||
author: string;
|
|
||||||
description: string;
|
description: string;
|
||||||
tags: string[];
|
icon?: React.ReactNode;
|
||||||
onFeatureClick?: () => void;
|
}>;
|
||||||
};
|
animationType?: ButtonAnimationType;
|
||||||
|
textboxLayout?: "default" | "split" | "split-actions" | "split-description" | "inline-image";
|
||||||
interface FeatureCardTwentyFourProps {
|
description?: string;
|
||||||
features: FeatureItem[];
|
tag?: string;
|
||||||
animationType: CardAnimationType;
|
tagIcon?: LucideIcon;
|
||||||
title: string;
|
tagAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
|
||||||
titleSegments?: TitleSegment[];
|
buttons?: Array<{ text: string; onClick?: () => void; href?: string }>;
|
||||||
description: string;
|
buttonAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
|
||||||
tag?: string;
|
useInvertedBackground?: boolean;
|
||||||
tagIcon?: LucideIcon;
|
ariaLabel?: string;
|
||||||
tagAnimation?: ButtonAnimationType;
|
className?: string;
|
||||||
buttons?: ButtonConfig[];
|
containerClassName?: string;
|
||||||
buttonAnimation?: ButtonAnimationType;
|
cardClassName?: string;
|
||||||
textboxLayout: TextboxLayout;
|
textBoxTitleClassName?: string;
|
||||||
useInvertedBackground: InvertedBackground;
|
textBoxDescriptionClassName?: string;
|
||||||
ariaLabel?: string;
|
cardTitleClassName?: string;
|
||||||
className?: string;
|
cardDescriptionClassName?: string;
|
||||||
containerClassName?: string;
|
cardIconClassName?: string;
|
||||||
cardClassName?: string;
|
cardIconWrapperClassName?: string;
|
||||||
textBoxTitleClassName?: string;
|
listClassName?: string;
|
||||||
textBoxDescriptionClassName?: string;
|
itemClassName?: string;
|
||||||
textBoxClassName?: string;
|
textBoxClassName?: string;
|
||||||
textBoxTagClassName?: string;
|
textBoxTagClassName?: string;
|
||||||
textBoxButtonContainerClassName?: string;
|
textBoxButtonContainerClassName?: string;
|
||||||
textBoxButtonClassName?: string;
|
textBoxButtonClassName?: string;
|
||||||
textBoxButtonTextClassName?: string;
|
textBoxButtonTextClassName?: string;
|
||||||
titleImageWrapperClassName?: string;
|
|
||||||
titleImageClassName?: string;
|
|
||||||
cardContentClassName?: string;
|
|
||||||
cardTitleClassName?: string;
|
|
||||||
authorClassName?: string;
|
|
||||||
cardDescriptionClassName?: string;
|
|
||||||
tagsContainerClassName?: string;
|
|
||||||
tagClassName?: string;
|
|
||||||
mediaWrapperClassName?: string;
|
|
||||||
mediaClassName?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const FeatureCardTwentyFour = ({
|
const FeatureCardTwentyFour: React.FC<FeatureCardTwentyFourProps> = ({
|
||||||
features,
|
features = [],
|
||||||
animationType,
|
animationType = "slide-up", textboxLayout = "default", description = "", tag,
|
||||||
title,
|
tagIcon,
|
||||||
titleSegments,
|
tagAnimation,
|
||||||
description,
|
buttons,
|
||||||
tag,
|
buttonAnimation,
|
||||||
tagIcon,
|
useInvertedBackground = false,
|
||||||
tagAnimation,
|
ariaLabel = "Feature section", className = "", containerClassName = "", cardClassName = "", textBoxTitleClassName = "", textBoxDescriptionClassName = "", cardTitleClassName = "", cardDescriptionClassName = "", cardIconClassName = "", cardIconWrapperClassName = "", listClassName = "", itemClassName = "", textBoxClassName = "", textBoxTagClassName = "", textBoxButtonContainerClassName = "", textBoxButtonClassName = "", textBoxButtonTextClassName = ""}) => {
|
||||||
buttons,
|
const listItems = useMemo(
|
||||||
buttonAnimation,
|
() =>
|
||||||
textboxLayout,
|
features.map((feature) => (
|
||||||
useInvertedBackground,
|
<div key={feature.id} className={`flex gap-4 p-4 rounded-lg bg-card/50 ${itemClassName}`}>
|
||||||
ariaLabel = "Features section",
|
{feature.icon && (
|
||||||
className = "",
|
<div className={`flex-shrink-0 flex items-center justify-center w-10 h-10 rounded-lg bg-primary-cta/10 ${cardIconWrapperClassName}`}>
|
||||||
containerClassName = "",
|
<span className={`text-lg ${cardIconClassName}`}>{feature.icon}</span>
|
||||||
cardClassName = "",
|
</div>
|
||||||
textBoxTitleClassName = "",
|
)}
|
||||||
textBoxDescriptionClassName = "",
|
<div className="flex-1 min-w-0">
|
||||||
textBoxClassName = "",
|
<h3 className={`text-sm font-semibold text-foreground ${cardTitleClassName}`}>
|
||||||
textBoxTagClassName = "",
|
{feature.title}
|
||||||
textBoxButtonContainerClassName = "",
|
</h3>
|
||||||
textBoxButtonClassName = "",
|
<p className={`text-xs text-foreground/70 ${cardDescriptionClassName}`}>
|
||||||
textBoxButtonTextClassName = "",
|
{feature.description}
|
||||||
titleImageWrapperClassName = "",
|
</p>
|
||||||
titleImageClassName = "",
|
</div>
|
||||||
cardContentClassName = "",
|
</div>
|
||||||
cardTitleClassName = "",
|
)),
|
||||||
authorClassName = "",
|
[features, itemClassName, cardIconWrapperClassName, cardIconClassName, cardTitleClassName, cardDescriptionClassName]
|
||||||
cardDescriptionClassName = "",
|
);
|
||||||
tagsContainerClassName = "",
|
|
||||||
tagClassName = "",
|
|
||||||
mediaWrapperClassName = "",
|
|
||||||
mediaClassName = "",
|
|
||||||
}: FeatureCardTwentyFourProps) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<div
|
||||||
|
className={`w-full py-20 ${useInvertedBackground ? "bg-background/50" : ""} ${containerClassName}`}
|
||||||
|
aria-label={ariaLabel}
|
||||||
|
>
|
||||||
|
<div className="max-w-content-width mx-auto px-4">
|
||||||
<CardList
|
<CardList
|
||||||
title={title}
|
animationType={animationType}
|
||||||
titleSegments={titleSegments}
|
ariaLabel={ariaLabel}
|
||||||
description={description}
|
className={className}
|
||||||
tag={tag}
|
listClassName={listClassName}
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
animationType={animationType}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
className={className}
|
|
||||||
containerClassName={containerClassName}
|
|
||||||
cardClassName={cardClassName}
|
|
||||||
titleClassName={textBoxTitleClassName}
|
|
||||||
descriptionClassName={textBoxDescriptionClassName}
|
|
||||||
textBoxClassName={textBoxClassName}
|
|
||||||
tagClassName={textBoxTagClassName}
|
|
||||||
buttonContainerClassName={textBoxButtonContainerClassName}
|
|
||||||
buttonClassName={textBoxButtonClassName}
|
|
||||||
buttonTextClassName={textBoxButtonTextClassName}
|
|
||||||
titleImageWrapperClassName={titleImageWrapperClassName}
|
|
||||||
titleImageClassName={titleImageClassName}
|
|
||||||
ariaLabel={ariaLabel}
|
|
||||||
>
|
>
|
||||||
{features.map((feature) => (
|
{listItems.map((item) => item)}
|
||||||
<article
|
|
||||||
key={feature.id}
|
|
||||||
className={cls(
|
|
||||||
"relative z-1 w-full min-h-0 h-full flex flex-col md:grid md:grid-cols-10 gap-6 md:gap-10 cursor-pointer group p-6 md:p-10",
|
|
||||||
cardContentClassName
|
|
||||||
)}
|
|
||||||
onClick={feature.onFeatureClick}
|
|
||||||
role="article"
|
|
||||||
aria-label={feature.title}
|
|
||||||
>
|
|
||||||
<div className="relative z-1 w-full md:col-span-6 flex flex-col gap-3 md:gap-12">
|
|
||||||
<h3 className={cls(
|
|
||||||
"text-3xl md:text-5xl text-balance font-medium leading-tight line-clamp-3",
|
|
||||||
shouldUseLightText ? "text-background" : "text-foreground",
|
|
||||||
cardTitleClassName
|
|
||||||
)}>
|
|
||||||
{feature.title}{" "}
|
|
||||||
<span className={cls(
|
|
||||||
shouldUseLightText ? "text-background/50" : "text-foreground/50",
|
|
||||||
authorClassName
|
|
||||||
)}>
|
|
||||||
by {feature.author}
|
|
||||||
</span>
|
|
||||||
</h3>
|
|
||||||
|
|
||||||
<div className="mt-auto flex flex-col gap-4">
|
|
||||||
<div className={cls("flex flex-wrap gap-2", tagsContainerClassName)}>
|
|
||||||
{feature.tags.map((tagText, index) => (
|
|
||||||
<Tag key={index} text={tagText} useInvertedBackground={useInvertedBackground} className={tagClassName} />
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p className={cls(
|
|
||||||
"text-base md:text-2xl text-balance leading-tight line-clamp-2",
|
|
||||||
shouldUseLightText ? "text-background" : "text-foreground",
|
|
||||||
cardDescriptionClassName
|
|
||||||
)}>
|
|
||||||
{feature.description}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className={cls(
|
|
||||||
"relative z-1 w-full md:col-span-4 aspect-square md:aspect-auto overflow-hidden rounded-theme-capped",
|
|
||||||
mediaWrapperClassName
|
|
||||||
)}>
|
|
||||||
<MediaContent
|
|
||||||
imageSrc={feature.imageSrc}
|
|
||||||
videoSrc={feature.videoSrc}
|
|
||||||
imageAlt={feature.imageAlt}
|
|
||||||
videoAriaLabel={feature.videoAriaLabel}
|
|
||||||
imageClassName={cls("w-full h-full object-cover", mediaClassName)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
))}
|
|
||||||
</CardList>
|
</CardList>
|
||||||
);
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
FeatureCardTwentyFour.displayName = "FeatureCardTwentyFour";
|
export default FeatureCardTwentyFour;
|
||||||
|
|
||||||
export default FeatureCardTwentyFour;
|
|
||||||
@@ -1,127 +1,44 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useState } from "react";
|
import React, { useMemo } from "react";
|
||||||
import { Plus } from "lucide-react";
|
import CardStack from "@/components/card/CardStack";
|
||||||
import CardStack from "@/components/cardStack/CardStack";
|
import TextBox from "@/components/Textbox";
|
||||||
import MediaContent from "@/components/shared/MediaContent";
|
import type { CardAnimationType } from "@/types/animations";
|
||||||
import { cls } from "@/lib/utils";
|
import type { GridVariant } from "@/types/grid";
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type { ButtonConfig, GridVariant, CardAnimationType, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
|
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
|
||||||
|
|
||||||
type FeatureCard = {
|
export interface FeatureCardTwentySevenProps {
|
||||||
id: string;
|
features?: Array<{
|
||||||
title: string;
|
id: string;
|
||||||
descriptions: string[];
|
title: string;
|
||||||
imageSrc?: string;
|
description: string;
|
||||||
videoSrc?: string;
|
icon?: React.ReactNode;
|
||||||
imageAlt?: string;
|
mediaItems?: Array<{ type: string; src: string; alt?: string }>;
|
||||||
};
|
}>;
|
||||||
|
gridVariant?: GridVariant;
|
||||||
interface FeatureCardTwentySevenItemProps {
|
|
||||||
title: string;
|
|
||||||
descriptions: string[];
|
|
||||||
imageSrc?: string;
|
|
||||||
videoSrc?: string;
|
|
||||||
imageAlt?: string;
|
|
||||||
className?: string;
|
|
||||||
titleClassName?: string;
|
|
||||||
descriptionClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const FeatureCardTwentySevenItem = ({
|
|
||||||
title,
|
|
||||||
descriptions,
|
|
||||||
imageSrc,
|
|
||||||
videoSrc,
|
|
||||||
imageAlt = "",
|
|
||||||
className = "",
|
|
||||||
titleClassName = "",
|
|
||||||
descriptionClassName = "",
|
|
||||||
}: FeatureCardTwentySevenItemProps) => {
|
|
||||||
const [isFlipped, setIsFlipped] = useState(false);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
className={cls(
|
|
||||||
"relative w-full h-full min-h-0 group [perspective:3000px] cursor-pointer",
|
|
||||||
className
|
|
||||||
)}
|
|
||||||
onClick={() => setIsFlipped(!isFlipped)}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
className={cls(
|
|
||||||
"relative w-full h-full transition-transform duration-500 [transform-style:preserve-3d]",
|
|
||||||
isFlipped && "[transform:rotateY(180deg)]"
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<div className="relative w-full h-full card rounded-theme-capped p-6 gap-6 flex flex-col [backface-visibility:hidden]">
|
|
||||||
<div className="flex justify-between items-start">
|
|
||||||
<h3 className={cls("text-2xl font-medium leading-tight", titleClassName)}>
|
|
||||||
{title}
|
|
||||||
</h3>
|
|
||||||
<div className="h-[calc(var(--text-2xl)*1.25)] w-[calc(var(--text-2xl)*1.25)] aspect-square rounded-theme primary-button flex items-center justify-center shrink-0">
|
|
||||||
<Plus className="h-1/2 w-1/2 text-primary-cta-text" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="w-full aspect-square md:aspect-[10/11] flex items-center justify-center rounded-theme-capped overflow-hidden">
|
|
||||||
<MediaContent
|
|
||||||
imageSrc={imageSrc}
|
|
||||||
videoSrc={videoSrc}
|
|
||||||
imageAlt={imageAlt}
|
|
||||||
imageClassName="w-full h-full object-cover"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="absolute! inset-0 w-full h-full card rounded-theme-capped p-6 gap-6 flex flex-col justify-between [backface-visibility:hidden] [transform:rotateY(180deg)]">
|
|
||||||
<div className="flex justify-between items-start">
|
|
||||||
<h3 className={cls("text-2xl font-medium leading-tight", titleClassName)}>
|
|
||||||
{title}
|
|
||||||
</h3>
|
|
||||||
<div className="h-[calc(var(--text-2xl)*1.25)] w-[calc(var(--text-2xl)*1.25)] aspect-square rounded-theme primary-button flex items-center justify-center shrink-0">
|
|
||||||
<Plus className="h-1/2 w-1/2 rotate-45 text-primary-cta-text" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="w-full flex flex-col gap-3">
|
|
||||||
{descriptions.map((desc, index) => (
|
|
||||||
<p key={index} className={cls("text-lg text-foreground/75 leading-tight", descriptionClassName)}>
|
|
||||||
{desc}
|
|
||||||
</p>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
interface FeatureCardTwentySevenProps {
|
|
||||||
features: FeatureCard[];
|
|
||||||
carouselMode?: "auto" | "buttons";
|
|
||||||
gridVariant: GridVariant;
|
|
||||||
uniformGridCustomHeightClasses?: string;
|
uniformGridCustomHeightClasses?: string;
|
||||||
animationType: CardAnimationType;
|
animationType?: CardAnimationType;
|
||||||
title: string;
|
title?: string;
|
||||||
titleSegments?: TitleSegment[];
|
titleSegments?: Array<{ type: "text"; content: string } | { type: "image"; src: string; alt?: string }>;
|
||||||
description: string;
|
description?: string;
|
||||||
tag?: string;
|
tag?: string;
|
||||||
tagIcon?: LucideIcon;
|
tagAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
|
||||||
tagAnimation?: ButtonAnimationType;
|
buttons?: Array<{ text: string; onClick?: () => void; href?: string }>;
|
||||||
buttons?: ButtonConfig[];
|
buttonAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
|
||||||
buttonAnimation?: ButtonAnimationType;
|
textboxLayout?: "default" | "split" | "split-actions" | "split-description" | "inline-image";
|
||||||
textboxLayout: TextboxLayout;
|
useInvertedBackground?: boolean;
|
||||||
useInvertedBackground: InvertedBackground;
|
|
||||||
ariaLabel?: string;
|
ariaLabel?: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
containerClassName?: string;
|
containerClassName?: string;
|
||||||
cardClassName?: string;
|
cardClassName?: string;
|
||||||
|
mediaClassName?: string;
|
||||||
textBoxTitleClassName?: string;
|
textBoxTitleClassName?: string;
|
||||||
textBoxTitleImageWrapperClassName?: string;
|
textBoxTitleImageWrapperClassName?: string;
|
||||||
textBoxTitleImageClassName?: string;
|
textBoxTitleImageClassName?: string;
|
||||||
textBoxDescriptionClassName?: string;
|
textBoxDescriptionClassName?: string;
|
||||||
cardTitleClassName?: string;
|
cardTitleClassName?: string;
|
||||||
cardDescriptionClassName?: string;
|
cardDescriptionClassName?: string;
|
||||||
|
cardIconClassName?: string;
|
||||||
|
cardIconWrapperClassName?: string;
|
||||||
gridClassName?: string;
|
gridClassName?: string;
|
||||||
carouselClassName?: string;
|
carouselClassName?: string;
|
||||||
controlsClassName?: string;
|
controlsClassName?: string;
|
||||||
@@ -132,90 +49,94 @@ interface FeatureCardTwentySevenProps {
|
|||||||
textBoxButtonTextClassName?: string;
|
textBoxButtonTextClassName?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const FeatureCardTwentySeven = ({
|
const FeatureCardTwentySeven: React.FC<FeatureCardTwentySevenProps> = ({
|
||||||
features,
|
features = [],
|
||||||
carouselMode = "buttons",
|
gridVariant = "uniform-all-items-equal", uniformGridCustomHeightClasses = "min-h-95 2xl:min-h-105", animationType = "slide-up", title,
|
||||||
gridVariant,
|
|
||||||
uniformGridCustomHeightClasses = "min-h-none",
|
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
titleSegments,
|
||||||
description,
|
description = "", tag,
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
tagAnimation,
|
||||||
buttons,
|
buttons,
|
||||||
buttonAnimation,
|
buttonAnimation,
|
||||||
textboxLayout,
|
textboxLayout = "default", useInvertedBackground = false,
|
||||||
useInvertedBackground,
|
ariaLabel = "Feature section", className = "", containerClassName = "", cardClassName = "", mediaClassName = "", textBoxTitleClassName = "", textBoxTitleImageWrapperClassName = "", textBoxTitleImageClassName = "", textBoxDescriptionClassName = "", cardTitleClassName = "", cardDescriptionClassName = "", cardIconClassName = "", cardIconWrapperClassName = "", gridClassName = "", carouselClassName = "", controlsClassName = "", textBoxClassName = "", textBoxTagClassName = "", textBoxButtonContainerClassName = "", textBoxButtonClassName = "", textBoxButtonTextClassName = ""}) => {
|
||||||
ariaLabel = "Feature section",
|
const cardItems = useMemo(
|
||||||
className = "",
|
() =>
|
||||||
containerClassName = "",
|
features.map((feature) => (
|
||||||
cardClassName = "",
|
<div
|
||||||
textBoxTitleClassName = "",
|
key={feature.id}
|
||||||
textBoxTitleImageWrapperClassName = "",
|
className={`h-full flex flex-col gap-4 p-6 rounded-lg bg-card ${cardClassName}`}
|
||||||
textBoxTitleImageClassName = "",
|
>
|
||||||
textBoxDescriptionClassName = "",
|
{feature.icon && (
|
||||||
cardTitleClassName = "",
|
<div className={`flex items-center justify-center w-12 h-12 rounded-lg bg-primary-cta/10 ${cardIconWrapperClassName}`}>
|
||||||
cardDescriptionClassName = "",
|
<span className={`text-2xl ${cardIconClassName}`}>{feature.icon}</span>
|
||||||
gridClassName = "",
|
</div>
|
||||||
carouselClassName = "",
|
)}
|
||||||
controlsClassName = "",
|
<h3 className={`text-xl font-semibold text-foreground ${cardTitleClassName}`}>
|
||||||
textBoxClassName = "",
|
{feature.title}
|
||||||
textBoxTagClassName = "",
|
</h3>
|
||||||
textBoxButtonContainerClassName = "",
|
<p className={`text-sm text-foreground/70 flex-1 ${cardDescriptionClassName}`}>
|
||||||
textBoxButtonClassName = "",
|
{feature.description}
|
||||||
textBoxButtonTextClassName = "",
|
</p>
|
||||||
}: FeatureCardTwentySevenProps) => {
|
{feature.mediaItems && (
|
||||||
|
<div className={`flex gap-2 mt-auto ${mediaClassName}`}>
|
||||||
|
{feature.mediaItems.map((media, idx) => (
|
||||||
|
<img
|
||||||
|
key={idx}
|
||||||
|
src={media.src}
|
||||||
|
alt={media.alt || "Feature media"}
|
||||||
|
className="w-full h-20 object-cover rounded-lg"
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)),
|
||||||
|
[features, cardClassName, cardIconWrapperClassName, cardIconClassName, cardTitleClassName, cardDescriptionClassName, mediaClassName]
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<CardStack
|
<div
|
||||||
mode={carouselMode}
|
className={`w-full py-20 ${useInvertedBackground ? "bg-background/50" : ""} ${containerClassName}`}
|
||||||
gridVariant={gridVariant}
|
aria-label={ariaLabel}
|
||||||
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
|
||||||
animationType={animationType}
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
className={className}
|
|
||||||
containerClassName={containerClassName}
|
|
||||||
gridClassName={gridClassName}
|
|
||||||
carouselClassName={carouselClassName}
|
|
||||||
controlsClassName={controlsClassName}
|
|
||||||
textBoxClassName={textBoxClassName}
|
|
||||||
titleClassName={textBoxTitleClassName}
|
|
||||||
titleImageWrapperClassName={textBoxTitleImageWrapperClassName}
|
|
||||||
titleImageClassName={textBoxTitleImageClassName}
|
|
||||||
descriptionClassName={textBoxDescriptionClassName}
|
|
||||||
tagClassName={textBoxTagClassName}
|
|
||||||
buttonContainerClassName={textBoxButtonContainerClassName}
|
|
||||||
buttonClassName={textBoxButtonClassName}
|
|
||||||
buttonTextClassName={textBoxButtonTextClassName}
|
|
||||||
ariaLabel={ariaLabel}
|
|
||||||
>
|
>
|
||||||
{features.map((feature, index) => (
|
{title && (
|
||||||
<FeatureCardTwentySevenItem
|
<div className={`max-w-content-width mx-auto px-4 mb-12 ${textBoxClassName}`}>
|
||||||
key={`${feature.id}-${index}`}
|
<TextBox
|
||||||
title={feature.title}
|
title={title}
|
||||||
descriptions={feature.descriptions}
|
titleSegments={titleSegments}
|
||||||
imageSrc={feature.imageSrc}
|
description={description}
|
||||||
videoSrc={feature.videoSrc}
|
tag={tag}
|
||||||
imageAlt={feature.imageAlt}
|
tagAnimation={tagAnimation}
|
||||||
className={cardClassName}
|
buttons={buttons}
|
||||||
titleClassName={cardTitleClassName}
|
buttonAnimation={buttonAnimation}
|
||||||
descriptionClassName={cardDescriptionClassName}
|
textboxLayout={textboxLayout}
|
||||||
/>
|
titleClassName={textBoxTitleClassName}
|
||||||
))}
|
descriptionClassName={textBoxDescriptionClassName}
|
||||||
</CardStack>
|
tagClassName={textBoxTagClassName}
|
||||||
|
buttonContainerClassName={textBoxButtonContainerClassName}
|
||||||
|
buttonClassName={textBoxButtonClassName}
|
||||||
|
buttonTextClassName={textBoxButtonTextClassName}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<div className="max-w-content-width mx-auto px-4">
|
||||||
|
<CardStack
|
||||||
|
gridVariant={gridVariant}
|
||||||
|
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
||||||
|
animationType={animationType}
|
||||||
|
carouselMode="buttons"
|
||||||
|
ariaLabel={ariaLabel}
|
||||||
|
className={className}
|
||||||
|
gridClassName={gridClassName}
|
||||||
|
carouselClassName={carouselClassName}
|
||||||
|
controlsClassName={controlsClassName}
|
||||||
|
>
|
||||||
|
{cardItems.map((item) => item)}
|
||||||
|
</CardStack>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
FeatureCardTwentySeven.displayName = "FeatureCardTwentySeven";
|
export default FeatureCardTwentySeven;
|
||||||
|
|
||||||
export default FeatureCardTwentySeven;
|
|
||||||
@@ -1,241 +1,141 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { memo } from "react";
|
import React, { useMemo } from "react";
|
||||||
import { ArrowRight } from "lucide-react";
|
import CardStack from "@/components/card/CardStack";
|
||||||
import CardStack from "@/components/cardStack/CardStack";
|
import TextBox from "@/components/Textbox";
|
||||||
import MediaContent from "@/components/shared/MediaContent";
|
import type { CardAnimationType } from "@/types/animations";
|
||||||
import Tag from "@/components/shared/Tag";
|
|
||||||
import { cls, shouldUseInvertedText } from "@/lib/utils";
|
|
||||||
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type { ButtonConfig, CardAnimationType, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
|
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
|
||||||
|
|
||||||
type FeatureItem = {
|
export interface FeatureCardTwentyThreeProps {
|
||||||
|
features?: Array<{
|
||||||
id: string;
|
id: string;
|
||||||
title: string;
|
title: string;
|
||||||
tags: string[];
|
|
||||||
imageSrc?: string;
|
|
||||||
videoSrc?: string;
|
|
||||||
imageAlt?: string;
|
|
||||||
videoAriaLabel?: string;
|
|
||||||
onFeatureClick?: () => void;
|
|
||||||
};
|
|
||||||
|
|
||||||
interface FeatureCardTwentyThreeProps {
|
|
||||||
features: FeatureItem[];
|
|
||||||
carouselMode?: "auto" | "buttons";
|
|
||||||
uniformGridCustomHeightClasses?: string;
|
|
||||||
animationType: CardAnimationType;
|
|
||||||
title: string;
|
|
||||||
titleSegments?: TitleSegment[];
|
|
||||||
description: string;
|
description: string;
|
||||||
tag?: string;
|
icon?: React.ReactNode;
|
||||||
tagIcon?: LucideIcon;
|
mediaItems?: Array<{ type: string; src: string; alt?: string }>;
|
||||||
tagAnimation?: ButtonAnimationType;
|
}>;
|
||||||
buttons?: ButtonConfig[];
|
gridVariant?: string;
|
||||||
buttonAnimation?: ButtonAnimationType;
|
uniformGridCustomHeightClasses?: string;
|
||||||
textboxLayout: TextboxLayout;
|
animationType?: CardAnimationType;
|
||||||
useInvertedBackground: InvertedBackground;
|
title?: string;
|
||||||
ariaLabel?: string;
|
titleSegments?: Array<{ type: "text"; content: string } | { type: "image"; src: string; alt?: string }>;
|
||||||
className?: string;
|
description?: string;
|
||||||
containerClassName?: string;
|
tag?: string;
|
||||||
itemClassName?: string;
|
tagAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
|
||||||
mediaWrapperClassName?: string;
|
buttons?: Array<{ text: string; onClick?: () => void; href?: string }>;
|
||||||
mediaClassName?: string;
|
buttonAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
|
||||||
cardClassName?: string;
|
textboxLayout?: "default" | "split" | "split-actions" | "split-description" | "inline-image";
|
||||||
cardTitleClassName?: string;
|
useInvertedBackground?: boolean;
|
||||||
tagsContainerClassName?: string;
|
ariaLabel?: string;
|
||||||
tagClassName?: string;
|
className?: string;
|
||||||
arrowClassName?: string;
|
containerClassName?: string;
|
||||||
textBoxTitleClassName?: string;
|
cardClassName?: string;
|
||||||
textBoxTitleImageWrapperClassName?: string;
|
mediaClassName?: string;
|
||||||
textBoxTitleImageClassName?: string;
|
textBoxTitleClassName?: string;
|
||||||
textBoxDescriptionClassName?: string;
|
textBoxTitleImageWrapperClassName?: string;
|
||||||
gridClassName?: string;
|
textBoxTitleImageClassName?: string;
|
||||||
carouselClassName?: string;
|
textBoxDescriptionClassName?: string;
|
||||||
controlsClassName?: string;
|
cardTitleClassName?: string;
|
||||||
textBoxClassName?: string;
|
cardDescriptionClassName?: string;
|
||||||
textBoxTagClassName?: string;
|
cardIconClassName?: string;
|
||||||
textBoxButtonContainerClassName?: string;
|
cardIconWrapperClassName?: string;
|
||||||
textBoxButtonClassName?: string;
|
gridClassName?: string;
|
||||||
textBoxButtonTextClassName?: string;
|
carouselClassName?: string;
|
||||||
|
controlsClassName?: string;
|
||||||
|
textBoxClassName?: string;
|
||||||
|
textBoxTagClassName?: string;
|
||||||
|
textBoxButtonContainerClassName?: string;
|
||||||
|
textBoxButtonClassName?: string;
|
||||||
|
buttonTextClassName?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface FeatureCardItemProps {
|
const FeatureCardTwentyThree: React.FC<FeatureCardTwentyThreeProps> = ({
|
||||||
feature: FeatureItem;
|
features = [],
|
||||||
shouldUseLightText: boolean;
|
gridVariant = "uniform-all-items-equal", uniformGridCustomHeightClasses = "min-h-95 2xl:min-h-105", animationType = "slide-up", title,
|
||||||
useInvertedBackground: InvertedBackground;
|
titleSegments,
|
||||||
itemClassName?: string;
|
description = "", tag,
|
||||||
mediaWrapperClassName?: string;
|
tagAnimation,
|
||||||
mediaClassName?: string;
|
buttons,
|
||||||
cardClassName?: string;
|
buttonAnimation,
|
||||||
cardTitleClassName?: string;
|
textboxLayout = "default", useInvertedBackground = false,
|
||||||
tagsContainerClassName?: string;
|
ariaLabel = "Feature section", className = "", containerClassName = "", cardClassName = "", mediaClassName = "", textBoxTitleClassName = "", textBoxTitleImageWrapperClassName = "", textBoxTitleImageClassName = "", textBoxDescriptionClassName = "", cardTitleClassName = "", cardDescriptionClassName = "", cardIconClassName = "", cardIconWrapperClassName = "", gridClassName = "", carouselClassName = "", controlsClassName = "", textBoxClassName = "", textBoxTagClassName = "", textBoxButtonContainerClassName = "", textBoxButtonClassName = "", buttonTextClassName = ""}) => {
|
||||||
tagClassName?: string;
|
const cardItems = useMemo(
|
||||||
arrowClassName?: string;
|
() =>
|
||||||
}
|
features.map((feature) => (
|
||||||
|
<div
|
||||||
const FeatureCardItem = memo(({
|
key={feature.id}
|
||||||
feature,
|
className={`h-full flex flex-col gap-4 p-6 rounded-lg bg-card ${cardClassName}`}
|
||||||
shouldUseLightText,
|
|
||||||
useInvertedBackground,
|
|
||||||
itemClassName = "",
|
|
||||||
mediaWrapperClassName = "",
|
|
||||||
mediaClassName = "",
|
|
||||||
cardClassName = "",
|
|
||||||
cardTitleClassName = "",
|
|
||||||
tagsContainerClassName = "",
|
|
||||||
tagClassName = "",
|
|
||||||
arrowClassName = "",
|
|
||||||
}: FeatureCardItemProps) => {
|
|
||||||
return (
|
|
||||||
<article
|
|
||||||
className={cls("relative h-full flex flex-col gap-6 cursor-pointer group", itemClassName)}
|
|
||||||
onClick={feature.onFeatureClick}
|
|
||||||
role="article"
|
|
||||||
aria-label={feature.title}
|
|
||||||
>
|
>
|
||||||
<div className={cls("relative w-full aspect-square overflow-hidden rounded-theme-capped", mediaWrapperClassName)}>
|
{feature.icon && (
|
||||||
<MediaContent
|
<div className={`flex items-center justify-center w-12 h-12 rounded-lg bg-primary-cta/10 ${cardIconWrapperClassName}`}>
|
||||||
imageSrc={feature.imageSrc}
|
<span className={`text-2xl ${cardIconClassName}`}>{feature.icon}</span>
|
||||||
videoSrc={feature.videoSrc}
|
</div>
|
||||||
imageAlt={feature.imageAlt || feature.title}
|
)}
|
||||||
videoAriaLabel={feature.videoAriaLabel || feature.title}
|
<h3 className={`text-xl font-semibold text-foreground ${cardTitleClassName}`}>
|
||||||
imageClassName={cls("w-full h-full object-cover transition-transform duration-500 ease-in-out group-hover:scale-105", mediaClassName)}
|
{feature.title}
|
||||||
|
</h3>
|
||||||
|
<p className={`text-sm text-foreground/70 flex-1 ${cardDescriptionClassName}`}>
|
||||||
|
{feature.description}
|
||||||
|
</p>
|
||||||
|
{feature.mediaItems && (
|
||||||
|
<div className={`flex gap-2 mt-auto ${mediaClassName}`}>
|
||||||
|
{feature.mediaItems.map((media, idx) => (
|
||||||
|
<img
|
||||||
|
key={idx}
|
||||||
|
src={media.src}
|
||||||
|
alt={media.alt || "Feature media"}
|
||||||
|
className="w-full h-20 object-cover rounded-lg"
|
||||||
/>
|
/>
|
||||||
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)),
|
||||||
|
[features, cardClassName, cardIconWrapperClassName, cardIconClassName, cardTitleClassName, cardDescriptionClassName, mediaClassName]
|
||||||
|
);
|
||||||
|
|
||||||
<div className={cls("relative z-1 card rounded-theme-capped p-5 flex-1 flex flex-col justify-between gap-4", cardClassName)}>
|
return (
|
||||||
<h3 className={cls(
|
<div
|
||||||
"text-xl md:text-2xl font-medium leading-tight",
|
className={`w-full py-20 ${useInvertedBackground ? "bg-background/50" : ""} ${containerClassName}`}
|
||||||
shouldUseLightText ? "text-background" : "text-foreground",
|
aria-label={ariaLabel}
|
||||||
cardTitleClassName
|
>
|
||||||
)}>
|
{title && (
|
||||||
{feature.title}
|
<div className={`max-w-content-width mx-auto px-4 mb-12 ${textBoxClassName}`}>
|
||||||
</h3>
|
<TextBox
|
||||||
|
|
||||||
<div className="flex items-center justify-between gap-4">
|
|
||||||
<div className={cls("flex items-center gap-2 flex-wrap", tagsContainerClassName)}>
|
|
||||||
{feature.tags.map((tag, index) => (
|
|
||||||
<Tag
|
|
||||||
key={index}
|
|
||||||
text={tag}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
className={tagClassName}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
<ArrowRight
|
|
||||||
className={cls(
|
|
||||||
"h-[var(--text-base)] w-auto shrink-0 transition-transform duration-300 group-hover:-rotate-45",
|
|
||||||
shouldUseLightText ? "text-background" : "text-foreground",
|
|
||||||
arrowClassName
|
|
||||||
)}
|
|
||||||
strokeWidth={1.5}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
FeatureCardItem.displayName = "FeatureCardItem";
|
|
||||||
|
|
||||||
const FeatureCardTwentyThree = ({
|
|
||||||
features,
|
|
||||||
carouselMode = "buttons",
|
|
||||||
uniformGridCustomHeightClasses,
|
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
textboxLayout,
|
|
||||||
useInvertedBackground,
|
|
||||||
ariaLabel = "Features section",
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
itemClassName = "",
|
|
||||||
mediaWrapperClassName = "",
|
|
||||||
mediaClassName = "",
|
|
||||||
cardClassName = "",
|
|
||||||
cardTitleClassName = "",
|
|
||||||
tagsContainerClassName = "",
|
|
||||||
tagClassName = "",
|
|
||||||
arrowClassName = "",
|
|
||||||
textBoxTitleClassName = "",
|
|
||||||
textBoxTitleImageWrapperClassName = "",
|
|
||||||
textBoxTitleImageClassName = "",
|
|
||||||
textBoxDescriptionClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
carouselClassName = "",
|
|
||||||
controlsClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
}: FeatureCardTwentyThreeProps) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
|
|
||||||
return (
|
|
||||||
<CardStack
|
|
||||||
mode={carouselMode}
|
|
||||||
gridVariant="uniform-all-items-equal"
|
|
||||||
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
|
||||||
animationType={animationType}
|
|
||||||
|
|
||||||
title={title}
|
title={title}
|
||||||
titleSegments={titleSegments}
|
titleSegments={titleSegments}
|
||||||
description={description}
|
description={description}
|
||||||
tag={tag}
|
tag={tag}
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
tagAnimation={tagAnimation}
|
||||||
buttons={buttons}
|
buttons={buttons}
|
||||||
buttonAnimation={buttonAnimation}
|
buttonAnimation={buttonAnimation}
|
||||||
textboxLayout={textboxLayout}
|
textboxLayout={textboxLayout}
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
ariaLabel={ariaLabel}
|
|
||||||
className={className}
|
|
||||||
containerClassName={containerClassName}
|
|
||||||
gridClassName={gridClassName}
|
|
||||||
carouselClassName={carouselClassName}
|
|
||||||
controlsClassName={controlsClassName}
|
|
||||||
textBoxClassName={textBoxClassName}
|
|
||||||
titleClassName={textBoxTitleClassName}
|
titleClassName={textBoxTitleClassName}
|
||||||
titleImageWrapperClassName={textBoxTitleImageWrapperClassName}
|
|
||||||
titleImageClassName={textBoxTitleImageClassName}
|
|
||||||
descriptionClassName={textBoxDescriptionClassName}
|
descriptionClassName={textBoxDescriptionClassName}
|
||||||
tagClassName={textBoxTagClassName}
|
tagClassName={textBoxTagClassName}
|
||||||
buttonContainerClassName={textBoxButtonContainerClassName}
|
buttonContainerClassName={textBoxButtonContainerClassName}
|
||||||
buttonClassName={textBoxButtonClassName}
|
buttonClassName={textBoxButtonClassName}
|
||||||
buttonTextClassName={textBoxButtonTextClassName}
|
buttonTextClassName={buttonTextClassName}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<div className="max-w-content-width mx-auto px-4">
|
||||||
|
<CardStack
|
||||||
|
gridVariant={gridVariant}
|
||||||
|
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
||||||
|
animationType={animationType}
|
||||||
|
carouselMode="buttons"
|
||||||
|
ariaLabel={ariaLabel}
|
||||||
|
className={className}
|
||||||
|
gridClassName={gridClassName}
|
||||||
|
carouselClassName={carouselClassName}
|
||||||
|
controlsClassName={controlsClassName}
|
||||||
>
|
>
|
||||||
{features.map((feature) => (
|
{cardItems.map((item) => item)}
|
||||||
<FeatureCardItem
|
|
||||||
key={feature.id}
|
|
||||||
feature={feature}
|
|
||||||
shouldUseLightText={shouldUseLightText}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
itemClassName={itemClassName}
|
|
||||||
mediaWrapperClassName={mediaWrapperClassName}
|
|
||||||
mediaClassName={mediaClassName}
|
|
||||||
cardClassName={cardClassName}
|
|
||||||
cardTitleClassName={cardTitleClassName}
|
|
||||||
tagsContainerClassName={tagsContainerClassName}
|
|
||||||
tagClassName={tagClassName}
|
|
||||||
arrowClassName={arrowClassName}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</CardStack>
|
</CardStack>
|
||||||
);
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
FeatureCardTwentyThree.displayName = "FeatureCardTwentyThree";
|
export default FeatureCardTwentyThree;
|
||||||
|
|
||||||
export default FeatureCardTwentyThree;
|
|
||||||
@@ -1,54 +1,43 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import CardStack from "@/components/cardStack/CardStack";
|
import React, { useMemo } from "react";
|
||||||
import FeatureBorderGlowItem from "./FeatureBorderGlowItem";
|
import CardStack from "@/components/card/CardStack";
|
||||||
import { shouldUseInvertedText } from "@/lib/utils";
|
import TextBox from "@/components/Textbox";
|
||||||
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
|
import type { CardAnimationType } from "@/types/animations";
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type {
|
|
||||||
ButtonConfig,
|
|
||||||
CardAnimationType,
|
|
||||||
TitleSegment,
|
|
||||||
ButtonAnimationType,
|
|
||||||
} from "@/components/cardStack/types";
|
|
||||||
import type {
|
|
||||||
TextboxLayout,
|
|
||||||
InvertedBackground,
|
|
||||||
} from "@/providers/themeProvider/config/constants";
|
|
||||||
|
|
||||||
interface FeatureCard {
|
export interface FeatureBorderGlowProps {
|
||||||
icon: LucideIcon;
|
features?: Array<{
|
||||||
title: string;
|
id: string;
|
||||||
description: string;
|
title: string;
|
||||||
}
|
description: string;
|
||||||
|
icon?: React.ReactNode;
|
||||||
interface FeatureBorderGlowProps {
|
mediaItems?: Array<{ type: string; src: string; alt?: string }>;
|
||||||
features: FeatureCard[];
|
}>;
|
||||||
carouselMode?: "auto" | "buttons";
|
gridVariant?: string;
|
||||||
uniformGridCustomHeightClasses?: string;
|
uniformGridCustomHeightClasses?: string;
|
||||||
animationType: CardAnimationType;
|
animationType?: CardAnimationType;
|
||||||
title: string;
|
title?: string;
|
||||||
titleSegments?: TitleSegment[];
|
titleSegments?: Array<{ type: "text"; content: string } | { type: "image"; src: string; alt?: string }>;
|
||||||
description: string;
|
description?: string;
|
||||||
tag?: string;
|
tag?: string;
|
||||||
tagIcon?: LucideIcon;
|
tagAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
|
||||||
tagAnimation?: ButtonAnimationType;
|
buttons?: Array<{ text: string; onClick?: () => void; href?: string }>;
|
||||||
buttons?: ButtonConfig[];
|
buttonAnimation?: "none" | "opacity" | "slide-up" | "blur-reveal";
|
||||||
buttonAnimation?: ButtonAnimationType;
|
textboxLayout?: "default" | "split" | "split-actions" | "split-description" | "inline-image";
|
||||||
textboxLayout: TextboxLayout;
|
useInvertedBackground?: boolean;
|
||||||
useInvertedBackground: InvertedBackground;
|
|
||||||
ariaLabel?: string;
|
ariaLabel?: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
containerClassName?: string;
|
containerClassName?: string;
|
||||||
cardClassName?: string;
|
cardClassName?: string;
|
||||||
iconContainerClassName?: string;
|
mediaClassName?: string;
|
||||||
iconClassName?: string;
|
|
||||||
textBoxTitleClassName?: string;
|
textBoxTitleClassName?: string;
|
||||||
textBoxTitleImageWrapperClassName?: string;
|
textBoxTitleImageWrapperClassName?: string;
|
||||||
textBoxTitleImageClassName?: string;
|
textBoxTitleImageClassName?: string;
|
||||||
textBoxDescriptionClassName?: string;
|
textBoxDescriptionClassName?: string;
|
||||||
cardTitleClassName?: string;
|
cardTitleClassName?: string;
|
||||||
cardDescriptionClassName?: string;
|
cardDescriptionClassName?: string;
|
||||||
|
cardIconClassName?: string;
|
||||||
|
cardIconWrapperClassName?: string;
|
||||||
gridClassName?: string;
|
gridClassName?: string;
|
||||||
carouselClassName?: string;
|
carouselClassName?: string;
|
||||||
controlsClassName?: string;
|
controlsClassName?: string;
|
||||||
@@ -59,97 +48,94 @@ interface FeatureBorderGlowProps {
|
|||||||
textBoxButtonTextClassName?: string;
|
textBoxButtonTextClassName?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const FeatureBorderGlow = ({
|
const FeatureBorderGlow: React.FC<FeatureBorderGlowProps> = ({
|
||||||
features,
|
features = [],
|
||||||
carouselMode = "buttons",
|
gridVariant = "uniform-all-items-equal", uniformGridCustomHeightClasses = "min-h-95 2xl:min-h-105", animationType = "slide-up", title,
|
||||||
uniformGridCustomHeightClasses = "min-h-75 2xl:min-h-85",
|
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
titleSegments,
|
||||||
description,
|
description = "", tag,
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
tagAnimation,
|
||||||
buttons,
|
buttons,
|
||||||
buttonAnimation,
|
buttonAnimation,
|
||||||
textboxLayout,
|
textboxLayout = "default", useInvertedBackground = false,
|
||||||
useInvertedBackground,
|
ariaLabel = "Feature section", className = "", containerClassName = "", cardClassName = "", mediaClassName = "", textBoxTitleClassName = "", textBoxTitleImageWrapperClassName = "", textBoxTitleImageClassName = "", textBoxDescriptionClassName = "", cardTitleClassName = "", cardDescriptionClassName = "", cardIconClassName = "", cardIconWrapperClassName = "", gridClassName = "", carouselClassName = "", controlsClassName = "", textBoxClassName = "", textBoxTagClassName = "", textBoxButtonContainerClassName = "", textBoxButtonClassName = "", textBoxButtonTextClassName = ""}) => {
|
||||||
ariaLabel = "Feature section",
|
const cardItems = useMemo(
|
||||||
className = "",
|
() =>
|
||||||
containerClassName = "",
|
features.map((feature) => (
|
||||||
cardClassName = "",
|
<div
|
||||||
iconContainerClassName = "",
|
key={feature.id}
|
||||||
iconClassName = "",
|
className={`h-full flex flex-col gap-4 p-6 rounded-lg bg-card ${cardClassName}`}
|
||||||
textBoxTitleClassName = "",
|
>
|
||||||
textBoxTitleImageWrapperClassName = "",
|
{feature.icon && (
|
||||||
textBoxTitleImageClassName = "",
|
<div className={`flex items-center justify-center w-12 h-12 rounded-lg bg-primary-cta/10 ${cardIconWrapperClassName}`}>
|
||||||
textBoxDescriptionClassName = "",
|
<span className={`text-2xl ${cardIconClassName}`}>{feature.icon}</span>
|
||||||
cardTitleClassName = "",
|
</div>
|
||||||
cardDescriptionClassName = "",
|
)}
|
||||||
gridClassName = "",
|
<h3 className={`text-xl font-semibold text-foreground ${cardTitleClassName}`}>
|
||||||
carouselClassName = "",
|
{feature.title}
|
||||||
controlsClassName = "",
|
</h3>
|
||||||
textBoxClassName = "",
|
<p className={`text-sm text-foreground/70 flex-1 ${cardDescriptionClassName}`}>
|
||||||
textBoxTagClassName = "",
|
{feature.description}
|
||||||
textBoxButtonContainerClassName = "",
|
</p>
|
||||||
textBoxButtonClassName = "",
|
{feature.mediaItems && (
|
||||||
textBoxButtonTextClassName = "",
|
<div className={`flex gap-2 mt-auto ${mediaClassName}`}>
|
||||||
}: FeatureBorderGlowProps) => {
|
{feature.mediaItems.map((media, idx) => (
|
||||||
const theme = useTheme();
|
<img
|
||||||
const shouldUseLightText = shouldUseInvertedText(
|
key={idx}
|
||||||
useInvertedBackground,
|
src={media.src}
|
||||||
theme.cardStyle
|
alt={media.alt || "Feature media"}
|
||||||
|
className="w-full h-20 object-cover rounded-lg"
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)),
|
||||||
|
[features, cardClassName, cardIconWrapperClassName, cardIconClassName, cardTitleClassName, cardDescriptionClassName, mediaClassName]
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<CardStack
|
<div
|
||||||
mode={carouselMode}
|
className={`w-full py-20 ${useInvertedBackground ? "bg-background/50" : ""} ${containerClassName}`}
|
||||||
gridVariant="uniform-all-items-equal"
|
aria-label={ariaLabel}
|
||||||
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
|
||||||
animationType={animationType}
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
className={className}
|
|
||||||
containerClassName={containerClassName}
|
|
||||||
gridClassName={gridClassName}
|
|
||||||
carouselClassName={carouselClassName}
|
|
||||||
controlsClassName={controlsClassName}
|
|
||||||
textBoxClassName={textBoxClassName}
|
|
||||||
titleClassName={textBoxTitleClassName}
|
|
||||||
titleImageWrapperClassName={textBoxTitleImageWrapperClassName}
|
|
||||||
titleImageClassName={textBoxTitleImageClassName}
|
|
||||||
descriptionClassName={textBoxDescriptionClassName}
|
|
||||||
tagClassName={textBoxTagClassName}
|
|
||||||
buttonContainerClassName={textBoxButtonContainerClassName}
|
|
||||||
buttonClassName={textBoxButtonClassName}
|
|
||||||
buttonTextClassName={textBoxButtonTextClassName}
|
|
||||||
ariaLabel={ariaLabel}
|
|
||||||
>
|
>
|
||||||
{features.map((feature, index) => (
|
{title && (
|
||||||
<FeatureBorderGlowItem
|
<div className={`max-w-content-width mx-auto px-4 mb-12 ${textBoxClassName}`}>
|
||||||
key={`${feature.title}-${index}`}
|
<TextBox
|
||||||
item={feature}
|
title={title}
|
||||||
index={index}
|
titleSegments={titleSegments}
|
||||||
className={cardClassName}
|
description={description}
|
||||||
iconContainerClassName={iconContainerClassName}
|
tag={tag}
|
||||||
iconClassName={iconClassName}
|
tagAnimation={tagAnimation}
|
||||||
titleClassName={cardTitleClassName}
|
buttons={buttons}
|
||||||
descriptionClassName={cardDescriptionClassName}
|
buttonAnimation={buttonAnimation}
|
||||||
shouldUseLightText={shouldUseLightText}
|
textboxLayout={textboxLayout}
|
||||||
/>
|
titleClassName={textBoxTitleClassName}
|
||||||
))}
|
descriptionClassName={textBoxDescriptionClassName}
|
||||||
</CardStack>
|
tagClassName={textBoxTagClassName}
|
||||||
|
buttonContainerClassName={textBoxButtonContainerClassName}
|
||||||
|
buttonClassName={textBoxButtonClassName}
|
||||||
|
buttonTextClassName={textBoxButtonTextClassName}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<div className="max-w-content-width mx-auto px-4">
|
||||||
|
<CardStack
|
||||||
|
gridVariant={gridVariant}
|
||||||
|
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
||||||
|
animationType={animationType}
|
||||||
|
carouselMode="buttons"
|
||||||
|
ariaLabel={ariaLabel}
|
||||||
|
className={className}
|
||||||
|
gridClassName={gridClassName}
|
||||||
|
carouselClassName={carouselClassName}
|
||||||
|
controlsClassName={controlsClassName}
|
||||||
|
>
|
||||||
|
{cardItems.map((item) => item)}
|
||||||
|
</CardStack>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
FeatureBorderGlow.displayName = "FeatureBorderGlow";
|
export default FeatureBorderGlow;
|
||||||
|
|
||||||
export default FeatureBorderGlow;
|
|
||||||
33
src/middleware.ts
Normal file
33
src/middleware.ts
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
import { NextRequest, NextResponse } from 'next/server';
|
||||||
|
|
||||||
|
const protectedRoutes = ['/dashboard', '/profile', '/settings'];
|
||||||
|
const authRoutes = ['/auth'];
|
||||||
|
const publicRoutes = ['/'];
|
||||||
|
|
||||||
|
export function middleware(request: NextRequest) {
|
||||||
|
const token = request.cookies.get('auth_token')?.value ||
|
||||||
|
(typeof window !== 'undefined' ? localStorage.getItem('token') : null);
|
||||||
|
|
||||||
|
const { pathname } = request.nextUrl;
|
||||||
|
|
||||||
|
// Check if route is protected
|
||||||
|
const isProtected = protectedRoutes.some(route => pathname.startsWith(route));
|
||||||
|
const isAuthRoute = authRoutes.some(route => pathname.startsWith(route));
|
||||||
|
const isPublic = publicRoutes.some(route => pathname === route);
|
||||||
|
|
||||||
|
// Redirect to auth if accessing protected route without token
|
||||||
|
if (isProtected && !token) {
|
||||||
|
return NextResponse.redirect(new URL('/auth', request.url));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Redirect to dashboard if accessing auth route with token
|
||||||
|
if (isAuthRoute && token) {
|
||||||
|
return NextResponse.redirect(new URL('/dashboard', request.url));
|
||||||
|
}
|
||||||
|
|
||||||
|
return NextResponse.next();
|
||||||
|
}
|
||||||
|
|
||||||
|
export const config = {
|
||||||
|
matcher: ['/((?!api|_next/static|_next/image|favicon.ico).*)'],
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user