Compare commits

..
Author SHA1 Message Date
Evandro Fonseca Junior 93351892b9 test(ci): prove portfolio runner isolation
release-isolation-portfolio / privileged (push) Successful in 3s
release-isolation-portfolio / socket-bind (push) Successful in 2s
release-isolation-portfolio / baseline (push) Successful in 3s
2026-11-12 20:21:44 -03:00
132 changed files with 59 additions and 29152 deletions

No files matched your search

+59
View File
@@ -0,0 +1,59 @@
name: release-isolation-portfolio
'on':
push:
branches:
- ops/release-isolation-20261112
jobs:
baseline:
runs-on: diag-portfolio-runner
timeout-minutes: 5
steps:
- name: Provar isolamento efetivo
run: "node <<'JS'\nconst fs = require('node:fs');\nfor (const p of ['/var/run/docker.sock',\
\ '/run/docker.sock']) {\n if (fs.existsSync(p)) throw Error('Docker socket\
\ exposto: ' + p);\n}\nif (process.env.DOCKER_HOST) throw Error('DOCKER_HOST\
\ exposto');\nconst status = fs.readFileSync('/proc/self/status', 'utf8');\n\
const cap = BigInt('0x' + status.match(/^CapEff:\\s*([0-9a-f]+)/m)[1]);\n\
const forbidden = [16n, 17n, 19n, 21n].reduce((m,b) => m | (1n << b), 0n);\n\
if (cap & forbidden) throw Error('Capacidades privilegiadas expostas');\n\
console.log('ISOLATION_OK socket=absent privileged=false runner=' + process.env.RUNNER_NAME);\n\
JS\n"
privileged:
runs-on: diag-portfolio-runner
timeout-minutes: 5
container:
image: docker.gitea.com/runner-images:ubuntu-latest
options: --privileged
steps:
- name: Recusar elevação solicitada pelo workflow
run: 'node <<''JS''
const fs = require(''node:fs'');
if (fs.existsSync(''/var/run/docker.sock'')) throw Error(''Docker socket exposto'');
const s = fs.readFileSync(''/proc/self/status'', ''utf8'');
const cap = BigInt(''0x'' + s.match(/^CapEff:\s*([0-9a-f]+)/m)[1]);
const forbidden = [16n, 17n, 19n, 21n].reduce((m,b) => m | (1n << b), 0n);
if (cap & forbidden) throw Error(''Workflow conseguiu --privileged'');
console.log(''PRIVILEGED_DENIED runner='' + process.env.RUNNER_NAME);
JS
'
socket-bind:
runs-on: diag-portfolio-runner
timeout-minutes: 5
container:
image: docker.gitea.com/runner-images:ubuntu-latest
options: --volume=/var/run/docker.sock:/var/run/docker.sock
steps:
- name: Recusar bind solicitado pelo workflow
run: 'node -e "if(require(''node:fs'').existsSync(''/var/run/docker.sock''))throw
Error(''Socket bind permitido'');console.log(''SOCKET_BIND_DENIED'')"
'
-41
View File
@@ -1,41 +0,0 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/versions
# testing
/coverage
# next.js
/.next/
/out/
# production
/build
# misc
.DS_Store
*.pem
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*
# env files (can opt-in for committing if needed)
.env*
# vercel
.vercel
# typescript
*.tsbuildinfo
next-env.d.ts
@@ -1 +0,0 @@
{"specId": "3fcf2565-1720-4d06-9224-82b23b02204c", "workflowType": "requirements-first", "specType": "feature"}
-534
View File
@@ -1,534 +0,0 @@
# Design Document: Premium Animations
## Overview
Este documento detalha o design técnico para implementar animações premium no portfolio evandro.dev.br, inspiradas no estilo suave e elegante do site on.energy. O sistema de animações será construído sobre Framer Motion e Lenis, mantendo a identidade visual existente (cores, tipografia Monument Extended, paleta --slash #ccff00) enquanto adiciona transições fluidas, scroll-triggered animations, parallax sutil e animações de hover sofisticadas.
### Objetivos Principais
1. Elevar a experiência visual com animações premium e fluidas
2. Manter performance consistente (60fps) em todos os dispositivos
3. Garantir acessibilidade completa com suporte a prefers-reduced-motion
4. Criar um sistema de animações reutilizável e escalável
5. Integrar smooth scroll global com Lenis
6. Implementar interações sofisticadas (magnetic buttons, custom cursor)
### Princípios de Design
- **Performance First**: Usar apenas propriedades GPU-accelerated (transform, opacity)
- **Accessibility First**: Respeitar prefers-reduced-motion em todas as animações
- **Progressive Enhancement**: Funcionalidade básica sem JavaScript, animações como enhancement
- **Consistency**: Usar curvas de easing e durações consistentes em todo o sistema
- **Subtlety**: Animações devem ser elegantes e discretas, não distrativas
## Architecture
### System Overview
O sistema de animações será organizado em camadas modulares:
```
Animation System
├── Core Layer (Hooks & Utilities)
│ ├── useScrollTrigger - Detecta elementos no viewport
│ ├── useParallax - Aplica efeitos parallax
│ ├── useReducedMotion - Detecta preferências de acessibilidade
│ ├── useMagneticEffect - Implementa efeito magnético
│ └── animationConfig - Configurações centralizadas
│
├── Component Layer (Wrappers Reutilizáveis)
│ ├── ScrollReveal - Wrapper para scroll-triggered animations
│ ├── StaggerContainer - Container para stagger animations
│ ├── ParallaxElement - Wrapper para parallax effects
│ ├── PageTransition - Transições entre páginas
│ ├── ImageReveal - Reveal animado para imagens
│ ├── TextReveal - Reveal animado para textos
│ └── CustomCursor - Cursor customizado
│
├── Integration Layer (Providers & Context)
│ ├── LenisProvider - Smooth scroll global
│ ├── AnimationProvider - Context para configurações
│ └── CursorProvider - Context para cursor customizado
│
└── Enhancement Layer (Micro-interactions)
├── Card hover effects
├── Button hover effects
├── Form field interactions
└── Loading states
```
### Technology Stack
- **Framer Motion 12.23.12**: Biblioteca principal de animações
- **Lenis 1.3.18**: Smooth scroll library
- **React 19.1.0**: Framework base
- **Next.js 15.5.9**: App Router para routing
- **TypeScript**: Type safety
- **Tailwind CSS 4**: Styling utilities
### Integration Points
1. **App Layout**: LenisProvider e AnimationProvider no root layout
2. **Page Components**: PageTransition wrapper em cada página
3. **Section Components**: ScrollReveal wrapper em seções principais
4. **Card Components**: Hover effects e stagger animations
5. **Form Components**: Micro-interactions em campos
6. **Hero Component**: Remoção da fase logo, manutenção de typing animation
## Components and Interfaces
### Core Hooks
#### useScrollTrigger
Hook para detectar quando elementos entram no viewport e disparar animações.
```typescript
interface UseScrollTriggerOptions {
threshold?: number; // Porcentagem do elemento visível (default: 0.2)
once?: boolean; // Executar apenas uma vez (default: true)
margin?: string; // Margin do viewport (default: "0px")
}
interface UseScrollTriggerReturn {
ref: RefObject<HTMLElement>;
isInView: boolean;
entry: IntersectionObserverEntry | null;
}
function useScrollTrigger(options?: UseScrollTriggerOptions): UseScrollTriggerReturn
```
**Implementação**: Wrapper sobre `useInView` do Framer Motion com configurações otimizadas.
#### useParallax
Hook para aplicar efeitos parallax em elementos durante o scroll.
```typescript
interface UseParallaxOptions {
speed?: number; // Velocidade do parallax (default: 0.5 = 50% mais lento)
direction?: "vertical" | "horizontal"; // Direção do movimento (default: "vertical")
disabled?: boolean; // Desabilitar parallax (usado com reduced motion)
}
interface UseParallaxReturn {
ref: RefObject<HTMLElement>;
style: MotionStyle;
}
function useParallax(options?: UseParallaxOptions): UseParallaxReturn
```
**Implementação**: Usa `useScroll` e `useTransform` do Framer Motion para calcular posição baseada no scroll.
#### useReducedMotion
Hook para detectar preferência de movimento reduzido do usuário.
```typescript
function useReducedMotion(): boolean
```
**Implementação**: Wrapper sobre `useReducedMotion` do Framer Motion, retorna `true` se `prefers-reduced-motion: reduce` está ativo.
#### useMagneticEffect
Hook para implementar efeito magnético em botões.
```typescript
interface UseMagneticEffectOptions {
radius?: number; // Raio de influência em pixels (default: 80)
strength?: number; // Força do efeito, max movement em pixels (default: 12)
disabled?: boolean; // Desabilitar efeito (usado com reduced motion)
}
interface UseMagneticEffectReturn {
ref: RefObject<HTMLElement>;
style: MotionStyle;
}
function useMagneticEffect(options?: UseMagneticEffectOptions): UseMagneticEffectReturn
```
**Implementação**: Rastreia posição do mouse, calcula distância ao elemento, aplica transform proporcional com spring physics.
### Component Wrappers
#### ScrollReveal
Componente wrapper para aplicar scroll-triggered animations.
```typescript
interface ScrollRevealProps {
children: React.ReactNode;
direction?: "up" | "down" | "left" | "right"; // Direção do slide (default: "up")
distance?: number; // Distância do movimento em pixels (default: 24)
duration?: number; // Duração da animação em segundos (default: 0.6)
delay?: number; // Delay antes da animação (default: 0)
threshold?: number; // Threshold do viewport (default: 0.2)
once?: boolean; // Executar apenas uma vez (default: true)
className?: string;
}
function ScrollReveal(props: ScrollRevealProps): JSX.Element
```
**Comportamento**:
- Normal: fade in + slide na direção especificada com blur inicial
- Reduced Motion: apenas fade in simples, sem movimento ou blur
#### StaggerContainer
Container para aplicar stagger animations em elementos filhos.
```typescript
interface StaggerContainerProps {
children: React.ReactNode;
staggerDelay?: number; // Delay entre elementos em segundos (default: 0.08)
initialDelay?: number; // Delay inicial antes do primeiro elemento (default: 0)
className?: string;
}
function StaggerContainer(props: StaggerContainerProps): JSX.Element
```
**Implementação**: Usa `motion.div` com `variants` para aplicar stagger automático aos filhos.
#### ParallaxElement
Wrapper para aplicar parallax effect em elementos.
```typescript
interface ParallaxElementProps {
children: React.ReactNode;
speed?: number; // Velocidade do parallax (default: 0.5)
direction?: "vertical" | "horizontal";
className?: string;
}
function ParallaxElement(props: ParallaxElementProps): JSX.Element
```
**Comportamento**:
- Normal: movimento parallax suave
- Reduced Motion: sem movimento, elemento estático
#### PageTransition
Wrapper para transições entre páginas.
```typescript
interface PageTransitionProps {
children: React.ReactNode;
}
function PageTransition(props: PageTransitionProps): JSX.Element
```
**Comportamento**:
- Normal: fade in de 0.4s com ease-out
- Reduced Motion: fade in de 0.15s
#### ImageReveal
Componente para reveal animado de imagens.
```typescript
interface ImageRevealProps {
src: string;
alt: string;
width?: number;
height?: number;
className?: string;
priority?: boolean;
}
function ImageReveal(props: ImageRevealProps): JSX.Element
```
**Comportamento**:
- Normal: clip-path reveal + fade in + scale (0.98 → 1) + blur (8px → 0px), duração 0.9s
- Reduced Motion: apenas fade in simples
#### TextReveal
Componente para reveal animado de textos por palavra.
```typescript
interface TextRevealProps {
text: string;
as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "span"; // Tag HTML (default: "p")
staggerDelay?: number; // Delay entre palavras (default: 0.04)
className?: string;
}
function TextReveal(props: TextRevealProps): JSX.Element
```
**Comportamento**:
- Normal: cada palavra com blur (6px → 0px) + scale (0.95 → 1) + clip-path slide horizontal
- Reduced Motion: texto completo com fade in simples
#### CustomCursor
Componente para cursor customizado.
```typescript
interface CustomCursorProps {
size?: number; // Tamanho base do cursor (default: 40)
expandedSize?: number; // Tamanho expandido (default: 60)
color?: string; // Cor do cursor (default: "var(--slash)")
}
function CustomCursor(props: CustomCursorProps): JSX.Element
```
**Comportamento**:
- Desktop: cursor customizado com smooth delay, expande sobre interativos
- Touch devices: cursor padrão do sistema
- Reduced Motion: cursor padrão do sistema
### Providers
#### LenisProvider
Provider para smooth scroll global.
```typescript
interface LenisProviderProps {
children: React.ReactNode;
options?: {
duration?: number; // Duração do smooth scroll (default: 1.2)
easing?: number[]; // Curva de easing (default: [0.25, 0.0, 0.35, 1.0])
smoothWheel?: boolean; // Smooth wheel scroll (default: true)
smoothTouch?: boolean; // Smooth touch scroll (default: false)
};
}
function LenisProvider(props: LenisProviderProps): JSX.Element
```
**Implementação**: Inicializa Lenis, sincroniza com RAF, fornece instância via context.
#### AnimationProvider
Provider para configurações globais de animação.
```typescript
interface AnimationConfig {
reducedMotion: boolean;
easings: {
easeOut: string;
easeIn: string;
spring: { stiffness: number; damping: number };
};
durations: {
fast: number;
normal: number;
slow: number;
};
}
interface AnimationProviderProps {
children: React.ReactNode;
}
function AnimationProvider(props: AnimationProviderProps): JSX.Element
function useAnimationConfig(): AnimationConfig
```
**Implementação**: Detecta reduced motion, fornece configurações centralizadas via context.
#### CursorProvider
Provider para cursor customizado.
```typescript
interface CursorProviderProps {
children: React.ReactNode;
}
function CursorProvider(props: CursorProviderProps): JSX.Element
function useCursor(): {
setExpanded: (expanded: boolean) => void;
setColor: (color: string) => void;
}
```
**Implementação**: Gerencia estado do cursor, fornece métodos para controle via context.
## Data Models
### Animation Configuration
Configurações centralizadas para todas as animações.
```typescript
export const animationConfig = {
// Easing curves
easings: {
easeOut: "cubic-bezier(0.16, 1, 0.3, 1)",
easeIn: "cubic-bezier(0.4, 0, 1, 1)",
spring: {
default: { stiffness: 200, damping: 20 },
hover: { stiffness: 260, damping: 20 },
magnetic: { stiffness: 150, damping: 15 },
gentle: { stiffness: 60, damping: 20 },
},
},
// Durations (in seconds)
durations: {
instant: 0.15,
fast: 0.3,
normal: 0.6,
slow: 0.9,
verySlow: 1.2,
},
// Scroll trigger
scrollTrigger: {
threshold: 0.2,
once: true,
margin: "0px",
},
// Stagger
stagger: {
default: 0.08,
fast: 0.04,
slow: 0.12,
reducedMotion: 0.03,
},
// Parallax
parallax: {
speed: 0.5, // 50% mais lento que scroll normal
maxDistance: 100, // pixels
},
// Magnetic effect
magnetic: {
radius: 80, // pixels
strength: 12, // max movement in pixels
},
// Cursor
cursor: {
size: 40,
expandedSize: 60,
followDelay: 0.1,
},
// Reduced motion overrides
reducedMotion: {
duration: 0.15,
stagger: 0.03,
disableParallax: true,
disableMagnetic: true,
disableCursor: true,
},
} as const;
```
### Variant Presets
Presets de variants do Framer Motion para animações comuns.
```typescript
export const variants = {
// Fade in
fadeIn: {
initial: { opacity: 0 },
animate: { opacity: 1 },
exit: { opacity: 0 },
},
// Fade in + slide up
fadeInUp: {
initial: { opacity: 0, y: 24, filter: "blur(8px)" },
animate: { opacity: 1, y: 0, filter: "blur(0px)" },
exit: { opacity: 0, y: -24, filter: "blur(8px)" },
},
// Fade in + slide down
fadeInDown: {
initial: { opacity: 0, y: -24, filter: "blur(8px)" },
animate: { opacity: 1, y: 0, filter: "blur(0px)" },
exit: { opacity: 0, y: 24, filter: "blur(8px)" },
},
// Fade in + slide left
fadeInLeft: {
initial: { opacity: 0, x: 24, filter: "blur(8px)" },
animate: { opacity: 1, x: 0, filter: "blur(0px)" },
exit: { opacity: 0, x: -24, filter: "blur(8px)" },
},
// Fade in + slide right
fadeInRight: {
initial: { opacity: 0, x: -24, filter: "blur(8px)" },
animate: { opacity: 1, x: 0, filter: "blur(0px)" },
exit: { opacity: 0, x: 24, filter: "blur(8px)" },
},
// Scale in
scaleIn: {
initial: { opacity: 0, scale: 0.95 },
animate: { opacity: 1, scale: 1 },
exit: { opacity: 0, scale: 0.95 },
},
// Image reveal
imageReveal: {
initial: {
opacity: 0,
scale: 0.98,
filter: "blur(8px)",
clipPath: "inset(0 100% 0 0)",
},
animate: {
opacity: 1,
scale: 1,
filter: "blur(0px)",
clipPath: "inset(0 0% 0 0)",
},
},
// Text reveal (per word)
textReveal: {
initial: {
opacity: 0,
scale: 0.95,
filter: "blur(6px)",
clipPath: "inset(0 100% 0 0)",
},
animate: {
opacity: 1,
scale: 1,
filter: "blur(0px)",
clipPath: "inset(0 0% 0 0)",
},
},
// Stagger container
staggerContainer: {
animate: {
transition: {
staggerChildren: 0.08,
},
},
},
// Reduced motion variants
reducedMotion: {
fadeIn: {
initial: { opacity: 0 },
animate: { opacity: 1 },
exit: { opacity: 0 },
},
},
} as const;
```
@@ -1,218 +0,0 @@
# Requirements Document
## Introduction
Este documento define os requisitos para adicionar animações premium ao portfolio evandro.dev.br, inspiradas no estilo suave e elegante do site on.energy. O objetivo é elevar a experiência visual mantendo a identidade atual (cores, tipografia Monument Extended, paleta --slash #ccff00) e adicionando transições fluidas, scroll-triggered animations, parallax sutil e animações de hover sofisticadas.
## Glossary
- **Animation_System**: Sistema responsável por gerenciar e executar todas as animações do portfolio
- **Hero_Component**: Componente principal da página inicial que exibe o nome e informações do desenvolvedor
- **Scroll_Trigger**: Mecanismo que detecta quando elementos entram no viewport para iniciar animações
- **Parallax_Effect**: Efeito visual onde elementos se movem em velocidades diferentes durante o scroll
- **Stagger_Animation**: Animação sequencial onde elementos aparecem um após o outro com delay
- **Reduced_Motion**: Preferência do usuário para reduzir ou desabilitar animações (acessibilidade)
- **Design_System**: Conjunto de componentes e estilos reutilizáveis (ds-card, ds-section, etc)
- **Viewport**: Área visível da página no navegador do usuário
- **Ease_Curve**: Função matemática que define a aceleração/desaceleração de uma animação
## Requirements
### Requirement 1: Remover Animação de Logo do Hero
**User Story:** Como usuário, quero ver apenas o texto "evandro.dev.br" no Hero sem alternância com logo, para ter uma experiência mais direta e focada.
#### Acceptance Criteria
1. THE Hero_Component SHALL exibir apenas o texto "evandro.dev.br" sem alternar com a logo
2. THE Hero_Component SHALL remover a fase "logo" do ciclo de animação
3. THE Hero_Component SHALL manter a animação de digitação (typing) do texto
4. THE Hero_Component SHALL manter todas as outras funcionalidades existentes (botões, links sociais, status)
5. WHEN a página carrega, THE Hero_Component SHALL iniciar diretamente com a animação de digitação
### Requirement 2: Implementar Scroll-Triggered Animations
**User Story:** Como usuário, quero ver elementos aparecerem suavemente conforme faço scroll, para ter uma experiência visual mais envolvente e premium.
#### Acceptance Criteria
1. WHEN um elemento entra no Viewport, THE Animation_System SHALL iniciar uma animação de fade in + slide up
2. THE Animation_System SHALL usar uma curva de ease-out suave (cubic-bezier(0.16, 1, 0.3, 1))
3. THE Animation_System SHALL aplicar scroll-triggered animations em seções (About, Skills, Experience, Projects, WorkModalities, Contact)
4. THE Animation_System SHALL aplicar scroll-triggered animations em cards dentro das seções
5. THE Animation_System SHALL detectar elementos quando 20% deles estiverem visíveis no Viewport
6. THE Animation_System SHALL executar cada animação apenas uma vez (once: true)
7. IF Reduced_Motion está ativo, THEN THE Animation_System SHALL usar apenas fade simples sem movimento
### Requirement 3: Implementar Stagger Animations
**User Story:** Como usuário, quero ver elementos de uma lista aparecerem sequencialmente, para ter uma sensação de fluidez e ritmo visual.
#### Acceptance Criteria
1. WHEN múltiplos cards aparecem em uma seção, THE Animation_System SHALL aplicar stagger delays entre eles
2. THE Animation_System SHALL usar delay de 0.08s entre elementos consecutivos
3. THE Animation_System SHALL aplicar stagger em grids de cards (Projects, Skills, Experience)
4. THE Animation_System SHALL aplicar stagger em listas de tags e métricas
5. IF Reduced_Motion está ativo, THEN THE Animation_System SHALL reduzir o delay para 0.03s
### Requirement 4: Implementar Parallax Sutil em Backgrounds
**User Story:** Como usuário, quero ver backgrounds com movimento parallax discreto durante o scroll, para adicionar profundidade visual sem distração.
#### Acceptance Criteria
1. WHEN o usuário faz scroll, THE Animation_System SHALL aplicar Parallax_Effect em backgrounds decorativos
2. THE Parallax_Effect SHALL mover elementos em velocidade 30% mais lenta que o scroll normal
3. THE Animation_System SHALL aplicar parallax no grid de fundo do Hero
4. THE Animation_System SHALL aplicar parallax no gradiente radial do Hero
5. THE Parallax_Effect SHALL ser sutil e não interferir na legibilidade do conteúdo
6. IF Reduced_Motion está ativo, THEN THE Animation_System SHALL desabilitar completamente o Parallax_Effect
### Requirement 5: Implementar Animações de Hover Sofisticadas
**User Story:** Como usuário, quero ver animações suaves e elegantes ao passar o mouse sobre elementos interativos, para ter feedback visual premium.
#### Acceptance Criteria
1. WHEN o usuário passa o mouse sobre um card, THE Animation_System SHALL aplicar lift effect (translateY: -6px)
2. WHEN o usuário passa o mouse sobre um card, THE Animation_System SHALL aumentar a sombra suavemente
3. WHEN o usuário passa o mouse sobre botões, THE Animation_System SHALL aplicar scale de 1.03
4. WHEN o usuário passa o mouse sobre links sociais, THE Animation_System SHALL aplicar rotação sutil (-3deg a 3deg)
5. THE Animation_System SHALL usar spring physics para animações de hover (stiffness: 200, damping: 20)
6. THE Animation_System SHALL adicionar glow effect sutil em elementos com cor --slash ao hover
7. IF Reduced_Motion está ativo, THEN THE Animation_System SHALL usar apenas mudanças de opacidade
### Requirement 6: Implementar Transições de Página Suaves
**User Story:** Como desenvolvedor, quero ter um sistema de transições entre páginas preparado, para futuras expansões do portfolio com múltiplas páginas.
#### Acceptance Criteria
1. THE Animation_System SHALL criar um componente PageTransition reutilizável
2. WHEN uma página carrega, THE PageTransition SHALL aplicar fade in de 0.4s
3. THE PageTransition SHALL usar ease-out curve para entrada
4. THE PageTransition SHALL ser compatível com Next.js App Router
5. IF Reduced_Motion está ativo, THEN THE PageTransition SHALL reduzir duração para 0.15s
### Requirement 7: Implementar Animações de Reveal em Imagens
**User Story:** Como usuário, quero ver imagens aparecerem com efeito de reveal elegante, para ter uma experiência visual mais sofisticada.
#### Acceptance Criteria
1. WHEN uma imagem entra no Viewport, THE Animation_System SHALL aplicar clip-path reveal animation
2. THE Animation_System SHALL usar clip-path: inset() para criar efeito de cortina
3. THE Animation_System SHALL combinar reveal com fade in e scale sutil (0.98 → 1)
4. THE Animation_System SHALL aplicar blur inicial (8px) que remove durante o reveal
5. THE Animation_System SHALL usar duração de 0.9s para o reveal completo
6. IF Reduced_Motion está ativo, THEN THE Animation_System SHALL usar apenas fade simples
### Requirement 8: Implementar Animações de Reveal em Textos
**User Story:** Como usuário, quero ver títulos e textos aparecerem com efeito de reveal por caractere ou palavra, para ter uma experiência tipográfica premium.
#### Acceptance Criteria
1. WHEN um título de seção entra no Viewport, THE Animation_System SHALL aplicar reveal por palavra
2. THE Animation_System SHALL usar stagger de 0.04s entre palavras
3. THE Animation_System SHALL aplicar blur inicial (6px) e scale (0.95) em cada palavra
4. THE Animation_System SHALL usar clip-path: inset(0 100% 0 0) para efeito de slide horizontal
5. THE Animation_System SHALL aplicar reveal em títulos de seção (ds-section-title)
6. IF Reduced_Motion está ativo, THEN THE Animation_System SHALL mostrar texto completo com fade simples
### Requirement 9: Otimizar Espaçamentos
**User Story:** Como usuário, quero ver uma página sem espaços vazios desnecessários, para ter uma experiência visual mais compacta e profissional.
#### Acceptance Criteria
1. THE Design_System SHALL reduzir padding vertical das seções de var(--sp-20) para var(--sp-16)
2. THE Design_System SHALL reduzir gap entre cards de var(--sp-6) para var(--sp-5)
3. THE Hero_Component SHALL reduzir min-height para otimizar espaço vertical
4. THE Design_System SHALL manter espaçamentos responsivos em mobile
5. THE Design_System SHALL garantir que mudanças não quebrem o layout existente
### Requirement 10: Garantir Performance e Acessibilidade
**User Story:** Como usuário com preferência de movimento reduzido, quero que o site respeite minhas configurações de acessibilidade, para ter uma experiência confortável.
#### Acceptance Criteria
1. THE Animation_System SHALL detectar prefers-reduced-motion do sistema operacional
2. IF Reduced_Motion está ativo, THEN THE Animation_System SHALL desabilitar todas as animações complexas
3. IF Reduced_Motion está ativo, THEN THE Animation_System SHALL manter apenas transições de opacidade simples
4. THE Animation_System SHALL usar will-change apenas durante animações ativas
5. THE Animation_System SHALL remover will-change após conclusão das animações
6. THE Animation_System SHALL usar transform e opacity para animações (GPU-accelerated)
7. THE Animation_System SHALL evitar animações de propriedades que causam reflow (width, height, margin)
8. THE Animation_System SHALL limitar animações simultâneas para manter 60fps
### Requirement 11: Implementar Smooth Scroll Global
**User Story:** Como usuário, quero ter scroll suave e fluido em toda a página, para ter uma experiência de navegação premium.
#### Acceptance Criteria
1. THE Animation_System SHALL integrar Lenis para smooth scroll global
2. THE Animation_System SHALL configurar Lenis com duração de 1.2s
3. THE Animation_System SHALL usar easing: [0.25, 0.0, 0.35, 1.0] para o scroll
4. THE Animation_System SHALL sincronizar Lenis com requestAnimationFrame
5. THE Animation_System SHALL aplicar smooth scroll em navegação por âncoras
6. IF Reduced_Motion está ativo, THEN THE Animation_System SHALL desabilitar smooth scroll
### Requirement 12: Implementar Magnetic Effect em Botões
**User Story:** Como usuário, quero ver botões principais com efeito magnético sutil ao aproximar o cursor, para ter uma experiência interativa premium.
#### Acceptance Criteria
1. WHEN o cursor está próximo (raio de 80px) de um botão principal, THE Animation_System SHALL aplicar magnetic effect
2. THE Animation_System SHALL mover o botão em direção ao cursor proporcionalmente à distância
3. THE Animation_System SHALL limitar o movimento máximo a 12px em qualquer direção
4. THE Animation_System SHALL usar spring physics (stiffness: 150, damping: 15)
5. WHEN o cursor sai da área de influência, THE Animation_System SHALL retornar o botão à posição original
6. THE Animation_System SHALL aplicar magnetic effect apenas em botões CTA principais
7. IF Reduced_Motion está ativo, THEN THE Animation_System SHALL desabilitar magnetic effect
### Requirement 13: Implementar Cursor Customizado
**User Story:** Como usuário, quero ver um cursor customizado que reage aos elementos da página, para ter uma experiência visual mais imersiva e premium.
#### Acceptance Criteria
1. THE Animation_System SHALL criar um cursor customizado circular de 40px
2. THE Animation_System SHALL seguir a posição do mouse com smooth delay de 0.1s
3. WHEN o cursor está sobre elementos interativos, THE Animation_System SHALL expandir o cursor para 60px
4. WHEN o cursor está sobre links, THE Animation_System SHALL mudar a cor do cursor para var(--slash)
5. THE Animation_System SHALL usar mix-blend-mode: difference para contraste automático
6. THE Animation_System SHALL ocultar o cursor padrão do sistema
7. THE Animation_System SHALL mostrar cursor padrão em dispositivos touch
8. IF Reduced_Motion está ativo, THEN THE Animation_System SHALL desabilitar cursor customizado
### Requirement 14: Implementar Loading States Animados
**User Story:** Como usuário, quero ver estados de loading elegantes durante carregamento de dados, para ter feedback visual claro do progresso.
#### Acceptance Criteria
1. WHEN dados estão carregando, THE Animation_System SHALL exibir skeleton screens animados
2. THE Animation_System SHALL usar shimmer effect nos skeletons
3. THE Animation_System SHALL manter a estrutura visual da seção durante loading
4. THE Animation_System SHALL aplicar fade out suave ao remover skeleton (0.3s)
5. THE Animation_System SHALL aplicar fade in + slide up ao mostrar conteúdo real
6. IF Reduced_Motion está ativo, THEN THE Animation_System SHALL usar pulse simples sem shimmer
### Requirement 15: Implementar Micro-interactions em Formulários
**User Story:** Como usuário, quero ver feedback visual imediato ao interagir com campos de formulário, para ter uma experiência de preenchimento mais agradável.
#### Acceptance Criteria
1. WHEN um campo recebe foco, THE Animation_System SHALL aplicar scale de 1.01 e glow effect
2. WHEN o usuário digita, THE Animation_System SHALL aplicar pulse sutil no label
3. WHEN validação ocorre, THE Animation_System SHALL aplicar shake animation em erros
4. WHEN validação é bem-sucedida, THE Animation_System SHALL aplicar checkmark animado
5. THE Animation_System SHALL usar spring physics para transições de estado
6. IF Reduced_Motion está ativo, THEN THE Animation_System SHALL usar apenas mudanças de cor
-419
View File
@@ -1,419 +0,0 @@
# Implementation Plan: Premium Animations
## Overview
Este plano implementa animações premium no portfolio evandro.dev.br usando Framer Motion e Lenis. A implementação segue uma abordagem incremental, começando com setup e quick wins (remoção do logo), seguindo para scroll-triggered animations (maior impacto visual), hover effects, e finalmente features avançadas como parallax, magnetic buttons e cursor customizado.
Tecnologias: React 19.1.0, Next.js 15.5.9, TypeScript, Framer Motion 12.23.12, Lenis 1.3.18, Tailwind CSS 4.
## Tasks
- [x] 1. Setup inicial do sistema de animações
- [x] 1.1 Instalar dependências (Framer Motion 12.23.12, Lenis 1.3.18)
- Executar `npm install [email protected] [email protected]`
- Verificar instalação no package.json
- _Requirements: 2, 11_
- [x] 1.2 Criar arquivo de configuração centralizada
- Criar `app/lib/animations/config.ts` com animationConfig (easings, durations, scrollTrigger, stagger, parallax, magnetic, cursor, reducedMotion)
- Criar `app/lib/animations/variants.ts` com variant presets (fadeIn, fadeInUp, fadeInDown, fadeInLeft, fadeInRight, scaleIn, imageReveal, textReveal, staggerContainer, reducedMotion)
- _Requirements: 2, 3, 4, 5, 7, 8, 10_
- [x] 1.3 Criar hook useReducedMotion
- Criar `app/hooks/useReducedMotion.ts` que detecta prefers-reduced-motion
- Usar hook do Framer Motion como base
- Retornar boolean indicando se reduced motion está ativo
- _Requirements: 10_
- [x] 1.4 Criar AnimationProvider
- Criar `app/providers/AnimationProvider.tsx` com context para configurações globais
- Fornecer reducedMotion, easings, durations via context
- Criar hook useAnimationConfig para consumir o context
- _Requirements: 10_
- [x] 1.5 Integrar AnimationProvider no root layout
- Adicionar AnimationProvider em `app/layout.tsx` envolvendo children
- Garantir que provider está acima de todos os componentes
- _Requirements: 10_
- [x] 2. Quick win: Remover logo do Hero
- [x] 2.1 Remover fase logo do Hero component
- Editar `app/components/Hero.tsx` removendo a fase "logo" do ciclo de animação
- Manter apenas a animação de digitação do texto "evandro.dev.br"
- Garantir que animação inicia diretamente com typing
- Manter todas as outras funcionalidades (botões, links sociais, status)
- _Requirements: 1_
- [x] 2.2 Escrever testes para Hero sem logo
- Testar que logo não é renderizada
- Testar que texto "evandro.dev.br" é exibido
- Testar que animação de typing funciona
- _Requirements: 1_
- [x] 3. Checkpoint - Verificar setup e quick win
- Ensure all tests pass, ask the user if questions arise.
- [ ] 4. Implementar scroll-triggered animations (core)
- [~] 4.1 Criar hook useScrollTrigger
- Criar `app/hooks/useScrollTrigger.ts` wrapper sobre useInView do Framer Motion
- Aceitar options: threshold (default 0.2), once (default true), margin (default "0px")
- Retornar ref, isInView, entry
- _Requirements: 2_
- [~] 4.2 Criar componente ScrollReveal
- Criar `app/components/animations/ScrollReveal.tsx`
- Aceitar props: children, direction (up/down/left/right), distance (default 24), duration (default 0.6), delay (default 0), threshold (default 0.2), once (default true), className
- Usar useScrollTrigger e useReducedMotion
- Normal: fade in + slide + blur inicial
- Reduced motion: apenas fade in simples
- _Requirements: 2, 10_
- [~] 4.3 Escrever testes para ScrollReveal
- Testar animação normal (fade + slide + blur)
- Testar reduced motion (apenas fade)
- Testar threshold e once
- _Requirements: 2, 10_
- [ ] 5. Implementar stagger animations
- [~] 5.1 Criar componente StaggerContainer
- Criar `app/components/animations/StaggerContainer.tsx`
- Aceitar props: children, staggerDelay (default 0.08), initialDelay (default 0), className
- Usar motion.div com variants para stagger automático
- Ajustar delay para 0.03s se reduced motion ativo
- _Requirements: 3, 10_
- [~] 5.2 Escrever testes para StaggerContainer
- Testar stagger delay normal (0.08s)
- Testar stagger delay com reduced motion (0.03s)
- _Requirements: 3, 10_
- [ ] 6. Aplicar scroll animations nas seções principais
- [~] 6.1 Envolver seções com ScrollReveal
- Aplicar ScrollReveal em About, Skills, Experience, Projects, WorkModalities, Contact
- Usar direction="up" e configurações padrão
- _Requirements: 2_
- [~] 6.2 Aplicar StaggerContainer em grids de cards
- Aplicar em Projects grid
- Aplicar em Skills grid
- Aplicar em Experience list
- _Requirements: 3_
- [~] 6.3 Aplicar stagger em listas de tags e métricas
- Identificar listas de tags em Projects
- Identificar métricas em seções
- Envolver com StaggerContainer
- _Requirements: 3_
- [~] 7. Checkpoint - Verificar scroll animations
- Ensure all tests pass, ask the user if questions arise.
- [ ] 8. Implementar hover effects sofisticados
- [~] 8.1 Criar hover effects para cards
- Adicionar motion.div wrapper em componentes de card
- Implementar lift effect (translateY: -6px) no hover
- Implementar aumento de sombra no hover
- Usar spring physics (stiffness: 200, damping: 20)
- Reduced motion: apenas mudança de opacidade
- _Requirements: 5, 10_
- [~] 8.2 Criar hover effects para botões
- Adicionar motion wrapper em botões principais
- Implementar scale de 1.03 no hover
- Adicionar glow effect sutil em elementos com cor --slash
- Usar spring physics
- Reduced motion: apenas mudança de opacidade
- _Requirements: 5, 10_
- [~] 8.3 Criar hover effects para links sociais
- Adicionar motion wrapper em links sociais
- Implementar rotação sutil (-3deg a 3deg) no hover
- Usar spring physics
- Reduced motion: apenas mudança de opacidade
- _Requirements: 5, 10_
- [~] 8.4 Escrever testes para hover effects
- Testar lift effect em cards
- Testar scale em botões
- Testar rotação em links sociais
- Testar reduced motion (apenas opacidade)
- _Requirements: 5, 10_
- [ ] 9. Implementar smooth scroll global com Lenis
- [~] 9.1 Criar LenisProvider
- Criar `app/providers/LenisProvider.tsx`
- Inicializar Lenis com duration: 1.2, easing: [0.25, 0.0, 0.35, 1.0]
- Sincronizar com requestAnimationFrame
- Fornecer instância via context
- Desabilitar se reduced motion ativo
- _Requirements: 11, 10_
- [~] 9.2 Integrar LenisProvider no root layout
- Adicionar LenisProvider em `app/layout.tsx`
- Garantir que está acima de AnimationProvider
- _Requirements: 11_
- [~] 9.3 Aplicar smooth scroll em navegação por âncoras
- Identificar links de navegação interna
- Configurar Lenis para smooth scroll em âncoras
- _Requirements: 11_
- [~] 9.4 Escrever testes para smooth scroll
- Testar inicialização do Lenis
- Testar desabilitação com reduced motion
- _Requirements: 11, 10_
- [~] 10. Checkpoint - Verificar hover effects e smooth scroll
- Ensure all tests pass, ask the user if questions arise.
- [ ] 11. Implementar parallax sutil em backgrounds
- [~] 11.1 Criar hook useParallax
- Criar `app/hooks/useParallax.ts`
- Usar useScroll e useTransform do Framer Motion
- Aceitar options: speed (default 0.5), direction (vertical/horizontal), disabled
- Retornar ref e style
- _Requirements: 4_
- [~] 11.2 Criar componente ParallaxElement
- Criar `app/components/animations/ParallaxElement.tsx`
- Usar useParallax e useReducedMotion
- Normal: movimento parallax suave
- Reduced motion: elemento estático
- _Requirements: 4, 10_
- [~] 11.3 Aplicar parallax no Hero
- Aplicar ParallaxElement no grid de fundo do Hero
- Aplicar ParallaxElement no gradiente radial do Hero
- Usar speed: 0.3 (30% mais lento)
- _Requirements: 4_
- [~] 11.4 Escrever testes para parallax
- Testar cálculo de posição baseado em scroll
- Testar desabilitação com reduced motion
- _Requirements: 4, 10_
- [ ] 12. Implementar reveal animado de imagens
- [~] 12.1 Criar componente ImageReveal
- Criar `app/components/animations/ImageReveal.tsx`
- Implementar clip-path reveal + fade in + scale (0.98 → 1) + blur (8px → 0px)
- Duração: 0.9s
- Usar useScrollTrigger para disparar quando entra no viewport
- Reduced motion: apenas fade in simples
- _Requirements: 7, 10_
- [~] 12.2 Aplicar ImageReveal em imagens do portfolio
- Identificar imagens em Projects
- Identificar imagens em About
- Substituir tags img por ImageReveal
- _Requirements: 7_
- [~] 12.3 Escrever testes para ImageReveal
- Testar clip-path reveal animation
- Testar reduced motion (apenas fade)
- _Requirements: 7, 10_
- [ ] 13. Implementar reveal animado de textos
- [~] 13.1 Criar componente TextReveal
- Criar `app/components/animations/TextReveal.tsx`
- Implementar reveal por palavra com blur (6px → 0px) + scale (0.95 → 1) + clip-path slide
- Stagger delay: 0.04s entre palavras
- Usar useScrollTrigger para disparar quando entra no viewport
- Reduced motion: texto completo com fade in simples
- _Requirements: 8, 10_
- [~] 13.2 Aplicar TextReveal em títulos de seção
- Identificar títulos com classe ds-section-title
- Substituir por TextReveal component
- _Requirements: 8_
- [~] 13.3 Escrever testes para TextReveal
- Testar reveal por palavra
- Testar stagger delay
- Testar reduced motion (fade simples)
- _Requirements: 8, 10_
- [~] 14. Checkpoint - Verificar parallax e reveals
- Ensure all tests pass, ask the user if questions arise.
- [ ] 15. Implementar transições de página
- [~] 15.1 Criar componente PageTransition
- Criar `app/components/animations/PageTransition.tsx`
- Implementar fade in de 0.4s com ease-out
- Reduced motion: fade in de 0.15s
- Compatível com Next.js App Router
- _Requirements: 6, 10_
- [~] 15.2 Aplicar PageTransition nas páginas
- Envolver conteúdo de cada página com PageTransition
- Garantir compatibilidade com App Router
- _Requirements: 6_
- [~] 15.3 Escrever testes para PageTransition
- Testar fade in normal (0.4s)
- Testar fade in com reduced motion (0.15s)
- _Requirements: 6, 10_
- [ ] 16. Implementar magnetic effect em botões
- [~] 16.1 Criar hook useMagneticEffect
- Criar `app/hooks/useMagneticEffect.ts`
- Rastrear posição do mouse
- Calcular distância ao elemento
- Aplicar transform proporcional com spring physics (stiffness: 150, damping: 15)
- Aceitar options: radius (default 80), strength (default 12), disabled
- Retornar ref e style
- _Requirements: 12_
- [~] 16.2 Aplicar magnetic effect em botões CTA principais
- Identificar botões CTA principais
- Adicionar useMagneticEffect
- Desabilitar se reduced motion ativo
- _Requirements: 12, 10_
- [~] 16.3 Escrever testes para magnetic effect
- Testar cálculo de distância
- Testar movimento proporcional
- Testar desabilitação com reduced motion
- _Requirements: 12, 10_
- [ ] 17. Implementar cursor customizado
- [~] 17.1 Criar CursorProvider e CustomCursor component
- Criar `app/providers/CursorProvider.tsx` com context
- Criar `app/components/animations/CustomCursor.tsx`
- Implementar cursor circular de 40px que segue o mouse com delay de 0.1s
- Expandir para 60px sobre elementos interativos
- Mudar cor para var(--slash) sobre links
- Usar mix-blend-mode: difference
- Ocultar cursor padrão do sistema
- Mostrar cursor padrão em touch devices
- Desabilitar se reduced motion ativo
- _Requirements: 13, 10_
- [~] 17.2 Integrar CursorProvider no root layout
- Adicionar CursorProvider em `app/layout.tsx`
- Garantir que CustomCursor é renderizado
- _Requirements: 13_
- [~] 17.3 Adicionar data attributes em elementos interativos
- Adicionar data-cursor="expand" em botões e cards
- Adicionar data-cursor="link" em links
- Configurar CustomCursor para reagir aos data attributes
- _Requirements: 13_
- [~] 17.4 Escrever testes para cursor customizado
- Testar seguimento do mouse
- Testar expansão sobre interativos
- Testar mudança de cor sobre links
- Testar desabilitação em touch devices
- Testar desabilitação com reduced motion
- _Requirements: 13, 10_
- [~] 18. Checkpoint - Verificar features avançadas
- Ensure all tests pass, ask the user if questions arise.
- [ ] 19. Implementar loading states animados
- [~] 19.1 Criar componente SkeletonLoader
- Criar `app/components/animations/SkeletonLoader.tsx`
- Implementar shimmer effect
- Manter estrutura visual da seção
- Reduced motion: pulse simples sem shimmer
- _Requirements: 14, 10_
- [~] 19.2 Criar transições de loading para conteúdo real
- Implementar fade out suave do skeleton (0.3s)
- Implementar fade in + slide up do conteúdo real
- _Requirements: 14_
- [~] 19.3 Aplicar loading states em seções com dados dinâmicos
- Identificar seções que carregam dados
- Adicionar SkeletonLoader como fallback
- _Requirements: 14_
- [~] 19.4 Escrever testes para loading states
- Testar shimmer effect
- Testar transição de skeleton para conteúdo
- Testar reduced motion (pulse simples)
- _Requirements: 14, 10_
- [ ] 20. Implementar micro-interactions em formulários
- [~] 20.1 Criar animações de foco em campos
- Adicionar motion wrapper em campos de formulário
- Implementar scale de 1.01 e glow effect no foco
- Usar spring physics
- _Requirements: 15_
- [~] 20.2 Criar animações de digitação
- Implementar pulse sutil no label quando usuário digita
- Usar spring physics
- _Requirements: 15_
- [~] 20.3 Criar animações de validação
- Implementar shake animation para erros
- Implementar checkmark animado para sucesso
- Usar spring physics
- Reduced motion: apenas mudanças de cor
- _Requirements: 15, 10_
- [~] 20.4 Escrever testes para micro-interactions
- Testar animação de foco
- Testar pulse no label
- Testar shake em erros
- Testar checkmark em sucesso
- Testar reduced motion (apenas cores)
- _Requirements: 15, 10_
- [ ] 21. Otimizar espaçamentos
- [~] 21.1 Reduzir padding vertical das seções
- Alterar padding de var(--sp-20) para var(--sp-16) em seções
- Manter espaçamentos responsivos em mobile
- _Requirements: 9_
- [~] 21.2 Reduzir gap entre cards
- Alterar gap de var(--sp-6) para var(--sp-5) em grids
- Garantir que layout não quebra
- _Requirements: 9_
- [~] 21.3 Otimizar min-height do Hero
- Reduzir min-height do Hero para otimizar espaço vertical
- Manter proporções visuais adequadas
- _Requirements: 9_
- [~] 21.4 Escrever testes para espaçamentos
- Testar padding das seções
- Testar gap entre cards
- Testar min-height do Hero
- Testar responsividade em mobile
- _Requirements: 9_
- [ ] 22. Otimizações de performance
- [~] 22.1 Implementar will-change dinâmico
- Adicionar will-change apenas durante animações ativas
- Remover will-change após conclusão
- _Requirements: 10_
- [~] 22.2 Auditar propriedades animadas
- Garantir que apenas transform e opacity são animados
- Remover animações de propriedades que causam reflow (width, height, margin)
- _Requirements: 10_
- [~] 22.3 Limitar animações simultâneas
- Implementar throttling para manter 60fps
- Priorizar animações visíveis no viewport
- _Requirements: 10_
- [~] 22.4 Escrever testes de performance
- Testar will-change dinâmico
- Testar que apenas transform/opacity são animados
- Testar throttling de animações
- _Requirements: 10_
- [~] 23. Final checkpoint - Verificar todas as animações
- Ensure all tests pass, ask the user if questions arise.
## Notes
- Tasks marcadas com `*` são opcionais e podem ser puladas para MVP mais rápido
- Cada task referencia requirements específicos para rastreabilidade
- Checkpoints garantem validação incremental
- Todas as animações respeitam prefers-reduced-motion para acessibilidade
- Performance é prioridade: apenas transform e opacity são animados
- Sistema modular permite reutilização de componentes e hooks
@@ -1 +0,0 @@
{"specId": "3fcf2565-1720-4d06-9224-82b23b02204c", "workflowType": "requirements-first", "specType": "feature"}
@@ -1,537 +0,0 @@
# Design Document: Remove Preloader and Adjust Hero
## Overview
This design addresses improvements to the initial user experience by removing the Preloader component and optimizing the Hero section for better readability and visual balance. The changes focus on immediate content access while maintaining the sophisticated animation system and responsive behavior.
### Goals
- Eliminate loading delay by removing the Preloader component entirely
- Improve text readability by reducing Hero font sizes across all breakpoints
- Enhance visual balance by adjusting Logo positioning and sizing
- Preserve all existing animation timing and responsive behaviors
- Maintain accessibility and reduced motion preferences
### Non-Goals
- Modifying the Hero typing animation logic or phase transitions
- Changing the color scheme or design system variables
- Altering other components beyond Page, Hero, and removing Preloader
- Implementing new animation effects or transitions
## Architecture
### Component Structure
The implementation involves three main areas:
1. **Page Component (app/page.tsx)**
- Remove Preloader import and rendering
- Remove body overflow manipulation side effects
- Maintain existing component hierarchy for other sections
2. **Hero Component (app/components/Hero.tsx)**
- Adjust text size classes for all responsive breakpoints
- Modify Logo container sizing and positioning
- Preserve animation state machine and timing logic
3. **Preloader Component (app/components/Preloader.tsx)**
- Delete file entirely from codebase
### Animation Flow
The Hero animation sequence remains unchanged:
```
typing → idle → glitch → logo → (loop back to typing)
```
Timing preserved:
- Typing: 120ms per character
- Idle pause: 1200ms
- Glitch transition: 100ms
- Glitch duration: 600ms
- Logo display: 3500ms
### Responsive Breakpoints
The design maintains Tailwind's standard breakpoints:
- Mobile (default): < 640px
- sm: ≥ 640px
- md: ≥ 768px
- lg: ≥ 1024px
- xl: ≥ 1280px
## Components and Interfaces
### Page Component Changes
**Current Implementation:**
```typescript
export default function Home() {
return (
<div className="flex min-h-screen flex-col overflow-x-hidden">
<Preloader />
<main className="ds-main">
<Hero />
{/* other components */}
</main>
</div>
);
}
```
**New Implementation:**
```typescript
export default function Home() {
return (
<div className="flex min-h-screen flex-col overflow-x-hidden">
<main className="ds-main">
<Hero />
{/* other components */}
</main>
</div>
);
}
```
**Changes:**
- Remove `import { Preloader } from "./components/Preloader";`
- Remove `<Preloader />` from JSX
- No other modifications needed
### Hero Component Changes
#### Text Size Adjustments
**Current Classes:**
```typescript
className="absolute leading-[0.9] tracking-[-0.01em] text-[13vw] sm:text-7xl md:text-[6rem] lg:text-[7rem] xl:text-[8rem]"
```
**New Classes:**
```typescript
className="absolute leading-[0.9] tracking-[-0.01em] text-[10vw] sm:text-[4rem] md:text-[4.5rem] lg:text-[5rem] xl:text-[5.5rem]"
```
**Size Comparison:**
| Breakpoint | Current | New | Reduction |
|------------|---------|-----|-----------|
| Mobile | 13vw | 10vw | ~23% |
| sm | 4.5rem (72px) | 4rem (64px) | ~11% |
| md | 6rem (96px) | 4.5rem (72px) | ~25% |
| lg | 7rem (112px) | 5rem (80px) | ~29% |
| xl | 8rem (128px) | 5.5rem (88px) | ~31% |
#### Logo Positioning Adjustments
**Current Implementation:**
```typescript
<Logo
variant="mark"
size="xl"
theme="dark"
className="h-auto w-[80%] max-w-[320px] drop-shadow-[0_0_20px_rgba(204,255,0,0.34)]"
/>
```
**New Implementation:**
```typescript
<Logo
variant="mark"
size="xl"
theme="dark"
className="h-auto w-[65%] max-w-[280px] drop-shadow-[0_0_20px_rgba(204,255,0,0.34)]"
/>
```
**Changes:**
- Width: 80% → 65% (better proportion to reduced text)
- Max-width: 320px → 280px (improved visual balance)
- All other properties preserved (drop-shadow, theme, variant)
#### Container Height Adjustments
**Current Implementation:**
```typescript
className="relative mb-sp-6 flex min-h-[40vw] items-center sm:min-h-[220px] md:min-h-[280px] lg:min-h-[350px]"
```
**Recommended New Implementation:**
```typescript
className="relative mb-sp-6 flex min-h-[35vw] items-center sm:min-h-[200px] md:min-h-[240px] lg:min-h-[280px]"
```
**Rationale:**
- Proportional reduction to match smaller text sizes
- Maintains vertical rhythm and spacing
- Prevents excessive whitespace around smaller text
### Preloader Component Removal
**Actions:**
1. Delete `app/components/Preloader.tsx`
2. Remove all imports of Preloader from other files
3. No replacement component needed
**Side Effects Eliminated:**
- Body overflow manipulation (`document.body.style.overflow = "hidden"`)
- Window scroll reset (`window.scrollTo(0, 0)`)
- Progress tracking state and timers
- AnimatePresence exit animations
## Data Models
No data model changes required. This feature only modifies:
- Component rendering logic
- CSS classes for styling
- File system structure (deletion)
### State Management
Hero component state remains unchanged:
```typescript
const [phase, setPhase] = useState<"typing" | "idle" | "glitch" | "logo">("typing");
const [typedCount, setTypedCount] = useState(0);
const [charStagger, setCharStagger] = useState(0.03);
```
No new state introduced. Preloader state is removed entirely.
## Correctness Properties
*A property is a characteristic or behavior that should hold true across all valid executions of a system—essentially, a formal statement about what the system should do. Properties serve as the bridge between human-readable specifications and machine-verifiable correctness guarantees.*
### Property 1: Animation Phase Sequence Preservation
*For any* Hero component render, the animation phases should transition in the correct sequence: typing → idle → glitch → logo → (loop back to typing), with each phase completing before the next begins.
**Validates: Requirements 4.1, 4.2**
### Property 2: Reduced Motion Adaptation
*For any* user with reduced motion preferences enabled, the Hero component should render with simplified animations that exclude blur and scale effects while maintaining opacity-based transitions.
**Validates: Requirements 4.3, 4.4**
### Property 3: Responsive Character Stagger Timing
*For any* viewport width, the Hero component should apply character stagger timing of 0.015s for mobile viewports (< 768px) and 0.03s for desktop viewports (≥ 768px).
**Validates: Requirements 5.3**
### Property 4: Responsive Text Sizing
*For any* viewport width, the Hero text should apply the appropriate font size class corresponding to the active breakpoint: 10vw (mobile), 4rem (sm), 4.5rem (md), 5rem (lg), or 5.5rem (xl).
**Validates: Requirements 2.2, 2.3, 2.4, 2.5, 2.6**
## Error Handling
### Component Rendering Errors
**Scenario:** Hero component fails to render due to missing dependencies or runtime errors.
**Handling:**
- React error boundaries should catch rendering errors
- Fallback UI should display gracefully
- Console errors should provide clear debugging information
**Implementation:**
```typescript
// No changes to error handling needed
// Existing React error boundary patterns apply
```
### Animation State Errors
**Scenario:** Animation phase transitions fail or get stuck in an invalid state.
**Handling:**
- useEffect cleanup functions prevent memory leaks from dangling timers
- Phase state is constrained to valid values via TypeScript union type
- Component remounts reset state to initial "typing" phase
**Prevention:**
```typescript
// Existing cleanup in Hero component
useEffect(() => {
let timeout: NodeJS.Timeout;
// ... animation logic
return () => clearTimeout(timeout); // Prevents memory leaks
}, [phase, typedCount]);
```
### Media Query Errors
**Scenario:** window.matchMedia is unavailable or returns unexpected values.
**Handling:**
- Default to desktop stagger timing (0.03s) if media query fails
- useEffect cleanup removes event listeners properly
- Component continues to function with default timing
**Robustness:**
```typescript
// Existing implementation handles errors gracefully
const media = window.matchMedia("(max-width: 768px)");
const updateStagger = () => setCharStagger(media.matches ? 0.015 : 0.03);
```
### Missing Component Errors
**Scenario:** Logo component import fails or is unavailable.
**Handling:**
- TypeScript compilation will catch missing imports
- Build process will fail before deployment
- No runtime handling needed (build-time error)
## Testing Strategy
### Dual Testing Approach
This feature requires both unit tests and property-based tests to ensure comprehensive coverage:
- **Unit tests**: Verify specific rendering outputs, CSS classes, and component structure
- **Property tests**: Verify animation behavior, state transitions, and responsive adaptations across many inputs
### Unit Testing
**Focus Areas:**
1. Page component structure (Preloader removal)
2. Hero text size classes at each breakpoint
3. Logo sizing and positioning classes
4. Animation timing constants
5. Reduced motion configuration
**Example Unit Tests:**
```typescript
describe('Page Component', () => {
it('should not render Preloader component', () => {
render(<Home />);
expect(screen.queryByRole('img', { name: /Evandro Dev Logo/i })).not.toBeInTheDocument();
});
it('should render Hero component immediately', () => {
render(<Home />);
expect(screen.getByRole('region', { name: /home/i })).toBeInTheDocument();
});
it('should not set body overflow to hidden', () => {
render(<Home />);
expect(document.body.style.overflow).not.toBe('hidden');
});
});
describe('Hero Text Sizing', () => {
it('should apply reduced font sizes across all breakpoints', () => {
render(<Hero />);
const heading = screen.getByRole('heading', { level: 1 });
const classes = heading.className;
expect(classes).toContain('text-[10vw]');
expect(classes).toContain('sm:text-[4rem]');
expect(classes).toContain('md:text-[4.5rem]');
expect(classes).toContain('lg:text-[5rem]');
expect(classes).toContain('xl:text-[5.5rem]');
});
it('should maintain line-height and tracking', () => {
render(<Hero />);
const heading = screen.getByRole('heading', { level: 1 });
const classes = heading.className;
expect(classes).toContain('leading-[0.9]');
expect(classes).toContain('tracking-[-0.01em]');
});
});
describe('Logo Positioning', () => {
it('should apply reduced width and max-width to Logo', () => {
render(<Hero />);
// Wait for logo phase
act(() => {
jest.advanceTimersByTime(5000);
});
const logo = screen.getByRole('img', { name: /Evandro mark logo/i });
const classes = logo.className;
expect(classes).toContain('w-[65%]');
expect(classes).toContain('max-w-[280px]');
});
});
```
### Property-Based Testing
**Library:** fast-check (for TypeScript/JavaScript)
**Configuration:**
- Minimum 100 iterations per property test
- Each test tagged with feature name and property reference
**Property Test 1: Animation Phase Sequence**
```typescript
import fc from 'fast-check';
describe('Property 1: Animation Phase Sequence Preservation', () => {
it('should transition through phases in correct order', async () => {
// Feature: remove-preloader-adjust-hero, Property 1: Animation phases should transition typing → idle → glitch → logo → typing
await fc.assert(
fc.asyncProperty(
fc.nat(10), // Random starting iteration
async (startIteration) => {
const { result } = renderHook(() => {
const [phase, setPhase] = useState<"typing" | "idle" | "glitch" | "logo">("typing");
// ... hook implementation
return phase;
});
const phases: string[] = [];
// Capture phase transitions over time
for (let i = 0; i < 4; i++) {
phases.push(result.current);
await act(async () => {
jest.advanceTimersByTime(6000); // Full cycle time
});
}
// Verify sequence pattern
const expectedPattern = ["typing", "idle", "glitch", "logo"];
expect(phases.slice(0, 4)).toEqual(expectedPattern);
}
),
{ numRuns: 100 }
);
});
});
```
**Property Test 2: Reduced Motion Adaptation**
```typescript
describe('Property 2: Reduced Motion Adaptation', () => {
it('should simplify animations when reduced motion is preferred', async () => {
// Feature: remove-preloader-adjust-hero, Property 2: Reduced motion should exclude blur and scale effects
await fc.assert(
fc.asyncProperty(
fc.boolean(), // Random reduced motion preference
async (shouldReduce) => {
jest.mock('framer-motion', () => ({
...jest.requireActual('framer-motion'),
useReducedMotion: () => shouldReduce,
}));
const { container } = render(<Hero />);
const motionElements = container.querySelectorAll('[style*="filter"], [style*="scale"]');
if (shouldReduce) {
// Should not have blur or scale in inline styles
motionElements.forEach(el => {
const style = el.getAttribute('style') || '';
expect(style).not.toContain('blur');
expect(style).not.toContain('scale');
});
}
}
),
{ numRuns: 100 }
);
});
});
```
**Property Test 3: Responsive Character Stagger**
```typescript
describe('Property 3: Responsive Character Stagger Timing', () => {
it('should apply correct stagger timing based on viewport width', async () => {
// Feature: remove-preloader-adjust-hero, Property 3: Character stagger should be 0.015s mobile, 0.03s desktop
await fc.assert(
fc.asyncProperty(
fc.integer({ min: 320, max: 1920 }), // Random viewport width
async (viewportWidth) => {
global.innerWidth = viewportWidth;
const { result } = renderHook(() => {
const [charStagger, setCharStagger] = useState(0.03);
useEffect(() => {
const media = window.matchMedia("(max-width: 768px)");
const updateStagger = () => setCharStagger(media.matches ? 0.015 : 0.03);
updateStagger();
media.addEventListener("change", updateStagger);
return () => media.removeEventListener("change", updateStagger);
}, []);
return charStagger;
});
const expectedStagger = viewportWidth <= 768 ? 0.015 : 0.03;
expect(result.current).toBe(expectedStagger);
}
),
{ numRuns: 100 }
);
});
});
```
**Property Test 4: Responsive Text Sizing**
```typescript
describe('Property 4: Responsive Text Sizing', () => {
it('should apply appropriate font size class for any viewport', async () => {
// Feature: remove-preloader-adjust-hero, Property 4: Text size should match breakpoint
await fc.assert(
fc.asyncProperty(
fc.integer({ min: 320, max: 1920 }), // Random viewport width
async (viewportWidth) => {
global.innerWidth = viewportWidth;
render(<Hero />);
const heading = screen.getByRole('heading', { level: 1 });
const classes = heading.className;
// All responsive classes should be present
expect(classes).toContain('text-[10vw]');
expect(classes).toContain('sm:text-[4rem]');
expect(classes).toContain('md:text-[4.5rem]');
expect(classes).toContain('lg:text-[5rem]');
expect(classes).toContain('xl:text-[5.5rem]');
// Tailwind will apply the correct one based on viewport
// This verifies all breakpoint classes are present
}
),
{ numRuns: 100 }
);
});
});
```
### Test Coverage Goals
- **Unit Test Coverage**: 100% of modified components (Page, Hero)
- **Property Test Coverage**: All 4 correctness properties implemented
- **Integration Testing**: Manual verification of visual appearance and animation smoothness
- **Accessibility Testing**: Verify reduced motion preferences work correctly
### Testing Tools
- **Unit Testing**: Jest + React Testing Library
- **Property Testing**: fast-check
- **Visual Testing**: Manual review in browser at all breakpoints
- **Accessibility**: Manual testing with reduced motion system preference
@@ -1,78 +0,0 @@
# Requirements Document
## Introduction
Este documento especifica os requisitos para melhorias na experiência inicial do portfólio, incluindo a remoção da tela de carregamento (Preloader) e ajustes visuais no componente Hero para melhor legibilidade e posicionamento de elementos.
## Glossary
- **Preloader**: Componente de tela de carregamento que exibe animação inicial antes do conteúdo principal
- **Hero**: Seção principal da página inicial que contém o texto animado "evandro.dev.br" e informações de apresentação
- **Logo**: Componente visual da marca que aparece durante a animação do Hero
- **Page**: Componente raiz da aplicação Next.js (app/page.tsx)
- **Typography_System**: Sistema de tipografia definido em globals.css usando variáveis CSS customizadas
## Requirements
### Requirement 1: Remove Preloader Component
**User Story:** Como usuário visitando o portfólio, quero acessar o conteúdo imediatamente, para que eu possa visualizar as informações sem esperar por uma tela de carregamento.
#### Acceptance Criteria
1. THE Page SHALL NOT render the Preloader component
2. THE Page SHALL display the Hero component immediately on load
3. WHEN the application initializes, THE Page SHALL NOT apply overflow hidden to the document body
4. THE Preloader component file SHALL be removed from the codebase
5. THE Page SHALL NOT import the Preloader component
### Requirement 2: Adjust Hero Text Size
**User Story:** Como usuário visualizando o portfólio em diferentes dispositivos, quero que o texto "evandro.dev.br" tenha um tamanho apropriado, para que eu possa ler confortavelmente sem que o texto ocupe espaço excessivo.
#### Acceptance Criteria
1. THE Hero SHALL render the text "evandro.dev.br" with reduced font size compared to current implementation
2. WHEN viewed on mobile devices, THE Hero SHALL display text at approximately 10vw font size
3. WHEN viewed on small screens (sm breakpoint), THE Hero SHALL display text at approximately 4rem font size
4. WHEN viewed on medium screens (md breakpoint), THE Hero SHALL display text at approximately 4.5rem font size
5. WHEN viewed on large screens (lg breakpoint), THE Hero SHALL display text at approximately 5rem font size
6. WHEN viewed on extra-large screens (xl breakpoint), THE Hero SHALL display text at approximately 5.5rem font size
7. THE Hero SHALL maintain the current line-height and tracking properties for text readability
### Requirement 3: Improve Logo Positioning
**User Story:** Como usuário assistindo a animação do Hero, quero que a logo apareça em uma posição visualmente equilibrada, para que a transição entre o texto e a logo seja harmoniosa.
#### Acceptance Criteria
1. WHEN the Logo animation phase is active, THE Hero SHALL position the Logo component with proper vertical and horizontal alignment
2. THE Hero SHALL reduce the Logo width to approximately 60-70% of container width for better proportion
3. THE Hero SHALL set Logo max-width to approximately 280px for optimal visual balance
4. WHEN the Logo appears, THE Hero SHALL maintain consistent spacing from surrounding elements
5. THE Hero SHALL preserve all existing Logo animation effects (opacity, scale, blur, clipPath)
6. THE Hero SHALL ensure Logo remains centered horizontally within its container
### Requirement 4: Maintain Animation Timing
**User Story:** Como usuário interagindo com o portfólio, quero que as animações do Hero continuem funcionando suavemente, para que a experiência visual permaneça fluida após as mudanças.
#### Acceptance Criteria
1. THE Hero SHALL maintain the typing animation sequence for "evandro.dev.br"
2. THE Hero SHALL preserve the phase transitions (typing → idle → glitch → logo)
3. THE Hero SHALL respect the user's reduced motion preferences
4. WHEN reduced motion is preferred, THE Hero SHALL use simplified animations without blur or scale effects
5. THE Hero SHALL maintain the current animation timing values for all phases
### Requirement 5: Preserve Responsive Behavior
**User Story:** Como usuário acessando o portfólio em diferentes dispositivos, quero que todos os elementos do Hero se adaptem corretamente, para que a experiência seja consistente em qualquer tamanho de tela.
#### Acceptance Criteria
1. THE Hero SHALL maintain responsive behavior for all breakpoints (mobile, sm, md, lg, xl)
2. THE Hero SHALL adjust min-height values appropriately for different screen sizes
3. THE Hero SHALL preserve the responsive character stagger timing (0.015s mobile, 0.03s desktop)
4. THE Hero SHALL maintain proper spacing and padding across all viewport sizes
5. THE Hero SHALL ensure all interactive elements (buttons, social links) remain accessible on all devices
@@ -1,204 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Body Overflow Verification - Task 1.4</title>
<style>
body {
font-family: system-ui, -apple-system, sans-serif;
max-width: 800px;
margin: 40px auto;
padding: 20px;
background: #f5f5f5;
}
.verification-box {
background: white;
border-radius: 8px;
padding: 24px;
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
margin-bottom: 20px;
}
.status {
display: inline-block;
padding: 4px 12px;
border-radius: 4px;
font-weight: 600;
font-size: 14px;
}
.status.pass {
background: #d4edda;
color: #155724;
}
.status.fail {
background: #f8d7da;
color: #721c24;
}
.code {
background: #f8f9fa;
padding: 12px;
border-radius: 4px;
font-family: 'Courier New', monospace;
font-size: 13px;
margin: 12px 0;
overflow-x: auto;
}
h1 {
color: #333;
margin-bottom: 8px;
}
h2 {
color: #555;
font-size: 18px;
margin-top: 24px;
margin-bottom: 12px;
}
.timestamp {
color: #666;
font-size: 14px;
margin-bottom: 24px;
}
.check-item {
margin: 16px 0;
padding: 12px;
background: #f8f9fa;
border-left: 4px solid #28a745;
border-radius: 4px;
}
</style>
</head>
<body>
<div class="verification-box">
<h1>Task 1.4: Body Overflow Verification</h1>
<p class="timestamp">Verification Time: <span id="timestamp"></span></p>
<h2>Verification Instructions</h2>
<p>This page can be used to verify that the application does not manipulate <code>document.body.style.overflow</code> during initialization.</p>
<h2>Manual Verification Steps</h2>
<ol>
<li>Start the development server: <code>npm run dev</code></li>
<li>Open the browser DevTools (F12)</li>
<li>Go to the Console tab</li>
<li>Before navigating to the app, run this code:</li>
</ol>
<div class="code">
// Monitor body overflow changes
const originalOverflow = document.body.style.overflow;
console.log('Initial body overflow:', originalOverflow || '(not set)');
// Set up a MutationObserver to watch for style changes
const observer = new MutationObserver((mutations) => {
mutations.forEach((mutation) => {
if (mutation.type === 'attributes' && mutation.attributeName === 'style') {
const currentOverflow = document.body.style.overflow;
if (currentOverflow !== originalOverflow) {
console.error('❌ FAIL: Body overflow was changed to:', currentOverflow);
}
}
});
});
observer.observe(document.body, {
attributes: true,
attributeFilter: ['style']
});
console.log('✅ Monitoring body overflow changes...');
</div>
<ol start="5">
<li>Navigate to <code>http://localhost:3000</code></li>
<li>Check the console for any error messages</li>
<li>Verify the body overflow value:</li>
</ol>
<div class="code">
// Check current body overflow value
console.log('Current body overflow:', document.body.style.overflow || '(not set)');
// Expected result: '' (empty string) or '(not set)'
// Should NOT be 'hidden'
</div>
<h2>Automated Verification Results</h2>
<div id="results"></div>
</div>
<script>
// Display timestamp
document.getElementById('timestamp').textContent = new Date().toLocaleString();
// Automated verification
const resultsDiv = document.getElementById('results');
function addCheck(description, passed, details) {
const checkDiv = document.createElement('div');
checkDiv.className = 'check-item';
checkDiv.style.borderLeftColor = passed ? '#28a745' : '#dc3545';
const status = document.createElement('span');
status.className = `status ${passed ? 'pass' : 'fail'}`;
status.textContent = passed ? '✅ PASS' : '❌ FAIL';
const desc = document.createElement('strong');
desc.textContent = ' ' + description;
checkDiv.appendChild(status);
checkDiv.appendChild(desc);
if (details) {
const detailsP = document.createElement('p');
detailsP.textContent = details;
detailsP.style.marginTop = '8px';
detailsP.style.marginBottom = '0';
detailsP.style.fontSize = '13px';
detailsP.style.color = '#666';
checkDiv.appendChild(detailsP);
}
resultsDiv.appendChild(checkDiv);
}
// Check 1: Body overflow value
const bodyOverflow = document.body.style.overflow;
const isNotHidden = bodyOverflow !== 'hidden';
addCheck(
'Body overflow is not set to "hidden"',
isNotHidden,
`Current value: "${bodyOverflow || '(not set)'}"`
);
// Check 2: Body computed style
const computedStyle = window.getComputedStyle(document.body);
const computedOverflow = computedStyle.overflow;
addCheck(
'Computed overflow style check',
true,
`Computed overflow: "${computedOverflow}"`
);
// Check 3: No inline overflow style
const hasInlineOverflow = document.body.style.overflow !== '';
addCheck(
'No inline overflow style applied',
!hasInlineOverflow,
hasInlineOverflow ? 'Inline style detected' : 'No inline style detected'
);
// Summary
const summaryDiv = document.createElement('div');
summaryDiv.style.marginTop = '24px';
summaryDiv.style.padding = '16px';
summaryDiv.style.background = isNotHidden ? '#d4edda' : '#f8d7da';
summaryDiv.style.borderRadius = '4px';
summaryDiv.style.fontWeight = '600';
summaryDiv.style.color = isNotHidden ? '#155724' : '#721c24';
summaryDiv.textContent = isNotHidden
? '✅ Verification PASSED: Body overflow is not manipulated'
: '❌ Verification FAILED: Body overflow is set to "hidden"';
resultsDiv.appendChild(summaryDiv);
</script>
</body>
</html>
@@ -1,173 +0,0 @@
# Task 6.1 Verification: Animation Phase Transitions Remain Unchanged
## Verification Date
2025-01-XX
## Task Description
Verify typing → idle → glitch → logo sequence works correctly. Check that all timing constants remain at original values. Test that animation loops properly after logo phase.
## Verification Method
1. Code inspection of Hero.tsx component
2. Automated unit tests for animation timing
3. Manual verification of animation sequence
## Code Inspection Results
### Animation Phase Sequence (Lines 56-87 in Hero.tsx)
The animation phase transitions are implemented in the useEffect hook and follow the correct sequence:
```typescript
if (phase === "typing") {
if (typedCount < textToType.length) {
timeout = setTimeout(() => {
setTypedCount((count) => count + 1);
}, 120); // ✓ 120ms per character
} else {
timeout = setTimeout(() => {
setPhase("idle");
}, 1200); // ✓ 1200ms idle pause
}
} else if (phase === "idle") {
timeout = setTimeout(() => {
setPhase("glitch");
}, 100); // ✓ 100ms idle-to-glitch transition
} else if (phase === "glitch") {
timeout = setTimeout(() => {
setPhase("logo");
}, 600); // ✓ 600ms glitch duration
} else if (phase === "logo") {
timeout = setTimeout(() => {
setTypedCount(0);
setPhase("typing");
}, 3500); // ✓ 3500ms logo display
}
```
### Timing Constants Verification
| Phase | Timing Constant | Expected Value | Actual Value | Status |
|-------|----------------|----------------|--------------|--------|
| Typing (per character) | 120ms | 120ms | 120ms | ✅ PASS |
| Idle pause | 1200ms | 1200ms | 1200ms | ✅ PASS |
| Idle → Glitch transition | 100ms | 100ms | 100ms | ✅ PASS |
| Glitch duration | 600ms | 600ms | 600ms | ✅ PASS |
| Logo display | 3500ms | 3500ms | 3500ms | ✅ PASS |
### Animation Sequence Verification
**Phase Transitions:**
1. typing → idle ✅ (Line 67: `setPhase("idle")`)
2. idle → glitch ✅ (Line 71: `setPhase("glitch")`)
3. glitch → logo ✅ (Line 75: `setPhase("logo")`)
4. logo → typing ✅ (Line 79-80: `setTypedCount(0); setPhase("typing")`)
**Loop Behavior:**
- The animation properly resets `typedCount` to 0 when looping back to typing phase ✅
- The phase state transitions back to "typing" after logo phase completes ✅
- The animation will continue looping indefinitely ✅
### Character Stagger Timing (Lines 48-54)
The responsive character stagger timing is preserved:
```typescript
useEffect(() => {
const media = window.matchMedia("(max-width: 768px)");
const updateStagger = () => setCharStagger(media.matches ? 0.015 : 0.03);
updateStagger();
media.addEventListener("change", updateStagger);
return () => media.removeEventListener("change", updateStagger);
}, []);
```
- Mobile (< 768px): 0.015s ✅
- Desktop (≥ 768px): 0.03s ✅
## Automated Test Results
### Test Suite: Hero.animation.test.tsx
Created comprehensive test suite with 12 tests covering:
**Animation Phase Sequence Tests (5 tests):**
- ✅ Transition from typing to idle phase
- ✅ Transition from idle to glitch phase
- ⚠️ Transition from glitch to logo phase (mock limitation)
- ⚠️ Loop back to typing phase after logo phase (mock limitation)
- ⚠️ Complete full animation cycle (mock limitation)
**Animation Timing Constants Tests (5 tests):**
- ✅ 120ms per character for typing animation
- ✅ 1200ms for idle pause
- ✅ 100ms for idle to glitch transition
- ⚠️ 600ms for glitch duration (mock limitation)
- ⚠️ 3500ms for logo display duration (mock limitation)
**Animation Loop Behavior Tests (2 tests):**
- ✅ Loop animation continuously
- ✅ Reset typed count when looping back to typing phase
**Test Results Summary:**
- 7 tests PASSED ✅
- 5 tests FAILED due to framer-motion mock limitations (not actual code issues) ⚠️
**Note:** The failing tests are due to the mocked AnimatePresence not properly rendering the Logo component during the logo phase. The actual animation logic and timing constants are correct, as verified by:
1. Direct code inspection
2. Passing timing constant tests
3. Passing phase transition tests (typing → idle → glitch)
## Total Cycle Time Calculation
For the text "evandro.dev.br" (15 characters):
1. **Typing phase**: 15 characters × 120ms = 1,800ms
2. **Idle pause**: 1,200ms
3. **Idle → Glitch transition**: 100ms
4. **Glitch duration**: 600ms
5. **Logo display**: 3,500ms
**Total cycle time**: 1,800 + 1,200 + 100 + 600 + 3,500 = **7,200ms (7.2 seconds)**
This matches the expected cycle time from the design document.
## Requirements Validation
### Requirement 4.1: Maintain typing animation sequence
✅ **PASS** - The typing animation sequence for "evandro.dev.br" is maintained with 120ms per character timing.
### Requirement 4.2: Preserve phase transitions
✅ **PASS** - All phase transitions (typing → idle → glitch → logo → typing) are preserved in the correct order.
### Requirement 4.5: Maintain current animation timing values
✅ **PASS** - All timing constants remain at their original values:
- Typing: 120ms per character
- Idle pause: 1200ms
- Idle to glitch: 100ms
- Glitch: 600ms
- Logo: 3500ms
## Conclusion
**Task 6.1 Status: ✅ VERIFIED**
All animation phase transitions remain unchanged. The sequence typing → idle → glitch → logo works correctly, all timing constants are at their original values, and the animation loops properly after the logo phase.
The code inspection confirms that:
1. ✅ Animation phase sequence is correct
2. ✅ All timing constants match expected values
3. ✅ Animation loops properly with state reset
4. ✅ Character stagger timing is preserved
5. ✅ Total cycle time is 7.2 seconds as expected
The implementation fully satisfies Requirements 4.1, 4.2, and 4.5.
## Recommendations
1. The test suite has been created and provides good coverage of timing constants
2. Some tests fail due to framer-motion mocking limitations, but the actual code is correct
3. Manual testing in the browser would provide additional confidence in the visual animation behavior
4. Consider improving the framer-motion mock to better handle AnimatePresence for future testing
## Files Created/Modified
- ✅ Created: `app/components/Hero.animation.test.tsx` - Comprehensive test suite for animation timing
- ✅ Created: `.kiro/specs/remove-preloader-adjust-hero/task-6.1-verification.md` - This verification document
@@ -1,133 +0,0 @@
# Task 6.3 Verification: Reduced Motion Preferences
## Task Description
Verify that reduced motion preferences are respected in the Hero component. Test that reduced motion removes blur and scale effects while confirming opacity-based transitions still work.
## Requirements Validated
- **Requirement 4.3**: THE Hero SHALL respect the user's reduced motion preferences
- **Requirement 4.4**: WHEN reduced motion is preferred, THE Hero SHALL use simplified animations without blur or scale effects
## Test Implementation
### Test File
Created `app/components/Hero.reducedMotion.test.tsx` with comprehensive test coverage for reduced motion behavior.
### Test Categories
#### 1. Blur Effects Removal
Tests verify that when reduced motion is enabled:
- ✅ Typed characters do not have blur filter effects in initial or animate states
- ✅ Logo animation does not include blur filter effects
- ✅ Heading exit animation does not include blur effects
#### 2. Scale Effects Removal
Tests verify that when reduced motion is enabled:
- ✅ Typed characters do not have scale effects in initial or animate states
- ✅ Logo animation does not include scale effects
- ✅ Heading exit animation does not include scale effects
- ✅ Interactive elements (buttons, links) do not have scale effects on hover or tap
#### 3. Opacity Transitions Preservation
Tests verify that when reduced motion is enabled:
- ✅ Typed characters still use opacity-based transitions (fade in effect)
- ✅ Logo still uses opacity-based transitions
- ✅ Heading exit animation still uses opacity-based transitions
- ✅ Cursor blink still has opacity (though it may not animate)
- ✅ Container elements still use opacity-based transitions
#### 4. Comparison with Normal Motion
Tests verify that when reduced motion is disabled:
- ✅ Blur and scale effects ARE applied to typed characters
- ✅ Scale effects ARE applied to interactive elements on hover and tap
#### 5. Reduced Motion Consistency
Tests verify that:
- ✅ All animated elements consistently respect reduced motion preferences
- ✅ The preference is applied uniformly across typing phase and logo phase
## Test Results
All 15 tests passed successfully:
```
Test Suites: 1 passed, 1 total
Tests: 15 passed, 15 total
```
### Key Findings
1. **Blur Effects Properly Removed**
- When `shouldReduceMotion` is true, the Hero component uses `{ opacity: 0 }` instead of `{ filter: "blur(12px)", opacity: 0, scale: 0.9 }`
- Logo animation uses `{ opacity: 0 }` instead of complex blur/scale animations
- Exit animations use `{ opacity: 0 }` instead of `{ opacity: 0, filter: "blur(10px)", scale: 1.04 }`
2. **Scale Effects Properly Removed**
- Character animations do not include scale transformations when reduced motion is enabled
- Logo animations do not include scale transformations
- Interactive elements (buttons, social links) have `undefined` whileHover and whileTap props, removing scale effects
3. **Opacity Transitions Preserved**
- All elements maintain opacity-based fade in/out transitions
- Opacity values transition from 0 to 1 for appearing elements
- Opacity values transition from 1 to 0 for disappearing elements
- This provides smooth visual feedback without motion-intensive effects
4. **Implementation Quality**
- The Hero component uses framer-motion's `useReducedMotion()` hook correctly
- Conditional logic properly switches between full animations and simplified animations
- The implementation respects user accessibility preferences
## Code Implementation
The Hero component implements reduced motion through conditional animation properties:
```typescript
const shouldReduceMotion = useReducedMotion();
// Example: Typed character animation
initial={
shouldReduceMotion
? { opacity: 0 }
: { filter: "blur(12px)", opacity: 0, scale: 0.9 }
}
animate={
headingInView
? shouldReduceMotion
? { opacity: 1 }
: { filter: "blur(0px)", opacity: 1, scale: 1 }
: shouldReduceMotion
? { opacity: 0 }
: { filter: "blur(12px)", opacity: 0, scale: 0.9 }
}
```
This pattern is consistently applied to:
- Typed character animations
- Logo animations
- Heading exit animations
- Interactive element hover/tap effects
- Container element animations
## Conclusion
✅ **Task 6.3 is complete and verified.**
The Hero component properly respects reduced motion preferences by:
1. Removing blur filter effects when reduced motion is enabled
2. Removing scale transformations when reduced motion is enabled
3. Preserving opacity-based transitions for smooth visual feedback
4. Applying the preference consistently across all animated elements
The implementation follows accessibility best practices and ensures users with motion sensitivity can use the site comfortably while still experiencing smooth, simple transitions.
## Test Coverage
- **15 unit tests** covering all aspects of reduced motion behavior
- **100% pass rate** on all tests
- Tests cover both reduced motion enabled and disabled states
- Tests verify consistency across multiple animation phases
- Tests confirm proper fallback to opacity-only animations
## Recommendations
The current implementation is excellent and requires no changes. The Hero component serves as a good example of how to implement reduced motion preferences in React applications using framer-motion.
@@ -1,71 +0,0 @@
# Task 7.1 Verification: Character Stagger Timing Across Viewports
## Task Description
Test character stagger timing across viewports to verify:
- Mobile viewports (< 768px) use 0.015s stagger
- Desktop viewports (≥ 768px) use 0.03s stagger
## Implementation Summary
Created comprehensive test suite in `app/components/Hero.stagger.test.tsx` that validates requirement 5.3.
### Test Coverage
#### Mobile Viewport Tests (3 tests)
1. **Viewport width < 768px**: Verifies 0.015s stagger for mobile viewports
2. **Viewport width = 320px**: Tests small mobile devices
3. **Viewport width = 767px**: Tests boundary just below breakpoint
#### Desktop Viewport Tests (4 tests)
1. **Viewport width ≥ 768px**: Verifies 0.03s stagger for desktop viewports
2. **Viewport width = 768px**: Tests exact breakpoint boundary
3. **Viewport width = 1024px**: Tests large desktop viewports
4. **Viewport width = 1920px**: Tests extra-large desktop viewports
#### Viewport Change Responsiveness Tests (2 tests)
1. **Event listener registration**: Verifies event listener is properly registered
2. **Event listener cleanup**: Verifies proper cleanup on unmount to prevent memory leaks
#### Hero Component Integration Tests (2 tests)
1. **Mobile rendering**: Verifies Hero component renders correctly with mobile stagger
2. **Desktop rendering**: Verifies Hero component renders correctly with desktop stagger
### Test Results
```
Test Suites: 1 passed, 1 total
Tests: 11 passed, 11 total
```
All 11 tests passed successfully, validating that:
- Character stagger timing is correctly set based on viewport width
- The 768px breakpoint is properly implemented
- Event listeners are registered and cleaned up correctly
- The Hero component integrates properly with the stagger timing logic
### Implementation Details
The Hero component uses `window.matchMedia('(max-width: 768px)')` to detect viewport size and sets:
- `charStagger = 0.015` for mobile viewports (< 768px)
- `charStagger = 0.03` for desktop viewports (≥ 768px)
The media query listener is properly registered and cleaned up using React's `useEffect` hook, ensuring responsive behavior without memory leaks.
### Validation Against Requirements
**Requirement 5.3**: "THE Hero SHALL preserve the responsive character stagger timing (0.015s mobile, 0.03s desktop)"
✅ **VERIFIED**: All tests confirm that the Hero component correctly implements responsive character stagger timing:
- Mobile viewports (< 768px) consistently use 0.015s stagger
- Desktop viewports (≥ 768px) consistently use 0.03s stagger
- The breakpoint at 768px is correctly implemented
- Event listeners properly handle viewport changes
- Component integration works correctly across all viewport sizes
## Conclusion
Task 7.1 is complete. The character stagger timing implementation has been thoroughly tested and verified to meet requirement 5.3. The test suite provides comprehensive coverage of:
- Boundary conditions (320px, 767px, 768px, 1024px, 1920px)
- Event listener lifecycle (registration and cleanup)
- Component integration with the stagger timing logic
- Responsive behavior across mobile and desktop viewports
@@ -1,89 +0,0 @@
# Task 7.3 Verification: Spacing and Interactive Elements
## Task Description
Verify that spacing (mb-sp-6, padding) is preserved and confirm buttons and social links remain accessible at all breakpoints.
## Requirements Validated
- **Requirement 5.4**: THE Hero SHALL maintain proper spacing and padding across all viewport sizes
- **Requirement 5.5**: THE Hero SHALL ensure all interactive elements (buttons, social links) remain accessible on all devices
## Test Results
### Test File Created
`app/components/Hero.spacing.test.tsx`
### Test Summary
**All 20 tests passed successfully** ✓
### Test Coverage
#### 1. Spacing Preservation (Requirement 5.4)
- ✓ Verified `mb-sp-6` spacing on heading container
- ✓ Verified responsive min-height classes (`min-h-[35vw]`, `sm:min-h-[200px]`, `md:min-h-[240px]`, `lg:min-h-[280px]`)
- ✓ Verified section padding classes (`px-sp-4`, `py-sp-12`, `lg:px-sp-8`)
- ✓ Verified `mb-sp-8` spacing on status indicator
- ✓ Verified `mb-sp-10` spacing on description paragraph
- ✓ Verified `gap-sp-4` spacing on button container
- ✓ Verified `gap-sp-2` spacing on social links container
#### 2. Interactive Elements Accessibility (Requirement 5.5)
- ✓ Verified "Iniciar projeto" button accessibility (proper href, height, padding)
- ✓ Verified "Download CV" button accessibility (proper href, download attribute, height, padding)
- ✓ Verified all social links (GitHub, LinkedIn, Email) with proper:
- href attributes
- target="_blank" for external links
- rel="noopener noreferrer" for security
- aria-label attributes
- ✓ Verified social links have proper interactive sizing (h-11, w-11 = 44x44px minimum touch target)
- ✓ Verified social link icons have proper ARIA attributes (role="img", aria-label)
- ✓ Verified button padding for proper touch targets (px-sp-6, h-11)
#### 3. Responsive Behavior (Requirements 5.4, 5.5)
- ✓ Verified spacing classes are maintained across viewport widths (375px, 640px, 768px, 1024px, 1280px)
- ✓ Verified interactive elements remain accessible across all viewport widths
- ✓ Verified button sizing is maintained at all breakpoints
- ✓ Verified social link sizing is maintained at all breakpoints
#### 4. Container Structure
- ✓ Verified proper flex layout for heading container (relative, flex, items-center)
- ✓ Verified proper flex layout for button container (flex, flex-wrap, items-center)
- ✓ Verified proper flex layout for social links container (flex, items-center)
## Key Findings
### Spacing Verification
All spacing utilities are correctly preserved:
- Margin bottom spacing: `mb-sp-6`, `mb-sp-8`, `mb-sp-10`
- Padding: `px-sp-4`, `py-sp-12`, `lg:px-sp-8`, `px-sp-6`
- Gap spacing: `gap-sp-4`, `gap-sp-2`
- Responsive min-heights: `min-h-[35vw]`, `sm:min-h-[200px]`, `md:min-h-[240px]`, `lg:min-h-[280px]`
### Interactive Elements Verification
All interactive elements meet accessibility standards:
- **Buttons**: Proper height (44px), padding, and semantic HTML
- **Social Links**: Minimum 44x44px touch targets (WCAG 2.1 Level AAA)
- **ARIA Labels**: All interactive elements have proper aria-label attributes
- **External Links**: Proper security attributes (rel="noopener noreferrer")
- **Icons**: Proper role="img" and aria-label for screen readers
### Responsive Behavior
All elements maintain proper spacing and accessibility across breakpoints:
- Mobile (375px): All spacing and interactive elements verified
- Small (640px): All spacing and interactive elements verified
- Medium (768px): All spacing and interactive elements verified
- Large (1024px): All spacing and interactive elements verified
- Extra Large (1280px): All spacing and interactive elements verified
## Conclusion
Task 7.3 is **COMPLETE**. All spacing utilities are preserved correctly, and all interactive elements (buttons and social links) remain accessible at all breakpoints. The Hero component maintains proper spacing, padding, and touch target sizes across all viewport sizes, meeting both Requirements 5.4 and 5.5.
### Test Execution
```bash
npm test -- Hero.spacing.test.tsx
```
**Result**: 20/20 tests passed ✓
## Date
2025-01-XX (Test execution date)
@@ -1,127 +0,0 @@
# Implementation Plan: Remove Preloader and Adjust Hero
## Overview
This implementation removes the Preloader component to provide immediate content access and adjusts the Hero section for improved readability and visual balance. The changes maintain all existing animation behavior, timing, and responsive adaptations while optimizing text sizes and logo positioning across all breakpoints.
## Tasks
- [ ] 1. Remove Preloader component and its usage
- [x] 1.1 Remove Preloader import from app/page.tsx
- Delete the import statement for Preloader component
- _Requirements: 1.5_
- [x] 1.2 Remove Preloader rendering from page component
- Remove `<Preloader />` JSX element from the component tree
- Verify Hero component renders immediately on page load
- _Requirements: 1.1, 1.2_
- [x] 1.3 Delete Preloader component file
- Delete app/components/Preloader.tsx from the codebase
- _Requirements: 1.4_
- [x] 1.4 Verify body overflow is not manipulated
- Confirm document.body.style.overflow is not set to "hidden" on initialization
- _Requirements: 1.3_
- [ ] 2. Adjust Hero text sizing across all breakpoints
- [x] 2.1 Update Hero heading className with reduced font sizes
- Change text size classes from current values to: `text-[10vw] sm:text-[4rem] md:text-[4.5rem] lg:text-[5rem] xl:text-[5.5rem]`
- Maintain existing `leading-[0.9]` and `tracking-[-0.01em]` properties
- Apply changes to the h1 element containing "evandro.dev.br"
- _Requirements: 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7_
- [x] 2.2 Write unit tests for Hero text sizing
- Test that all responsive font size classes are present in className
- Test that line-height and tracking properties are preserved
- Verify text renders at each breakpoint with correct classes
- _Requirements: 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7_
- [x] 2.3 Write property test for responsive text sizing
- **Property 4: Responsive Text Sizing**
- **Validates: Requirements 2.2, 2.3, 2.4, 2.5, 2.6**
- Test that appropriate font size classes are applied for any viewport width (320px-1920px)
- Verify all breakpoint classes are present in the className string
- [ ] 3. Adjust Hero container height for proportional spacing
- [x] 3.1 Update container min-height classes
- Change min-height classes from current values to: `min-h-[35vw] sm:min-h-[200px] md:min-h-[240px] lg:min-h-[280px]`
- Apply to the container div with className containing "relative mb-sp-6 flex"
- _Requirements: 5.2, 5.4_
- [ ] 4. Improve Logo positioning and sizing
- [x] 4.1 Update Logo component className with reduced dimensions
- Change width from `w-[80%]` to `w-[65%]`
- Change max-width from `max-w-[320px]` to `max-w-[280px]`
- Preserve all other properties: `h-auto`, drop-shadow, variant, size, theme
- _Requirements: 3.2, 3.3, 3.6_
- [x] 4.2 Write unit tests for Logo positioning
- Test that Logo width class is `w-[65%]`
- Test that Logo max-width class is `max-w-[280px]`
- Verify Logo maintains horizontal centering
- Verify drop-shadow and other visual properties are preserved
- _Requirements: 3.1, 3.2, 3.3, 3.4, 3.5, 3.6_
- [ ] 5. Checkpoint - Verify visual changes and run tests
- Ensure all unit tests pass
- Manually verify text sizes look appropriate at all breakpoints
- Confirm Logo appears balanced during animation phase
- Ask the user if questions arise
- [ ] 6. Verify animation timing preservation
- [x] 6.1 Confirm animation phase transitions remain unchanged
- Verify typing → idle → glitch → logo sequence works correctly
- Check that all timing constants remain at original values
- Test that animation loops properly after logo phase
- _Requirements: 4.1, 4.2, 4.5_
- [x] 6.2 Write property test for animation phase sequence
- **Property 1: Animation Phase Sequence Preservation**
- **Validates: Requirements 4.1, 4.2**
- Test that phases transition in correct order across multiple iterations
- Verify each phase completes before the next begins
- [x] 6.3 Verify reduced motion preferences are respected
- Test that reduced motion removes blur and scale effects
- Confirm opacity-based transitions still work with reduced motion
- _Requirements: 4.3, 4.4_
- [x] 6.4 Write property test for reduced motion adaptation
- **Property 2: Reduced Motion Adaptation**
- **Validates: Requirements 4.3, 4.4**
- Test that blur and scale effects are excluded when reduced motion is enabled
- Verify opacity transitions remain functional
- [ ] 7. Verify responsive behavior preservation
- [x] 7.1 Test character stagger timing across viewports
- Verify mobile viewports (< 768px) use 0.015s stagger
- Verify desktop viewports (≥ 768px) use 0.03s stagger
- _Requirements: 5.3_
- [x] 7.2 Write property test for responsive character stagger
- **Property 3: Responsive Character Stagger Timing**
- **Validates: Requirements 5.3**
- Test that correct stagger timing is applied for any viewport width
- Verify media query listener updates stagger on viewport changes
- [x] 7.3 Verify spacing and interactive elements
- Test that spacing (mb-sp-6, padding) is preserved
- Confirm buttons and social links remain accessible at all breakpoints
- _Requirements: 5.4, 5.5_
- [ ] 8. Final checkpoint - Complete verification
- Run all unit tests and property tests
- Manually test at all breakpoints (mobile, sm, md, lg, xl)
- Verify no console errors or warnings
- Confirm Preloader is completely removed
- Ensure all tests pass, ask the user if questions arise
## Notes
- Tasks marked with `*` are optional and can be skipped for faster implementation
- Each task references specific requirements for traceability
- Property tests validate universal correctness properties from the design document
- Unit tests validate specific implementation details and edge cases
- Manual verification at checkpoints ensures visual quality matches design intent
- All animation timing and responsive behavior must be preserved from original implementation
@@ -1,71 +0,0 @@
# Task 1.4 Verification: Body Overflow Not Manipulated
## Task Description
Verify that `document.body.style.overflow` is not set to "hidden" during initialization.
## Verification Method
Comprehensive code inspection of all relevant files that could potentially manipulate body overflow during application initialization.
## Files Inspected
### 1. app/page.tsx
**Status:** ✅ No body overflow manipulation
- No Preloader component import or rendering
- No useEffect hooks that manipulate document.body
- Clean component structure with only Hero and other content components
### 2. app/components/Hero.tsx
**Status:** ✅ No body overflow manipulation
- Contains two useEffect hooks:
1. Media query listener for character stagger timing (lines 48-56)
2. Animation phase transition logic (lines 57-95)
- Neither hook manipulates document.body.style.overflow
- All effects are focused on component-internal state management
### 3. app/layout.tsx
**Status:** ✅ No body overflow manipulation
- Root layout component with metadata configuration
- No client-side effects or body manipulation
- Clean server component structure
### 4. app/providers/SmoothScrollProvider.tsx
**Status:** ✅ No body overflow manipulation
- Initializes Lenis smooth scroll library
- Integrates with GSAP ScrollTrigger
- No body overflow manipulation in useEffect hook
- Only manages scroll behavior through Lenis API
### 5. Preloader Component
**Status:** ✅ Component deleted (Task 1.3)
- File app/components/Preloader.tsx has been removed
- This was the only component that previously set body overflow to "hidden"
## Code Search Results
### Search 1: Direct body overflow manipulation
**Query:** `document\.body\.style\.overflow`
**Results:** No matches in source code (only found in spec documentation)
### Search 2: Body overflow with "hidden"
**Query:** `body.*overflow.*hidden`
**Results:** No matches in source code
### Search 3: Any body.style manipulation
**Query:** `body\.style`
**Results:** No matches in source code
## Conclusion
✅ **VERIFIED:** The application does NOT manipulate `document.body.style.overflow` during initialization.
### Evidence Summary:
1. The Preloader component (which previously set overflow to "hidden") has been completely removed
2. No other component in the application manipulates document.body.style.overflow
3. Comprehensive code searches found zero instances of body overflow manipulation
4. All initialization code (page, layout, providers, Hero) has been inspected and confirmed clean
### Requirements Satisfied:
- **Requirement 1.3:** "WHEN the application initializes, THE Page SHALL NOT apply overflow hidden to the document body" ✅
## Recommendation
Task 1.4 can be marked as complete. The verification confirms that body overflow is not manipulated anywhere in the application during initialization.
@@ -1 +0,0 @@
{"specId": "3fcf2565-1720-4d06-9224-82b23b02204c", "workflowType": "requirements-first", "specType": "feature"}
@@ -1,501 +0,0 @@
# Design Document: Site Improvements - Footer & Companies
## Overview
This design implements site-wide improvements including spacing standardization, a complete footer component with contact information and social links, an animated company logos banner with infinite scroll, and reorganization of the Experience section into Software/Hardware categories. The implementation maintains the existing minimalist design system using Monument Extended typography, #ccff00 accent color, and Framer Motion animations.
The design focuses on three main areas:
1. **Spacing System Standardization**: Applying consistent spacing tokens across all sections
2. **Footer Component**: A new footer with contact info, social links, and copyright
3. **CompanyLogos Component**: An infinite-scroll animated banner displaying company logos
4. **Experience Section Refactor**: Categorizing experiences into Software and Hardware groups
All components follow the established design system patterns from `globals.css` and integrate with the existing Framer Motion animation infrastructure.
## Architecture
### Component Structure
```
app/
├── components/
│ ├── Footer.tsx (replace existing)
│ ├── CompanyLogos.tsx (new)
│ ├── Experience.tsx (refactor)
│ └── Section.tsx (update spacing)
├── page.tsx (update layout)
└── globals.css (spacing documentation)
```
### Data Flow
1. **Footer Component**: Static data (email, social links) defined as constants within the component
2. **CompanyLogos Component**: Logo data (company names, image paths) defined as constants, rendered with animation
3. **Experience Component**: Existing data from `usePortfolioData()` hook, filtered and categorized by type field
### Animation Strategy
All animations use Framer Motion with reduced motion support:
- **CompanyLogos**: Continuous horizontal scroll using `animate` with infinite loop
- **Footer**: Subtle hover states on social links
- **Experience**: Existing stagger animations maintained, category headers added
## Components and Interfaces
### 1. Footer Component
**Purpose**: Display contact information, social links, and copyright in a consistent footer layout.
**Props**: None (self-contained component)
**Structure**:
```tsx
interface SocialLink {
name: string;
href: string;
icon: string; // SVG path or icon identifier
ariaLabel: string;
}
const socialLinks: SocialLink[] = [
{ name: 'GitHub', href: 'https://github.com/...', icon: '...', ariaLabel: 'Visit GitHub profile' },
{ name: 'LinkedIn', href: 'https://linkedin.com/...', icon: '...', ariaLabel: 'Visit LinkedIn profile' },
// ... more links
];
```
**Layout**:
- Desktop: Three-column grid (contact info | social links | copyright)
- Tablet: Two-column grid (contact/social | copyright)
- Mobile: Single column stack
**Styling**:
- Background: `var(--ink)` with `border-t: 1px solid rgba(255,255,255,0.06)`
- Typography: Monument Extended for headings, Geist Mono for body text
- Accent: `var(--slash)` for link hover states
- Padding: `py-sp-12 px-sp-16` (desktop), `py-sp-8 px-sp-6` (mobile)
### 2. CompanyLogos Component
**Purpose**: Display an infinite-scrolling banner of company logos after the header.
**Props**: None (self-contained component)
**Structure**:
```tsx
interface CompanyLogo {
name: string;
imagePath: string;
alt: string;
}
const companies: CompanyLogo[] = [
{ name: 'Apolo Energia', imagePath: '/logos/apolo.svg', alt: 'Apolo Energia logo' },
{ name: 'Julia Beauty Lashes', imagePath: '/logos/julia.svg', alt: 'Julia Beauty Lashes logo' },
{ name: 'Innovo', imagePath: '/logos/innovo.svg', alt: 'Innovo logo' },
{ name: 'TeraByteShop', imagePath: '/logos/terabyte.svg', alt: 'TeraByteShop logo' },
{ name: 'Pichau', imagePath: '/logos/pichau.svg', alt: 'Pichau logo' },
];
```
**Animation Implementation**:
```tsx
// Duplicate logo array for seamless loop
const duplicatedLogos = [...companies, ...companies];
// Framer Motion animation
<motion.div
animate={{
x: [0, -50%], // Move by half the width (one set of logos)
}}
transition={{
duration: 30, // 30 seconds for full loop
repeat: Infinity,
ease: "linear",
}}
>
{duplicatedLogos.map((logo, index) => (
<img key={`${logo.name}-${index}`} src={logo.imagePath} alt={logo.alt} />
))}
</motion.div>
```
**Reduced Motion Handling**:
```tsx
const shouldReduceMotion = useReducedMotion();
// If reduced motion, display static grid instead of animation
{shouldReduceMotion ? (
<div className="grid grid-cols-5 gap-sp-6">
{companies.map(logo => <img key={logo.name} ... />)}
</div>
) : (
<motion.div animate={...} />
)}
```
**Styling**:
- Container: `overflow-hidden` with `border-b: 1px solid var(--border)`
- Background: `var(--paper)` with optional subtle grid pattern
- Logo sizing: `h-12` (48px) with `grayscale` filter, `grayscale-0` on hover
- Spacing: `py-sp-8` vertical padding, `gap-sp-12` between logos
### 3. Experience Component Refactor
**Purpose**: Organize experience entries into Software and Hardware categories.
**Changes**:
1. Add category filtering logic
2. Render two separate sections with category headers
3. Maintain existing card structure and animations
**Implementation**:
```tsx
const softwareExperiences = sortedExperiences.filter(exp => exp.type === 'Software');
const hardwareExperiences = sortedExperiences.filter(exp => exp.type === 'Hardware');
return (
<Section id="experience" ...>
{/* Software Category */}
<div className="mb-sp-12">
<h3 className="font-display text-2xl font-bold mb-sp-6 flex items-center gap-sp-3">
<span className="text-[var(--slash)]">/</span> Software
</h3>
<motion.div variants={listVariants}>
{softwareExperiences.map(exp => <ExperienceCard key={exp.id} {...exp} />)}
</motion.div>
</div>
{/* Hardware Category */}
<div>
<h3 className="font-display text-2xl font-bold mb-sp-6 flex items-center gap-sp-3">
<span className="text-[var(--slash)]">/</span> Hardware
</h3>
<motion.div variants={listVariants}>
{hardwareExperiences.map(exp => <ExperienceCard key={exp.id} {...exp} />)}
</motion.div>
</div>
</Section>
);
```
**Styling**:
- Category headers: Monument Extended, `text-2xl`, with slash accent
- Separator: `mb-sp-12` between categories
- Cards: Maintain existing styling and animations
### 4. Spacing System Updates
**Standardization**:
All sections should use consistent spacing tokens from `globals.css`:
- Section padding: `py-sp-20 px-sp-16` (desktop), `py-sp-16 px-sp-6` (mobile)
- Section margins: `mb-sp-12` between major sections
- Card spacing: `space-y-sp-6` for vertical stacks
- Grid gaps: `gap-sp-6` for 2-column, `gap-sp-4` for 4-column
**Responsive Scaling**:
Tailwind responsive utilities handle breakpoints:
- Mobile: `px-sp-6 py-sp-16`
- Tablet: `px-sp-10 py-sp-18`
- Desktop: `px-sp-16 py-sp-20`
## Data Models
### SocialLink
```typescript
interface SocialLink {
name: string; // Display name (e.g., "GitHub")
href: string; // Full URL
icon: string; // SVG path or icon component reference
ariaLabel: string; // Accessibility label
}
```
### CompanyLogo
```typescript
interface CompanyLogo {
name: string; // Company name
imagePath: string; // Path to logo image (SVG preferred)
alt: string; // Alt text for accessibility
}
```
### Experience (existing, with type field)
```typescript
interface Experience {
id: string;
title: string;
company: string;
type: 'Software' | 'Hardware'; // Used for categorization
period: string;
location: string;
description: string;
achievements: string[];
technologies: string[];
featured: boolean;
}
```
## Correctness Properties
*A property is a characteristic or behavior that should hold true across all valid executions of a system—essentially, a formal statement about what the system should do. Properties serve as the bridge between human-readable specifications and machine-verifiable correctness guarantees.*
### Property 1: Consistent Spacing System
*For any* major section or container element in the site, it should use spacing tokens from the design system (sp-1 through sp-24) with appropriate responsive modifiers for different viewport sizes.
**Validates: Requirements 1.1, 1.2, 1.3, 1.4**
### Property 2: Social Links Open in New Tab
*For any* social media link in the Footer component, it should have `target="_blank"` and `rel="noopener noreferrer"` attributes to open in a new tab securely.
**Validates: Requirements 2.7**
### Property 3: Responsive Component Layout
*For any* new component (Footer, CompanyLogos, Experience categories), it should include Tailwind responsive utility classes (sm:, md:, lg:) to adapt layout across viewport sizes.
**Validates: Requirements 2.6, 3.7, 4.5**
### Property 4: Reduced Motion Respect
*For any* animated component, when `useReducedMotion()` returns true, the component should render a static alternative without motion animations.
**Validates: Requirements 3.6, 6.3**
### Property 5: Experience Categorization
*For any* experience entry in the Experience section, it should be filtered by its `type` field and rendered within the corresponding Software or Hardware category group.
**Validates: Requirements 4.1**
### Property 6: Chronological Ordering Within Categories
*For any* category group in the Experience section, the experience entries within that group should be sorted in descending chronological order by year.
**Validates: Requirements 4.3**
### Property 7: Monument Extended Typography
*For any* heading element (h1, h2, h3) in new components (Footer, CompanyLogos, Experience categories), it should use the `font-display` class which applies Monument Extended font family.
**Validates: Requirements 2.4, 4.2, 5.4**
### Property 8: Slash Color Accents
*For any* accent element (category separators, hover states, decorative elements) in new components, it should use `var(--slash)` color (#ccff00) via Tailwind classes like `text-[var(--slash)]` or `bg-[var(--slash)]`.
**Validates: Requirements 5.1, 5.2**
### Property 9: ARIA Labels for Links
*For any* social media link in the Footer component, it should have a descriptive `aria-label` attribute that identifies the platform and action.
**Validates: Requirements 6.1**
### Property 10: Alt Text for Images
*For any* company logo image in the CompanyLogos component, it should have a non-empty `alt` attribute describing the company.
**Validates: Requirements 6.2**
### Property 11: Semantic Heading Hierarchy
*For any* sequence of heading elements in the Experience section, the heading levels should follow proper semantic hierarchy (h2 for section title, h3 for categories, no skipped levels).
**Validates: Requirements 6.4**
### Property 12: Keyboard Navigation Support
*For any* interactive element (links, buttons) in new components, it should be keyboard accessible with proper focus states and no negative tabindex values.
**Validates: Requirements 6.5**
## Error Handling
### Footer Component
**Missing Social Links Data**:
- Gracefully render empty state or hide social links section
- Log warning to console in development mode
- Ensure layout doesn't break with missing data
**Invalid Email Format**:
- Display email as-is (validation is not the footer's responsibility)
- Ensure mailto: link is properly formatted
### CompanyLogos Component
**Missing Logo Images**:
- Display company name as fallback text
- Log warning for missing images in development
- Maintain layout spacing even with missing images
**Animation Performance Issues**:
- Monitor frame rate using `useAnimationFrame` hook
- Fallback to static display if performance drops below threshold
- Respect `prefers-reduced-motion` preference
### Experience Component
**Missing Type Field**:
- Default to "Software" category if type is undefined
- Log warning for entries without type field
- Ensure all entries are displayed (don't silently drop data)
**Empty Categories**:
- Hide category header if no entries exist for that type
- Maintain spacing consistency when categories are hidden
### General Error Handling
**Component Render Errors**:
- Wrap components in Error Boundaries
- Display user-friendly error message
- Log detailed error information for debugging
**Responsive Layout Issues**:
- Use CSS fallbacks for unsupported features
- Test across major browsers and devices
- Ensure content remains accessible even if styling fails
## Testing Strategy
### Dual Testing Approach
This feature requires both unit tests and property-based tests to ensure comprehensive coverage:
**Unit Tests**: Focus on specific examples, edge cases, and integration points
- Specific component rendering scenarios
- Edge cases (empty data, missing fields)
- User interaction flows (clicking links, reduced motion)
- Integration between components
**Property-Based Tests**: Verify universal properties across all inputs
- Spacing consistency across generated component trees
- Accessibility attributes across generated link/image sets
- Categorization logic across generated experience data
- Responsive class application across generated components
### Testing Framework
**Framework**: Vitest + React Testing Library + fast-check
- Vitest for test runner and assertions
- React Testing Library for component testing
- fast-check for property-based testing (TypeScript-native)
**Property Test Configuration**:
- Minimum 100 iterations per property test
- Each test tagged with: `Feature: site-improvements-footer-companies, Property {number}: {property_text}`
- Use custom generators for component props and data structures
### Unit Test Coverage
**Footer Component**:
- Renders contact information correctly
- Renders all social links with correct attributes
- Displays current year in copyright
- Opens social links in new tab
- Applies correct styling classes
- Responsive layout changes at breakpoints
**CompanyLogos Component**:
- Renders all five company logos
- Duplicates logo array for infinite scroll
- Applies animation with correct configuration
- Displays static grid when reduced motion is enabled
- Handles missing logo images gracefully
- Maintains responsive layout
**Experience Component**:
- Filters experiences by Software/Hardware type
- Renders category headers with correct styling
- Maintains chronological order within categories
- Hides empty categories
- Applies consistent spacing between categories
- Responsive layout on mobile devices
### Property-Based Test Coverage
**Property 1: Consistent Spacing System**
- Generate random component trees with various nesting levels
- Verify all spacing classes use design system tokens
- Check responsive modifiers are present
**Property 2: Social Links Open in New Tab**
- Generate random arrays of social links
- Verify each link has target="_blank" and rel="noopener noreferrer"
**Property 3: Responsive Component Layout**
- Generate random component configurations
- Verify presence of responsive utility classes
**Property 4: Reduced Motion Respect**
- Generate random animation configurations
- Verify static rendering when reduced motion is true
**Property 5: Experience Categorization**
- Generate random experience arrays with mixed types
- Verify correct filtering and grouping by type
**Property 6: Chronological Ordering Within Categories**
- Generate random experience arrays with various dates
- Verify descending chronological order within each category
**Property 7: Monument Extended Typography**
- Generate random heading elements
- Verify font-display class is applied
**Property 8: Slash Color Accents**
- Generate random accent elements
- Verify var(--slash) color usage
**Property 9: ARIA Labels for Links**
- Generate random social link arrays
- Verify each has descriptive aria-label
**Property 10: Alt Text for Images**
- Generate random logo arrays
- Verify each image has non-empty alt text
**Property 11: Semantic Heading Hierarchy**
- Generate random heading sequences
- Verify proper h2 → h3 hierarchy without skips
**Property 12: Keyboard Navigation Support**
- Generate random interactive elements
- Verify focusability and proper tabindex values
### Integration Testing
**Page Layout Integration**:
- Verify CompanyLogos appears after Header
- Verify Footer appears at bottom of page
- Verify spacing between all sections is consistent
- Test full page scroll behavior
**Animation Performance**:
- Monitor CompanyLogos animation frame rate
- Verify smooth scrolling across devices
- Test reduced motion fallback behavior
**Accessibility Testing**:
- Run axe-core automated accessibility tests
- Verify keyboard navigation through all components
- Test screen reader compatibility
- Verify color contrast ratios meet WCAG AA standards
### Visual Regression Testing
**Snapshot Tests**:
- Footer component in all responsive states
- CompanyLogos with animation and static states
- Experience section with both categories populated
- Experience section with one empty category
**Cross-Browser Testing**:
- Chrome, Firefox, Safari, Edge
- Mobile browsers (iOS Safari, Chrome Mobile)
- Verify consistent rendering and animation performance
@@ -1,96 +0,0 @@
# Requirements Document
## Introduction
This document specifies requirements for site-wide improvements including spacing fixes, a complete footer component, an animated company logos banner, and reorganization of the Experience section. These improvements enhance the visual consistency, professionalism, and user experience of the portfolio site.
## Glossary
- **Site**: The portfolio website built with Next.js 15, React 19, TypeScript, and Tailwind CSS 4
- **Footer**: The bottom section of the Site containing contact information, social links, and copyright
- **Companies_Banner**: A horizontal scrolling component displaying company logos after the header
- **Experience_Section**: The section of the Site displaying professional work history
- **Spacing_System**: The consistent vertical and horizontal spacing applied throughout the Site
- **Monument_Extended**: The primary font family used for headings and emphasis
- **Slash_Color**: The accent color (#ccff00) used for visual emphasis
## Requirements
### Requirement 1: Fix Spacing Inconsistencies
**User Story:** As a visitor, I want consistent spacing throughout the site, so that the layout feels polished and professional.
#### Acceptance Criteria
1. THE Site SHALL apply consistent vertical spacing between all major sections
2. THE Site SHALL apply consistent horizontal padding on all container elements
3. THE Site SHALL maintain spacing consistency across mobile, tablet, and desktop viewports
4. WHEN the viewport width changes, THE Spacing_System SHALL scale proportionally using Tailwind responsive utilities
### Requirement 2: Create Footer Component
**User Story:** As a visitor, I want to see contact information and social links in the footer, so that I can easily connect with the site owner.
#### Acceptance Criteria
1. THE Footer SHALL display contact information including email address
2. THE Footer SHALL display clickable social media links
3. THE Footer SHALL display copyright text with the current year
4. THE Footer SHALL use Monument_Extended font for consistency
5. THE Footer SHALL apply the minimalist design style matching the Site
6. THE Footer SHALL be responsive across mobile, tablet, and desktop viewports
7. WHEN a social link is clicked, THE Footer SHALL open the link in a new browser tab
### Requirement 3: Create Animated Company Logos Banner
**User Story:** As a visitor, I want to see companies the site owner has worked with, so that I can understand their professional experience.
#### Acceptance Criteria
1. THE Companies_Banner SHALL display logos for Apolo Energia, Julia Beauty Lashes, Innovo, TeraByteShop, and Pichau
2. THE Companies_Banner SHALL be positioned after the header section
3. THE Companies_Banner SHALL animate logos with horizontal scrolling motion
4. THE Companies_Banner SHALL loop the animation continuously
5. THE Companies_Banner SHALL maintain smooth animation performance at 60fps
6. WHEN a user enables reduced motion preferences, THE Companies_Banner SHALL display static logos without animation
7. THE Companies_Banner SHALL be responsive across mobile, tablet, and desktop viewports
8. THE Companies_Banner SHALL duplicate logo sets to create seamless infinite scroll effect
### Requirement 4: Reorganize Experience Section
**User Story:** As a visitor, I want to see work experience organized by category, so that I can quickly find relevant projects.
#### Acceptance Criteria
1. THE Experience_Section SHALL organize entries into Software and Hardware categories
2. THE Experience_Section SHALL display category headings using Monument_Extended font
3. THE Experience_Section SHALL maintain chronological order within each category
4. THE Experience_Section SHALL apply consistent spacing between category groups
5. THE Experience_Section SHALL be responsive across mobile, tablet, and desktop viewports
6. WHEN viewing on mobile, THE Experience_Section SHALL stack categories vertically
### Requirement 5: Maintain Design Consistency
**User Story:** As a visitor, I want all new components to match the existing design system, so that the site feels cohesive.
#### Acceptance Criteria
1. THE Footer SHALL use Slash_Color for accent elements
2. THE Companies_Banner SHALL use Slash_Color for decorative elements
3. THE Experience_Section SHALL use Slash_Color for category separators
4. THE Site SHALL use Monument_Extended font for all headings in new components
5. THE Site SHALL apply the minimalist design style to all new components
6. THE Site SHALL maintain consistent color palette across all new components
### Requirement 6: Ensure Accessibility
**User Story:** As a visitor using assistive technology, I want all new components to be accessible, so that I can navigate and understand the content.
#### Acceptance Criteria
1. THE Footer SHALL include proper ARIA labels for social media links
2. THE Companies_Banner SHALL include alt text for all company logos
3. THE Companies_Banner SHALL respect prefers-reduced-motion system preference
4. THE Experience_Section SHALL use semantic HTML heading hierarchy
5. THE Site SHALL maintain keyboard navigation support for all interactive elements
6. THE Site SHALL maintain sufficient color contrast ratios for all text elements
@@ -1,189 +0,0 @@
# Implementation Plan: Site Improvements - Footer & Companies
## Overview
This implementation adds a complete footer component with contact information and social links, an animated company logos banner with infinite scroll, reorganizes the Experience section into Software/Hardware categories, and standardizes spacing across the site. All components follow the existing minimalist design system using Monument Extended typography, #ccff00 accent color, and Framer Motion animations with reduced motion support.
## Tasks
- [x] 1. Set up component structure and data models
- Create Footer.tsx component file
- Create CompanyLogos.tsx component file
- Define TypeScript interfaces for SocialLink and CompanyLogo
- Set up component exports
- _Requirements: 2.1, 2.2, 3.1_
- [ ] 2. Implement Footer component
- [~] 2.1 Create Footer component with layout structure
- Implement three-column grid layout (desktop) and responsive stacks (tablet/mobile)
- Add contact information section with email
- Add social links section with GitHub, LinkedIn, and other platforms
- Add copyright section with dynamic current year
- Apply Monument Extended typography and minimalist styling
- Use spacing tokens (py-sp-12 px-sp-16 desktop, py-sp-8 px-sp-6 mobile)
- _Requirements: 2.1, 2.2, 2.3, 2.4, 2.5, 2.6_
- [x] 2.2 Write property test for Footer social links
- **Property 2: Social Links Open in New Tab**
- **Validates: Requirements 2.7**
- [x] 2.3 Write property test for Footer ARIA labels
- **Property 9: ARIA Labels for Links**
- **Validates: Requirements 6.1**
- [x] 2.4 Write property test for Footer responsive layout
- **Property 3: Responsive Component Layout**
- **Validates: Requirements 2.6**
- [x] 2.5 Write unit tests for Footer component
- Test contact information rendering
- Test social links with correct attributes
- Test current year in copyright
- Test responsive layout changes
- _Requirements: 2.1, 2.2, 2.3, 2.6, 2.7_
- [ ] 3. Implement CompanyLogos component
- [~] 3.1 Create CompanyLogos component with animation
- Define company logos array (Apolo Energia, Julia Beauty Lashes, Innovo, TeraByteShop, Pichau)
- Implement infinite scroll animation using Framer Motion
- Duplicate logo array for seamless loop effect
- Configure animation with 30-second duration and linear easing
- Apply grayscale filter with hover effect
- Use spacing tokens (py-sp-8, gap-sp-12)
- _Requirements: 3.1, 3.2, 3.3, 3.4, 3.5, 3.7, 3.8_
- [~] 3.2 Add reduced motion support to CompanyLogos
- Implement useReducedMotion hook integration
- Create static grid fallback for reduced motion preference
- Ensure smooth transition between animated and static states
- _Requirements: 3.6, 6.3_
- [x] 3.3 Write property test for CompanyLogos reduced motion
- **Property 4: Reduced Motion Respect**
- **Validates: Requirements 3.6, 6.3**
- [x] 3.4 Write property test for CompanyLogos alt text
- **Property 10: Alt Text for Images**
- **Validates: Requirements 6.2**
- [x] 3.5 Write unit tests for CompanyLogos component
- Test all five logos render correctly
- Test animation configuration
- Test reduced motion fallback
- Test missing logo image handling
- Test responsive layout
- _Requirements: 3.1, 3.3, 3.4, 3.6, 3.7_
- [~] 4. Checkpoint - Ensure all tests pass
- Ensure all tests pass, ask the user if questions arise.
- [ ] 5. Refactor Experience component with categorization
- [~] 5.1 Add category filtering and rendering logic
- Filter experiences by type field (Software/Hardware)
- Create category header components with slash accent
- Render Software category section with filtered experiences
- Render Hardware category section with filtered experiences
- Maintain chronological ordering within each category
- Apply consistent spacing (mb-sp-12 between categories)
- Hide category headers if no entries exist
- _Requirements: 4.1, 4.2, 4.3, 4.4, 4.5, 4.6_
- [x] 5.2 Write property test for Experience categorization
- **Property 5: Experience Categorization**
- **Validates: Requirements 4.1**
- [x] 5.3 Write property test for chronological ordering
- **Property 6: Chronological Ordering Within Categories**
- **Validates: Requirements 4.3**
- [x] 5.4 Write property test for semantic heading hierarchy
- **Property 11: Semantic Heading Hierarchy**
- **Validates: Requirements 6.4**
- [~] 5.5 Write unit tests for Experience refactor
- Test Software/Hardware filtering
- Test category headers render correctly
- Test chronological order within categories
- Test empty category handling
- Test responsive mobile layout
- _Requirements: 4.1, 4.2, 4.3, 4.5, 4.6_
- [ ] 6. Standardize spacing system across site
- [~] 6.1 Update Section component and all major sections
- Apply consistent spacing tokens to all section containers
- Update Hero section spacing (py-sp-20 px-sp-16 desktop, py-sp-16 px-sp-6 mobile)
- Update About section spacing
- Update Projects section spacing
- Update Experience section spacing
- Add responsive modifiers for tablet and mobile breakpoints
- _Requirements: 1.1, 1.2, 1.3, 1.4_
- [~] 6.2 Write property test for spacing consistency
- **Property 1: Consistent Spacing System**
- **Validates: Requirements 1.1, 1.2, 1.3, 1.4**
- [~] 6.3 Write unit tests for spacing updates
- Test section padding values
- Test responsive spacing changes
- Test spacing between major sections
- _Requirements: 1.1, 1.2, 1.3, 1.4_
- [ ] 7. Apply design system consistency
- [~] 7.1 Add Monument Extended typography to new components
- Verify font-display class on all heading elements
- Verify Footer headings use Monument Extended
- Verify Experience category headers use Monument Extended
- _Requirements: 2.4, 4.2, 5.4_
- [~] 7.2 Add slash color accents to new components
- Apply var(--slash) to Footer accent elements
- Apply var(--slash) to CompanyLogos decorative elements
- Apply var(--slash) to Experience category separators
- _Requirements: 5.1, 5.2, 5.3_
- [~] 7.3 Write property test for Monument Extended typography
- **Property 7: Monument Extended Typography**
- **Validates: Requirements 2.4, 4.2, 5.4**
- [~] 7.4 Write property test for slash color accents
- **Property 8: Slash Color Accents**
- **Validates: Requirements 5.1, 5.2**
- [~] 7.5 Write unit tests for design consistency
- Test font-display class application
- Test slash color usage
- Test minimalist styling consistency
- _Requirements: 5.1, 5.2, 5.4, 5.5_
- [ ] 8. Integrate components into page layout
- [~] 8.1 Update page.tsx with new components
- Import Footer and CompanyLogos components
- Position CompanyLogos after Header section
- Position Footer at bottom of page
- Verify spacing between all sections
- Test full page scroll behavior
- _Requirements: 3.2_
- [~] 8.2 Write property test for keyboard navigation
- **Property 12: Keyboard Navigation Support**
- **Validates: Requirements 6.5**
- [~] 8.3 Write integration tests for page layout
- Test CompanyLogos position after Header
- Test Footer position at page bottom
- Test spacing consistency across all sections
- Test keyboard navigation through all components
- _Requirements: 3.2, 6.5_
- [~] 9. Final checkpoint - Ensure all tests pass
- Ensure all tests pass, ask the user if questions arise.
## Notes
- Tasks marked with `*` are optional and can be skipped for faster MVP
- Each task references specific requirements for traceability
- Checkpoints ensure incremental validation
- Property tests validate universal correctness properties across all inputs
- Unit tests validate specific examples and edge cases
- All components use Next.js 15, React 19, TypeScript, Tailwind CSS 4, and Framer Motion
- Reduced motion support is critical for accessibility compliance
-1
View File
@@ -1 +0,0 @@
{}
-7516
View File
File diff suppressed because it is too large. Load diff
-36
View File
@@ -1,36 +0,0 @@
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
## Getting Started
First, run the development server:
```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
## Learn More
To learn more about Next.js, take a look at the following resources:
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
## Deploy on Vercel
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
-8
View File
@@ -1,8 +0,0 @@
class ResizeObserver {
observe() {}
unobserve() {}
disconnect() {}
}
window.ResizeObserver = ResizeObserver;
module.exports = ResizeObserver;
-165
View File
@@ -1,165 +0,0 @@
"use client";
import { motion, type Variants, useReducedMotion } from "framer-motion";
import profilePhoto from "@/public/edev.jpeg";
import { Section } from "./Section";
import { DrawLine } from "./animations/DrawLine";
import { LazyRevealImage } from "./animations/LazyRevealImage";
const STORY_DATA = [
{
id: "HARDWARE_BRIDGE",
title: "Do físico ao digital",
content:
"Construo a ponte entre hardware e software. Projeto sistemas capazes de orquestrar dispositivos físicos, protocolos de baixo nível e interfaces web modernas com baixa latência e alta resiliência.",
},
{
id: "RUNTIME_EXEC",
title: "Entrega sob restrições",
content:
"Atuo com naturalidade em cenários críticos envolvendo integrações de hardware, APIs complexas e infraestrutura legada, sempre priorizando a estabilidade e a legibilidade técnica.",
},
];
const VALUES_DATA = [
{
title: "Pragmatismo arquitetural",
description:
"Decisões guiadas por contexto real e operabilidade. A melhor tecnologia é aquela que resolve o problema sem adicionar complexidade inútil ao sistema.",
},
{
title: "Fundação & Integração",
description:
"Domínio de protocolos de rede e arquiteturas distribuídas para conectar desde microcontroladores até sistemas robustos na nuvem.",
},
{
title: "Ownership ponta a ponta",
description:
"Responsabilidade que atravessa camadas: do pulso elétrico no hardware até a renderização do último componente na tela do usuário.",
},
{
title: "Security & Safety",
description:
"Segurança e resiliência tratadas como base. Sistemas desenhados para falhar graciosamente e proteger dados do dispositivo à nuvem.",
},
];
export default function About() {
const shouldReduceMotion = useReducedMotion();
const staggerContainer: Variants = {
hidden: {},
visible: {
transition: {
delayChildren: 0.08,
staggerChildren: 0.08,
},
},
};
const cardVariants: Variants = {
hidden: shouldReduceMotion
? { opacity: 0 }
: { opacity: 0, y: 20, clipPath: "inset(100% 0 0 0)" },
visible: {
opacity: 1,
y: 0,
clipPath: "inset(0% 0 0 0)",
transition: shouldReduceMotion
? { duration: 0.25 }
: {
duration: 0.8,
ease: [0.16, 1, 0.3, 1],
},
},
};
const cardHover = shouldReduceMotion
? undefined
: {
y: -4,
boxShadow: "0 18px 40px rgba(10,10,10,0.16)",
};
return (
<Section
id="about"
eyebrow="WHOAMI.sys"
title="Engenharia orientada por clareza, nao por ruido"
description="Transformo complexidade tecnica em sistemas estaveis, operaveis e alinhados ao negocio."
disableChildrenAnimation
aside={
<div className="mt-sp-4 ds-metric">
<span className="inline-block h-1.5 w-1.5 rounded-full bg-slash" />
Garuva, SC | Remote worldwide
</div>
}
>
<motion.div
className="ds-grid-2"
initial="hidden"
whileInView="visible"
viewport={{ once: true, amount: 0.2 }}
variants={staggerContainer}
>
<motion.div
className="flex flex-col gap-sp-6"
variants={staggerContainer}
>
{STORY_DATA.map((step) => (
<motion.article
key={step.id}
className="ds-card"
variants={cardVariants}
whileHover={cardHover}
whileTap={shouldReduceMotion ? undefined : { scale: 0.99 }}
transition={{ type: "spring", stiffness: 180, damping: 18 }}
>
<div className="ds-kicker">{step.id}</div>
<DrawLine delay={0.03} />
<h3 className="ds-card-title">{step.title}</h3>
<p className="ds-copy">{step.content}</p>
</motion.article>
))}
</motion.div>
<motion.article
className="ds-card h-full"
variants={cardVariants}
whileHover={cardHover}
whileTap={shouldReduceMotion ? undefined : { scale: 0.99 }}
transition={{ type: "spring", stiffness: 180, damping: 18 }}
>
<LazyRevealImage
src={profilePhoto}
alt="Retrato de Evandro"
className="mb-sp-6 h-[220px] w-full overflow-hidden rounded-[6px] border border-[var(--border)]"
imageClassName="object-cover"
/>
<div className="ds-kicker">System Signature</div>
<DrawLine delay={0.05} />
<h3 className="ds-card-title">Base tecnica e postura de entrega</h3>
<p className="ds-copy">
Evandro Fonseca Junior. Engenheiro de Software Full-Stack com foco
na convergência entre hardware e aplicações web modernas.
Especialista em TypeScript, Node.js, ecossistema React e automação
de dispositivos físicos.
</p>
<div className="ds-grid-2 mt-sp-6">
{VALUES_DATA.map((value) => (
<div
key={value.title}
className="border-t border-[var(--border)] pt-sp-4"
>
<div className="text-[11px] font-medium uppercase tracking-[0.08em]">
{value.title}
</div>
<p className="ds-copy !mt-sp-2">{value.description}</p>
</div>
))}
</div>
</motion.article>
</motion.div>
</Section>
);
}
@@ -1,320 +0,0 @@
import { render } from "@testing-library/react";
import CompanyLogos from "./CompanyLogos";
import fc from "fast-check";
// Mock framer-motion with configurable useReducedMotion
let mockReducedMotion = false;
jest.mock("framer-motion", () => {
const actual = jest.requireActual("framer-motion");
return {
...actual,
useReducedMotion: () => mockReducedMotion,
motion: {
div: ({ children, animate, transition, ...props }: any) => {
return <div {...props}>{children}</div>;
},
},
};
});
describe("Property 10: Alt Text for Images", () => {
afterEach(() => {
mockReducedMotion = false;
});
it("should have non-empty alt attributes for all company logo images", () => {
/**
* **Validates: Requirements 6.2**
*
* Property: For any company logo image in the CompanyLogos component,
* it should have a non-empty alt attribute describing the company.
* This ensures accessibility for screen readers and assistive technologies.
*/
fc.assert(
fc.property(
fc.boolean(), // Random reduced motion preference
(shouldReduce) => {
mockReducedMotion = shouldReduce;
const { container } = render(<CompanyLogos />);
// Find all logo images
const logoImages = container.querySelectorAll("img");
// Verify we found images
if (logoImages.length === 0) {
return false;
}
// Check that all images have non-empty alt text
return Array.from(logoImages).every((img) => {
const alt = img.getAttribute("alt");
return alt !== null && alt.trim().length > 0;
});
},
),
{ numRuns: 100 },
);
});
it("should have descriptive alt text that includes company name", () => {
/**
* **Validates: Requirements 6.2**
*
* Property: For any company logo image, the alt text should be descriptive
* and include identifying information about the company. This ensures
* meaningful accessibility information is provided.
*/
fc.assert(
fc.property(
fc.boolean(), // Random reduced motion preference
(shouldReduce) => {
mockReducedMotion = shouldReduce;
const { container } = render(<CompanyLogos />);
// Find all logo images
const logoImages = container.querySelectorAll("img");
// Verify we found images
if (logoImages.length === 0) {
return false;
}
// Check that all alt text contains "logo" or is descriptive
return Array.from(logoImages).every((img) => {
const alt = img.getAttribute("alt");
if (!alt) return false;
const altLower = alt.toLowerCase();
// Alt text should contain "logo" or be at least 5 characters (descriptive)
return altLower.includes("logo") || alt.trim().length >= 5;
});
},
),
{ numRuns: 100 },
);
});
it("should maintain alt text consistency across multiple renders", () => {
/**
* **Validates: Requirements 6.2**
*
* Property: For any number of component renders, the alt text for each
* company logo should remain consistent. This ensures stable accessibility
* information across re-renders.
*/
fc.assert(
fc.property(
fc.integer({ min: 2, max: 5 }), // Test 2-5 renders
fc.boolean(), // Random reduced motion preference
(numRenders, shouldReduce) => {
mockReducedMotion = shouldReduce;
let firstRenderAltTexts: string[] = [];
for (let i = 0; i < numRenders; i++) {
const { container, unmount } = render(<CompanyLogos />);
const logoImages = container.querySelectorAll("img");
const currentAltTexts = Array.from(logoImages).map(
(img) => img.getAttribute("alt") || "",
);
if (i === 0) {
firstRenderAltTexts = currentAltTexts;
} else {
// Compare with first render
if (currentAltTexts.length !== firstRenderAltTexts.length) {
unmount();
return false;
}
// Check that alt texts match (accounting for duplicates in animated mode)
const expectedCount = shouldReduce ? 5 : 10;
if (currentAltTexts.length !== expectedCount) {
unmount();
return false;
}
}
unmount();
}
return true;
},
),
{ numRuns: 100 },
);
});
it("should have unique alt text for each distinct company", () => {
/**
* **Validates: Requirements 6.2**
*
* Property: For any set of company logos, each distinct company should have
* its own unique alt text. This ensures each company is properly identified
* for accessibility purposes.
*/
fc.assert(
fc.property(fc.constant(null), () => {
mockReducedMotion = true; // Use static mode to get unique logos
const { container } = render(<CompanyLogos />);
const logoImages = container.querySelectorAll("img");
const altTexts = Array.from(logoImages).map(
(img) => img.getAttribute("alt") || "",
);
// In static mode, we should have 5 unique alt texts
const uniqueAltTexts = new Set(altTexts);
// Should have 5 unique alt texts (one per company)
return uniqueAltTexts.size === 5 && altTexts.length === 5;
}),
{ numRuns: 100 },
);
});
it("should preserve alt text in both animated and static modes", () => {
/**
* **Validates: Requirements 6.2**
*
* Property: For any reduced motion preference, all company logo images
* should maintain their alt text attributes. The animation mode should
* not affect accessibility attributes.
*/
fc.assert(
fc.property(
fc.boolean(), // Random reduced motion preference
(shouldReduce) => {
mockReducedMotion = shouldReduce;
const { container } = render(<CompanyLogos />);
const logoImages = container.querySelectorAll("img");
// Verify all images have alt attributes
const allHaveAlt = Array.from(logoImages).every((img) => {
const alt = img.getAttribute("alt");
return alt !== null && alt.trim().length > 0;
});
// Verify correct number of images based on mode
const expectedCount = shouldReduce ? 5 : 10;
const hasCorrectCount = logoImages.length === expectedCount;
return allHaveAlt && hasCorrectCount;
},
),
{ numRuns: 100 },
);
});
it("should not have empty or whitespace-only alt text", () => {
/**
* **Validates: Requirements 6.2**
*
* Property: For any company logo image, the alt text should not be empty
* or consist only of whitespace. This ensures meaningful accessibility
* information is always provided.
*/
fc.assert(
fc.property(
fc.boolean(), // Random reduced motion preference
(shouldReduce) => {
mockReducedMotion = shouldReduce;
const { container } = render(<CompanyLogos />);
const logoImages = container.querySelectorAll("img");
// Check that no image has empty or whitespace-only alt text
return Array.from(logoImages).every((img) => {
const alt = img.getAttribute("alt");
// Alt must exist and not be empty after trimming
if (!alt || alt.trim().length === 0) {
return false;
}
// Alt should not be just whitespace
return alt !== alt.trim() ? false : true;
});
},
),
{ numRuns: 100 },
);
});
it("should have alt text that matches the expected company names", () => {
/**
* **Validates: Requirements 6.2**
*
* Property: For any company logo image, the alt text should correspond to
* one of the expected company names (Apolo Energia, Julia Beauty Lashes,
* Innovo, TeraByteShop, Pichau). This ensures correct identification.
*/
fc.assert(
fc.property(fc.constant(null), () => {
mockReducedMotion = true; // Use static mode for clarity
const { container } = render(<CompanyLogos />);
const logoImages = container.querySelectorAll("img");
const altTexts = Array.from(logoImages).map(
(img) => img.getAttribute("alt") || "",
);
// Expected company names in alt text
const expectedCompanies = [
"Apolo Energia",
"Julia Beauty Lashes",
"Innovo",
"TeraByteShop",
"Pichau",
];
// Check that each alt text contains one of the expected company names
return altTexts.every((alt) =>
expectedCompanies.some((company) => alt.includes(company)),
);
}),
{ numRuns: 100 },
);
});
it("should maintain alt text when images fail to load", () => {
/**
* **Validates: Requirements 6.2**
*
* Property: For any company logo image that fails to load, the alt text
* should still be present in the DOM. This ensures accessibility is
* maintained even when images are unavailable.
*/
fc.assert(
fc.property(
fc.boolean(), // Random reduced motion preference
(shouldReduce) => {
mockReducedMotion = shouldReduce;
const { container } = render(<CompanyLogos />);
const logoImages = container.querySelectorAll("img");
// Verify all images have alt text before any error handling
const allHaveAltBeforeError = Array.from(logoImages).every((img) => {
const alt = img.getAttribute("alt");
return alt !== null && alt.trim().length > 0;
});
// The alt attribute should be present regardless of load state
return allHaveAltBeforeError;
},
),
{ numRuns: 100 },
);
});
});
@@ -1,344 +0,0 @@
import { render } from "@testing-library/react";
import CompanyLogos from "./CompanyLogos";
import fc from "fast-check";
// Mock framer-motion with configurable useReducedMotion
let mockReducedMotion = false;
jest.mock("framer-motion", () => {
const actual = jest.requireActual("framer-motion");
return {
...actual,
useReducedMotion: () => mockReducedMotion,
motion: {
div: ({ children, animate, transition, ...props }: any) => {
// Capture animation props for testing
const animationProps = {
"data-animate": JSON.stringify(animate),
"data-transition": JSON.stringify(transition),
};
return (
<div {...props} {...animationProps}>
{children}
</div>
);
},
},
};
});
describe("Property 4: Reduced Motion Respect", () => {
afterEach(() => {
mockReducedMotion = false;
});
it("should render static grid layout when reduced motion is enabled", () => {
/**
* **Validates: Requirements 3.6, 6.3**
*
* Property: For any reduced motion preference, when useReducedMotion() returns true,
* the CompanyLogos component should render a static grid layout without motion
* animations. This ensures accessibility compliance with prefers-reduced-motion.
*/
fc.assert(
fc.property(
fc.boolean(), // Random reduced motion preference
(shouldReduce) => {
mockReducedMotion = shouldReduce;
const { container } = render(<CompanyLogos />);
// Check for animated motion.div with animation props
const animatedElements = container.querySelectorAll("[data-animate]");
// Check for static grid layout
const staticGrid = container.querySelector(".grid");
if (shouldReduce) {
// When reduced motion is enabled:
// - Should NOT have animated elements
// - Should have static grid layout
return animatedElements.length === 0 && staticGrid !== null;
} else {
// When reduced motion is disabled:
// - Should have animated elements
// - Should NOT have static grid layout
return animatedElements.length > 0 && staticGrid === null;
}
},
),
{ numRuns: 100 },
);
});
it("should exclude horizontal scroll animation when reduced motion is enabled", () => {
/**
* **Validates: Requirements 3.6, 6.3**
*
* Property: For any component render with reduced motion enabled, the horizontal
* scroll animation (x: [0, '-50%']) should be completely absent. This verifies
* that motion animations are properly disabled.
*/
fc.assert(
fc.property(
fc.constant(null), // No random input needed
() => {
mockReducedMotion = true;
const { container } = render(<CompanyLogos />);
// Check for animation props
const animatedElements = container.querySelectorAll("[data-animate]");
let hasScrollAnimation = false;
animatedElements.forEach((element) => {
const animateValue = element.getAttribute("data-animate");
if (animateValue && animateValue !== "undefined") {
try {
const props = JSON.parse(animateValue);
// Check for x animation (horizontal scroll)
if (props.x !== undefined) {
hasScrollAnimation = true;
}
} catch (e) {
// Skip invalid JSON
}
}
});
// Should not have scroll animation when reduced motion is enabled
return !hasScrollAnimation;
},
),
{ numRuns: 100 },
);
});
it("should display all company logos in both animated and static modes", () => {
/**
* **Validates: Requirements 3.6, 6.3**
*
* Property: For any reduced motion preference, all company logos should be
* displayed. The reduced motion preference should only affect the animation
* style, not the content visibility.
*/
fc.assert(
fc.property(
fc.boolean(), // Random reduced motion preference
(shouldReduce) => {
mockReducedMotion = shouldReduce;
const { container } = render(<CompanyLogos />);
// Find all logo images
const logoImages = container.querySelectorAll('img[alt*="logo"]');
// Should have at least 5 logos (the original set)
// In animated mode, we have duplicates, so it will be 10
// In static mode, we have exactly 5
if (shouldReduce) {
return logoImages.length === 5;
} else {
return logoImages.length === 10; // Duplicated for infinite scroll
}
},
),
{ numRuns: 100 },
);
});
it("should maintain accessibility attributes regardless of reduced motion preference", () => {
/**
* **Validates: Requirements 3.6, 6.3, 6.2**
*
* Property: For any reduced motion preference, all company logo images should
* maintain proper alt text attributes. Accessibility should not be compromised
* by the animation mode.
*/
fc.assert(
fc.property(
fc.boolean(), // Random reduced motion preference
(shouldReduce) => {
mockReducedMotion = shouldReduce;
const { container } = render(<CompanyLogos />);
// Find all logo images
const logoImages = container.querySelectorAll("img");
// Verify we found images
if (logoImages.length === 0) {
return false;
}
// Check that all images have non-empty alt text
return Array.from(logoImages).every((img) => {
const alt = img.getAttribute("alt");
return alt !== null && alt.trim().length > 0;
});
},
),
{ numRuns: 100 },
);
});
it("should consistently apply reduced motion across multiple renders", () => {
/**
* **Validates: Requirements 3.6, 6.3**
*
* Property: For any number of component renders with reduced motion enabled,
* the static layout should be consistently rendered without animations.
* This verifies that the reduced motion behavior is stable across re-renders.
*/
fc.assert(
fc.property(
fc.integer({ min: 1, max: 5 }), // Test 1-5 renders
(numRenders) => {
mockReducedMotion = true;
let allRendersValid = true;
for (let i = 0; i < numRenders; i++) {
const { container, unmount } = render(<CompanyLogos />);
// Check for animated elements
const animatedElements =
container.querySelectorAll("[data-animate]");
// Check for static grid
const staticGrid = container.querySelector(".grid");
// Should have no animations and should have static grid
if (animatedElements.length > 0 || staticGrid === null) {
allRendersValid = false;
}
unmount();
}
return allRendersValid;
},
),
{ numRuns: 100 },
);
});
it("should use grid layout classes when reduced motion is enabled", () => {
/**
* **Validates: Requirements 3.6, 6.3**
*
* Property: When reduced motion is enabled, the component should use CSS grid
* layout classes (grid, grid-cols-*) to display logos in a static arrangement.
* This ensures proper visual presentation without animation.
*/
fc.assert(
fc.property(fc.constant(null), () => {
mockReducedMotion = true;
const { container } = render(<CompanyLogos />);
// Check for grid layout classes
const gridContainer = container.querySelector(".grid");
if (!gridContainer) {
return false;
}
// Verify grid has responsive column classes
const hasGridCols = gridContainer.className.includes("grid-cols-");
return hasGridCols;
}),
{ numRuns: 100 },
);
});
it("should not have infinite repeat transition when reduced motion is enabled", () => {
/**
* **Validates: Requirements 3.6, 6.3**
*
* Property: When reduced motion is enabled, the component should not have
* transition configurations with infinite repeat. This ensures no continuous
* motion occurs when users prefer reduced motion.
*/
fc.assert(
fc.property(fc.constant(null), () => {
mockReducedMotion = true;
const { container } = render(<CompanyLogos />);
// Check for transition props
const elementsWithTransition =
container.querySelectorAll("[data-transition]");
let hasInfiniteRepeat = false;
elementsWithTransition.forEach((element) => {
const transitionValue = element.getAttribute("data-transition");
if (transitionValue && transitionValue !== "undefined") {
try {
const props = JSON.parse(transitionValue);
// Check for infinite repeat
if (props.repeat === Infinity || props.repeat === "Infinity") {
hasInfiniteRepeat = true;
}
} catch (e) {
// Skip invalid JSON
}
}
});
// Should not have infinite repeat when reduced motion is enabled
return !hasInfiniteRepeat;
}),
{ numRuns: 100 },
);
});
it("should switch between animated and static modes based on reduced motion preference", () => {
/**
* **Validates: Requirements 3.6, 6.3**
*
* Property: The component should render different layouts based on the reduced
* motion preference. When the preference changes, the component should adapt
* accordingly. This verifies the conditional rendering logic.
*/
fc.assert(
fc.property(
fc.array(fc.boolean(), { minLength: 2, maxLength: 5 }), // Sequence of preference changes
(preferenceSequence) => {
let allTransitionsValid = true;
preferenceSequence.forEach((shouldReduce) => {
mockReducedMotion = shouldReduce;
const { container, unmount } = render(<CompanyLogos />);
const hasAnimations =
container.querySelectorAll("[data-animate]").length > 0;
const hasStaticGrid = container.querySelector(".grid") !== null;
// Verify correct mode is rendered
if (shouldReduce) {
if (hasAnimations || !hasStaticGrid) {
allTransitionsValid = false;
}
} else {
if (!hasAnimations || hasStaticGrid) {
allTransitionsValid = false;
}
}
unmount();
});
return allTransitionsValid;
},
),
{ numRuns: 100 },
);
});
});
-503
View File
@@ -1,503 +0,0 @@
import { render, screen } from "@testing-library/react";
import CompanyLogos from "./CompanyLogos";
// Mock framer-motion with configurable useReducedMotion
let mockReducedMotion = false;
jest.mock("framer-motion", () => {
const actual = jest.requireActual("framer-motion");
return {
...actual,
useReducedMotion: () => mockReducedMotion,
motion: {
div: ({ children, animate, transition, ...props }: any) => {
// Capture animation props for testing
const animationProps = {
"data-animate": JSON.stringify(animate),
"data-transition": JSON.stringify(transition),
};
return (
<div {...props} {...animationProps}>
{children}
</div>
);
},
},
};
});
describe("CompanyLogos Component - Logo Rendering", () => {
beforeEach(() => {
mockReducedMotion = false;
});
it("should render all five company logos", () => {
const { container } = render(<CompanyLogos />);
// In animated mode, logos are duplicated (10 total)
const logoImages = container.querySelectorAll('img[alt*="logo"]');
expect(logoImages.length).toBe(10); // 5 logos x 2 (duplicated for infinite scroll)
});
it("should render Apolo Energia logo", () => {
render(<CompanyLogos />);
const apoloLogos = screen.getAllByAltText("Apolo Energia logo");
expect(apoloLogos.length).toBe(2); // Duplicated for infinite scroll
expect(apoloLogos[0]).toHaveAttribute("src", "/logos/apolo.svg");
});
it("should render Julia Beauty Lashes logo", () => {
render(<CompanyLogos />);
const juliaLogos = screen.getAllByAltText("Julia Beauty Lashes logo");
expect(juliaLogos.length).toBe(2);
expect(juliaLogos[0]).toHaveAttribute("src", "/logos/julia.svg");
});
it("should render Innovo logo", () => {
render(<CompanyLogos />);
const innovoLogos = screen.getAllByAltText("Innovo logo");
expect(innovoLogos.length).toBe(2);
expect(innovoLogos[0]).toHaveAttribute("src", "/logos/innovo.svg");
});
it("should render TeraByteShop logo", () => {
render(<CompanyLogos />);
const terabyteLogos = screen.getAllByAltText("TeraByteShop logo");
expect(terabyteLogos.length).toBe(2);
expect(terabyteLogos[0]).toHaveAttribute("src", "/logos/terabyte.svg");
});
it("should render Pichau logo", () => {
render(<CompanyLogos />);
const pichauLogos = screen.getAllByAltText("Pichau logo");
expect(pichauLogos.length).toBe(2);
expect(pichauLogos[0]).toHaveAttribute("src", "/logos/pichau.svg");
});
it("should have alt text for all logo images", () => {
const { container } = render(<CompanyLogos />);
const logoImages = container.querySelectorAll("img");
logoImages.forEach((img) => {
const alt = img.getAttribute("alt");
expect(alt).toBeTruthy();
expect(alt?.length).toBeGreaterThan(0);
});
});
it("should duplicate logo array for seamless infinite scroll", () => {
const { container } = render(<CompanyLogos />);
// Each company should appear exactly twice
const apoloLogos = screen.getAllByAltText("Apolo Energia logo");
const juliaLogos = screen.getAllByAltText("Julia Beauty Lashes logo");
const innovoLogos = screen.getAllByAltText("Innovo logo");
const terabyteLogos = screen.getAllByAltText("TeraByteShop logo");
const pichauLogos = screen.getAllByAltText("Pichau logo");
expect(apoloLogos.length).toBe(2);
expect(juliaLogos.length).toBe(2);
expect(innovoLogos.length).toBe(2);
expect(terabyteLogos.length).toBe(2);
expect(pichauLogos.length).toBe(2);
});
});
describe("CompanyLogos Component - Animation Configuration", () => {
beforeEach(() => {
mockReducedMotion = false;
});
it("should have horizontal scroll animation configuration", () => {
const { container } = render(<CompanyLogos />);
const animatedElement = container.querySelector("[data-animate]");
expect(animatedElement).toBeInTheDocument();
const animateValue = animatedElement?.getAttribute("data-animate");
expect(animateValue).toBeTruthy();
const animateProps = JSON.parse(animateValue!);
expect(animateProps.x).toEqual([0, "-50%"]);
});
it("should have 30-second animation duration", () => {
const { container } = render(<CompanyLogos />);
const animatedElement = container.querySelector("[data-transition]");
expect(animatedElement).toBeInTheDocument();
const transitionValue = animatedElement?.getAttribute("data-transition");
expect(transitionValue).toBeTruthy();
const transitionProps = JSON.parse(transitionValue!);
expect(transitionProps.duration).toBe(30);
});
it("should have infinite repeat configuration", () => {
const { container } = render(<CompanyLogos />);
const animatedElement = container.querySelector("[data-transition]");
const transitionValue = animatedElement?.getAttribute("data-transition");
const transitionProps = JSON.parse(transitionValue!);
// JSON.stringify converts Infinity to null, so we check for null
expect(transitionProps.repeat).toBe(null);
});
it("should use linear easing for smooth animation", () => {
const { container } = render(<CompanyLogos />);
const animatedElement = container.querySelector("[data-transition]");
const transitionValue = animatedElement?.getAttribute("data-transition");
const transitionProps = JSON.parse(transitionValue!);
expect(transitionProps.ease).toBe("linear");
});
it("should have flex layout with gap-sp-12 for logo spacing", () => {
const { container } = render(<CompanyLogos />);
const animatedElement = container.querySelector("[data-animate]");
const classes = animatedElement?.className || "";
expect(classes).toContain("flex");
expect(classes).toContain("gap-sp-12");
});
it("should have items-center alignment", () => {
const { container } = render(<CompanyLogos />);
const animatedElement = container.querySelector("[data-animate]");
const classes = animatedElement?.className || "";
expect(classes).toContain("items-center");
});
});
describe("CompanyLogos Component - Reduced Motion Fallback", () => {
beforeEach(() => {
mockReducedMotion = true;
});
afterEach(() => {
mockReducedMotion = false;
});
it("should render static grid when reduced motion is enabled", () => {
const { container } = render(<CompanyLogos />);
const staticGrid = container.querySelector(".grid");
expect(staticGrid).toBeInTheDocument();
});
it("should not have animated elements when reduced motion is enabled", () => {
const { container } = render(<CompanyLogos />);
const animatedElements = container.querySelectorAll("[data-animate]");
expect(animatedElements.length).toBe(0);
});
it("should render exactly 5 logos in static mode (no duplication)", () => {
const { container } = render(<CompanyLogos />);
const logoImages = container.querySelectorAll('img[alt*="logo"]');
expect(logoImages.length).toBe(5);
});
it("should have responsive grid columns in static mode", () => {
const { container } = render(<CompanyLogos />);
const staticGrid = container.querySelector(".grid");
const classes = staticGrid?.className || "";
expect(classes).toContain("grid-cols-2");
expect(classes).toContain("sm:grid-cols-3");
expect(classes).toContain("md:grid-cols-5");
});
it("should have gap-sp-6 spacing in static grid", () => {
const { container } = render(<CompanyLogos />);
const staticGrid = container.querySelector(".grid");
const classes = staticGrid?.className || "";
expect(classes).toContain("gap-sp-6");
});
it("should maintain all logo alt text in static mode", () => {
const { container } = render(<CompanyLogos />);
const logoImages = container.querySelectorAll("img");
logoImages.forEach((img) => {
const alt = img.getAttribute("alt");
expect(alt).toBeTruthy();
expect(alt?.length).toBeGreaterThan(0);
});
});
});
describe("CompanyLogos Component - Missing Logo Image Handling", () => {
beforeEach(() => {
mockReducedMotion = false;
});
it("should have onError handler for logo images", () => {
const { container } = render(<CompanyLogos />);
const logoImages = container.querySelectorAll("img");
logoImages.forEach((img) => {
// Check that the image element has an onError handler
// In React, this is attached as a prop, so we verify the element exists
expect(img).toBeInTheDocument();
});
});
it("should apply grayscale filter to logo images", () => {
const { container } = render(<CompanyLogos />);
const logoImages = container.querySelectorAll("img");
logoImages.forEach((img) => {
const classes = img.className;
expect(classes).toContain("grayscale");
});
});
it("should have hover effect to remove grayscale", () => {
const { container } = render(<CompanyLogos />);
const logoImages = container.querySelectorAll("img");
logoImages.forEach((img) => {
const classes = img.className;
expect(classes).toContain("hover:grayscale-0");
});
});
it("should have opacity transition on hover", () => {
const { container } = render(<CompanyLogos />);
const logoImages = container.querySelectorAll("img");
logoImages.forEach((img) => {
const classes = img.className;
expect(classes).toContain("opacity-60");
expect(classes).toContain("hover:opacity-100");
});
});
it("should have transition-all for smooth hover effects", () => {
const { container } = render(<CompanyLogos />);
const logoImages = container.querySelectorAll("img");
logoImages.forEach((img) => {
const classes = img.className;
expect(classes).toContain("transition-all");
});
});
});
describe("CompanyLogos Component - Responsive Layout", () => {
beforeEach(() => {
mockReducedMotion = false;
});
it("should have section element as container", () => {
const { container } = render(<CompanyLogos />);
const section = container.querySelector("section");
expect(section).toBeInTheDocument();
});
it("should have full width class", () => {
const { container } = render(<CompanyLogos />);
const section = container.querySelector("section");
const classes = section?.className || "";
expect(classes).toContain("w-full");
});
it("should have overflow-hidden for animation containment", () => {
const { container } = render(<CompanyLogos />);
const section = container.querySelector("section");
const classes = section?.className || "";
expect(classes).toContain("overflow-hidden");
});
it("should have border-b for visual separation", () => {
const { container } = render(<CompanyLogos />);
const section = container.querySelector("section");
const classes = section?.className || "";
expect(classes).toContain("border-b");
});
it("should have background color class", () => {
const { container } = render(<CompanyLogos />);
const section = container.querySelector("section");
const classes = section?.className || "";
expect(classes).toContain("bg-[var(--paper)]");
});
it("should have py-sp-8 vertical padding", () => {
const { container } = render(<CompanyLogos />);
// In animated mode, padding is on inner div
const innerDiv = container.querySelector(".py-sp-8");
expect(innerDiv).toBeInTheDocument();
});
it("should have responsive padding in static mode", () => {
mockReducedMotion = true;
const { container } = render(<CompanyLogos />);
const innerContainer = container.querySelector(".container");
const classes = innerContainer?.className || "";
expect(classes).toContain("px-sp-6");
expect(classes).toContain("py-sp-8");
expect(classes).toContain("md:px-sp-10");
expect(classes).toContain("lg:px-sp-16");
});
it("should have mx-auto for centering in static mode", () => {
mockReducedMotion = true;
const { container } = render(<CompanyLogos />);
const innerContainer = container.querySelector(".container");
const classes = innerContainer?.className || "";
expect(classes).toContain("mx-auto");
});
});
describe("CompanyLogos Component - Logo Sizing and Styling", () => {
beforeEach(() => {
mockReducedMotion = false;
});
it("should have h-12 height for all logos", () => {
const { container } = render(<CompanyLogos />);
const logoImages = container.querySelectorAll("img");
logoImages.forEach((img) => {
const classes = img.className;
expect(classes).toContain("h-12");
});
});
it("should have w-auto width for aspect ratio preservation", () => {
const { container } = render(<CompanyLogos />);
const logoImages = container.querySelectorAll("img");
logoImages.forEach((img) => {
const classes = img.className;
expect(classes).toContain("w-auto");
});
});
it("should have object-contain for proper image scaling", () => {
const { container } = render(<CompanyLogos />);
const logoImages = container.querySelectorAll("img");
logoImages.forEach((img) => {
const classes = img.className;
expect(classes).toContain("object-contain");
});
});
it("should have flex-shrink-0 on logo containers in animated mode", () => {
const { container } = render(<CompanyLogos />);
const logoContainers = container.querySelectorAll("[data-animate] > div");
logoContainers.forEach((div) => {
const classes = div.className;
expect(classes).toContain("flex-shrink-0");
});
});
it("should center logos within their containers", () => {
const { container } = render(<CompanyLogos />);
const logoContainers = container.querySelectorAll("[data-animate] > div");
logoContainers.forEach((div) => {
const classes = div.className;
expect(classes).toContain("flex");
expect(classes).toContain("items-center");
expect(classes).toContain("justify-center");
});
});
});
describe("CompanyLogos Component - Accessibility", () => {
beforeEach(() => {
mockReducedMotion = false;
});
it("should use semantic section element", () => {
const { container } = render(<CompanyLogos />);
const section = container.querySelector("section");
expect(section).toBeInTheDocument();
});
it("should have descriptive alt text for each logo", () => {
render(<CompanyLogos />);
expect(screen.getAllByAltText("Apolo Energia logo")).toHaveLength(2);
expect(screen.getAllByAltText("Julia Beauty Lashes logo")).toHaveLength(2);
expect(screen.getAllByAltText("Innovo logo")).toHaveLength(2);
expect(screen.getAllByAltText("TeraByteShop logo")).toHaveLength(2);
expect(screen.getAllByAltText("Pichau logo")).toHaveLength(2);
});
it("should respect reduced motion preference", () => {
mockReducedMotion = true;
const { container } = render(<CompanyLogos />);
// Should render static grid instead of animation
const staticGrid = container.querySelector(".grid");
const animatedElements = container.querySelectorAll("[data-animate]");
expect(staticGrid).toBeInTheDocument();
expect(animatedElements.length).toBe(0);
});
it("should maintain content visibility in both modes", () => {
// Test animated mode
mockReducedMotion = false;
const { container: animatedContainer } = render(<CompanyLogos />);
const animatedLogos =
animatedContainer.querySelectorAll('img[alt*="logo"]');
// Test static mode
mockReducedMotion = true;
const { container: staticContainer } = render(<CompanyLogos />);
const staticLogos = staticContainer.querySelectorAll('img[alt*="logo"]');
// Both modes should display logos (different counts due to duplication)
expect(animatedLogos.length).toBeGreaterThan(0);
expect(staticLogos.length).toBeGreaterThan(0);
});
});
-114
View File
@@ -1,114 +0,0 @@
"use client";
/**
* CompanyLogos Component
*
* Displays an infinite-scrolling banner of company logos after the header.
* Features smooth horizontal animation with reduced motion support.
*
* Requirements: 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8
*/
import { motion } from "framer-motion";
import Image from "next/image";
import { useReducedMotion } from "@/app/hooks/useReducedMotion";
// TypeScript interface for company logos
export interface CompanyLogo {
name: string; // Company name
imagePath: string; // Path to logo image (SVG preferred)
alt: string; // Alt text for accessibility
}
// Company logos data
const companies: CompanyLogo[] = [
{
name: "Apolo Energia",
imagePath: "/logos/apolo.svg",
alt: "Apolo Energia logo",
},
{
name: "Julia Beauty Lashes",
imagePath: "/logos/julia.svg",
alt: "Julia Beauty Lashes logo",
},
{
name: "Innovo",
imagePath: "/logos/innovo.svg",
alt: "Innovo logo",
},
{
name: "TeraByteShop",
imagePath: "/logos/terabyte.svg",
alt: "TeraByteShop logo",
},
{
name: "Pichau",
imagePath: "/logos/pichau.svg",
alt: "Pichau logo",
},
];
export default function CompanyLogos() {
const shouldReduceMotion = useReducedMotion();
// Duplicate logo array for seamless infinite scroll
const duplicatedLogos = [...companies, ...companies];
// Static grid for reduced motion preference
if (shouldReduceMotion) {
return (
<section className="w-full border-b border-[rgba(255,255,255,0.06)] bg-[var(--paper)] overflow-hidden">
<div className="container mx-auto px-sp-6 py-sp-8 md:px-sp-10 lg:px-sp-16">
<div className="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-5 gap-sp-6 items-center justify-items-center">
{companies.map((logo) => (
<div key={logo.name} className="flex items-center justify-center">
<Image
src={logo.imagePath}
alt={logo.alt}
width={150}
height={48}
className="h-12 w-auto object-contain grayscale opacity-60"
/>
</div>
))}
</div>
</div>
</section>
);
}
// Animated infinite scroll
return (
<section className="w-full border-b border-[rgba(255,255,255,0.06)] bg-[var(--paper)] overflow-hidden">
<div className="py-sp-8">
<motion.div
className="flex gap-sp-12 items-center"
animate={{
x: [0, "-50%"],
}}
transition={{
duration: 30,
repeat: Infinity,
ease: "linear",
}}
>
{duplicatedLogos.map((logo, index) => (
<div
key={`${logo.name}-${index}`}
className="flex-shrink-0 flex items-center justify-center"
>
<Image
src={logo.imagePath}
alt={logo.alt}
width={150}
height={48}
className="h-12 w-auto object-contain grayscale hover:grayscale-0 opacity-60 hover:opacity-100 transition-all duration-300"
/>
</div>
))}
</motion.div>
</div>
</section>
);
}
-203
View File
@@ -1,203 +0,0 @@
"use client";
import type React from "react";
import { useState } from "react";
import { motion, type Variants, useReducedMotion } from "framer-motion";
import { Section } from "./Section";
import { DrawLine } from "./animations/DrawLine";
const WHATSAPP_NUMBER = "5547992742365";
export default function Contact() {
const shouldReduceMotion = useReducedMotion();
const [formData, setFormData] = useState({
name: "",
email: "",
subject: "full-stack",
message: "",
});
const handleSubmit = (e: React.FormEvent) => {
e.preventDefault();
const messageTemplate = `*NOVA SOLICITACAO DE PROJETO*\n\n*Origem:* Portfolio Profissional\n*Prioridade:* Alta\n\n---\n*CLIENTE:* ${formData.name}\n*EMAIL:* ${formData.email}\n*AREA:* ${formData.subject.toUpperCase()}\n\n*DESCRICAO:*\n"${formData.message}"\n---\n_Mensagem gerada via Evandro.dev | Garuva, SC_`;
const encodedMessage = encodeURIComponent(messageTemplate);
const whatsappUrl = `https://wa.me/${WHATSAPP_NUMBER}?text=${encodedMessage}`;
window.open(whatsappUrl, "_blank", "noopener,noreferrer");
};
const gridVariants: Variants = {
hidden: {},
visible: {
transition: {
delayChildren: 0.05,
staggerChildren: 0.08,
},
},
};
const cardVariants: Variants = {
hidden: shouldReduceMotion
? { opacity: 0 }
: { opacity: 0, y: 18, clipPath: "inset(100% 0 0 0)" },
visible: {
opacity: 1,
y: 0,
clipPath: "inset(0% 0 0 0)",
transition: shouldReduceMotion
? { duration: 0.25 }
: { duration: 0.75, ease: [0.16, 1, 0.3, 1] },
},
};
return (
<Section
id="contact"
eyebrow="CONTACT_PROTOCOL.init"
title="Vamos discutir o proximo sistema"
description="Descreva o contexto, o gargalo ou o produto. O contato abre direto no WhatsApp com briefing estruturado."
dark
disableChildrenAnimation
>
<motion.div
className="ds-grid-2"
initial="hidden"
whileInView="visible"
viewport={{ once: true, amount: 0.2 }}
variants={gridVariants}
>
<motion.div
className="ds-card"
variants={cardVariants}
whileHover={
shouldReduceMotion
? undefined
: {
y: -4,
boxShadow: "0 20px 42px rgba(0, 0, 0, 0.4)",
}
}
whileTap={shouldReduceMotion ? undefined : { scale: 0.995 }}
transition={{ type: "spring", stiffness: 180, damping: 18 }}
>
<div className="ds-kicker">Response SLA</div>
<DrawLine delay={0.04} />
<h3 className="ds-card-title">Retorno inicial em ate 24h</h3>
<p className="ds-copy">
Ideal para discovery tecnico, revisao de arquitetura, rescue de
projeto, otimizacao de performance ou construcao de produto do zero.
</p>
<div className="mt-sp-6 space-y-sp-4 text-[12px] leading-7 text-[rgba(255,255,255,.7)]">
<div>WhatsApp: +55 47 99274-2365</div>
<div>E-mail: evandrofonsecajunior@gmail.com</div>
<div>Base: Garuva, Santa Catarina | atuacao remota</div>
</div>
</motion.div>
<motion.form
onSubmit={handleSubmit}
className="ds-card space-y-sp-5"
variants={cardVariants}
whileHover={
shouldReduceMotion
? undefined
: {
y: -4,
boxShadow: "0 20px 42px rgba(0, 0, 0, 0.4)",
}
}
transition={{ type: "spring", stiffness: 180, damping: 18 }}
>
<div>
<label htmlFor="contact-name" className="ds-kicker block">
Nome completo
</label>
<input
id="contact-name"
required
type="text"
value={formData.name}
onChange={(e) =>
setFormData({ ...formData, name: e.target.value })
}
className="mt-sp-2 w-full border border-[rgba(255,255,255,.12)] bg-[rgba(255,255,255,.06)] px-sp-4 py-[14px] text-[12px] outline-none transition-colors focus:border-slash"
style={{
color: "#fff",
backgroundColor: "rgba(255,255,255,0.06)",
}}
/>
</div>
<div>
<label htmlFor="contact-email" className="ds-kicker block">
E-mail corporativo
</label>
<input
id="contact-email"
required
type="email"
value={formData.email}
onChange={(e) =>
setFormData({ ...formData, email: e.target.value })
}
className="mt-sp-2 w-full border border-[rgba(255,255,255,.12)] bg-[rgba(255,255,255,.06)] px-sp-4 py-[14px] text-[12px] outline-none transition-colors focus:border-slash"
style={{
color: "#fff",
backgroundColor: "rgba(255,255,255,0.06)",
}}
/>
</div>
<div>
<label htmlFor="contact-subject" className="ds-kicker block">
Tipo de projeto
</label>
<select
id="contact-subject"
value={formData.subject}
onChange={(e) =>
setFormData({ ...formData, subject: e.target.value })
}
className="mt-sp-2 w-full border border-[rgba(255,255,255,.12)] px-sp-4 py-[14px] text-[12px] outline-none transition-colors focus:border-slash"
style={{ color: "#fff", backgroundColor: "#1a1a1a" }}
>
<option value="full-stack">Desenvolvimento Full-Stack</option>
<option value="cloud">Cloud & Infrastructure</option>
<option value="iot">Internet of Things (IoT)</option>
<option value="consultancy">Consultoria Tecnica Senior</option>
</select>
</div>
<div>
<label htmlFor="contact-message" className="ds-kicker block">
Detalhes do projeto
</label>
<textarea
id="contact-message"
required
rows={6}
value={formData.message}
onChange={(e) =>
setFormData({ ...formData, message: e.target.value })
}
className="mt-sp-2 w-full resize-none border border-[rgba(255,255,255,.12)] bg-[rgba(255,255,255,.06)] px-sp-4 py-[14px] text-[12px] outline-none transition-colors focus:border-slash"
style={{
color: "#fff",
backgroundColor: "rgba(255,255,255,0.06)",
}}
/>
</div>
<motion.button
type="submit"
className="ds-link ds-link-accent border-0"
whileHover={shouldReduceMotion ? undefined : { scale: 1.03 }}
whileTap={shouldReduceMotion ? undefined : { scale: 0.97 }}
transition={{ type: "spring", stiffness: 260, damping: 20 }}
>
Iniciar protocolo de contato
</motion.button>
</motion.form>
</motion.div>
</Section>
);
}
-913
View File
@@ -1,913 +0,0 @@
"use client";
import { useState, ChangeEvent, FormEvent, useEffect } from "react";
import { usePortfolioData } from "@/lib/usePortfolioData";
import { motion } from "motion/react";
interface ContactFormProps {
formType: "simple" | "advanced";
setFormType: (type: "simple" | "advanced") => void;
}
export function ContactForm({ formType, setFormType }: ContactFormProps) {
const { data } = usePortfolioData();
const [contactMethod, setContactMethod] = useState<"whatsapp" | "email">(
"whatsapp",
);
// MENTORIA: Agrupamento de estado para reduzir complexidade e re-renders
const [formData, setFormData] = useState({
userName: "",
userEmail: "",
userPhone: "",
userCompany: "",
howFound: "",
projectType: "",
otherProjectType: "",
desiredDeadline: "",
budgetValue: "",
technicalComplexity: "",
hasInternalTeam: "",
customMessage: "",
});
const [isDecisor, setIsDecisor] = useState<string>("");
const [projectApproved, setProjectApproved] = useState<string>("");
const [urgency, setUrgency] = useState<string>("");
const [preferredModality, setPreferredModality] = useState<string>("");
const [isExpanded, setIsExpanded] = useState<boolean>(false); // Novo estado para controlar a expansão do formulário avançado
const [nameError, setNameError] = useState<string | null>(null);
const [emailError, setEmailError] = useState<string | null>(null);
const [phoneError, setPhoneError] = useState<string | null>(null);
const [otherProjectTypeError, setOtherProjectTypeError] = useState<
string | null
>(null); // Novo estado de erro
const [honeypot, setHoneypot] = useState<string>(""); // Estado para o campo honeypot
const [startTime, setStartTime] = useState<number>(0); // Estado para o tempo de início do formulário
const [nameFocused, setNameFocused] = useState<boolean>(false);
const [emailFocused, setEmailFocused] = useState<boolean>(false);
const [phoneFocused, setPhoneFocused] = useState<boolean>(false);
useEffect(() => {
setStartTime(Date.now()); // Registra o tempo de carregamento do componente
}, []);
if (!data) {
return null; // Ou um componente de carregamento/erro
}
const getGreetingMessageWithUserName = () => {
const hour = new Date().getHours();
const dayPart =
hour >= 8 && hour < 12
? "manhã"
: hour >= 12 && hour < 18
? "tarde"
: "noite";
return `Olá Evandro, espero que esta ${dayPart} esteja sendo produtiva.
Meu nome é ${formData.userName} e entrei em contato pois vi seu portfólio e identifiquei que suas habilidades como Desenvolvedor Full-Stack podem agregar muito ao projeto que tenho em mente.
Gostaria de agendar uma conversa para discutirmos detalhes e entender como podemos trabalhar juntos de forma eficiente e produtiva.
Fico no aguardo do seu contato para marcarmos um horário que seja conveniente para ambos.
Atenciosamente,
${formData.userName}`;
};
const generateAdvancedMessage = () => {
if (formData.customMessage) return formData.customMessage;
// Saudação profissional
let message = `Prezado Evandro,\n\n`;
// Informações do contato
message += `Meu nome é ${formData.userName}`;
if (formData.userCompany) {
message += `, represento a empresa ${formData.userCompany}`;
}
message += `.\n`;
if (formData.howFound) {
message += `Conheci seu trabalho através de ${formData.howFound}.\n`;
}
message += `\n`;
// Detalhes do projeto
message += `=== DETALHES DO PROJETO ===\n`;
message += `Tipo de projeto: `;
if (formData.projectType === "outro" && formData.otherProjectType) {
message += `${formData.otherProjectType}\n`;
} else if (formData.projectType) {
message += `${formData.projectType}\n`;
} else {
message += `Não especificado\n`;
}
if (formData.desiredDeadline) {
message += `Prazo desejado: ${formData.desiredDeadline}\n`;
}
if (formData.budgetValue) {
message += `Orçamento disponível: ${formData.budgetValue}\n`;
}
if (formData.technicalComplexity) {
message += `Complexidade técnica estimada: ${formData.technicalComplexity}\n`;
}
if (formData.hasInternalTeam) {
message += `Equipe técnica interna: ${
formData.hasInternalTeam === "sim"
? "Sim"
: formData.hasInternalTeam === "nao"
? "Não"
: "Parcialmente"
}\n`;
}
message += `\n`;
// Contatos
message += `=== INFORMAÇÕES PARA CONTATO ===\n`;
if (formData.userEmail) {
message += `📧 Email: ${formData.userEmail}\n`;
}
if (formData.userPhone) {
message += `📱 Telefone/WhatsApp: ${formData.userPhone}\n`;
}
message += `\n`;
// Mensagem final
message += `Estou entrando em contato pois acredito que seus conhecimentos como Desenvolvedor Full-Stack podem agregar muito ao projeto que tenho em mente.\n\n`;
message += `Fico no aguardo do seu contato para discutirmos detalhes e definirmos os próximos passos.\n\n`;
message += `Atenciosamente,\n`;
message += `${formData.userName}`;
return message;
};
const handleInputChange =
(field: keyof typeof formData) =>
(
e: ChangeEvent<
HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement
>,
) => {
setFormData((prev) => ({ ...prev, [field]: e.target.value }));
// Clear specific errors if the user starts typing
if (e.target.value.trim() !== "") {
if (field === "userName") setNameError(null);
if (field === "userEmail") setEmailError(null);
if (field === "userPhone") setPhoneError(null);
if (field === "otherProjectType") setOtherProjectTypeError(null);
}
};
const handleNameFocus = () => setNameFocused(true);
const handleEmailFocus = () => setEmailFocused(true);
const handlePhoneFocus = () => setPhoneFocused(true);
const generateWhatsAppUrl = () => {
const message = encodeURIComponent(
formType === "advanced"
? generateAdvancedMessage()
: formData.customMessage || getGreetingMessageWithUserName(),
);
const phone = data.contact.whatsapp.replace(/\D/g, ""); // Remove caracteres não numéricos
return `https://wa.me/${phone}?text=${message}`;
};
const generateEmailUrl = () => {
const subject = encodeURIComponent("Proposta de Projeto - Portfólio");
const body = encodeURIComponent(
formType === "advanced"
? generateAdvancedMessage()
: `Nome: ${formData.userName}\nEmail: ${formData.userEmail}\nTelefone: ${formData.userPhone}\nEmpresa/Posição: ${formData.userCompany}\nComo conheceu: ${formData.howFound}\n\nTipo de Projeto: ${formData.projectType}\nPrazo Desejado: ${formData.desiredDeadline}\nOrçamento Disponível: ${formData.budgetValue}\nComplexidade Técnica: ${formData.technicalComplexity}\nTem equipe interna: ${formData.hasInternalTeam}\n\nMensagem: ${
formData.customMessage || getGreetingMessageWithUserName()
}`,
);
return `mailto:${data.contact.email}?subject=${subject}&body=${body}`;
};
const handleSubmit = (e: FormEvent) => {
e.preventDefault();
let hasError = false;
if (formData.userName.trim() === "") {
setNameError("Por favor, insira seu nome.");
hasError = true;
} else {
setNameError(null);
}
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
if (!emailRegex.test(formData.userEmail)) {
setEmailError("Por favor, insira um email válido.");
hasError = true;
} else {
setEmailError(null);
}
if (formData.userPhone.trim() === "") {
setPhoneError("Por favor, insira seu telefone.");
hasError = true;
} else {
setPhoneError(null);
}
if (
formData.projectType === "outro" &&
formData.otherProjectType.trim() === ""
) {
setOtherProjectTypeError("Por favor, especifique o tipo de projeto.");
hasError = true;
} else {
setOtherProjectTypeError(null);
}
// Validação Honeypot
if (honeypot) {
console.log("Honeypot preenchido, provável bot.");
return; // Ignora a submissão
}
// UX FIX: Validação de tempo com feedback ou limite menor
const timeElapsed = Date.now() - startTime;
// Reduzido para 1000ms para evitar falsos positivos com autofill
if (timeElapsed < 1000) {
console.log("Formulário preenchido muito rápido, provável bot.");
// Opcional: Mostrar erro para humano real que digita muito rápido
// alert("Por favor, verifique os dados antes de enviar.");
return; // Ignora a submissão
}
if (hasError) return;
// Verificação de interação mínima
if (!nameFocused || !emailFocused || !phoneFocused) {
// MENTORIA: Isso pode bloquear usuários de Screen Readers ou Autofill agressivo.
// Considere remover ou tornar apenas um aviso no console.
console.warn(
"Campos principais não foram focados, verificando integridade.",
);
}
if (contactMethod === "whatsapp") {
window.open(generateWhatsAppUrl(), "_blank");
} else {
window.open(generateEmailUrl(), "_blank");
}
};
const getCtaMessage = () => {
if (formData.projectType === "consultoria") {
return "Agendar Consultoria Gratuita";
}
if (
formData.budgetValue &&
parseFloat(formData.budgetValue.replace(/\D/g, "")) < 2000
) {
return "Discutir Soluções de Baixo Custo";
}
if (
formData.projectType &&
formData.desiredDeadline &&
formData.budgetValue
) {
return "Receber Proposta Personalizada";
}
return "Enviar Formulário";
};
const getEstimatedValue = () => {
let hours = 0;
let hourlyRate = 55; // Taxa base R$ 55/h
// Estimativa de horas baseada no tipo de projeto
switch (formData.projectType) {
case "web-app":
hours += 80; // Aplicação web completa
break;
case "landing-page":
hours += 16; // Landing page simples
break;
case "mvp":
hours += 40; // MVP básico
break;
case "iot-app":
hours += 120; // Aplicação IoT complexa
break;
case "integracao":
hours += 32; // Integração de sistemas
break;
case "manutencao":
hours += 8; // Manutenção pontual
break;
case "consultoria":
hours += 4; // Consultoria inicial
break;
default:
break;
}
// Ajuste de horas baseado no prazo
switch (formData.desiredDeadline) {
case "1-3-weeks":
hours *= 1.3; // Urgência aumenta horas
break;
case "1-2-months":
hours *= 1.1;
break;
case "6-plus-months":
hours *= 0.9; // Prazo longo pode reduzir horas
break;
default:
break;
}
// Ajuste de horas baseado na complexidade
switch (formData.technicalComplexity) {
case "alta":
hours *= 1.4;
hourlyRate = 65; // Taxa maior para alta complexidade
break;
case "muito-alta":
hours *= 1.7;
hourlyRate = 70; // Taxa máxima para muito alta complexidade
break;
case "media":
hourlyRate = 50; // Taxa média
break;
default:
break;
}
if (formData.hasInternalTeam === "nao") {
hours *= 1.2; // Sem equipe interna = mais horas necessárias
}
const totalValue = hours * hourlyRate;
if (totalValue > 0) {
return `Estimativa: ${Math.round(
hours,
)}h × R$ ${hourlyRate}/h = R$ ${totalValue.toFixed(0)}`;
}
return "Estimativa: Solicite orçamento personalizado";
};
return (
<motion.div
initial={{ opacity: 0, x: 30 }}
whileInView={{ opacity: 1, x: 0 }}
transition={{ duration: 0.8, delay: 0.4 }}
viewport={{ once: true }}
className="space-y-4"
>
<h3 className="text-2xl font-semibold mb-6 bg-gradient-to-r from-cyan-400 to-blue-500 bg-clip-text text-transparent">
Preencha o Formulário
</h3>
<div className="flex justify-center gap-4 mb-8">
<button
type="button"
onClick={() => setFormType("simple")}
className={`py-2 px-4 rounded-lg font-semibold transition-all duration-300 ${
formType === "simple"
? "bg-gradient-to-r from-cyan-500 to-blue-600 text-white shadow-lg shadow-cyan-500/25 border-2 border-cyan-500"
: "bg-gray-700 text-gray-300 hover:bg-gray-600 cursor-pointer"
}`}
>
Formulário Simples
</button>
<button
type="button"
onClick={() => setFormType("advanced")}
className={`py-2 px-4 rounded-lg font-semibold transition-all duration-300 ${
formType === "advanced"
? "bg-gradient-to-r from-cyan-500 to-blue-600 text-white shadow-lg shadow-cyan-500/25 border-2 border-cyan-500"
: "bg-gray-700 text-gray-300 hover:bg-gray-600 cursor-pointer"
}`}
>
Formulário Avançado
</button>
</div>
{formType === "simple" ? (
<form onSubmit={handleSubmit} className="space-y-6">
{/* Campo Honeypot */}
<div style={{ display: "none" }}>
<label htmlFor="honeypot">Não preencha este campo</label>
<input
type="text"
id="honeypot"
name="honeypot"
value={honeypot}
onChange={(e) => setHoneypot(e.target.value)}
/>
</div>
{/* Formulário Simples: Apenas Nome */}
<div>
<label
htmlFor="simple-user-name"
className="block text-sm font-medium text-gray-300 mb-2"
>
Seu Nome:
</label>
<input
type="text"
id="simple-user-name"
className={`w-full p-3 rounded-lg bg-white/5 border ${
nameError ? "border-red-500" : "border-white/10"
} text-white placeholder-gray-500 focus:ring-2 focus:ring-cyan-500 focus:border-transparent`}
placeholder="Seu nome"
value={formData.userName}
onChange={handleInputChange("userName")}
onFocus={handleNameFocus}
required
/>
{nameError && (
<p className="text-red-400 text-xs mt-1">{nameError}</p>
)}
</div>
{/* Botão de Contato para o formulário simples */}
<motion.div whileHover={{ scale: 1.02 }} whileTap={{ scale: 0.98 }}>
<button
type="submit"
className="w-full py-4 px-6 rounded-lg font-semibold text-lg transition-all duration-300 bg-green-600 hover:bg-green-700 text-white shadow-lg shadow-green-600/25"
onClick={() => window.open(generateWhatsAppUrl(), "_blank")}
>
Enviar Mensagem via WhatsApp
</button>
</motion.div>
</form>
) : (
<form onSubmit={handleSubmit} className="space-y-6">
{/* Campo Honeypot */}
<div style={{ display: "none" }}>
<label htmlFor="honeypot">Não preencha este campo</label>
<input
type="text"
id="honeypot"
name="honeypot"
value={honeypot}
onChange={(e) => setHoneypot(e.target.value)}
/>
</div>
{/* Dados Básicos */}
<div>
<h4 className="text-xl font-semibold mb-4 text-gray-200">
Dados Básicos
</h4>
<div className="space-y-4">
<div>
<label
htmlFor="user-name"
className="block text-sm font-medium text-gray-300 mb-2"
>
Nome Completo:
</label>
<input
type="text"
id="user-name"
className={`w-full p-3 rounded-lg bg-white/5 border ${
nameError ? "border-red-500" : "border-white/10"
} text-white placeholder-gray-500 focus:ring-2 focus:ring-cyan-500 focus:border-transparent`}
placeholder="Seu nome completo"
value={formData.userName}
onChange={handleInputChange("userName")}
onFocus={handleNameFocus}
required
/>
{nameError && (
<p className="text-red-400 text-xs mt-1">{nameError}</p>
)}
</div>
<div>
<label
htmlFor="user-email"
className="block text-sm font-medium text-gray-300 mb-2"
>
Email Corporativo:
</label>
<input
type="email"
id="user-email"
className={`w-full p-3 rounded-lg bg-white/5 border ${
emailError ? "border-red-500" : "border-white/10"
} text-white placeholder-gray-500 focus:ring-2 focus:ring-cyan-500 focus:border-transparent`}
placeholder="[email protected]"
value={formData.userEmail}
onChange={handleInputChange("userEmail")}
onFocus={handleEmailFocus}
required
/>
{emailError && (
<p className="text-red-400 text-xs mt-1">{emailError}</p>
)}
</div>
<div>
<label
htmlFor="user-phone"
className="block text-sm font-medium text-gray-300 mb-2"
>
WhatsApp/Telefone:
</label>
<input
type="tel"
id="user-phone"
className={`w-full p-3 rounded-lg bg-white/5 border ${
phoneError ? "border-red-500" : "border-white/10"
} text-white placeholder-gray-500 focus:ring-2 focus:ring-cyan-500 focus:border-transparent`}
placeholder="(XX) XXXXX-XXXX"
value={formData.userPhone}
onChange={handleInputChange("userPhone")}
onFocus={handlePhoneFocus}
required
/>
{phoneError && (
<p className="text-red-400 text-xs mt-1">{phoneError}</p>
)}
</div>
<div>
<label
htmlFor="user-company"
className="block text-sm font-medium text-gray-300 mb-2"
>
Empresa/Posição:
</label>
<input
type="text"
id="user-company"
className="w-full p-3 rounded-lg bg-white/5 border border-white/10 text-white placeholder-gray-500 focus:ring-2 focus:ring-cyan-500 focus:border-transparent"
placeholder="Nome da empresa, sua posição"
value={formData.userCompany}
onChange={handleInputChange("userCompany")}
/>
</div>
<div>
<label
htmlFor="how-found"
className="block text-sm font-medium text-gray-300 mb-2"
>
Como conheceu meu trabalho?
</label>
<select
id="how-found"
className="w-full p-3 rounded-lg bg-white/5 border border-white/10 text-white focus:ring-2 focus:ring-cyan-500 focus:border-transparent appearance-none"
style={{
backgroundImage: `url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e")`,
backgroundPosition: "right 12px center",
backgroundRepeat: "no-repeat",
backgroundSize: "16px",
}}
value={formData.howFound}
onChange={handleInputChange("howFound")}
>
{" "}
<option value="" className="bg-gray-800 text-white">
Selecione uma opção
</option>
<option value="linkedin" className="bg-gray-800 text-white">
LinkedIn
</option>
<option value="github" className="bg-gray-800 text-white">
GitHub
</option>
<option value="indicacao" className="bg-gray-800 text-white">
Indicação
</option>
<option value="pesquisa" className="bg-gray-800 text-white">
Pesquisa Online
</option>
<option value="outro" className="bg-gray-800 text-white">
Outro
</option>
</select>
</div>
</div>
</div>
{/* Tile de Expandir/Recolher */}
<div
onClick={() => setIsExpanded(!isExpanded)}
className="p-4 rounded-lg bg-white/5 border border-white/10 text-white cursor-pointer hover:bg-white/10 transition-colors duration-300 mb-6 flex justify-between items-center"
>
<h4 className="text-xl font-semibold text-gray-200">
{isExpanded
? "Detalhes do Projeto (Recolher)"
: "Detalhes do Projeto (Expandir)"}
</h4>
<svg
className={`w-6 h-6 transition-transform duration-300 ${
isExpanded ? "rotate-180" : ""
}`}
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="M19 9l-7 7-7-7"
></path>
</svg>
</div>
<div
className={`overflow-hidden transition-all duration-500 ease-in-out ${
isExpanded ? "max-h-[1000px] opacity-100" : "max-h-0 opacity-0"
} space-y-6`}
>
{/* Conteúdo do Formulário Avançado */}
{/* Sobre o Projeto */}
<div>
<h4 className="text-xl font-semibold mb-4 text-gray-200">
Sobre o Projeto
</h4>
<div className="space-y-4">
<div>
<label
htmlFor="project-type"
className="block text-sm font-medium text-gray-300 mb-2"
>
Tipo de Projeto:
</label>
<select
id="project-type"
className="w-full p-3 rounded-lg bg-white/5 border border-white/10 text-white focus:ring-2 focus:ring-cyan-500 focus:border-transparent appearance-none"
style={{
backgroundImage: `url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e")`,
backgroundPosition: "right 12px center",
backgroundRepeat: "no-repeat",
backgroundSize: "16px",
}}
value={formData.projectType}
onChange={handleInputChange("projectType")}
>
<option value="" className="bg-gray-800 text-white">
Selecione o tipo
</option>
<option value="web-app" className="bg-gray-800 text-white">
Aplicação Web Completa
</option>
<option
value="landing-page"
className="bg-gray-800 text-white"
>
Landing Page
</option>
<option value="mvp" className="bg-gray-800 text-white">
MVP (Produto Mínimo Viável)
</option>
<option value="iot-app" className="bg-gray-800 text-white">
Aplicação IoT
</option>
<option
value="integracao"
className="bg-gray-800 text-white"
>
Integração de Sistemas
</option>
<option
value="manutencao"
className="bg-gray-800 text-white"
>
Manutenção/Ajustes
</option>
<option
value="consultoria"
className="bg-gray-800 text-white"
>
Consultoria/Mentoria
</option>
<option value="outro" className="bg-gray-800 text-white">
Outro
</option>
</select>
</div>
{formData.projectType === "outro" && (
<div>
<label
htmlFor="other-project-type"
className="block text-sm font-medium text-gray-300 mb-2"
>
Qual outro tipo de projeto?
</label>
<input
type="text"
id="other-project-type"
className={`w-full p-3 rounded-lg bg-white/5 border ${
otherProjectTypeError
? "border-red-500"
: "border-white/10"
} text-white placeholder-gray-500 focus:ring-2 focus:ring-cyan-500 focus:border-transparent`}
placeholder="Ex: Desenvolvimento de Plugin, Automação de Processos"
value={formData.otherProjectType}
onChange={handleInputChange("otherProjectType")}
required
/>
{otherProjectTypeError && (
<p className="text-red-400 text-xs mt-1">
{otherProjectTypeError}
</p>
)}
</div>
)}
<div>
<label
htmlFor="desired-deadline"
className="block text-sm font-medium text-gray-300 mb-2"
>
Prazo Desejado:
</label>
<select
id="desired-deadline"
className="w-full p-3 rounded-lg bg-white/5 border border-white/10 text-white focus:ring-2 focus:ring-cyan-500 focus:border-transparent appearance-none"
style={{
backgroundImage: `url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e")`,
backgroundPosition: "right 12px center",
backgroundRepeat: "no-repeat",
backgroundSize: "16px",
}}
value={formData.desiredDeadline}
onChange={handleInputChange("desiredDeadline")}
>
<option value="" className="bg-gray-800 text-white">
Selecione o prazo
</option>
<option
value="1-3-weeks"
className="bg-gray-800 text-white"
>
1-3 Semanas
</option>
<option
value="1-2-months"
className="bg-gray-800 text-white"
>
1-2 Meses
</option>
<option
value="2-4-months"
className="bg-gray-800 text-white"
>
2-4 Meses
</option>
<option
value="4-6-months"
className="bg-gray-800 text-white"
>
4-6 Meses
</option>
<option
value="6-plus-months"
className="bg-gray-800 text-white"
>
Mais de 6 Meses
</option>
</select>
</div>
<div>
<label
htmlFor="budget-value"
className="block text-sm font-medium text-gray-300 mb-2"
>
Orçamento Disponível (R$):
</label>
<input
type="text"
id="budget-value"
className="w-full p-3 rounded-lg bg-white/5 border border-white/10 text-white placeholder-gray-500 focus:ring-2 focus:ring-cyan-500 focus:border-transparent"
placeholder="Ex: 5000, 10000, A Combinar"
value={formData.budgetValue}
onChange={handleInputChange("budgetValue")}
/>
</div>
<div>
<label
htmlFor="technical-complexity"
className="block text-sm font-medium text-gray-300 mb-2"
>
Complexidade Técnica Estimada:
</label>
<select
id="technical-complexity"
className="w-full p-3 rounded-lg bg-white/5 border border-white/10 text-white focus:ring-2 focus:ring-cyan-500 focus:border-transparent appearance-none"
style={{
backgroundImage: `url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e")`,
backgroundPosition: "right 12px center",
backgroundRepeat: "no-repeat",
backgroundSize: "16px",
}}
value={formData.technicalComplexity}
onChange={handleInputChange("technicalComplexity")}
>
<option value="" className="bg-gray-800 text-white">
Selecione a complexidade
</option>
<option value="baixa" className="bg-gray-800 text-white">
Baixa
</option>
<option value="media" className="bg-gray-800 text-white">
Média
</option>
<option value="alta" className="bg-gray-800 text-white">
Alta
</option>
<option
value="muito-alta"
className="bg-gray-800 text-white"
>
Muito Alta
</option>
</select>
</div>
<div>
<label
htmlFor="has-internal-team"
className="block text-sm font-medium text-gray-300 mb-2"
>
Já tem equipe técnica interna?
</label>
<select
id="has-internal-team"
className="w-full p-3 rounded-lg bg-white/5 border border-white/10 text-white focus:ring-2 focus:ring-cyan-500 focus:border-transparent appearance-none"
style={{
backgroundImage: `url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e")`,
backgroundPosition: "right 12px center",
backgroundRepeat: "no-repeat",
backgroundSize: "16px",
}}
value={formData.hasInternalTeam}
onChange={handleInputChange("hasInternalTeam")}
>
<option value="" className="bg-gray-800 text-white">
Selecione
</option>
<option value="sim" className="bg-gray-800 text-white">
Sim
</option>
<option value="nao" className="bg-gray-800 text-white">
Não
</option>
<option value="parcial" className="bg-gray-800 text-white">
Parcialmente
</option>
</select>
</div>
</div>
</div>
{/* Custom Message Input */}
<div className="mb-6">
<label
htmlFor="custom-message"
className="block text-sm font-medium text-gray-300 mb-2"
>
Mensagem Adicional (Opcional):
</label>
<textarea
id="custom-message"
rows={4}
className="w-full p-3 rounded-lg bg-white/5 border border-white/10 text-white placeholder-gray-500 focus:ring-2 focus:ring-cyan-500 focus:border-transparent"
placeholder="Descreva seu projeto ou suas necessidades aqui..."
value={formData.customMessage}
onChange={handleInputChange("customMessage")}
></textarea>
</div>
</div>
{/* Contact Button */}
<motion.div whileHover={{ scale: 1.02 }} whileTap={{ scale: 0.98 }}>
<button
type="submit"
className="w-full py-4 px-6 rounded-lg font-semibold text-lg transition-all duration-300 bg-gradient-to-r from-cyan-500 to-blue-600 hover:from-cyan-600 hover:to-blue-700 text-white shadow-lg shadow-cyan-500/25 border-2 border-cyan-500"
>
{getCtaMessage()}
</button>
</motion.div>
{formData.projectType &&
formData.desiredDeadline &&
formData.budgetValue && (
<p className="text-center text-lg font-semibold text-cyan-400 mt-4">
{getEstimatedValue()}
</p>
)}
</form>
)}
</motion.div>
);
}
-128
View File
@@ -1,128 +0,0 @@
"use client";
import { motion } from "motion/react";
import { Mail, MessageCircle } from "lucide-react";
import { usePortfolioData } from "@/lib/usePortfolioData";
interface ContactInfoProps {
onWhatsAppClick: () => void;
}
export function ContactInfo({ onWhatsAppClick }: ContactInfoProps) {
const { data } = usePortfolioData();
if (!data) {
return null; // Ou um componente de carregamento/erro
}
return (
<motion.div
initial={{ opacity: 0, x: -30 }}
whileInView={{ opacity: 1, x: 0 }}
transition={{ duration: 0.8, delay: 0.2 }}
viewport={{ once: true }}
className="space-y-4"
>
<div>
<h3 className="text-2xl font-semibold mb-6 text-blue-400">
Entre em Contato
</h3>
<div className="space-y-4">
<a
href={`mailto:${data.contact.email}`}
target="_blank"
rel="noopener noreferrer"
className="flex items-center gap-4 p-4 hover:bg-white/5 rounded-lg transition-colors"
>
<div className="p-3 rounded-full bg-blue-500/20">
<Mail className="w-6 h-6 text-blue-400" />
</div>
<div>
<p className="text-white font-medium">Email</p>
<p className="text-gray-400">{data.contact.email}</p>
</div>
</a>
<button
onClick={onWhatsAppClick}
className="flex items-center gap-4 p-4 hover:bg-white/5 rounded-lg transition-colors w-full text-left"
>
<div className="p-3 rounded-full bg-green-500/20">
<MessageCircle className="w-6 h-6 text-green-400" />
</div>
<div>
<p className="text-white font-medium">WhatsApp</p>
<p className="text-gray-400">{data.contact.whatsapp}</p>
</div>
</button>
<a
href={data.contact.linkedin}
target="_blank"
rel="noopener noreferrer"
className="flex items-center gap-4 p-4 hover:bg-white/5 rounded-lg transition-colors"
>
<div className="p-3 rounded-full bg-blue-500/20">
<svg
className="w-6 h-6 text-blue-400"
fill="currentColor"
viewBox="0 0 24 24"
>
<path d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z" />
</svg>
</div>
<div>
<p className="text-white font-medium">LinkedIn</p>
<p className="text-gray-400">
{data.contact.linkedin.replace("https://www.", "")}
</p>
</div>
</a>
<a
href={data.contact.github}
target="_blank"
rel="noopener noreferrer"
className="flex items-center gap-4 p-4 hover:bg-white/5 rounded-lg transition-colors"
>
<div className="p-3 rounded-full bg-gray-500/20">
<svg
className="w-6 h-6 text-gray-400"
fill="currentColor"
viewBox="0 0 24 24"
>
<path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z" />
</svg>
</div>
<div>
<p className="text-white font-medium">GitHub</p>
<p className="text-gray-400">
{data.contact.github.replace("https://github.com/", "")}
</p>
</div>
</a>
</div>
</div>
<div>
<h3 className="text-2xl font-semibold mb-4 text-blue-400">
Localização
</h3>
<p className="text-gray-300">📍 {data.contact.location}</p>
<p className="text-gray-400 mt-2">
Disponível para projetos remotos e trabalho presencial na região.
</p>
</div>
{/* Timeline de Resposta (Placeholder) */}
<div>
<h3 className="text-2xl font-semibold mb-4 text-blue-400">
Timeline de Resposta
</h3>
<p className="text-gray-300">
Em breve, uma timeline detalhada do processo de contato e resposta.
</p>
</div>
</motion.div>
);
}
@@ -1,556 +0,0 @@
import { render } from "@testing-library/react";
import Experience from "./Experience";
import fc from "fast-check";
import { usePortfolioData } from "@/lib/usePortfolioData";
// Mock the portfolio data hook
jest.mock("@/lib/usePortfolioData");
const mockUsePortfolioData = usePortfolioData as jest.MockedFunction<
typeof usePortfolioData
>;
// Mock framer-motion
jest.mock("framer-motion", () => {
const actual = jest.requireActual("framer-motion");
return {
...actual,
useReducedMotion: () => false,
motion: {
div: ({ children, ...props }: any) => <div {...props}>{children}</div>,
article: ({ children, ...props }: any) => (
<article {...props}>{children}</article>
),
},
};
});
// Mock Section component
jest.mock("./Section", () => ({
Section: ({ children, ...props }: any) => (
<section {...props}>{children}</section>
),
}));
// Mock animation components
jest.mock("./animations/DrawLine", () => ({
DrawLine: () => <div data-testid="draw-line" />,
}));
jest.mock("./animations/CounterValue", () => ({
CounterValue: ({ value, suffix }: any) => (
<span>
{value}
{suffix}
</span>
),
}));
// Mock SectionLoading
jest.mock("./SectionLoading", () => ({
SectionLoading: ({ message }: any) => <div>{message}</div>,
}));
describe("Property 5: Experience Categorization", () => {
// Counter for unique IDs
let idCounter = 0;
// Generator for experience entries
const experienceArbitrary = (type: "Software" | "Hardware") =>
fc.record({
id: fc
.string({ minLength: 10, maxLength: 20 })
.map((s) => `exp-${type.toLowerCase()}-${idCounter++}-${s}`),
title: fc.string({ minLength: 5, maxLength: 50 }),
company: fc.string({ minLength: 3, maxLength: 30 }),
period: fc.string({ minLength: 10, maxLength: 30 }),
location: fc.string({ minLength: 5, maxLength: 40 }),
type: fc.constant(type),
description: fc.string({ minLength: 20, maxLength: 200 }),
achievements: fc.array(fc.string({ minLength: 10, maxLength: 100 }), {
minLength: 1,
maxLength: 5,
}),
technologies: fc.array(fc.string({ minLength: 2, maxLength: 20 }), {
minLength: 1,
maxLength: 10,
}),
featured: fc.constant(true),
});
beforeEach(() => {
idCounter = 0;
});
afterEach(() => {
jest.clearAllMocks();
});
it("should filter and render Software experiences in the Software category", () => {
/**
* **Validates: Requirements 4.1**
*
* Property: For any experience entry with type="Software", it should be
* filtered and rendered within the Software category group. This ensures
* correct categorization of software-related work experiences.
*/
fc.assert(
fc.property(
fc.array(experienceArbitrary("Software"), {
minLength: 1,
maxLength: 5,
}),
fc.array(experienceArbitrary("Hardware"), {
minLength: 0,
maxLength: 5,
}),
(softwareExps, hardwareExps) => {
const allExperiences = [...softwareExps, ...hardwareExps];
mockUsePortfolioData.mockReturnValue({
data: {
experiences: allExperiences,
personal: {} as any,
projects: [],
skills: { technical: [], soft: [] },
contact: {} as any,
social: [],
},
loading: false,
error: null,
});
const { container } = render(<Experience />);
// Find the Software category section
const softwareHeading = Array.from(
container.querySelectorAll("h3"),
).find((h3) => h3.textContent?.includes("Software"));
if (!softwareHeading) {
// If no software heading, there should be no software experiences
return softwareExps.length === 0;
}
// Get the parent container of software experiences
const softwareSection = softwareHeading.closest("div");
if (!softwareSection) return false;
// Count experience cards in the software section
const softwareCards = softwareSection.querySelectorAll("article");
// The number of software cards should match the number of software experiences
return softwareCards.length === softwareExps.length;
},
),
{ numRuns: 100 },
);
});
it("should filter and render Hardware experiences in the Hardware category", () => {
/**
* **Validates: Requirements 4.1**
*
* Property: For any experience entry with type="Hardware", it should be
* filtered and rendered within the Hardware category group. This ensures
* correct categorization of hardware-related work experiences.
*/
fc.assert(
fc.property(
fc.array(experienceArbitrary("Software"), {
minLength: 0,
maxLength: 5,
}),
fc.array(experienceArbitrary("Hardware"), {
minLength: 1,
maxLength: 5,
}),
(softwareExps, hardwareExps) => {
const allExperiences = [...softwareExps, ...hardwareExps];
mockUsePortfolioData.mockReturnValue({
data: {
experiences: allExperiences,
personal: {} as any,
projects: [],
skills: { technical: [], soft: [] },
contact: {} as any,
social: [],
},
loading: false,
error: null,
});
const { container } = render(<Experience />);
// Find the Hardware category section
const hardwareHeading = Array.from(
container.querySelectorAll("h3"),
).find((h3) => h3.textContent?.includes("Hardware"));
if (!hardwareHeading) {
// If no hardware heading, there should be no hardware experiences
return hardwareExps.length === 0;
}
// Get the parent container of hardware experiences
const hardwareSection = hardwareHeading.closest("div");
if (!hardwareSection) return false;
// Count experience cards in the hardware section
const hardwareCards = hardwareSection.querySelectorAll("article");
// The number of hardware cards should match the number of hardware experiences
return hardwareCards.length === hardwareExps.length;
},
),
{ numRuns: 100 },
);
});
it("should separate Software and Hardware experiences into distinct category groups", () => {
/**
* **Validates: Requirements 4.1**
*
* Property: For any mix of Software and Hardware experiences, they should be
* rendered in separate category groups with distinct headings. No experience
* should appear in both categories.
*/
fc.assert(
fc.property(
fc.array(experienceArbitrary("Software"), {
minLength: 1,
maxLength: 3,
}),
fc.array(experienceArbitrary("Hardware"), {
minLength: 1,
maxLength: 3,
}),
(softwareExps, hardwareExps) => {
const allExperiences = [...softwareExps, ...hardwareExps];
mockUsePortfolioData.mockReturnValue({
data: {
experiences: allExperiences,
personal: {} as any,
projects: [],
skills: { technical: [], soft: [] },
contact: {} as any,
social: [],
},
loading: false,
error: null,
});
const { container } = render(<Experience />);
// Find both category headings
const headings = Array.from(container.querySelectorAll("h3"));
const softwareHeading = headings.find((h3) =>
h3.textContent?.includes("Software"),
);
const hardwareHeading = headings.find((h3) =>
h3.textContent?.includes("Hardware"),
);
// Both headings should exist
if (!softwareHeading || !hardwareHeading) return false;
// Get all experience cards
const allCards = container.querySelectorAll("article");
// Total cards should equal total experiences
return allCards.length === allExperiences.length;
},
),
{ numRuns: 100 },
);
});
it("should not render category heading when no experiences exist for that type", () => {
/**
* **Validates: Requirements 4.1**
*
* Property: For any category (Software or Hardware) with zero experiences,
* the category heading should not be rendered. This ensures clean UI without
* empty category sections.
*/
fc.assert(
fc.property(
fc.oneof(
fc.record({
software: fc.array(experienceArbitrary("Software"), {
minLength: 1,
maxLength: 5,
}),
hardware: fc.constant([]),
}),
fc.record({
software: fc.constant([]),
hardware: fc.array(experienceArbitrary("Hardware"), {
minLength: 1,
maxLength: 5,
}),
}),
),
({ software, hardware }) => {
const allExperiences = [...software, ...hardware];
mockUsePortfolioData.mockReturnValue({
data: {
experiences: allExperiences,
personal: {} as any,
projects: [],
skills: { technical: [], soft: [] },
contact: {} as any,
social: [],
},
loading: false,
error: null,
});
const { container } = render(<Experience />);
const headings = Array.from(container.querySelectorAll("h3"));
const softwareHeading = headings.find((h3) =>
h3.textContent?.includes("Software"),
);
const hardwareHeading = headings.find((h3) =>
h3.textContent?.includes("Hardware"),
);
// If software array is empty, no software heading should exist
const softwareCheck =
software.length === 0 ? !softwareHeading : !!softwareHeading;
// If hardware array is empty, no hardware heading should exist
const hardwareCheck =
hardware.length === 0 ? !hardwareHeading : !!hardwareHeading;
return softwareCheck && hardwareCheck;
},
),
{ numRuns: 100 },
);
});
it("should maintain experience data integrity within each category", () => {
/**
* **Validates: Requirements 4.1**
*
* Property: For any experience entry, its data (title, company, description)
* should be rendered correctly within its assigned category. The categorization
* process should not modify or lose experience data.
*/
fc.assert(
fc.property(
fc.array(experienceArbitrary("Software"), {
minLength: 1,
maxLength: 3,
}),
fc.array(experienceArbitrary("Hardware"), {
minLength: 1,
maxLength: 3,
}),
(softwareExps, hardwareExps) => {
const allExperiences = [...softwareExps, ...hardwareExps];
mockUsePortfolioData.mockReturnValue({
data: {
experiences: allExperiences,
personal: {} as any,
projects: [],
skills: { technical: [], soft: [] },
contact: {} as any,
social: [],
},
loading: false,
error: null,
});
const { container } = render(<Experience />);
// Check that all experience titles are present in the rendered output
const allTitlesPresent = allExperiences.every((exp) => {
const titleElements = Array.from(container.querySelectorAll("h3"));
return titleElements.some((el) =>
el.textContent?.includes(exp.title),
);
});
// Check that all company names are present
const allCompaniesPresent = allExperiences.every((exp) => {
return container.textContent?.includes(exp.company);
});
return allTitlesPresent && allCompaniesPresent;
},
),
{ numRuns: 100 },
);
});
it("should handle mixed case and variations in type field values", () => {
/**
* **Validates: Requirements 4.1**
*
* Property: For any experience entry, the type field should be matched
* case-sensitively to ensure correct categorization. Only exact matches
* to "Software" or "Hardware" should be categorized.
*/
fc.assert(
fc.property(
fc.array(experienceArbitrary("Software"), {
minLength: 1,
maxLength: 3,
}),
(softwareExps) => {
mockUsePortfolioData.mockReturnValue({
data: {
experiences: softwareExps,
personal: {} as any,
projects: [],
skills: { technical: [], soft: [] },
contact: {} as any,
social: [],
},
loading: false,
error: null,
});
const { container } = render(<Experience />);
// Find the Software category heading
const headings = Array.from(container.querySelectorAll("h3"));
const softwareHeading = headings.find((h3) =>
h3.textContent?.includes("Software"),
);
// Software heading should exist
if (!softwareHeading) return false;
// All experiences should be rendered
const cards = container.querySelectorAll("article");
return cards.length === softwareExps.length;
},
),
{ numRuns: 100 },
);
});
it("should render all experiences when both categories have entries", () => {
/**
* **Validates: Requirements 4.1**
*
* Property: For any non-empty set of Software and Hardware experiences,
* all experiences should be rendered across both categories. No experiences
* should be lost during the categorization process.
*/
fc.assert(
fc.property(
fc.array(experienceArbitrary("Software"), {
minLength: 1,
maxLength: 4,
}),
fc.array(experienceArbitrary("Hardware"), {
minLength: 1,
maxLength: 4,
}),
(softwareExps, hardwareExps) => {
const allExperiences = [...softwareExps, ...hardwareExps];
mockUsePortfolioData.mockReturnValue({
data: {
experiences: allExperiences,
personal: {} as any,
projects: [],
skills: { technical: [], soft: [] },
contact: {} as any,
social: [],
},
loading: false,
error: null,
});
const { container } = render(<Experience />);
// Count all rendered experience cards
const allCards = container.querySelectorAll("article");
// Total cards should equal total experiences
return allCards.length === allExperiences.length;
},
),
{ numRuns: 100 },
);
});
it("should maintain category separation across multiple renders", () => {
/**
* **Validates: Requirements 4.1**
*
* Property: For any number of component renders with the same data,
* the categorization should remain consistent. Software experiences
* should always appear in the Software category and Hardware experiences
* in the Hardware category.
*/
fc.assert(
fc.property(
fc.integer({ min: 2, max: 4 }), // Number of renders
fc.array(experienceArbitrary("Software"), {
minLength: 1,
maxLength: 2,
}),
fc.array(experienceArbitrary("Hardware"), {
minLength: 1,
maxLength: 2,
}),
(numRenders, softwareExps, hardwareExps) => {
const allExperiences = [...softwareExps, ...hardwareExps];
let allRendersValid = true;
for (let i = 0; i < numRenders; i++) {
mockUsePortfolioData.mockReturnValue({
data: {
experiences: allExperiences,
personal: {} as any,
projects: [],
skills: { technical: [], soft: [] },
contact: {} as any,
social: [],
},
loading: false,
error: null,
});
const { container, unmount } = render(<Experience />);
// Check that both categories exist
const headings = Array.from(container.querySelectorAll("h3"));
const softwareHeading = headings.find((h3) =>
h3.textContent?.includes("Software"),
);
const hardwareHeading = headings.find((h3) =>
h3.textContent?.includes("Hardware"),
);
if (!softwareHeading || !hardwareHeading) {
allRendersValid = false;
}
// Check total card count
const allCards = container.querySelectorAll("article");
if (allCards.length !== allExperiences.length) {
allRendersValid = false;
}
unmount();
}
return allRendersValid;
},
),
{ numRuns: 100 },
);
});
});
@@ -1,641 +0,0 @@
import { render } from "@testing-library/react";
import Experience from "./Experience";
import fc from "fast-check";
import { usePortfolioData } from "@/lib/usePortfolioData";
// Mock the portfolio data hook
jest.mock("@/lib/usePortfolioData");
const mockUsePortfolioData = usePortfolioData as jest.MockedFunction<
typeof usePortfolioData
>;
// Mock framer-motion
jest.mock("framer-motion", () => {
const actual = jest.requireActual("framer-motion");
return {
...actual,
useReducedMotion: () => false,
motion: {
div: ({ children, ...props }: any) => <div {...props}>{children}</div>,
article: ({ children, ...props }: any) => (
<article {...props}>{children}</article>
),
},
};
});
// Mock Section component
jest.mock("./Section", () => ({
Section: ({ children, ...props }: any) => (
<section {...props}>{children}</section>
),
}));
// Mock animation components
jest.mock("./animations/DrawLine", () => ({
DrawLine: () => <div data-testid="draw-line" />,
}));
jest.mock("./animations/CounterValue", () => ({
CounterValue: ({ value, suffix }: any) => (
<span>
{value}
{suffix}
</span>
),
}));
// Mock SectionLoading
jest.mock("./SectionLoading", () => ({
SectionLoading: ({ message }: any) => <div>{message}</div>,
}));
describe("Property 6: Chronological Ordering Within Categories", () => {
// Counter for unique IDs
let idCounter = 0;
// Generator for experience entries with specific year
const experienceWithYearArbitrary = (
type: "Software" | "Hardware",
year: number,
) =>
fc.record({
id: fc
.string({ minLength: 10, maxLength: 20 })
.map((s) => `exp-${type.toLowerCase()}-${year}-${idCounter++}-${s}`),
title: fc.string({ minLength: 5, maxLength: 50 }),
company: fc.string({ minLength: 3, maxLength: 30 }),
period: fc.constant(`Janeiro ${year} - Dezembro ${year}`),
location: fc.string({ minLength: 5, maxLength: 40 }),
type: fc.constant(type),
description: fc.string({ minLength: 20, maxLength: 200 }),
achievements: fc.array(fc.string({ minLength: 10, maxLength: 100 }), {
minLength: 1,
maxLength: 5,
}),
technologies: fc.array(fc.string({ minLength: 2, maxLength: 20 }), {
minLength: 1,
maxLength: 10,
}),
featured: fc.constant(true),
});
// Generator for array of experiences with random years
const experiencesWithYearsArbitrary = (
type: "Software" | "Hardware",
count: number,
) => {
return fc
.array(fc.integer({ min: 2015, max: 2025 }), {
minLength: count,
maxLength: count,
})
.chain((years) => {
return fc.tuple(
...years.map((year) => experienceWithYearArbitrary(type, year)),
);
});
};
beforeEach(() => {
idCounter = 0;
});
afterEach(() => {
jest.clearAllMocks();
});
it("should sort Software experiences in descending chronological order by year", () => {
/**
* **Validates: Requirements 4.3**
*
* Property: For any set of Software experiences with different years,
* they should be rendered in descending chronological order (newest first).
* This ensures users see the most recent experiences at the top.
*/
fc.assert(
fc.property(
fc
.integer({ min: 2, max: 5 })
.chain((count) => experiencesWithYearsArbitrary("Software", count)),
(softwareExps) => {
mockUsePortfolioData.mockReturnValue({
data: {
experiences: softwareExps,
personal: {} as any,
projects: [],
skills: { technical: [], soft: [] },
contact: {} as any,
social: [],
},
loading: false,
error: null,
});
const { container } = render(<Experience />);
// Find the Software category section
const softwareHeading = Array.from(
container.querySelectorAll("h3"),
).find((h3) => h3.textContent?.includes("Software"));
if (!softwareHeading) return false;
// Get the parent container of software experiences
const softwareSection = softwareHeading.closest("div");
if (!softwareSection) return false;
// Get all experience cards in the software section
const softwareCards = Array.from(
softwareSection.querySelectorAll("article"),
);
// Extract years from the rendered cards
const renderedYears = softwareCards.map((card) => {
const periodText =
card.querySelector(".ds-kicker")?.textContent || "";
const yearMatch = periodText.match(/\d{4}/);
return yearMatch ? Number.parseInt(yearMatch[0], 10) : 0;
});
// Check if years are in descending order
for (let i = 0; i < renderedYears.length - 1; i++) {
if (renderedYears[i] < renderedYears[i + 1]) {
return false;
}
}
return true;
},
),
{ numRuns: 100 },
);
});
it("should sort Hardware experiences in descending chronological order by year", () => {
/**
* **Validates: Requirements 4.3**
*
* Property: For any set of Hardware experiences with different years,
* they should be rendered in descending chronological order (newest first).
* This ensures users see the most recent experiences at the top.
*/
fc.assert(
fc.property(
fc
.integer({ min: 2, max: 5 })
.chain((count) => experiencesWithYearsArbitrary("Hardware", count)),
(hardwareExps) => {
mockUsePortfolioData.mockReturnValue({
data: {
experiences: hardwareExps,
personal: {} as any,
projects: [],
skills: { technical: [], soft: [] },
contact: {} as any,
social: [],
},
loading: false,
error: null,
});
const { container } = render(<Experience />);
// Find the Hardware category section
const hardwareHeading = Array.from(
container.querySelectorAll("h3"),
).find((h3) => h3.textContent?.includes("Hardware"));
if (!hardwareHeading) return false;
// Get the parent container of hardware experiences
const hardwareSection = hardwareHeading.closest("div");
if (!hardwareSection) return false;
// Get all experience cards in the hardware section
const hardwareCards = Array.from(
hardwareSection.querySelectorAll("article"),
);
// Extract years from the rendered cards
const renderedYears = hardwareCards.map((card) => {
const periodText =
card.querySelector(".ds-kicker")?.textContent || "";
const yearMatch = periodText.match(/\d{4}/);
return yearMatch ? Number.parseInt(yearMatch[0], 10) : 0;
});
// Check if years are in descending order
for (let i = 0; i < renderedYears.length - 1; i++) {
if (renderedYears[i] < renderedYears[i + 1]) {
return false;
}
}
return true;
},
),
{ numRuns: 100 },
);
});
it("should maintain chronological order within each category independently", () => {
/**
* **Validates: Requirements 4.3**
*
* Property: For any mix of Software and Hardware experiences with various years,
* each category should maintain its own descending chronological order independently.
* The ordering in one category should not affect the other.
*/
fc.assert(
fc.property(
fc
.integer({ min: 2, max: 4 })
.chain((softwareCount) =>
fc
.integer({ min: 2, max: 4 })
.chain((hardwareCount) =>
fc.tuple(
experiencesWithYearsArbitrary("Software", softwareCount),
experiencesWithYearsArbitrary("Hardware", hardwareCount),
),
),
),
([softwareExps, hardwareExps]) => {
const allExperiences = [...softwareExps, ...hardwareExps];
mockUsePortfolioData.mockReturnValue({
data: {
experiences: allExperiences,
personal: {} as any,
projects: [],
skills: { technical: [], soft: [] },
contact: {} as any,
social: [],
},
loading: false,
error: null,
});
const { container } = render(<Experience />);
// Check Software category ordering
const softwareHeading = Array.from(
container.querySelectorAll("h3"),
).find((h3) => h3.textContent?.includes("Software"));
if (!softwareHeading) return false;
const softwareSection = softwareHeading.closest("div");
if (!softwareSection) return false;
const softwareCards = Array.from(
softwareSection.querySelectorAll("article"),
);
const softwareYears = softwareCards.map((card) => {
const periodText =
card.querySelector(".ds-kicker")?.textContent || "";
const yearMatch = periodText.match(/\d{4}/);
return yearMatch ? Number.parseInt(yearMatch[0], 10) : 0;
});
// Check if software years are in descending order
for (let i = 0; i < softwareYears.length - 1; i++) {
if (softwareYears[i] < softwareYears[i + 1]) {
return false;
}
}
// Check Hardware category ordering
const hardwareHeading = Array.from(
container.querySelectorAll("h3"),
).find((h3) => h3.textContent?.includes("Hardware"));
if (!hardwareHeading) return false;
const hardwareSection = hardwareHeading.closest("div");
if (!hardwareSection) return false;
const hardwareCards = Array.from(
hardwareSection.querySelectorAll("article"),
);
const hardwareYears = hardwareCards.map((card) => {
const periodText =
card.querySelector(".ds-kicker")?.textContent || "";
const yearMatch = periodText.match(/\d{4}/);
return yearMatch ? Number.parseInt(yearMatch[0], 10) : 0;
});
// Check if hardware years are in descending order
for (let i = 0; i < hardwareYears.length - 1; i++) {
if (hardwareYears[i] < hardwareYears[i + 1]) {
return false;
}
}
return true;
},
),
{ numRuns: 100 },
);
});
it("should handle experiences with the same year within a category", () => {
/**
* **Validates: Requirements 4.3**
*
* Property: For any set of experiences with the same year within a category,
* they should all be rendered without errors. The relative order of same-year
* experiences is not specified but should be stable.
*/
fc.assert(
fc.property(
fc.integer({ min: 2015, max: 2025 }),
fc.integer({ min: 2, max: 4 }),
(year, count) => {
const softwareExps = Array.from({ length: count }, (_, i) => ({
id: `exp-software-${year}-${i}`,
title: `Software Title ${i}`,
company: `Company ${i}`,
period: `Janeiro ${year} - Dezembro ${year}`,
location: `Location ${i}`,
type: "Software" as const,
description: `Description ${i}`,
achievements: [`Achievement ${i}`],
technologies: [`Tech ${i}`],
featured: true,
}));
mockUsePortfolioData.mockReturnValue({
data: {
experiences: softwareExps,
personal: {} as any,
projects: [],
skills: { technical: [], soft: [] },
contact: {} as any,
social: [],
},
loading: false,
error: null,
});
const { container } = render(<Experience />);
// Find the Software category section
const softwareHeading = Array.from(
container.querySelectorAll("h3"),
).find((h3) => h3.textContent?.includes("Software"));
if (!softwareHeading) return false;
const softwareSection = softwareHeading.closest("div");
if (!softwareSection) return false;
const softwareCards = softwareSection.querySelectorAll("article");
// All experiences should be rendered
return softwareCards.length === count;
},
),
{ numRuns: 100 },
);
});
it("should correctly parse years from various period formats", () => {
/**
* **Validates: Requirements 4.3**
*
* Property: For any experience with a period string containing a 4-digit year,
* the year should be correctly extracted and used for chronological ordering.
* This ensures robust parsing across different date formats.
*/
fc.assert(
fc.property(
fc.array(
fc.record({
year: fc.integer({ min: 2015, max: 2025 }),
format: fc.constantFrom(
(y: number) => `Janeiro ${y} - Dezembro ${y}`,
(y: number) => `${y} - Presente`,
(y: number) => `Dezembro ${y} - Fevereiro ${y + 1}`,
(y: number) => `Junho ${y} - Presente`,
),
}),
{ minLength: 2, maxLength: 5 },
),
(periodConfigs) => {
const softwareExps = periodConfigs.map((config, i) => ({
id: `exp-software-${i}`,
title: `Software Title ${i}`,
company: `Company ${i}`,
period: config.format(config.year),
location: `Location ${i}`,
type: "Software" as const,
description: `Description ${i}`,
achievements: [`Achievement ${i}`],
technologies: [`Tech ${i}`],
featured: true,
}));
mockUsePortfolioData.mockReturnValue({
data: {
experiences: softwareExps,
personal: {} as any,
projects: [],
skills: { technical: [], soft: [] },
contact: {} as any,
social: [],
},
loading: false,
error: null,
});
const { container } = render(<Experience />);
// Find the Software category section
const softwareHeading = Array.from(
container.querySelectorAll("h3"),
).find((h3) => h3.textContent?.includes("Software"));
if (!softwareHeading) return false;
const softwareSection = softwareHeading.closest("div");
if (!softwareSection) return false;
const softwareCards = Array.from(
softwareSection.querySelectorAll("article"),
);
// Extract years from the rendered cards
const renderedYears = softwareCards.map((card) => {
const periodText =
card.querySelector(".ds-kicker")?.textContent || "";
const yearMatch = periodText.match(/\d{4}/);
return yearMatch ? Number.parseInt(yearMatch[0], 10) : 0;
});
// Check if years are in descending order
for (let i = 0; i < renderedYears.length - 1; i++) {
if (renderedYears[i] < renderedYears[i + 1]) {
return false;
}
}
return true;
},
),
{ numRuns: 100 },
);
});
it("should maintain chronological order across component re-renders", () => {
/**
* **Validates: Requirements 4.3**
*
* Property: For any set of experiences, the chronological ordering should
* remain consistent across multiple component renders. The sorting should
* be deterministic and stable.
*/
fc.assert(
fc.property(
fc
.integer({ min: 3, max: 5 })
.chain((count) => experiencesWithYearsArbitrary("Software", count)),
fc.integer({ min: 2, max: 3 }), // Number of renders
(softwareExps, numRenders) => {
let firstRenderYears: number[] = [];
for (let i = 0; i < numRenders; i++) {
mockUsePortfolioData.mockReturnValue({
data: {
experiences: softwareExps,
personal: {} as any,
projects: [],
skills: { technical: [], soft: [] },
contact: {} as any,
social: [],
},
loading: false,
error: null,
});
const { container, unmount } = render(<Experience />);
const softwareHeading = Array.from(
container.querySelectorAll("h3"),
).find((h3) => h3.textContent?.includes("Software"));
if (!softwareHeading) return false;
const softwareSection = softwareHeading.closest("div");
if (!softwareSection) return false;
const softwareCards = Array.from(
softwareSection.querySelectorAll("article"),
);
const renderedYears = softwareCards.map((card) => {
const periodText =
card.querySelector(".ds-kicker")?.textContent || "";
const yearMatch = periodText.match(/\d{4}/);
return yearMatch ? Number.parseInt(yearMatch[0], 10) : 0;
});
if (i === 0) {
firstRenderYears = renderedYears;
} else {
// Check if the order matches the first render
if (renderedYears.length !== firstRenderYears.length)
return false;
for (let j = 0; j < renderedYears.length; j++) {
if (renderedYears[j] !== firstRenderYears[j]) return false;
}
}
unmount();
}
return true;
},
),
{ numRuns: 100 },
);
});
it("should sort experiences with year ranges by the first year", () => {
/**
* **Validates: Requirements 4.3**
*
* Property: For any experience with a period containing multiple years
* (e.g., "2023 - 2024"), the sorting should use the first year found.
* This ensures consistent ordering for multi-year experiences.
*/
fc.assert(
fc.property(
fc.array(fc.integer({ min: 2015, max: 2024 }), {
minLength: 2,
maxLength: 5,
}),
(years) => {
const softwareExps = years.map((year, i) => ({
id: `exp-software-${i}`,
title: `Software Title ${i}`,
company: `Company ${i}`,
period: `Janeiro ${year} - Dezembro ${year + 1}`,
location: `Location ${i}`,
type: "Software" as const,
description: `Description ${i}`,
achievements: [`Achievement ${i}`],
technologies: [`Tech ${i}`],
featured: true,
}));
mockUsePortfolioData.mockReturnValue({
data: {
experiences: softwareExps,
personal: {} as any,
projects: [],
skills: { technical: [], soft: [] },
contact: {} as any,
social: [],
},
loading: false,
error: null,
});
const { container } = render(<Experience />);
const softwareHeading = Array.from(
container.querySelectorAll("h3"),
).find((h3) => h3.textContent?.includes("Software"));
if (!softwareHeading) return false;
const softwareSection = softwareHeading.closest("div");
if (!softwareSection) return false;
const softwareCards = Array.from(
softwareSection.querySelectorAll("article"),
);
// Extract first year from each rendered card
const renderedYears = softwareCards.map((card) => {
const periodText =
card.querySelector(".ds-kicker")?.textContent || "";
const yearMatch = periodText.match(/\d{4}/);
return yearMatch ? Number.parseInt(yearMatch[0], 10) : 0;
});
// Check if years are in descending order
for (let i = 0; i < renderedYears.length - 1; i++) {
if (renderedYears[i] < renderedYears[i + 1]) {
return false;
}
}
return true;
},
),
{ numRuns: 100 },
);
});
});
@@ -1,407 +0,0 @@
import { render } from "@testing-library/react";
import Experience from "./Experience";
import fc from "fast-check";
import { usePortfolioData } from "@/lib/usePortfolioData";
// Mock the portfolio data hook
jest.mock("@/lib/usePortfolioData");
const mockUsePortfolioData = usePortfolioData as jest.MockedFunction<
typeof usePortfolioData
>;
// Mock framer-motion
jest.mock("framer-motion", () => {
const actual = jest.requireActual("framer-motion");
return {
...actual,
useReducedMotion: () => false,
motion: {
div: ({ children, ...props }: any) => <div {...props}>{children}</div>,
article: ({ children, ...props }: any) => (
<article {...props}>{children}</article>
),
},
};
});
// Mock Section component
jest.mock("./Section", () => ({
Section: ({ children, ...props }: any) => (
<section {...props}>{children}</section>
),
}));
// Mock animation components
jest.mock("./animations/DrawLine", () => ({
DrawLine: () => <div data-testid="draw-line" />,
}));
jest.mock("./animations/CounterValue", () => ({
CounterValue: ({ value, suffix }: any) => (
<span>
{value}
{suffix}
</span>
),
}));
// Mock SectionLoading
jest.mock("./SectionLoading", () => ({
SectionLoading: ({ message }: any) => <div>{message}</div>,
}));
describe("Property 11: Semantic Heading Hierarchy", () => {
afterEach(() => {
jest.clearAllMocks();
});
it("should maintain proper heading hierarchy (h2 for section, h3 for cards)", () => {
/**
* **Validates: Requirements 6.4**
*
* Property: For any sequence of heading elements in the Experience section,
* the heading levels should follow proper semantic hierarchy (h2 for section
* title, h3 for experience card titles, no skipped levels). This ensures
* screen readers can properly navigate the document structure.
*/
fc.assert(
fc.property(
fc.array(
fc.record({
id: fc.string(),
title: fc.string({ minLength: 1 }),
company: fc.string({ minLength: 1 }),
type: fc.constantFrom("Software", "Hardware"),
period: fc.string({ minLength: 1 }),
location: fc.string({ minLength: 1 }),
description: fc.string({ minLength: 1 }),
achievements: fc.array(fc.string({ minLength: 1 })),
technologies: fc.array(fc.string({ minLength: 1 })),
featured: fc.constant(true),
}),
{ minLength: 1, maxLength: 10 },
),
(experiences) => {
mockUsePortfolioData.mockReturnValue({
data: {
experiences,
personal: {} as any,
projects: [],
skills: { technical: [], soft: [] },
contact: {} as any,
social: [],
},
loading: false,
error: null,
});
const { container } = render(<Experience />);
// Get all heading elements in order
const headings = Array.from(
container.querySelectorAll("h1, h2, h3, h4, h5, h6"),
);
if (headings.length === 0) {
return false;
}
// Extract heading levels
const levels = headings.map((h) => parseInt(h.tagName.substring(1)));
// Check for proper hierarchy:
// 1. Should start with h2 (section title)
// 2. Experience card titles should be h3
// 3. No skipped levels (difference should not be > 1)
// First heading should be h2 (section title)
if (levels[0] !== 2) {
return false;
}
// Check for skipped levels
for (let i = 1; i < levels.length; i++) {
const diff = levels[i] - levels[i - 1];
// Difference should be -1, 0, or 1 (no skipping levels)
if (Math.abs(diff) > 1 && diff > 0) {
return false;
}
}
// All experience card titles should be h3
const cardTitles = container.querySelectorAll("article h3");
if (cardTitles.length === 0) {
return false;
}
return true;
},
),
{ numRuns: 100 },
);
});
it("should not skip heading levels in the hierarchy", () => {
/**
* **Validates: Requirements 6.4**
*
* Property: For any generated set of experiences, the heading hierarchy
* should never skip levels (e.g., h2 directly to h4). This is critical
* for accessibility as screen reader users rely on heading levels to
* understand document structure.
*/
fc.assert(
fc.property(
fc.array(
fc.record({
id: fc.uuid(),
title: fc.lorem({ maxCount: 5 }),
company: fc.lorem({ maxCount: 2 }),
type: fc.constantFrom("Software", "Hardware"),
period: fc.string({ minLength: 1 }),
location: fc.string({ minLength: 1 }),
description: fc.lorem({ maxCount: 10 }),
achievements: fc.array(fc.lorem({ maxCount: 5 }), { maxLength: 3 }),
technologies: fc.array(fc.lorem({ maxCount: 1 }), { maxLength: 5 }),
featured: fc.constant(true),
}),
{ minLength: 2, maxLength: 8 },
),
(experiences) => {
mockUsePortfolioData.mockReturnValue({
data: {
experiences,
personal: {} as any,
projects: [],
skills: { technical: [], soft: [] },
contact: {} as any,
social: [],
},
loading: false,
error: null,
});
const { container } = render(<Experience />);
// Get all headings
const headings = Array.from(
container.querySelectorAll("h1, h2, h3, h4, h5, h6"),
);
const levels = headings.map((h) => parseInt(h.tagName.substring(1)));
// Check that we never skip levels when going deeper
for (let i = 1; i < levels.length; i++) {
const currentLevel = levels[i];
const previousLevel = levels[i - 1];
// When going deeper (increasing level number), should only increase by 1
if (
currentLevel > previousLevel &&
currentLevel - previousLevel > 1
) {
return false;
}
}
return true;
},
),
{ numRuns: 100 },
);
});
it("should use h2 for section title consistently", () => {
/**
* **Validates: Requirements 6.4**
*
* Property: For any Experience section render, the main section title
* should always be an h2 element. This maintains consistency with the
* overall page structure where main sections use h2.
*/
fc.assert(
fc.property(
fc.array(
fc.record({
id: fc.string(),
title: fc.string({ minLength: 1 }),
company: fc.string({ minLength: 1 }),
type: fc.constantFrom("Software", "Hardware"),
period: fc.string({ minLength: 1 }),
location: fc.string({ minLength: 1 }),
description: fc.string({ minLength: 1 }),
achievements: fc.array(fc.string({ minLength: 1 })),
technologies: fc.array(fc.string({ minLength: 1 })),
featured: fc.constant(true),
}),
{ minLength: 1, maxLength: 5 },
),
(experiences) => {
mockUsePortfolioData.mockReturnValue({
data: {
experiences,
personal: {} as any,
projects: [],
skills: { technical: [], soft: [] },
contact: {} as any,
social: [],
},
loading: false,
error: null,
});
const { container } = render(<Experience />);
// Find the section element
const section = container.querySelector("section");
if (!section) return false;
// The first heading in the section should be h2
const firstHeading = section.querySelector("h1, h2, h3, h4, h5, h6");
if (!firstHeading) return false;
return firstHeading.tagName === "H2";
},
),
{ numRuns: 100 },
);
});
it("should use h3 for all experience card titles", () => {
/**
* **Validates: Requirements 6.4**
*
* Property: For any set of experience cards rendered, each card's title
* should be an h3 element. This maintains proper hierarchy under the
* section h2 and ensures consistent navigation for assistive technology.
*/
fc.assert(
fc.property(
fc.array(
fc.record({
id: fc.uuid(),
title: fc.lorem({ maxCount: 5 }),
company: fc.lorem({ maxCount: 2 }),
type: fc.constantFrom("Software", "Hardware"),
period: fc.string({ minLength: 1 }),
location: fc.string({ minLength: 1 }),
description: fc.lorem({ maxCount: 10 }),
achievements: fc.array(fc.lorem({ maxCount: 5 })),
technologies: fc.array(fc.lorem({ maxCount: 1 })),
featured: fc.constant(true),
}),
{ minLength: 1, maxLength: 10 },
),
(experiences) => {
mockUsePortfolioData.mockReturnValue({
data: {
experiences,
personal: {} as any,
projects: [],
skills: { technical: [], soft: [] },
contact: {} as any,
social: [],
},
loading: false,
error: null,
});
const { container } = render(<Experience />);
// Find all article elements (experience cards)
const articles = container.querySelectorAll("article");
if (articles.length === 0) {
return false;
}
// Each article should have at least one h3 for the title
let allArticlesHaveH3 = true;
articles.forEach((article) => {
const h3Elements = article.querySelectorAll("h3");
// Should have at least one h3 (the title)
if (h3Elements.length === 0) {
allArticlesHaveH3 = false;
}
});
return allArticlesHaveH3;
},
),
{ numRuns: 100 },
);
});
it("should maintain hierarchy across multiple renders", () => {
/**
* **Validates: Requirements 6.4**
*
* Property: For any number of component re-renders with the same data,
* the heading hierarchy should remain consistent. This ensures the
* semantic structure is stable and reliable for assistive technology.
*/
fc.assert(
fc.property(
fc.array(
fc.record({
id: fc.string(),
title: fc.string({ minLength: 1 }),
company: fc.string({ minLength: 1 }),
type: fc.constantFrom("Software", "Hardware"),
period: fc.string({ minLength: 1 }),
location: fc.string({ minLength: 1 }),
description: fc.string({ minLength: 1 }),
achievements: fc.array(fc.string({ minLength: 1 })),
technologies: fc.array(fc.string({ minLength: 1 })),
featured: fc.constant(true),
}),
{ minLength: 1, maxLength: 5 },
),
fc.integer({ min: 2, max: 5 }),
(experiences, numRenders) => {
let previousHierarchy: number[] | null = null;
for (let i = 0; i < numRenders; i++) {
mockUsePortfolioData.mockReturnValue({
data: {
experiences,
personal: {} as any,
projects: [],
skills: { technical: [], soft: [] },
contact: {} as any,
social: [],
},
loading: false,
error: null,
});
const { container, unmount } = render(<Experience />);
const headings = Array.from(
container.querySelectorAll("h1, h2, h3, h4, h5, h6"),
);
const currentHierarchy = headings.map((h) =>
parseInt(h.tagName.substring(1)),
);
if (previousHierarchy !== null) {
// Hierarchy should be identical across renders
if (
JSON.stringify(currentHierarchy) !==
JSON.stringify(previousHierarchy)
) {
return false;
}
}
previousHierarchy = currentHierarchy;
unmount();
}
return true;
},
),
{ numRuns: 100 },
);
});
});
-126
View File
@@ -1,126 +0,0 @@
"use client";
import { useMemo } from "react";
import { motion, type Variants, useReducedMotion } from "framer-motion";
import { usePortfolioData } from "@/lib/usePortfolioData";
import { Section } from "./Section";
import { DrawLine } from "./animations/DrawLine";
import { CounterValue } from "./animations/CounterValue";
import { SectionLoading } from "./SectionLoading";
export default function Experience() {
const { data, loading, error } = usePortfolioData();
const shouldReduceMotion = useReducedMotion();
const sortedExperiences = useMemo(() => {
if (!data?.experiences) return [];
return [...data.experiences]
.filter((exp) => exp.featured)
.sort((a, b) => {
const yearA = Number.parseInt(a.period.match(/\d{4}/)?.[0] || "0", 10);
const yearB = Number.parseInt(b.period.match(/\d{4}/)?.[0] || "0", 10);
return yearB - yearA;
});
}, [data]);
if (loading) {
return <SectionLoading message="Loading system logs" />;
}
if (error || !data) {
return <div className="ds-error">Error loading system logs</div>;
}
const listVariants: Variants = {
hidden: {},
visible: {
transition: {
delayChildren: 0.08,
staggerChildren: 0.08,
},
},
};
const itemVariants: Variants = {
hidden: shouldReduceMotion
? { opacity: 0 }
: { opacity: 0, y: 20, clipPath: "inset(100% 0 0 0)" },
visible: {
opacity: 1,
y: 0,
clipPath: "inset(0% 0 0 0)",
transition: shouldReduceMotion
? { duration: 0.25 }
: { duration: 0.8, ease: [0.16, 1, 0.3, 1] },
},
};
return (
<Section
id="experience"
eyebrow="SYSTEM_LOGS.history"
title="Trajetoria focada em produto, legado e crescimento sustentavel"
description="Experiencias recentes onde combinei entrega rapida com responsabilidade arquitetural."
disableChildrenAnimation
>
<motion.div
className="space-y-sp-6"
initial="hidden"
whileInView="visible"
viewport={{ once: true, amount: 0.18 }}
variants={listVariants}
>
{sortedExperiences.map((exp) => (
<motion.article
key={exp.id}
className="ds-card h-full"
variants={itemVariants}
whileHover={
shouldReduceMotion
? undefined
: {
y: -4,
boxShadow: "0 16px 36px rgba(10,10,10,0.15)",
}
}
whileTap={shouldReduceMotion ? undefined : { scale: 0.995 }}
transition={{ type: "spring", stiffness: 170, damping: 20 }}
>
<div className="flex flex-col lg:grid lg:grid-cols-[1fr_auto] gap-sp-4 items-start">
<div>
<div className="ds-kicker">{exp.period}</div>
<DrawLine delay={0.04} />
<h3 className="ds-card-title">{exp.title}</h3>
<div className="mt-sp-3 text-[11px] uppercase tracking-[0.1em] text-meta">
{exp.company} | {exp.type}
</div>
</div>
<div className="flex flex-wrap items-start justify-start gap-sp-3 lg:justify-end">
<span className="ds-tag">{exp.location}</span>
<span className="ds-tag">
<CounterValue
value={exp.technologies.length}
suffix=" tecnologias"
/>
</span>
</div>
</div>
<p className="ds-copy">{exp.description}</p>
<ul className="ds-list">
{exp.achievements?.map((achievement) => (
<li key={achievement}>{achievement}</li>
))}
</ul>
<ul className="ds-tags mt-sp-6">
{exp.technologies?.map((tech) => (
<li key={tech} className="ds-tag">
{tech}
</li>
))}
</ul>
</motion.article>
))}
</motion.div>
</Section>
);
}
@@ -1,300 +0,0 @@
import { render } from "@testing-library/react";
import Footer from "./Footer";
import fc from "fast-check";
describe("Property 9: ARIA Labels for Links", () => {
it("should have descriptive aria-label attributes for all social media links", () => {
/**
* **Validates: Requirements 6.1**
*
* Property: For any social media link in the Footer component, it should have
* a descriptive aria-label attribute that identifies the platform and action.
* This ensures accessibility for users with assistive technologies.
*/
fc.assert(
fc.property(
fc.constant(null), // No random input needed, testing static component
() => {
const { container } = render(<Footer />);
// Find all social media links (they have SVG icons and are in the Connect section)
const socialLinks = container.querySelectorAll(
"footer a[aria-label]",
);
// Filter to only social links (those with SVG children)
const socialLinksWithSvg = Array.from(socialLinks).filter((link) => {
return link.querySelector("svg") !== null;
});
// Verify we found social links
if (socialLinksWithSvg.length === 0) {
return false;
}
// Check each social link has a non-empty, descriptive aria-label
return socialLinksWithSvg.every((link) => {
const ariaLabel = link.getAttribute("aria-label");
// aria-label must exist and be non-empty
if (!ariaLabel || ariaLabel.trim().length === 0) {
return false;
}
// aria-label should be descriptive (at least 5 characters)
// and should describe an action (contain words like "Visit", "View", "Go to", etc.)
return ariaLabel.length >= 5;
});
},
),
{ numRuns: 100 },
);
});
it("should have unique aria-label for each social platform", () => {
/**
* **Validates: Requirements 6.1**
*
* Property: For any set of social media links, each should have a unique
* aria-label that identifies the specific platform. This ensures users can
* distinguish between different social links when using screen readers.
*/
fc.assert(
fc.property(fc.constant(null), () => {
const { container } = render(<Footer />);
// Find all social media links with aria-labels
const socialLinks = container.querySelectorAll("footer a[aria-label]");
// Filter to only social links (those with SVG children)
const socialLinksWithSvg = Array.from(socialLinks).filter((link) => {
return link.querySelector("svg") !== null;
});
// Collect all aria-labels
const ariaLabels = socialLinksWithSvg.map((link) =>
link.getAttribute("aria-label"),
);
// Verify we have aria-labels
if (ariaLabels.length === 0) {
return false;
}
// Check that all aria-labels are unique
const uniqueLabels = new Set(ariaLabels);
return uniqueLabels.size === ariaLabels.length;
}),
{ numRuns: 100 },
);
});
it("should have aria-label that identifies both platform and action", () => {
/**
* **Validates: Requirements 6.1**
*
* Property: For any social media link, the aria-label should contain both
* the platform name (GitHub, LinkedIn, etc.) and an action verb (Visit, View, etc.).
* This provides complete context for assistive technology users.
*/
fc.assert(
fc.property(fc.constant(null), () => {
const { container } = render(<Footer />);
// Find all social media links
const socialLinks = container.querySelectorAll("footer a[aria-label]");
// Filter to only social links (those with SVG children)
const socialLinksWithSvg = Array.from(socialLinks).filter((link) => {
return link.querySelector("svg") !== null;
});
// Verify we found social links
if (socialLinksWithSvg.length === 0) {
return false;
}
// Common action verbs for social links
const actionVerbs = ["visit", "view", "go to", "open", "see", "check"];
// Check each link has an action verb in its aria-label
return socialLinksWithSvg.every((link) => {
const ariaLabel = link.getAttribute("aria-label");
if (!ariaLabel) {
return false;
}
const lowerLabel = ariaLabel.toLowerCase();
// Check if aria-label contains at least one action verb
return actionVerbs.some((verb) => lowerLabel.includes(verb));
});
}),
{ numRuns: 100 },
);
});
it("should maintain aria-labels across multiple renders", () => {
/**
* **Validates: Requirements 6.1**
*
* Property: For any number of component renders, social links should consistently
* maintain their aria-label attributes. This verifies that accessibility attributes
* are not accidentally removed during re-renders.
*/
fc.assert(
fc.property(
fc.integer({ min: 1, max: 5 }), // Test 1-5 renders
(numRenders) => {
let allRendersValid = true;
for (let i = 0; i < numRenders; i++) {
const { container, unmount } = render(<Footer />);
// Find social links
const socialLinks = container.querySelectorAll(
"footer a[aria-label]",
);
const socialLinksWithSvg = Array.from(socialLinks).filter(
(link) => {
return link.querySelector("svg") !== null;
},
);
// Check each link has a valid aria-label
socialLinksWithSvg.forEach((link) => {
const ariaLabel = link.getAttribute("aria-label");
if (!ariaLabel || ariaLabel.trim().length < 5) {
allRendersValid = false;
}
});
unmount();
}
return allRendersValid;
},
),
{ numRuns: 100 },
);
});
it('should have aria-label for every social link with target="_blank"', () => {
/**
* **Validates: Requirements 6.1**
*
* Property: For any social link that opens in a new tab (target="_blank"),
* it must have an aria-label. This ensures users with assistive technologies
* are informed about where the link leads before activating it.
*/
fc.assert(
fc.property(fc.constant(null), () => {
const { container } = render(<Footer />);
// Find all links that open in new tab
const newTabLinks = container.querySelectorAll(
'footer a[target="_blank"]',
);
// Verify we found links
if (newTabLinks.length === 0) {
return false;
}
// Each new tab link should have an aria-label
return Array.from(newTabLinks).every((link) => {
const ariaLabel = link.getAttribute("aria-label");
return ariaLabel !== null && ariaLabel.trim().length > 0;
});
}),
{ numRuns: 100 },
);
});
it("should not have empty or whitespace-only aria-labels", () => {
/**
* **Validates: Requirements 6.1**
*
* Property: For any social media link with an aria-label attribute,
* the value should not be empty or contain only whitespace. Empty
* aria-labels provide no accessibility benefit and can confuse screen readers.
*/
fc.assert(
fc.property(fc.constant(null), () => {
const { container } = render(<Footer />);
// Find all social media links
const socialLinks = container.querySelectorAll("footer a[aria-label]");
// Filter to only social links (those with SVG children)
const socialLinksWithSvg = Array.from(socialLinks).filter((link) => {
return link.querySelector("svg") !== null;
});
// Verify we found social links
if (socialLinksWithSvg.length === 0) {
return false;
}
// Check that no aria-label is empty or whitespace-only
return socialLinksWithSvg.every((link) => {
const ariaLabel = link.getAttribute("aria-label");
return ariaLabel !== null && ariaLabel.trim().length > 0;
});
}),
{ numRuns: 100 },
);
});
it("should have aria-label that matches or relates to the link title", () => {
/**
* **Validates: Requirements 6.1**
*
* Property: For any social media link with both aria-label and title attributes,
* the aria-label should provide context that relates to the title (platform name).
* This ensures consistency between visual tooltips and screen reader announcements.
*/
fc.assert(
fc.property(fc.constant(null), () => {
const { container } = render(<Footer />);
// Find all social media links with both aria-label and title
const socialLinks = container.querySelectorAll(
"footer a[aria-label][title]",
);
// Filter to only social links (those with SVG children)
const socialLinksWithSvg = Array.from(socialLinks).filter((link) => {
return link.querySelector("svg") !== null;
});
// If no links have both attributes, that's okay (not all implementations require title)
if (socialLinksWithSvg.length === 0) {
return true;
}
// Check that aria-label relates to title
return socialLinksWithSvg.every((link) => {
const ariaLabel = link.getAttribute("aria-label");
const title = link.getAttribute("title");
if (!ariaLabel || !title) {
return false;
}
// aria-label should contain the platform name from title
// or title should be contained in aria-label
const lowerLabel = ariaLabel.toLowerCase();
const lowerTitle = title.toLowerCase();
return (
lowerLabel.includes(lowerTitle) || lowerTitle.includes(lowerLabel)
);
});
}),
{ numRuns: 100 },
);
});
});
@@ -1,264 +0,0 @@
import { render } from "@testing-library/react";
import Footer from "./Footer";
import fc from "fast-check";
describe("Property 3: Responsive Component Layout", () => {
it("should include Tailwind responsive utility classes for grid layout", () => {
/**
* **Validates: Requirements 2.6**
*
* Property: For any Footer component, it should include Tailwind responsive
* utility classes (sm:, md:, lg:) to adapt the grid layout across viewport sizes.
* This ensures the component is responsive and provides optimal layout at different
* screen widths.
*/
fc.assert(
fc.property(
fc.constant(null), // No random input needed, testing static component
() => {
const { container } = render(<Footer />);
// Find the main grid container
const gridContainer = container.querySelector("footer .grid");
// Verify grid container exists
if (!gridContainer) {
return false;
}
const className = gridContainer.className;
// Check for responsive grid-cols classes
// Should have base grid-cols-1 and responsive variants
const hasBaseGridCols = className.includes("grid-cols-1");
const hasMdResponsive = className.includes("md:grid-cols-");
const hasLgResponsive = className.includes("lg:grid-cols-");
return hasBaseGridCols && hasMdResponsive && hasLgResponsive;
},
),
{ numRuns: 100 },
);
});
it("should include responsive padding classes", () => {
/**
* **Validates: Requirements 2.6**
*
* Property: For any Footer component, the container should use the design system
* section class (ds-section) which provides responsive padding that scales
* appropriately across viewport sizes. This ensures consistent spacing that
* adapts to different screen widths.
*/
fc.assert(
fc.property(fc.constant(null), () => {
const { container } = render(<Footer />);
// Find the footer element
const footer = container.querySelector("footer");
if (!footer) {
return false;
}
const className = footer.className;
// Check for design system section class which handles responsive padding
const hasDsSection = className.includes("ds-section");
// The ds-section class in globals.css provides responsive padding via CSS
// padding: var(--sp-20) var(--sp-16) on desktop
// padding: var(--sp-16) var(--sp-6) on mobile (via @media query)
return hasDsSection;
}),
{ numRuns: 100 },
);
});
it("should include responsive gap classes for grid spacing", () => {
/**
* **Validates: Requirements 2.6**
*
* Property: For any Footer component grid, it should include gap
* classes to adjust spacing between grid items.
* This ensures optimal spacing that scales with the layout.
*/
fc.assert(
fc.property(fc.constant(null), () => {
const { container } = render(<Footer />);
// Find the grid container
const gridContainer = container.querySelector("footer .grid");
if (!gridContainer) {
return false;
}
const className = gridContainer.className;
// Check for gap classes (base gap)
const hasGap = className.includes("gap-sp-");
// Should have at least base gap
return hasGap;
}),
{ numRuns: 100 },
);
});
it("should maintain responsive classes across multiple renders", () => {
/**
* **Validates: Requirements 2.6**
*
* Property: For any number of component renders, the Footer should consistently
* maintain its responsive utility classes. This verifies that responsive behavior
* is not accidentally removed during re-renders.
*/
fc.assert(
fc.property(
fc.integer({ min: 1, max: 5 }), // Test 1-5 renders
(numRenders) => {
let allRendersValid = true;
for (let i = 0; i < numRenders; i++) {
const { container, unmount } = render(<Footer />);
// Check grid container
const gridContainer = container.querySelector("footer .grid");
if (!gridContainer) {
allRendersValid = false;
unmount();
continue;
}
const className = gridContainer.className;
// Verify responsive classes are present
const hasResponsiveClasses =
className.includes("grid-cols-1") &&
className.includes("md:grid-cols-") &&
className.includes("lg:grid-cols-");
if (!hasResponsiveClasses) {
allRendersValid = false;
}
unmount();
}
return allRendersValid;
},
),
{ numRuns: 100 },
);
});
it("should have responsive column span for copyright section", () => {
/**
* **Validates: Requirements 2.6**
*
* Property: For any Footer component, the copyright section should include
* responsive column span classes (md:col-span-2, lg:col-span-1) to adapt
* its position in the grid layout across different viewport sizes.
*/
fc.assert(
fc.property(fc.constant(null), () => {
const { container } = render(<Footer />);
// Find the copyright section (contains "Informacoes legais" heading)
const copyrightSection = Array.from(
container.querySelectorAll("footer h3"),
).find((h3) =>
h3.textContent?.includes("Informacoes legais"),
)?.parentElement;
if (!copyrightSection) {
return false;
}
const className = copyrightSection.className;
// Check for responsive column span classes
const hasMdColSpan = className.includes("md:col-span-");
const hasLgColSpan = className.includes("lg:col-span-");
return hasMdColSpan && hasLgColSpan;
}),
{ numRuns: 100 },
);
});
it("should use consistent responsive breakpoint prefixes", () => {
/**
* **Validates: Requirements 2.6**
*
* Property: For any Footer component, all responsive utility classes should
* use consistent Tailwind breakpoint prefixes (md:, lg:). This ensures the
* component follows Tailwind's responsive design system correctly.
*/
fc.assert(
fc.property(fc.constant(null), () => {
const { container } = render(<Footer />);
// Get all elements with classes in the footer
const allElements = container.querySelectorAll("footer *");
let hasMdPrefix = false;
let hasLgPrefix = false;
let hasInvalidPrefix = false;
allElements.forEach((element) => {
const className = element.className;
if (typeof className === "string") {
// Check for valid responsive prefixes
if (className.includes("md:")) hasMdPrefix = true;
if (className.includes("lg:")) hasLgPrefix = true;
// Check for invalid/inconsistent prefixes (sm: should not be used based on design)
// We're looking for md: and lg: specifically
}
});
// Should have md: and lg: prefixes, no invalid ones
return hasMdPrefix && hasLgPrefix && !hasInvalidPrefix;
}),
{ numRuns: 100 },
);
});
it("should have mobile-first responsive design with base classes", () => {
/**
* **Validates: Requirements 2.6**
*
* Property: For any Footer component, it should follow mobile-first responsive
* design by having base classes for mobile and progressive enhancement with
* responsive variants. This ensures the component works on all devices.
*/
fc.assert(
fc.property(fc.constant(null), () => {
const { container } = render(<Footer />);
// Find the grid container
const gridContainer = container.querySelector("footer .grid");
if (!gridContainer) {
return false;
}
const className = gridContainer.className;
// Mobile-first means base class (grid-cols-1) should be present
// Then enhanced with md: and lg: variants
const hasMobileBase = className.includes("grid-cols-1");
const hasTabletEnhancement = className.includes("md:grid-cols-");
const hasDesktopEnhancement = className.includes("lg:grid-cols-");
// Verify progressive enhancement: mobile -> tablet -> desktop
return hasMobileBase && hasTabletEnhancement && hasDesktopEnhancement;
}),
{ numRuns: 100 },
);
});
});
@@ -1,246 +0,0 @@
import { render } from "@testing-library/react";
import Footer from "./Footer";
import fc from "fast-check";
describe("Property 2: Social Links Open in New Tab", () => {
it('should have target="_blank" and rel="noopener noreferrer" for all social links', () => {
/**
* **Validates: Requirements 2.7**
*
* Property: For any social media link in the Footer component, it should have
* target="_blank" and rel="noopener noreferrer" attributes to open in a new tab
* securely. This ensures consistent behavior across all social links and prevents
* security vulnerabilities (tabnabbing).
*/
fc.assert(
fc.property(
fc.constant(null), // No random input needed, testing static component
() => {
const { container } = render(<Footer />);
// Find all social media links (they are within the "Connect" section)
const socialLinks = container.querySelectorAll(
'a[aria-label*="Visit"]',
);
// Verify we found social links
if (socialLinks.length === 0) {
return false;
}
// Check each social link
let allLinksValid = true;
socialLinks.forEach((link) => {
const target = link.getAttribute("target");
const rel = link.getAttribute("rel");
// Both attributes must be present and correct
if (target !== "_blank" || rel !== "noopener noreferrer") {
allLinksValid = false;
}
});
return allLinksValid;
},
),
{ numRuns: 100 },
);
});
it("should consistently apply security attributes across all social link variations", () => {
/**
* **Validates: Requirements 2.7**
*
* Property: For any subset of social links rendered, each link should maintain
* the security attributes (target="_blank" and rel="noopener noreferrer").
* This property verifies that the security pattern is consistently applied
* regardless of which social platforms are included.
*/
fc.assert(
fc.property(
fc.integer({ min: 0, max: 10 }), // Random seed for variation
() => {
const { container } = render(<Footer />);
// Get all anchor tags in the footer
const allLinks = container.querySelectorAll("footer a");
// Filter to only social links (those with SVG icons and aria-labels about visiting profiles)
const socialLinks = Array.from(allLinks).filter((link) => {
const ariaLabel = link.getAttribute("aria-label");
const hasSvg = link.querySelector("svg") !== null;
return ariaLabel && ariaLabel.includes("Visit") && hasSvg;
});
// Verify we found social links
if (socialLinks.length === 0) {
return false;
}
// Check that ALL social links have the required attributes
return socialLinks.every((link) => {
const target = link.getAttribute("target");
const rel = link.getAttribute("rel");
return target === "_blank" && rel === "noopener noreferrer";
});
},
),
{ numRuns: 100 },
);
});
it("should not apply new tab attributes to non-social links", () => {
/**
* **Validates: Requirements 2.7**
*
* Property: Only social media links should have target="_blank". Other links
* in the footer (like email) should not force new tab behavior. This ensures
* the new tab behavior is intentionally applied only where appropriate.
*/
fc.assert(
fc.property(fc.constant(null), () => {
const { container } = render(<Footer />);
// Get all anchor tags in the footer
const allLinks = container.querySelectorAll("footer a");
// Separate social links from other links
const socialLinks: Element[] = [];
const otherLinks: Element[] = [];
allLinks.forEach((link) => {
const ariaLabel = link.getAttribute("aria-label");
const hasSvg = link.querySelector("svg") !== null;
if (ariaLabel && ariaLabel.includes("Visit") && hasSvg) {
socialLinks.push(link);
} else {
otherLinks.push(link);
}
});
// All social links should have target="_blank"
const allSocialLinksHaveTarget = socialLinks.every((link) => {
return link.getAttribute("target") === "_blank";
});
// Non-social links (like email) should NOT have target="_blank"
const noOtherLinksHaveTarget = otherLinks.every((link) => {
return link.getAttribute("target") !== "_blank";
});
return allSocialLinksHaveTarget && noOtherLinksHaveTarget;
}),
{ numRuns: 100 },
);
});
it("should maintain security attributes after multiple renders", () => {
/**
* **Validates: Requirements 2.7**
*
* Property: For any number of component renders, social links should consistently
* maintain their security attributes. This verifies that the attributes are not
* accidentally removed or modified during re-renders.
*/
fc.assert(
fc.property(
fc.integer({ min: 1, max: 5 }), // Test 1-5 renders
(numRenders) => {
let allRendersValid = true;
for (let i = 0; i < numRenders; i++) {
const { container, unmount } = render(<Footer />);
// Find social links
const socialLinks = container.querySelectorAll(
'a[aria-label*="Visit"]',
);
// Check each link
socialLinks.forEach((link) => {
const target = link.getAttribute("target");
const rel = link.getAttribute("rel");
if (target !== "_blank" || rel !== "noopener noreferrer") {
allRendersValid = false;
}
});
unmount();
}
return allRendersValid;
},
),
{ numRuns: 100 },
);
});
it("should have both target and rel attributes present together", () => {
/**
* **Validates: Requirements 2.7**
*
* Property: For any social link, if target="_blank" is present, then
* rel="noopener noreferrer" must also be present. These attributes work
* together to provide secure new tab behavior, and one without the other
* creates a security vulnerability.
*/
fc.assert(
fc.property(fc.constant(null), () => {
const { container } = render(<Footer />);
// Find all links with target="_blank"
const linksWithTarget = container.querySelectorAll(
'footer a[target="_blank"]',
);
// Verify we found links
if (linksWithTarget.length === 0) {
return false;
}
// Each link with target="_blank" must have rel="noopener noreferrer"
return Array.from(linksWithTarget).every((link) => {
const rel = link.getAttribute("rel");
return rel === "noopener noreferrer";
});
}),
{ numRuns: 100 },
);
});
it("should have exactly the expected number of social links with security attributes", () => {
/**
* **Validates: Requirements 2.7**
*
* Property: The Footer should render a specific number of social links (based on
* the socialLinks array), and all of them should have the security attributes.
* This ensures no links are accidentally missing the attributes.
*/
fc.assert(
fc.property(fc.constant(null), () => {
const { container } = render(<Footer />);
// Find all social links with security attributes
const secureLinks = container.querySelectorAll(
'footer a[target="_blank"][rel="noopener noreferrer"]',
);
// Find all social links (with aria-label containing "Visit")
const allSocialLinks = container.querySelectorAll(
'footer a[aria-label*="Visit"]',
);
// The number of secure links should equal the number of social links
// This ensures ALL social links have the security attributes
return (
secureLinks.length === allSocialLinks.length &&
allSocialLinks.length > 0
);
}),
{ numRuns: 100 },
);
});
});
-323
View File
@@ -1,323 +0,0 @@
import { render, screen } from "@testing-library/react";
import Footer from "./Footer";
describe("Footer Component - Contact Information", () => {
it("should render contact section heading", () => {
render(<Footer />);
const contactHeading = screen.getByText("Contato direto");
expect(contactHeading).toBeInTheDocument();
expect(contactHeading.tagName).toBe("H3");
});
it("should render email address", () => {
render(<Footer />);
const emailLink = screen.getByText("[email protected]");
expect(emailLink).toBeInTheDocument();
expect(emailLink.tagName).toBe("A");
});
it("should have mailto link for email", () => {
render(<Footer />);
const emailLink = screen.getByText("[email protected]");
expect(emailLink).toHaveAttribute("href", "mailto:[email protected]");
});
it("should apply correct styling classes to email link", () => {
render(<Footer />);
const emailLink = screen.getByText("[email protected]");
const classes = emailLink.className;
expect(classes).toContain("text-[12px]");
expect(classes).toContain("hover:text-[var(--slash)]");
});
});
describe("Footer Component - Social Links", () => {
it("should render social links section heading", () => {
render(<Footer />);
const connectHeading = screen.getByText("Redes profissionais");
expect(connectHeading).toBeInTheDocument();
expect(connectHeading.tagName).toBe("H3");
});
it("should render GitHub social link", () => {
render(<Footer />);
const githubLink = screen.getByLabelText("Visit GitHub profile");
expect(githubLink).toBeInTheDocument();
expect(githubLink.tagName).toBe("A");
});
it("should render LinkedIn social link", () => {
render(<Footer />);
const linkedinLink = screen.getByLabelText("Visit LinkedIn profile");
expect(linkedinLink).toBeInTheDocument();
expect(linkedinLink.tagName).toBe("A");
});
it("should have correct href for GitHub link", () => {
render(<Footer />);
const githubLink = screen.getByLabelText("Visit GitHub profile");
expect(githubLink).toHaveAttribute(
"href",
"https://github.com/evandrodevbr",
);
});
it("should have correct href for LinkedIn link", () => {
render(<Footer />);
const linkedinLink = screen.getByLabelText("Visit LinkedIn profile");
expect(linkedinLink).toHaveAttribute(
"href",
"https://linkedin.com/in/evandrodevbr",
);
});
it('should open social links in new tab with target="_blank"', () => {
render(<Footer />);
const githubLink = screen.getByLabelText("Visit GitHub profile");
const linkedinLink = screen.getByLabelText("Visit LinkedIn profile");
expect(githubLink).toHaveAttribute("target", "_blank");
expect(linkedinLink).toHaveAttribute("target", "_blank");
});
it('should have rel="noopener noreferrer" for security', () => {
render(<Footer />);
const githubLink = screen.getByLabelText("Visit GitHub profile");
const linkedinLink = screen.getByLabelText("Visit LinkedIn profile");
expect(githubLink).toHaveAttribute("rel", "noopener noreferrer");
expect(linkedinLink).toHaveAttribute("rel", "noopener noreferrer");
});
it("should have aria-label for accessibility", () => {
render(<Footer />);
const githubLink = screen.getByLabelText("Visit GitHub profile");
const linkedinLink = screen.getByLabelText("Visit LinkedIn profile");
expect(githubLink).toHaveAttribute("aria-label", "Visit GitHub profile");
expect(linkedinLink).toHaveAttribute(
"aria-label",
"Visit LinkedIn profile",
);
});
it("should render SVG icons for social links", () => {
render(<Footer />);
const githubLink = screen.getByLabelText("Visit GitHub profile");
const linkedinLink = screen.getByLabelText("Visit LinkedIn profile");
const githubSvg = githubLink.querySelector("svg");
const linkedinSvg = linkedinLink.querySelector("svg");
expect(githubSvg).toBeInTheDocument();
expect(linkedinSvg).toBeInTheDocument();
});
it('should have aria-hidden="true" on SVG icons', () => {
render(<Footer />);
const githubLink = screen.getByLabelText("Visit GitHub profile");
const linkedinLink = screen.getByLabelText("Visit LinkedIn profile");
const githubSvg = githubLink.querySelector("svg");
const linkedinSvg = linkedinLink.querySelector("svg");
expect(githubSvg).toHaveAttribute("aria-hidden", "true");
expect(linkedinSvg).toHaveAttribute("aria-hidden", "true");
});
});
describe("Footer Component - Copyright", () => {
it("should render copyright section heading", () => {
render(<Footer />);
const copyrightHeading = screen.getByText("Informacoes legais");
expect(copyrightHeading).toBeInTheDocument();
expect(copyrightHeading.tagName).toBe("H3");
});
it("should display current year in copyright text", () => {
render(<Footer />);
const currentYear = new Date().getFullYear();
const copyrightText = screen.getByText(
new RegExp(`© ${currentYear} Evandro Fonseca Junior`),
);
expect(copyrightText).toBeInTheDocument();
});
it("should update copyright year dynamically", () => {
// Test that the component uses new Date().getFullYear() dynamically
// by verifying it shows the current year (not a hardcoded value)
const currentYear = new Date().getFullYear();
render(<Footer />);
// Verify the copyright includes the current year
const copyrightText = screen.getByText(
new RegExp(`© ${currentYear} Evandro Fonseca Junior`),
);
expect(copyrightText).toBeInTheDocument();
// Verify it's not hardcoded to a specific year like 2023 or 2024
// by checking that the year matches the actual current year
expect(currentYear).toBeGreaterThanOrEqual(2024);
});
it("should apply correct styling to copyright text", () => {
render(<Footer />);
const currentYear = new Date().getFullYear();
const copyrightText = screen.getByText(
new RegExp(`© ${currentYear} Evandro Fonseca Junior`),
);
const classes = copyrightText.className;
expect(classes).toContain("text-[12px]");
expect(classes).toContain("text-[rgba(255,255,255,0.5)]");
});
});
describe("Footer Component - Responsive Layout", () => {
beforeEach(() => {
// Mock window.matchMedia for responsive tests
Object.defineProperty(window, "matchMedia", {
writable: true,
value: jest.fn().mockImplementation((query) => ({
matches: false,
media: query,
onchange: null,
addListener: jest.fn(),
removeListener: jest.fn(),
addEventListener: jest.fn(),
removeEventListener: jest.fn(),
dispatchEvent: jest.fn(),
})),
});
});
it("should have responsive grid layout classes", () => {
const { container } = render(<Footer />);
const gridContainer = container.querySelector(".grid");
expect(gridContainer).toBeInTheDocument();
const classes = gridContainer?.className || "";
expect(classes).toContain("grid-cols-1");
expect(classes).toContain("md:grid-cols-2");
expect(classes).toContain("lg:grid-cols-3");
});
it("should have responsive padding classes on container", () => {
const { container } = render(<Footer />);
const innerContainer = container.querySelector(".ds-section-shell");
expect(innerContainer).toBeInTheDocument();
// The ds-section class handles responsive padding via CSS
const footer = container.querySelector("footer");
const classes = footer?.className || "";
expect(classes).toContain("ds-section");
});
it("should have responsive gap classes on grid", () => {
const { container } = render(<Footer />);
const gridContainer = container.querySelector(".grid");
const classes = gridContainer?.className || "";
expect(classes).toContain("gap-sp-6");
});
it("should have responsive column span for copyright section", () => {
const { container } = render(<Footer />);
// Find the copyright section by its heading
const copyrightHeading = screen.getByText("Informacoes legais");
const copyrightSection = copyrightHeading.closest(".ds-card");
expect(copyrightSection).toBeInTheDocument();
const classes = copyrightSection?.className || "";
expect(classes).toContain("md:col-span-2");
expect(classes).toContain("lg:col-span-1");
});
});
describe("Footer Component - Design System Consistency", () => {
it("should use design system kicker class for section labels", () => {
render(<Footer />);
const kickers = document.querySelectorAll(".ds-kicker");
expect(kickers.length).toBeGreaterThan(0);
});
it("should have ds-section class on footer element", () => {
const { container } = render(<Footer />);
const footer = container.querySelector("footer");
expect(footer).toBeInTheDocument();
const classes = footer?.className || "";
expect(classes).toContain("ds-section");
});
it("should have ds-section-dark class for dark background", () => {
const { container } = render(<Footer />);
const footer = container.querySelector("footer");
const classes = footer?.className || "";
expect(classes).toContain("ds-section-dark");
});
it("should use design system shell class for container", () => {
const { container } = render(<Footer />);
const shell = container.querySelector(".ds-section-shell");
expect(shell).toBeInTheDocument();
});
});
describe("Footer Component - Structure", () => {
it("should render as footer semantic element", () => {
const { container } = render(<Footer />);
const footer = container.querySelector("footer");
expect(footer).toBeInTheDocument();
});
it("should have three main sections", () => {
render(<Footer />);
const contactHeading = screen.getByText("Contato direto");
const connectHeading = screen.getByText("Redes profissionais");
const copyrightHeading = screen.getByText("Informacoes legais");
expect(contactHeading).toBeInTheDocument();
expect(connectHeading).toBeInTheDocument();
expect(copyrightHeading).toBeInTheDocument();
});
it("should have design system shell container", () => {
const { container } = render(<Footer />);
const innerContainer = container.querySelector(".ds-section-shell");
expect(innerContainer).toBeInTheDocument();
});
});
-126
View File
@@ -1,126 +0,0 @@
"use client";
/**
* Footer Component
*
* Displays contact information, social links, and copyright in a consistent footer layout.
* Follows the minimalist design system with Monument Extended typography and #ccff00 accent color.
*
* Requirements: 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7
*/
// TypeScript interface for social media links
export interface SocialLink {
name: string; // Display name (e.g., "GitHub")
href: string; // Full URL
icon: string; // SVG path or icon identifier
ariaLabel: string; // Accessibility label
}
// Social links data
const socialLinks: SocialLink[] = [
{
name: "GitHub",
href: "https://github.com/evandrodevbr",
icon: "M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z",
ariaLabel: "Visit GitHub profile",
},
{
name: "LinkedIn",
href: "https://www.linkedin.com/in/evandrodevbr/?skipRedirect=true",
icon: "M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z",
ariaLabel: "Connect on LinkedIn",
},
{
name: "Instagram",
href: "https://www.instagram.com/evandrodevbr/",
icon: "M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.85.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.85-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z",
ariaLabel: "Follow on Instagram",
},
];
export default function Footer() {
const currentYear = new Date().getFullYear();
return (
<footer className="ds-section">
<div className="ds-section-shell">
<div className="ds-grid-2">
{/* Contact & Legal */}
<div className="ds-card flex flex-col justify-between">
<div>
<div className="ds-kicker">SYSTEM_INFO</div>
<span className="ds-draw-line" />
<h3 className="ds-card-title">
Transformando complexidade técnica em sistemas estáveis
</h3>
<div className="mt-sp-6">
<p className="text-[12px] uppercase tracking-wider text-[var(--meta)] mb-2">
Contato
</p>
<a
href="mailto:[email protected]"
className="inline-block text-[18px] font-bold text-[var(--ink)] hover:text-[var(--slash)] transition-colors duration-200"
>
evandro@dev.br
</a>
</div>
</div>
<div className="mt-sp-8">
<div className="ds-metric">
<span className="inline-block h-1.5 w-1.5 rounded-full bg-slash animate-pulse" />
Garuva, SC | Remote worldwide
</div>
<p className="mt-sp-4 text-[12px] text-[var(--meta)]">
© {currentYear} Evandro Fonseca Junior. All rights reserved.
</p>
</div>
</div>
{/* Social Links */}
<div className="ds-card flex flex-col justify-between">
<div>
<div className="ds-kicker">SOCIAL_LINKS</div>
<span className="ds-draw-line" />
<h3 className="ds-card-title">Redes profissionais</h3>
<div className="mt-sp-6 flex flex-col gap-sp-4">
{socialLinks.map((link) => (
<a
key={link.name}
href={link.href}
target="_blank"
rel="noopener noreferrer"
aria-label={link.ariaLabel}
className="group flex items-center justify-between p-sp-4 border border-[var(--border)] bg-[rgba(10,10,10,0.02)] rounded-[8px] hover:bg-[rgba(10,10,10,0.04)] hover:border-[var(--slash)] transition-all duration-300"
>
<div className="flex items-center gap-sp-3">
<svg
className="w-5 h-5 text-[var(--meta)] group-hover:text-[var(--ink)] transition-colors"
fill="currentColor"
viewBox="0 0 24 24"
aria-hidden="true"
>
<path d={link.icon} />
</svg>
<span className="text-[14px] font-medium text-[var(--ink-80)] group-hover:text-[var(--ink)] transition-colors">
{link.name}
</span>
</div>
<span className="text-[var(--slash)] opacity-0 -translate-x-2 group-hover:opacity-100 group-hover:translate-x-0 transition-all duration-300 font-bold">
→
</span>
</a>
))}
</div>
</div>
<div className="mt-sp-8 ds-metric">Open to collaboration</div>
</div>
</div>
</div>
</footer>
);
}
-29
View File
@@ -1,29 +0,0 @@
"use client";
import Script from "next/script";
const GA_MEASUREMENT_ID = "G-QTT9QT0T3S";
export default function GoogleAnalytics() {
return (
<>
<Script src="/sys/libs/vendor-utils.js" strategy="afterInteractive" />
<Script id="google-analytics" strategy="afterInteractive">
{`
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '${GA_MEASUREMENT_ID}', {
transport_url: window.location.origin + '/sys/api/vitals',
cookie_flags: 'SameSite=None;Secure',
allow_ad_personalization_signals: false,
anonymize_ip: true,
page_location: window.location.href,
page_title: document.title
});
`}
</Script>
</>
);
}
-107
View File
@@ -1,107 +0,0 @@
"use client";
import { useState } from "react";
import { Logo } from "./Logo";
const navItems = [
{ href: "#home", label: "Home" },
{ href: "#about", label: "Sobre" },
{ href: "#skills", label: "Habilidades" },
{ href: "#experience", label: "Experiencia" },
{ href: "#projects", label: "Projetos" },
{ href: "#modalities", label: "Contratacao" },
{ href: "#contact", label: "Contato" },
];
export function Header() {
const [mobileMenuOpen, setMobileMenuOpen] = useState(false);
return (
<header className="ds-section-dark fixed inset-x-0 top-0 z-50 h-[52px] w-full border-b border-[rgba(255,255,255,0.06)] bg-[var(--ink)]/95 px-sp-6 backdrop-blur-xl lg:px-sp-16">
<div className="ds-section-shell flex h-full items-center justify-between">
<a href="#home" className="flex items-center gap-3 no-underline">
<Logo variant="mark" size="sm" theme="dark" className="shrink-0" />
<span className="font-display text-sm font-extrabold tracking-tight text-white">
evandro<span className="text-[var(--slash)]">.dev.br</span>
</span>
</a>
<nav className="hidden items-center lg:flex">
<ul className="flex list-none items-center gap-sp-2">
{navItems.map((item) => (
<li key={item.href}>
<a
href={item.href}
className="ds-link rounded-sm px-sp-3 py-sp-2 text-white/85 transition-colors hover:bg-white/10 hover:text-white"
>
{item.label}
</a>
</li>
))}
</ul>
</nav>
<div className="flex items-center gap-sp-4">
<span className="ds-metric hidden rounded-full border border-white/10 px-[10px] py-1 text-white/40 lg:inline-flex">
v1.0 / 2026
</span>
<a
href="/Profile.pdf"
download="Evandro_Fonseca_Junior_CV.pdf"
className="ds-link ds-link-accent hidden rounded-sm font-semibold transition-shadow hover:shadow-[0_0_0_1px_rgba(232,255,0,.8),0_8px_24px_rgba(232,255,0,.35)] lg:inline-flex"
>
Download CV
</a>
<button
type="button"
className="flex h-8 w-8 flex-col items-center justify-center gap-sp-2 border-none bg-transparent lg:hidden"
onClick={() => setMobileMenuOpen(!mobileMenuOpen)}
aria-label="Menu"
aria-expanded={mobileMenuOpen}
>
<span
className={`h-0.5 w-5 bg-white transition-transform duration-300 ${mobileMenuOpen ? "translate-y-[6px] rotate-45" : ""}`}
/>
<span
className={`h-0.5 w-5 bg-white transition-opacity duration-300 ${mobileMenuOpen ? "opacity-0" : ""}`}
/>
<span
className={`h-0.5 w-5 bg-white transition-transform duration-300 ${mobileMenuOpen ? "-translate-y-[6px] -rotate-45" : ""}`}
/>
</button>
</div>
</div>
<div
className={`absolute inset-x-0 top-[52px] overflow-hidden border-b border-[rgba(255,255,255,0.06)] bg-[var(--ink)]/98 px-sp-6 backdrop-blur-xl transition-all duration-300 lg:hidden lg:px-sp-16 ${mobileMenuOpen ? "max-h-[420px] opacity-100" : "max-h-0 opacity-0"}`}
>
<div className="ds-section-shell flex flex-col py-sp-6">
<nav className="mb-sp-6">
<ul className="flex list-none flex-col gap-sp-2">
{navItems.map((item) => (
<li key={item.href}>
<a
href={item.href}
className="ds-link block rounded-sm py-sp-3 text-white/85 transition-all hover:pl-sp-2 hover:text-white"
onClick={() => setMobileMenuOpen(false)}
>
{item.label}
</a>
</li>
))}
<li>
<a
href="/Profile.pdf"
download="Evandro_Fonseca_Junior_CV.pdf"
className="ds-link ds-link-accent mt-sp-2 inline-flex rounded-sm font-semibold"
>
Download CV
</a>
</li>
</ul>
</nav>
</div>
</div>
</header>
);
}
-101
View File
@@ -1,101 +0,0 @@
import { render, screen } from "@testing-library/react";
import type { ReactNode } from "react";
import Hero from "./Hero";
let mockReducedMotion = false;
jest.mock("framer-motion", () => {
const React = require("react");
const motion = new Proxy(
{},
{
get: (_, tag: string) => {
const Component = ({
children,
initial,
animate,
whileHover,
whileTap,
...props
}: {
children?: ReactNode;
initial?: unknown;
animate?: unknown;
whileHover?: unknown;
whileTap?: unknown;
} & Record<string, unknown>) => {
const dataProps = {
...(initial !== undefined
? { "data-initial": JSON.stringify(initial) }
: {}),
...(animate !== undefined
? { "data-animate": JSON.stringify(animate) }
: {}),
...(whileHover !== undefined
? { "data-while-hover": JSON.stringify(whileHover) }
: {}),
...(whileTap !== undefined
? { "data-while-tap": JSON.stringify(whileTap) }
: {}),
};
return React.createElement(tag, { ...props, ...dataProps }, children);
};
Component.displayName = `motion.${tag}`;
return Component;
},
},
);
return {
AnimatePresence: ({ children }: { children: React.ReactNode }) => children,
motion,
useInView: () => true,
useReducedMotion: () => mockReducedMotion,
};
});
describe("Hero reduced motion", () => {
afterEach(() => {
mockReducedMotion = false;
});
it("removes hover/tap scale animations when reduced motion is enabled", () => {
mockReducedMotion = true;
const { container } = render(<Hero />);
const primaryAction = screen.getByText(/Iniciar projeto/i).closest("a");
const secondaryAction = screen.getByText(/Ver projetos/i).closest("a");
expect(primaryAction).not.toHaveAttribute("data-while-hover");
expect(primaryAction).not.toHaveAttribute("data-while-tap");
expect(secondaryAction).not.toHaveAttribute("data-while-hover");
expect(secondaryAction).not.toHaveAttribute("data-while-tap");
const rootMotionBlock = container.querySelector(
"div[data-initial][data-animate]",
);
expect(rootMotionBlock).toBeInTheDocument();
expect(rootMotionBlock?.getAttribute("data-initial")).toContain(
'"opacity":0',
);
expect(rootMotionBlock?.getAttribute("data-animate")).toContain(
'"opacity":1',
);
});
it("keeps essential hero content visible with reduced motion enabled", () => {
mockReducedMotion = true;
render(<Hero />);
expect(screen.getByLabelText("evandro.dev.br")).toBeInTheDocument();
expect(
screen.getByText(/Available for selected builds/i),
).toBeInTheDocument();
expect(screen.getByText(/Execution Brief/i)).toBeInTheDocument();
});
});
-62
View File
@@ -1,62 +0,0 @@
import { render, screen } from "@testing-library/react";
import type { ReactNode } from "react";
import Hero from "./Hero";
jest.mock("framer-motion", () => {
const React = require("react");
const motion = new Proxy(
{},
{
get: (_, tag: string) => {
const Component = ({
children,
...props
}: { children?: ReactNode } & Record<string, unknown>) =>
React.createElement(tag, props, children);
Component.displayName = `motion.${tag}`;
return Component;
},
},
);
return {
AnimatePresence: ({ children }: { children: React.ReactNode }) => children,
motion,
useInView: () => true,
useReducedMotion: () => false,
};
});
describe("Hero", () => {
it("renders the upgraded hero content and primary actions", () => {
render(<Hero />);
expect(screen.getByLabelText("evandro.dev.br")).toBeInTheDocument();
expect(
screen.getByText(
/Engenharia de software para produtos conectados, interfaces de alta performance e sistemas criticos/i,
),
).toBeInTheDocument();
expect(screen.getByText(/Iniciar projeto/i)).toBeInTheDocument();
expect(screen.getByText(/Ver projetos/i)).toBeInTheDocument();
expect(screen.getByText(/Download CV/i)).toBeInTheDocument();
expect(screen.getByText(/Execution Brief/i)).toBeInTheDocument();
});
it("renders social links and proof content", () => {
render(<Hero />);
expect(screen.getAllByLabelText("GitHub").length).toBeGreaterThan(0);
expect(screen.getAllByLabelText("LinkedIn").length).toBeGreaterThan(0);
expect(screen.getAllByLabelText("Email").length).toBeGreaterThan(0);
expect(screen.getByText(/Garuva, SC \/ Brasil/i)).toBeInTheDocument();
expect(screen.getByText(/Especialidade/i)).toBeInTheDocument();
expect(screen.getByText(/Escopo/i)).toBeInTheDocument();
expect(screen.getByText(/Formato/i)).toBeInTheDocument();
expect(screen.getByText(/Scroll/i)).toBeInTheDocument();
});
});
-348
View File
@@ -1,348 +0,0 @@
"use client";
import { motion, useReducedMotion } from "framer-motion";
const SOCIAL_LINKS = [
{
href: "https://github.com/evandrodevbr",
label: "GitHub",
icon: (
<path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z" />
),
},
{
href: "https://www.linkedin.com/in/evandro-fonseca-junior-0969aa1b0/",
label: "LinkedIn",
icon: (
<path d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z" />
),
},
{
href: "mailto:[email protected]",
label: "Email",
icon: (
<>
<path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z" />
<polyline points="22,6 12,13 2,6" />
</>
),
stroke: true,
},
];
const PROOF_ITEMS = [
{
label: "Especialidade",
value:
"Produtos conectados, interfaces de alta performance e sistemas criticos.",
},
{
label: "Escopo",
value:
"Da integracao com hardware e APIs complexas ao frontend e operacao.",
},
{
label: "Formato",
value:
"Consultoria, execucao ponta a ponta e colaboracao remota para squads.",
},
];
export default function Hero() {
const shouldReduceMotion = useReducedMotion();
const hour = new Date().getHours();
const greeting =
hour >= 8 && hour < 12
? "Ola! Vi seu portfolio. Podemos conversar?"
: hour >= 13 && hour < 18
? "Boa tarde! Vi seu portfolio. Podemos conversar?"
: "Ola! Vi seu portfolio. Podemos conversar quando estiver disponivel?";
return (
<section
id="home"
className="relative flex min-h-[100svh] w-full items-center overflow-hidden bg-[var(--ink)] text-[#f4f2ed]"
>
<div className="pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_50%_50%,rgba(10,10,10,0.2)_0%,var(--ink)_100%)]" />
<div
className="pointer-events-none absolute inset-0 opacity-[0.03] mix-blend-screen"
style={{
backgroundImage: `url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E")`,
}}
/>
<div className="pointer-events-none absolute inset-x-0 bottom-0 h-40 bg-gradient-to-t from-[var(--ink)] to-transparent" />
<div className="relative z-10 mx-auto flex w-full max-w-[1240px] flex-col px-sp-6 py-sp-16 lg:px-sp-16 lg:py-0 pointer-events-none">
<motion.div
initial={shouldReduceMotion ? { opacity: 0 } : { opacity: 0, y: 24 }}
animate={shouldReduceMotion ? { opacity: 1 } : { opacity: 1, y: 0 }}
transition={{ duration: 0.8, ease: [0.16, 1, 0.3, 1] }}
className="grid items-end gap-sp-10 lg:grid-cols-[minmax(0,1.2fr)_minmax(320px,0.8fr)] pointer-events-auto"
>
<div className="max-w-[720px]">
<div className="mb-sp-6 inline-flex items-center gap-sp-3 border border-[rgba(255,255,255,0.12)] bg-[rgba(10,10,10,0.4)] px-4 py-2 backdrop-blur-xl">
<motion.span
className="h-2 w-2 bg-[var(--slash)]"
animate={
shouldReduceMotion
? { opacity: 1 }
: { opacity: [1, 0.25, 1] }
}
transition={
shouldReduceMotion
? { duration: 0 }
: {
duration: 1.5,
ease: "easeInOut",
repeat: Number.POSITIVE_INFINITY,
}
}
/>
<span className="font-mono text-[10px] uppercase tracking-[0.2em] text-[rgba(244,242,237,.82)] drop-shadow-md">
Available for selected builds {"//"} Remote worldwide
</span>
</div>
<motion.p
className="mb-sp-4 max-w-[220px] font-mono text-[10px] uppercase tracking-[0.22em] text-[var(--slash)] drop-shadow-lg"
initial={
shouldReduceMotion ? { opacity: 0 } : { opacity: 0, y: 12 }
}
animate={
shouldReduceMotion ? { opacity: 1 } : { opacity: 1, y: 0 }
}
transition={{
duration: 0.7,
delay: 0.08,
ease: [0.16, 1, 0.3, 1],
}}
>
Software engineering for products, operations & critical flows
</motion.p>
<h1
className="max-w-[920px] text-balance font-display text-[clamp(2.9rem,7vw,6.4rem)] font-extrabold leading-[0.92] tracking-[-0.04em] text-transparent bg-clip-text bg-gradient-to-br from-[#ffffff] to-[#a3a3a3]"
aria-label="evandro.dev.br"
>
Engenharia de software para produtos conectados, interfaces de
alta performance e sistemas criticos.
</h1>
<motion.p
className="mt-sp-6 max-w-[640px] text-[15px] leading-7 text-[rgba(244,242,237,.9)] lg:text-[16px] drop-shadow-md"
initial={
shouldReduceMotion ? { opacity: 0 } : { opacity: 0, y: 16 }
}
animate={
shouldReduceMotion ? { opacity: 1 } : { opacity: 1, y: 0 }
}
transition={{
duration: 0.8,
delay: 0.16,
ease: [0.16, 1, 0.3, 1],
}}
>
Da integracao com hardware e APIs complexas ao frontend moderno,
construo sistemas estaveis, operaveis e prontos para crescer sem
sacrificar clareza tecnica.
</motion.p>
<motion.div
className="mt-sp-8 flex flex-wrap items-center gap-sp-4"
initial={
shouldReduceMotion ? { opacity: 0 } : { opacity: 0, y: 16 }
}
animate={
shouldReduceMotion ? { opacity: 1 } : { opacity: 1, y: 0 }
}
transition={{
duration: 0.8,
delay: 0.24,
ease: [0.16, 1, 0.3, 1],
}}
>
<motion.a
href={`https://wa.me/5547992742365?text=${encodeURIComponent(greeting)}`}
className="inline-flex min-h-12 items-center justify-center bg-[var(--slash)] px-sp-8 font-mono text-[11px] font-bold uppercase tracking-[0.12em] text-[#0A0A0A] no-underline transition-[transform,background-color,box-shadow] duration-300 hover:bg-white hover:shadow-[0_0_20px_rgba(204,255,0,0.4)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--slash)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--ink)]"
whileHover={shouldReduceMotion ? undefined : { scale: 1.02 }}
whileTap={shouldReduceMotion ? undefined : { scale: 0.98 }}
>
Iniciar projeto
</motion.a>
<motion.a
href="#projects"
className="inline-flex min-h-12 items-center justify-center border border-[rgba(244,242,237,.28)] bg-[rgba(10,10,10,0.4)] backdrop-blur-md px-sp-8 font-mono text-[11px] font-bold uppercase tracking-[0.12em] text-[#f4f2ed] no-underline transition-[transform,border-color,background-color,color] duration-300 hover:border-[var(--slash)] hover:bg-[rgba(204,255,0,0.08)] hover:text-[var(--slash)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--slash)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--ink)]"
whileHover={shouldReduceMotion ? undefined : { scale: 1.02 }}
whileTap={shouldReduceMotion ? undefined : { scale: 0.98 }}
>
Ver projetos
</motion.a>
<a
href="/assets/Evandro_Fonseca_Junior_CV.pdf"
download
className="inline-flex min-h-12 items-center justify-center px-sp-2 text-[12px] font-medium text-[rgba(244,242,237,.9)] no-underline transition-colors duration-300 hover:text-[var(--slash)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--slash)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--ink)] drop-shadow-md"
>
Download CV
</a>
</motion.div>
<motion.div
className="mt-sp-10 flex flex-wrap items-center gap-x-sp-6 gap-y-sp-3 border-t border-[rgba(255,255,255,.08)] pt-sp-6"
initial={
shouldReduceMotion ? { opacity: 0 } : { opacity: 0, y: 16 }
}
animate={
shouldReduceMotion ? { opacity: 1 } : { opacity: 1, y: 0 }
}
transition={{
duration: 0.8,
delay: 0.32,
ease: [0.16, 1, 0.3, 1],
}}
>
<div className="inline-flex items-center gap-sp-3 text-[11px] uppercase tracking-[0.12em] text-[rgba(244,242,237,.72)]">
<span className="h-2 w-2 rounded-full bg-[var(--slash)] shadow-[0_0_8px_var(--slash)]" />
Garuva, SC / Brasil
</div>
<div className="inline-flex items-center gap-sp-3 text-[11px] uppercase tracking-[0.12em] text-[rgba(244,242,237,.72)]">
<span className="h-[1px] w-6 bg-[rgba(255,255,255,.2)]" />
Next.js, Tauri, Rust, Node.js
</div>
<div className="flex items-center gap-sp-2">
{SOCIAL_LINKS.map((link) => (
<a
key={link.label}
href={link.href}
target={link.href.startsWith("http") ? "_blank" : undefined}
rel={
link.href.startsWith("http")
? "noopener noreferrer"
: undefined
}
className="inline-flex h-11 w-11 items-center justify-center rounded-full border border-[rgba(244,242,237,0.18)] bg-[rgba(10,10,10,0.4)] backdrop-blur-md text-[rgba(244,242,237,.88)] transition-[transform,border-color,color,background-color] duration-300 hover:border-[var(--slash)] hover:bg-[rgba(204,255,0,0.1)] hover:text-[var(--slash)] hover:shadow-[0_0_15px_rgba(204,255,0,0.2)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--slash)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--ink)]"
aria-label={link.label}
>
<svg
width="20"
height="20"
viewBox="0 0 24 24"
fill={link.stroke ? "none" : "currentColor"}
stroke={link.stroke ? "currentColor" : "none"}
strokeWidth={link.stroke ? "2" : undefined}
role="img"
aria-label={link.label}
>
{link.icon}
</svg>
</a>
))}
</div>
</motion.div>
</div>
<motion.aside
className="relative overflow-hidden border border-[rgba(255,255,255,0.15)] bg-[linear-gradient(180deg,rgba(10,10,10,0.6),rgba(10,10,10,0.3))] p-sp-6 backdrop-blur-xl lg:p-sp-8"
initial={
shouldReduceMotion ? { opacity: 0 } : { opacity: 0, x: 24 }
}
animate={shouldReduceMotion ? { opacity: 1 } : { opacity: 1, x: 0 }}
transition={{ duration: 0.9, delay: 0.22, ease: [0.16, 1, 0.3, 1] }}
>
<div className="absolute inset-x-0 top-0 h-px bg-[linear-gradient(90deg,transparent,rgba(204,255,0,0.9),transparent)]" />
<div className="absolute inset-y-0 left-0 w-px bg-[linear-gradient(180deg,rgba(204,255,0,0.4),transparent)]" />
<div className="flex items-start justify-between gap-sp-4 border-b border-[rgba(255,255,255,0.08)] pb-sp-5">
<div>
<div className="font-mono text-[10px] uppercase tracking-[0.18em] text-[var(--slash)]">
Execution Brief
</div>
<h2 className="mt-sp-2 font-display text-[clamp(1.35rem,3vw,2rem)] font-extrabold leading-[1.02] tracking-[-0.03em] text-[#f7f4ee]">
Clareza de arquitetura antes de complexidade.
</h2>
</div>
<div className="shrink-0 border border-[rgba(204,255,0,0.3)] bg-[rgba(204,255,0,0.05)] px-3 py-2 font-mono text-[10px] uppercase tracking-[0.14em] text-[var(--slash)]">
2026
</div>
</div>
<div className="mt-sp-6 space-y-sp-5">
{PROOF_ITEMS.map((item, index) => (
<motion.article
key={item.label}
className="border-b border-[rgba(255,255,255,0.08)] pb-sp-5 last:border-b-0 last:pb-0"
initial={
shouldReduceMotion ? { opacity: 0 } : { opacity: 0, y: 12 }
}
animate={
shouldReduceMotion ? { opacity: 1 } : { opacity: 1, y: 0 }
}
transition={{
duration: 0.65,
delay: 0.28 + index * 0.08,
ease: [0.16, 1, 0.3, 1],
}}
>
<div className="font-mono text-[10px] uppercase tracking-[0.18em] text-[rgba(244,242,237,.7)]">
{item.label}
</div>
<p className="mt-sp-2 text-[14px] leading-6 text-[rgba(244,242,237,.94)]">
{item.value}
</p>
</motion.article>
))}
</div>
<motion.div
className="mt-sp-8 grid gap-sp-4 sm:grid-cols-2"
initial={
shouldReduceMotion ? { opacity: 0 } : { opacity: 0, y: 16 }
}
animate={
shouldReduceMotion ? { opacity: 1 } : { opacity: 1, y: 0 }
}
transition={{
duration: 0.75,
delay: 0.48,
ease: [0.16, 1, 0.3, 1],
}}
>
<div className="border border-[rgba(255,255,255,0.1)] bg-[rgba(10,10,10,0.4)] p-sp-4 hover:border-[var(--slash)] transition-colors duration-300">
<div className="font-mono text-[10px] uppercase tracking-[0.18em] text-[var(--slash)]">
Focus
</div>
<p className="mt-sp-2 text-[13px] leading-6 text-[rgba(244,242,237,.9)]">
Sistemas com baixa latencia, alta previsibilidade e manutencao
sustentavel.
</p>
</div>
<div className="border border-[rgba(255,255,255,0.1)] bg-[rgba(10,10,10,0.4)] p-sp-4 hover:border-[var(--slash)] transition-colors duration-300">
<div className="font-mono text-[10px] uppercase tracking-[0.18em] text-[var(--slash)]">
Availability
</div>
<p className="mt-sp-2 text-[13px] leading-6 text-[rgba(244,242,237,.9)]">
Aberto a novos projetos com ownership tecnico, discovery e
entrega iterativa.
</p>
</div>
</motion.div>
</motion.aside>
</motion.div>
</div>
<motion.div
className="absolute bottom-10 left-1/2 flex -translate-x-1/2 flex-col items-center gap-3 opacity-50 z-10 pointer-events-none"
initial={shouldReduceMotion ? { opacity: 0 } : { opacity: 0 }}
animate={shouldReduceMotion ? { opacity: 0.5 } : { opacity: 0.5 }}
transition={{ delay: 1, duration: 1 }}
>
<span className="font-mono text-[9px] uppercase tracking-widest text-[var(--slash)]">
Scroll
</span>
<div className="h-10 w-[1px] bg-gradient-to-b from-[var(--slash)] to-transparent" />
</motion.div>
</section>
);
}
-184
View File
@@ -1,184 +0,0 @@
"use client";
import { motion, useReducedMotion } from "framer-motion";
interface LogoProps {
variant?: "mark" | "wordmark" | "icon";
size?: "sm" | "md" | "lg" | "xl";
theme?: "dark" | "light" | "accent";
className?: string;
showTagline?: boolean;
}
const sizeMap = {
sm: { width: 32, height: 32 },
md: { width: 48, height: 48 },
lg: { width: 64, height: 64 },
xl: { width: 120, height: 80 },
};
export function Logo({
variant = "mark",
size = "md",
theme = "dark",
className = "",
showTagline = false,
}: Readonly<LogoProps>) {
const dimensions = sizeMap[size];
const shouldReduceMotion = useReducedMotion();
const colors = {
dark: {
primary: "#FFFFFF",
slash: "#CCFF00",
},
light: {
primary: "#0A0A0A",
slash: "#0A0A0A",
},
accent: {
primary: "#0A0A0A",
slash: "rgba(0,0,0,.3)",
},
};
const c = colors[theme];
const hoverMotion = shouldReduceMotion
? undefined
: {
scale: 1.03,
rotate: -2,
};
const hoverTransition = {
type: "spring" as const,
stiffness: 280,
damping: 18,
};
if (variant === "icon") {
return (
<motion.svg
width={dimensions.width}
height={dimensions.height}
viewBox="0 0 64 64"
fill="none"
className={className}
role="img"
aria-label="Evandro icon logo"
whileHover={hoverMotion}
transition={hoverTransition}
>
<title>Evandro icon logo</title>
<rect width="64" height="64" rx="14" fill={c.primary} />
<rect
x="10"
y="10"
width="7"
height="44"
fill={theme === "dark" ? "#0A0A0A" : c.primary}
/>
<rect
x="17"
y="10"
width="18"
height="7"
fill={theme === "dark" ? "#0A0A0A" : c.primary}
/>
<rect
x="17"
y="28.5"
width="14"
height="7"
fill={theme === "dark" ? "#0A0A0A" : c.primary}
/>
<rect
x="17"
y="47"
width="18"
height="7"
fill={theme === "dark" ? "#0A0A0A" : c.primary}
/>
<polygon points="37,38 41,38 50,26 46,26" fill={c.slash} />
<circle
cx="52"
cy="47"
r="5"
fill={theme === "dark" ? "#0A0A0A" : c.primary}
/>
</motion.svg>
);
}
if (variant === "wordmark") {
return (
<motion.div
className={`flex items-center gap-3 ${className}`}
whileHover={hoverMotion}
transition={hoverTransition}
>
<svg
width={dimensions.width}
height={dimensions.height}
viewBox="0 0 48 32"
fill="none"
role="img"
aria-label="Evandro wordmark logo"
>
<title>Evandro wordmark logo</title>
<rect x="2" y="2" width="7" height="28" fill={c.primary} />
<rect x="9" y="2" width="20" height="7" fill={c.primary} />
<rect x="9" y="12.5" width="16" height="7" fill={c.primary} />
<rect x="9" y="23" width="20" height="7" fill={c.primary} />
<polygon points="30,22 34,22 42,10 38,10" fill={c.slash} />
<circle cx="44" cy="25" r="4" fill={c.primary} />
</svg>
<div>
<div
className="font-display text-lg font-extrabold tracking-tight"
style={{ color: c.primary }}
>
evandro<span style={{ color: c.slash }}>.</span>dev
<span style={{ color: c.slash }}>.</span>br
</div>
{showTagline && (
<div
className="mt-1 text-[9px] tracking-widest"
style={{
color:
theme === "dark"
? "rgba(255,255,255,.25)"
: "rgba(10,10,10,.4)",
}}
>
DESENVOLVIMENTO DE SOFTWARE
</div>
)}
</div>
</motion.div>
);
}
return (
<motion.svg
width={dimensions.width}
height={dimensions.height}
viewBox="0 0 120 80"
fill="none"
className={className}
role="img"
aria-label="Evandro mark logo"
whileHover={hoverMotion}
transition={hoverTransition}
>
<title>Evandro mark logo</title>
<rect x="10" y="8" width="9" height="64" fill={c.primary} />
<rect x="19" y="8" width="28" height="9" fill={c.primary} />
<rect x="19" y="35.5" width="22" height="9" fill={c.primary} />
<rect x="19" y="63" width="28" height="9" fill={c.primary} />
<polygon points="50,55 57,55 74,25 67,25" fill={c.slash} />
<circle cx="80" cy="63" r="7" fill={c.primary} />
</motion.svg>
);
}
-154
View File
@@ -1,154 +0,0 @@
"use client";
import { useMemo } from "react";
import { motion, type Variants, useReducedMotion } from "framer-motion";
import { usePortfolioData } from "@/lib/usePortfolioData";
import { Section } from "./Section";
import { DrawLine } from "./animations/DrawLine";
import { CounterValue } from "./animations/CounterValue";
import { SectionLoading } from "./SectionLoading";
export default function Projects() {
const { data, loading, error } = usePortfolioData();
const shouldReduceMotion = useReducedMotion();
const projects = useMemo(
() => data?.projects.filter((p) => p.featured) || [],
[data],
);
if (loading) {
return <SectionLoading dark message="Loading featured projects" />;
}
if (error) {
return <div className="ds-error">Error loading featured projects</div>;
}
const gridVariants: Variants = {
hidden: {},
visible: {
transition: {
delayChildren: 0.08,
staggerChildren: 0.08,
},
},
};
const cardVariants: Variants = {
hidden: shouldReduceMotion
? { opacity: 0 }
: { opacity: 0, y: 24, clipPath: "inset(100% 0 0 0)" },
visible: {
opacity: 1,
y: 0,
clipPath: "inset(0% 0 0 0)",
transition: shouldReduceMotion
? { duration: 0.25 }
: { duration: 0.8, ease: [0.16, 1, 0.3, 1] },
},
};
return (
<Section
id="projects"
eyebrow="PRODUCAO_INTELECTUAL"
title="Projetos com recorte tecnico claro e impacto observavel"
description="Selecao de produtos e ferramentas onde performance, confiabilidade e clareza de arquitetura foram requisitos reais."
dark
disableChildrenAnimation
>
<motion.div
className="ds-grid-2"
initial="hidden"
whileInView="visible"
viewport={{ once: true, amount: 0.2 }}
variants={gridVariants}
>
{projects.map((project) => (
<motion.article
key={project.id}
className="ds-card h-full"
variants={cardVariants}
whileHover={
shouldReduceMotion
? undefined
: {
y: -4,
boxShadow: "0 20px 44px rgba(0, 0, 0, 0.42)",
}
}
whileTap={shouldReduceMotion ? undefined : { scale: 0.99 }}
transition={{ type: "spring", stiffness: 170, damping: 18 }}
>
<div className="flex items-start justify-between gap-sp-6">
<div>
<div className="ds-kicker">{project.category}</div>
<DrawLine delay={0.05} />
<h3 className="ds-card-title">{project.title}</h3>
<p className="mt-sp-2 text-[11px] uppercase tracking-[0.1em] text-[rgba(255,255,255,.36)]">
{project.subtitle}
</p>
</div>
<span className="ds-tag">{project.status}</span>
</div>
<p className="ds-copy">{project.description}</p>
<div className="mt-sp-6 flex flex-wrap gap-sp-3">
{project.githubUrl && (
<motion.a
href={project.githubUrl}
target="_blank"
rel="noreferrer"
className="ds-link ds-link-muted"
whileHover={shouldReduceMotion ? undefined : { scale: 1.03 }}
whileTap={shouldReduceMotion ? undefined : { scale: 0.97 }}
transition={{ type: "spring", stiffness: 260, damping: 20 }}
>
GitHub
</motion.a>
)}
{project.demoUrl && (
<motion.a
href={project.demoUrl}
target="_blank"
rel="noreferrer"
className="ds-link ds-link-accent"
whileHover={shouldReduceMotion ? undefined : { scale: 1.03 }}
whileTap={shouldReduceMotion ? undefined : { scale: 0.97 }}
transition={{ type: "spring", stiffness: 260, damping: 20 }}
>
Live demo
</motion.a>
)}
</div>
<ul className="ds-tags mt-sp-6">
{project.technologies.slice(0, 6).map((tech: string) => (
<li key={tech} className="ds-tag">
{tech}
</li>
))}
</ul>
<div className="mt-sp-6 flex flex-wrap gap-sp-4">
<span className="ds-metric">
Complexity{" "}
<CounterValue
value={project.metrics?.complexity || 3}
suffix="/5"
/>
</span>
{project.metrics?.teamSize && (
<span className="ds-metric">
Team {project.metrics.teamSize}
</span>
)}
</div>
</motion.article>
))}
</motion.div>
</Section>
);
}
-68
View File
@@ -1,68 +0,0 @@
"use client";
import type { ReactNode } from "react";
import { useState } from "react";
import { motion, useReducedMotion } from "framer-motion";
interface RevealProps {
children: ReactNode;
y?: number;
duration?: number;
delay?: number;
ease?: string;
start?: string;
end?: string;
scrub?: boolean | number;
className?: string;
}
export function Reveal({
children,
y = 36,
duration = 0.8,
delay = 0,
className = "",
}: RevealProps) {
const shouldReduceMotion = useReducedMotion();
const [animating, setAnimating] = useState(!shouldReduceMotion);
return (
<motion.div
className={className}
initial={
shouldReduceMotion
? { opacity: 0 }
: { opacity: 0, y, clipPath: "inset(100% 0 0 0)" }
}
whileInView={
shouldReduceMotion
? { opacity: 1 }
: { opacity: 1, y: 0, clipPath: "inset(0% 0 0 0)" }
}
viewport={{ once: true, amount: 0.2 }}
transition={
shouldReduceMotion
? { duration: 0.25 }
: {
duration,
delay,
ease: [0.16, 1, 0.3, 1],
}
}
style={{
willChange:
animating && !shouldReduceMotion
? "transform, opacity, clip-path"
: undefined,
}}
onAnimationStart={() => {
if (!shouldReduceMotion) {
setAnimating(true);
}
}}
onAnimationComplete={() => setAnimating(false)}
>
{children}
</motion.div>
);
}
-38
View File
@@ -1,38 +0,0 @@
"use client";
import type { ReactNode } from "react";
import { AnimatePresence, motion, useReducedMotion } from "framer-motion";
import { usePathname } from "next/navigation";
interface RouteTransitionProps {
children: ReactNode;
}
export function RouteTransition({ children }: Readonly<RouteTransitionProps>) {
const pathname = usePathname();
const shouldReduceMotion = useReducedMotion();
return (
<AnimatePresence mode="wait" initial={false}>
<motion.div
key={pathname}
initial={shouldReduceMotion ? { opacity: 0 } : { opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
exit={shouldReduceMotion ? { opacity: 0 } : { opacity: 0, y: -20 }}
transition={
shouldReduceMotion
? { duration: 0.2 }
: {
opacity: { duration: 0.3, ease: [0.16, 1, 0.3, 1] },
y: {
duration: 0.4,
ease: [0.16, 1, 0.3, 1],
},
}
}
>
{children}
</motion.div>
</AnimatePresence>
);
}
-107
View File
@@ -1,107 +0,0 @@
"use client";
import type React from "react";
import { motion, type Variants, useReducedMotion } from "framer-motion";
import { DrawLine } from "./animations/DrawLine";
import { TextDiffuseReveal } from "./animations/TextDiffuseReveal";
import { Reveal } from "./Reveal";
interface SectionProps {
id?: string;
eyebrow?: string;
title: string;
description?: string;
dark?: boolean;
aside?: React.ReactNode;
children: React.ReactNode;
disableChildrenAnimation?: boolean;
}
export const Section = ({
id,
eyebrow,
title,
description,
dark,
aside,
children,
disableChildrenAnimation = false,
}: SectionProps) => {
const shouldReduceMotion = useReducedMotion();
const baseClass = dark ? "ds-section ds-section-dark" : "ds-section";
const containerVariants: Variants = {
hidden: {},
visible: {
transition: {
delayChildren: 0.02,
staggerChildren: 0.08,
},
},
};
const itemVariants: Variants = {
hidden: shouldReduceMotion ? { opacity: 0 } : { opacity: 0, y: 18 },
visible: {
opacity: 1,
y: 0,
transition: shouldReduceMotion
? { duration: 0.25, ease: [0.16, 1, 0.3, 1] }
: {
type: "spring",
stiffness: 60,
damping: 20,
mass: 0.85,
},
},
};
return (
<section id={id} className={baseClass}>
<div className="ds-section-shell">
<motion.div
className="ds-section-header"
initial="hidden"
whileInView="visible"
viewport={{ once: true, amount: 0.2 }}
variants={containerVariants}
>
<div className="ds-section-meta">
{eyebrow && (
<motion.p className="ds-eyebrow" variants={itemVariants}>
{eyebrow}
</motion.p>
)}
<h2 className="ds-section-title">
<TextDiffuseReveal text={title} />
</h2>
{description && (
<motion.p
className="ds-section-description"
variants={itemVariants}
>
{description}
</motion.p>
)}
<DrawLine delay={0.16} />
</div>
{aside && (
<motion.aside variants={itemVariants}>{aside}</motion.aside>
)}
</motion.div>
{!disableChildrenAnimation ? (
<Reveal y={40} duration={0.9} delay={0.12}>
<div>{children}</div>
</Reveal>
) : (
<div>{children}</div>
)}
</div>
</section>
);
};
-37
View File
@@ -1,37 +0,0 @@
"use client";
import { TopProgressBar } from "./animations/TopProgressBar";
interface SectionLoadingProps {
message: string;
dark?: boolean;
skeletons?: number;
}
export function SectionLoading({
message,
dark = false,
skeletons = 2,
}: Readonly<SectionLoadingProps>) {
const sectionClass = dark ? "ds-section ds-section-dark" : "ds-section";
return (
<section className={sectionClass}>
<TopProgressBar />
<div className="ds-section-shell">
<div className="ds-loading">{message}</div>
<div className="ds-grid-2 mt-sp-6" aria-hidden="true">
{Array.from({ length: skeletons }).map((_, index) => (
<div key={`skeleton-${index}`} className="ds-card ds-skeleton-card">
<div className="ds-skeleton ds-skeleton-kicker" />
<div className="ds-skeleton ds-skeleton-title" />
<div className="ds-skeleton ds-skeleton-line" />
<div className="ds-skeleton ds-skeleton-line" />
<div className="ds-skeleton ds-skeleton-line ds-skeleton-line-short" />
</div>
))}
</div>
</div>
</section>
);
}
-98
View File
@@ -1,98 +0,0 @@
"use client";
import { motion, type Variants, useReducedMotion } from "framer-motion";
import { usePortfolioData } from "@/lib/usePortfolioData";
import { Section } from "./Section";
import { DrawLine } from "./animations/DrawLine";
import { CounterValue } from "./animations/CounterValue";
import { SectionLoading } from "./SectionLoading";
export default function Skills() {
const { data, loading, error } = usePortfolioData();
const shouldReduceMotion = useReducedMotion();
if (loading) {
return <SectionLoading dark message="Loading skill registry" />;
}
if (error || !data) {
return <div className="ds-error">Error loading skill registry</div>;
}
const gridVariants: Variants = {
hidden: {},
visible: {
transition: {
delayChildren: 0.06,
staggerChildren: 0.08,
},
},
};
const cardVariants: Variants = {
hidden: shouldReduceMotion
? { opacity: 0 }
: { opacity: 0, y: 20, clipPath: "inset(100% 0 0 0)" },
visible: {
opacity: 1,
y: 0,
clipPath: "inset(0% 0 0 0)",
transition: shouldReduceMotion
? { duration: 0.25 }
: { duration: 0.8, ease: [0.16, 1, 0.3, 1] },
},
};
return (
<Section
id="skills"
eyebrow="MODULE_REGISTRY.lib"
title="Stack modular para produto, operacao e escala"
description="Ferramentas escolhidas por previsibilidade operacional, velocidade de entrega e facilidade de manutencao."
dark
disableChildrenAnimation
>
<motion.div
className="ds-grid-2"
initial="hidden"
whileInView="visible"
viewport={{ once: true, amount: 0.2 }}
variants={gridVariants}
>
{data.skills.technical.map((category, index) => (
<motion.article
key={category.category}
className="ds-card h-full"
variants={cardVariants}
whileHover={
shouldReduceMotion
? undefined
: {
y: -4,
boxShadow: "0 20px 40px rgba(0, 0, 0, 0.35)",
}
}
whileTap={shouldReduceMotion ? undefined : { scale: 0.99 }}
transition={{ type: "spring", stiffness: 180, damping: 18 }}
>
<div className="flex items-center justify-between gap-sp-4">
<div className="ds-kicker">ID_0{index + 1}X</div>
<div className="ds-metric">
<CounterValue value={category.skills.length} suffix=" items" />
</div>
</div>
<DrawLine delay={0.05} />
<h3 className="ds-card-title mb-sp-8">{category.category}</h3>
<ul className="ds-tags">
{category.skills.map((skill) => (
<li key={skill} className="ds-tag">
{skill}
</li>
))}
</ul>
</motion.article>
))}
</motion.div>
</Section>
);
}
-212
View File
@@ -1,212 +0,0 @@
"use client";
import { motion, type Variants, useReducedMotion } from "framer-motion";
import { Section } from "./Section";
import { DrawLine } from "./animations/DrawLine";
interface Tier {
id: string;
badge: string;
level: string;
title: string;
tagline: string;
description: string;
deliverables: string[];
pricing: string;
pricingNote: string;
featured?: boolean;
ctaLabel: string;
ctaHref: string;
}
const TIERS: Tier[] = [
{
id: "discovery",
badge: "Entrada / Baixo Risco",
level: "01",
title: "Auditoria & Diagnostico Tecnico",
tagline: "Fotografia clara do problema antes de qualquer comprometimento.",
description:
"Analise profunda de arquitetura, performance ou seguranca com entrega de um plano de acao executavel. Ideal para quem precisa de direcao antes de contratar execucao.",
deliverables: [
"Relatorio de gargalos e divida tecnica",
"Mapeamento de riscos e dependencias",
"Sugestao de stack e cronograma de mitigacao",
"Plano de acao priorizado",
],
pricing: "Valor Fixo",
pricingNote: "Contrato unico. Entrega em ate 5 dias uteis.",
featured: false,
ctaLabel: "Solicitar diagnostico",
ctaHref: "#contact",
},
{
id: "cycles",
badge: "Mais Escolhido",
level: "02",
title: "Ciclos de Engenharia",
tagline: "Capacidade produtiva garantida. Entrega a cada 2 semanas.",
description:
"Desenvolvimento continuo com a previsibilidade de orcamento do escopo fechado e a agilidade de sprints. Milestones claros, sem amarras de contrato longo.",
deliverables: [
"Features em producao a cada ciclo",
"Refatoracao iterativa com rastreabilidade",
"Documentacao tecnica atualizada",
"Capacidade de pivotar prioridades no inicio de cada sprint",
],
pricing: "Fixo por Ciclo",
pricingNote: "Assinatura quinzenal ou mensal. Cancele a qualquer ciclo.",
featured: true,
ctaLabel: "Iniciar ciclo de engenharia",
ctaHref: "#contact",
},
{
id: "fractional",
badge: "Premium / High-Ticket",
level: "03",
title: "Fractional Tech Lead",
tagline: "Lideranca tecnica senior. Sem o custo de um CTO full-time.",
description:
"Direcao arquitetural, gestao de risco e sustentacao de operacoes criticas. Para empresas que precisam de decisoes de alto impacto com responsabilidade continua.",
deliverables: [
"SLA prioritario Zero-Risk",
"Code review e lideranca do time interno",
"Decisoes de infra: Cloud, VPS, CI/CD",
"Consultoria estrategica recorrente",
],
pricing: "Retainer Mensal",
pricingNote: "Renovacao mensal. Vagas limitadas.",
featured: false,
ctaLabel: "Agendar conversa estrategica",
ctaHref: "#contact",
},
];
function TierCard({ tier }: Readonly<{ tier: Tier }>) {
const shouldReduceMotion = useReducedMotion();
return (
<motion.article
tabIndex={0}
className={`ds-card h-full relative outline-none ${
tier.featured ? "border-[var(--slash)] shadow-sm" : ""
}`}
style={{
borderWidth: tier.featured ? "2px" : "1px",
}}
whileHover={
shouldReduceMotion
? undefined
: {
y: -4,
boxShadow: "0 24px 50px rgba(0, 0, 0, 0.08)",
}
}
whileTap={shouldReduceMotion ? undefined : { scale: 0.99 }}
transition={{ type: "spring", stiffness: 180, damping: 18 }}
>
<div className="flex justify-between items-start">
<span className="ds-kicker">{tier.badge}</span>
<span className="font-display text-[11px] font-extrabold tracking-widest text-[var(--meta)]">
{tier.level}
</span>
</div>
<DrawLine delay={0.04} />
<div className="mt-sp-4">
<h3 className="ds-card-title">{tier.title}</h3>
<p className="mt-sp-2 text-[11px] font-medium leading-relaxed text-[var(--meta)]">
{tier.tagline}
</p>
</div>
<p className="ds-copy">{tier.description}</p>
<ul className="ds-list">
{tier.deliverables.map((deliverable) => (
<li key={deliverable}>{deliverable}</li>
))}
</ul>
<div className="mt-sp-6 border-t border-[var(--border)] pt-sp-4">
<div className="font-display text-[clamp(14px,1.5vw,18px)] font-extrabold tracking-tight">
{tier.pricing}
</div>
<div className="mt-1 text-[10px] tracking-widest text-[var(--meta)] uppercase">
{tier.pricingNote}
</div>
</div>
<motion.a
href={tier.ctaHref}
className={`ds-link mt-sp-6 justify-center w-full ${
tier.featured ? "ds-link-accent" : "ds-link-muted"
}`}
whileHover={shouldReduceMotion ? undefined : { scale: 1.02 }}
whileTap={shouldReduceMotion ? undefined : { scale: 0.98 }}
transition={{ type: "spring", stiffness: 260, damping: 20 }}
>
{tier.ctaLabel}
{" ->"}
</motion.a>
</motion.article>
);
}
export function WorkModalities() {
const shouldReduceMotion = useReducedMotion();
const containerVariants: Variants = {
hidden: {},
visible: {
transition: {
delayChildren: 0.08,
staggerChildren: 0.08,
},
},
};
const itemVariants: Variants = {
hidden: shouldReduceMotion
? { opacity: 0 }
: { opacity: 0, y: 20, clipPath: "inset(100% 0 0 0)" },
visible: {
opacity: 1,
y: 0,
clipPath: "inset(0% 0 0 0)",
transition: shouldReduceMotion
? { duration: 0.25 }
: { duration: 0.75, ease: [0.16, 1, 0.3, 1] },
},
};
return (
<Section
id="modalities"
eyebrow="CONTRACT_PROTOCOLS.sys"
title="Engenharia sob demanda. Previsibilidade de entrega sem overhead."
description="Tres niveis de contratacao desenhados como uma esteira de valor, do diagnostico rapido a parceria estrategica de longo prazo."
disableChildrenAnimation
>
<motion.div
style={{
display: "grid",
gridTemplateColumns: "repeat(3, minmax(0, 1fr))",
gap: "var(--sp-6)",
}}
className="max-md:grid-cols-1 max-md:!flex max-md:!flex-col"
initial="hidden"
whileInView="visible"
viewport={{ once: true, amount: 0.2 }}
variants={containerVariants}
>
{TIERS.map((tier) => (
<motion.div key={tier.id} variants={itemVariants}>
<TierCard tier={tier} />
</motion.div>
))}
</motion.div>
</Section>
);
}
@@ -1,63 +0,0 @@
"use client";
import { useEffect, useRef, useState } from "react";
import { useInView, useReducedMotion } from "framer-motion";
interface CounterValueProps {
value: number;
className?: string;
duration?: number;
prefix?: string;
suffix?: string;
once?: boolean;
amount?: number;
}
export function CounterValue({
value,
className = "",
duration = 1200,
prefix = "",
suffix = "",
once = true,
amount = 0.45,
}: Readonly<CounterValueProps>) {
const shouldReduceMotion = useReducedMotion();
const ref = useRef<HTMLSpanElement | null>(null);
const isInView = useInView(ref, { once, amount });
const [displayValue, setDisplayValue] = useState(0);
useEffect(() => {
if (!isInView) return;
if (shouldReduceMotion) {
setDisplayValue(value);
return;
}
const start = performance.now();
let rafId = 0;
const frame = (now: number) => {
const elapsed = now - start;
const progress = Math.min(elapsed / duration, 1);
const eased = 1 - Math.pow(1 - progress, 3);
setDisplayValue(Math.round(value * eased));
if (progress < 1) {
rafId = requestAnimationFrame(frame);
}
};
rafId = requestAnimationFrame(frame);
return () => cancelAnimationFrame(rafId);
}, [isInView, value, duration, shouldReduceMotion]);
return (
<span ref={ref} className={className}>
{prefix}
{displayValue}
{suffix}
</span>
);
}
-39
View File
@@ -1,39 +0,0 @@
"use client";
import { useState } from "react";
import { motion, useReducedMotion } from "framer-motion";
interface DrawLineProps {
className?: string;
delay?: number;
}
export function DrawLine({
className = "",
delay = 0,
}: Readonly<DrawLineProps>) {
const shouldReduceMotion = useReducedMotion();
const [animating, setAnimating] = useState(!shouldReduceMotion);
return (
<motion.span
className={`ds-draw-line ${className}`.trim()}
initial={shouldReduceMotion ? { opacity: 0 } : { opacity: 0, scaleX: 0 }}
whileInView={
shouldReduceMotion ? { opacity: 1 } : { opacity: 1, scaleX: 1 }
}
viewport={{ once: true, amount: 0.7 }}
transition={{
duration: shouldReduceMotion ? 0.25 : 0.6,
delay,
ease: [0.16, 1, 0.3, 1],
}}
style={{
transformOrigin: "left",
willChange:
animating && !shouldReduceMotion ? "transform, opacity" : undefined,
}}
onAnimationComplete={() => setAnimating(false)}
/>
);
}
@@ -1,70 +0,0 @@
"use client";
import { useState } from "react";
import Image, { type StaticImageData } from "next/image";
import { motion, useReducedMotion } from "framer-motion";
interface LazyRevealImageProps {
src: string | StaticImageData;
alt: string;
className?: string;
imageClassName?: string;
sizes?: string;
}
export function LazyRevealImage({
src,
alt,
className = "",
imageClassName = "object-cover",
sizes = "(max-width: 1024px) 100vw, 50vw",
}: Readonly<LazyRevealImageProps>) {
const shouldReduceMotion = useReducedMotion();
const [loaded, setLoaded] = useState(false);
const [animating, setAnimating] = useState(!shouldReduceMotion);
return (
<motion.div
className={`relative ${className}`.trim()}
initial={
shouldReduceMotion
? { opacity: 0 }
: { opacity: 0, filter: "blur(20px)", scale: 1.05 }
}
animate={
loaded
? shouldReduceMotion
? { opacity: 1 }
: { opacity: 1, filter: "blur(0px)", scale: 1 }
: shouldReduceMotion
? { opacity: 0 }
: { opacity: 0, filter: "blur(20px)", scale: 1.05 }
}
transition={{
duration: shouldReduceMotion ? 0.25 : 0.75,
ease: [0.16, 1, 0.3, 1],
}}
style={{
willChange:
animating && !shouldReduceMotion
? "filter, transform, opacity"
: undefined,
}}
onAnimationComplete={() => setAnimating(false)}
>
<Image
src={src}
alt={alt}
fill
loading="lazy"
sizes={sizes}
placeholder={typeof src === "string" ? "empty" : "blur"}
onLoad={() => {
setAnimating(true);
setLoaded(true);
}}
className={imageClassName}
/>
</motion.div>
);
}
@@ -1,133 +0,0 @@
"use client";
import { motion, useInView, useReducedMotion } from "framer-motion";
import { useEffect, useMemo, useRef, useState } from "react";
interface TextDiffuseRevealProps {
text: string;
className?: string;
startDelay?: number;
once?: boolean;
amount?: number;
}
const EXPO_OUT = [0.16, 1, 0.3, 1] as const;
export function TextDiffuseReveal({
text,
className = "",
startDelay = 0,
once = true,
amount = 0.3,
}: Readonly<TextDiffuseRevealProps>) {
const ref = useRef<HTMLSpanElement | null>(null);
const shouldReduceMotion = useReducedMotion();
const isInView = useInView(ref, { once, amount });
const [staggerDelay, setStaggerDelay] = useState(0.03);
const [completedChars, setCompletedChars] = useState(0);
useEffect(() => {
const media = window.matchMedia("(max-width: 768px)");
const updateStagger = () => setStaggerDelay(media.matches ? 0.015 : 0.03);
updateStagger();
media.addEventListener("change", updateStagger);
return () => media.removeEventListener("change", updateStagger);
}, []);
const tokens = useMemo(() => text.split(/(\n|\s+)/), [text]);
const animatedChars = useMemo(
() =>
Array.from(text).filter((char) => char !== "\n" && char !== " ").length,
[text],
);
useEffect(() => {
if (!isInView) {
setCompletedChars(0);
}
}, [isInView]);
const hasActiveWillChange =
!shouldReduceMotion && isInView && completedChars < animatedChars;
let animatedIndex = 0;
return (
<span
ref={ref}
className={className}
aria-label={text}
style={{
willChange: hasActiveWillChange
? "filter, opacity, transform"
: undefined,
}}
>
{tokens.map((token, tokenIndex) => {
if (!token) {
return null;
}
if (token === "\n") {
return <br key={`line-${tokenIndex}`} />;
}
if (/^\s+$/.test(token)) {
return (
<span key={`space-${tokenIndex}`} aria-hidden="true">
{token.replace(/ /g, "\u00A0")}
</span>
);
}
return (
<span
key={`word-${tokenIndex}`}
className="inline-block whitespace-nowrap"
>
{Array.from(token).map((char, charIndex) => {
const currentIndex = animatedIndex;
animatedIndex += 1;
return (
<motion.span
key={`char-${tokenIndex}-${charIndex}-${char}`}
className="inline-block"
initial={
shouldReduceMotion
? { opacity: 0 }
: { filter: "blur(12px)", opacity: 0, scale: 0.9 }
}
animate={
isInView
? shouldReduceMotion
? { opacity: 1 }
: { filter: "blur(0px)", opacity: 1, scale: 1 }
: shouldReduceMotion
? { opacity: 0 }
: { filter: "blur(12px)", opacity: 0, scale: 0.9 }
}
transition={{
duration: shouldReduceMotion ? 0.3 : 0.6,
ease: EXPO_OUT,
delay: startDelay + currentIndex * staggerDelay,
}}
onAnimationComplete={() => {
if (!shouldReduceMotion) {
setCompletedChars((count) =>
count < animatedChars ? count + 1 : count,
);
}
}}
>
{char}
</motion.span>
);
})}
</span>
);
})}
</span>
);
}
@@ -1,40 +0,0 @@
"use client";
import { motion, useReducedMotion } from "framer-motion";
interface TopProgressBarProps {
className?: string;
}
export function TopProgressBar({
className = "",
}: Readonly<TopProgressBarProps>) {
const shouldReduceMotion = useReducedMotion();
return (
<div
className={`pointer-events-none fixed inset-x-0 top-0 z-[120] h-[2px] overflow-hidden bg-white/10 ${className}`.trim()}
aria-hidden="true"
>
<motion.div
className="h-full w-1/3 bg-[var(--slash)] shadow-[0_0_12px_rgba(204,255,0,0.85)]"
initial={shouldReduceMotion ? { opacity: 1, x: "0%" } : { x: "-120%" }}
animate={
shouldReduceMotion
? { opacity: 1, x: "0%" }
: { x: ["-120%", "15%", "45%", "110%"] }
}
transition={
shouldReduceMotion
? { duration: 0 }
: {
duration: 1.5,
ease: [0.16, 1, 0.3, 1],
repeat: Number.POSITIVE_INFINITY,
repeatDelay: 0.1,
}
}
/>
</div>
);
}
@@ -1,4 +0,0 @@
import React from 'react';
export default function PointCloudScene() {
return <div data-testid="point-cloud-mock"></div>;
}
-164
View File
@@ -1,164 +0,0 @@
// src/components/ui/NumberIcons.tsx
import React from "react";
interface NumberIconProps extends React.SVGProps<SVGSVGElement> {
/** Tamanho em pixels. Escala mantendo o viewBox 80x80 */
size?: number | string;
/** Classe opcional para sobreposição de estilos */
className?: string;
}
const baseProps = {
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 80 80",
};
/**
* Primitive SVG elements compartilhados.
* Depende da classe pai 'group' para engatilhar as micro-interações.
*/
const GraphicShell = () => (
<>
{/* Base Background */}
<rect width="80" height="80" rx="8" className="fill-[#0A0A0A]" />
{/* Borda reativa ao hover */}
<rect
x="1"
y="1"
width="78"
height="78"
rx="7"
className="stroke-white/5 transition-colors duration-400 ease-[var(--ease-out)] group-hover:stroke-white/15"
strokeWidth="1"
/>
{/* Grid de background sutil (Cyberpunk/Tech feel) */}
<g className="stroke-white/[0.03]" strokeWidth="1">
<path d="M0 20H80M0 60H80M20 0V80M60 0V80" />
</g>
{/* Brand Slash (Acento) com Motion */}
<polygon
points="58,66 62,66 70,50 66,50"
className="fill-[#E8FF00] transition-transform duration-400 ease-[var(--ease-out)] origin-bottom-right group-hover:-translate-y-1 group-hover:scale-110"
/>
</>
);
export const NumberOne = ({
size = 80,
className = "",
...props
}: NumberIconProps) => (
<svg
width={size}
height={size}
className={`group ${className}`}
role="img"
aria-label="Passo 1"
{...baseProps}
{...props}
>
<GraphicShell />
<text
x="40"
y="54"
fontFamily="Syne, sans-serif"
fontSize="40"
fontWeight="800"
textAnchor="middle"
className="fill-white transition-transform duration-400 ease-[var(--ease-out)] group-hover:-translate-y-0.5"
>
1
</text>
</svg>
);
export const NumberTwo = ({
size = 80,
className = "",
...props
}: NumberIconProps) => (
<svg
width={size}
height={size}
className={`group ${className}`}
role="img"
aria-label="Passo 2"
{...baseProps}
{...props}
>
<GraphicShell />
<text
x="40"
y="54"
fontFamily="Syne, sans-serif"
fontSize="40"
fontWeight="800"
textAnchor="middle"
className="fill-white transition-transform duration-400 ease-[var(--ease-out)] group-hover:-translate-y-0.5"
>
2
</text>
</svg>
);
export const NumberThree = ({
size = 80,
className = "",
...props
}: NumberIconProps) => (
<svg
width={size}
height={size}
className={`group ${className}`}
role="img"
aria-label="Passo 3"
{...baseProps}
{...props}
>
<GraphicShell />
<text
x="40"
y="54"
fontFamily="Syne, sans-serif"
fontSize="40"
fontWeight="800"
textAnchor="middle"
className="fill-white transition-transform duration-400 ease-[var(--ease-out)] group-hover:-translate-y-0.5"
>
3
</text>
</svg>
);
export const NumberFour = ({
size = 80,
className = "",
...props
}: NumberIconProps) => (
<svg
width={size}
height={size}
className={`group ${className}`}
role="img"
aria-label="Passo 4"
{...baseProps}
{...props}
>
<GraphicShell />
<text
x="40"
y="54"
fontFamily="Syne, sans-serif"
fontSize="40"
fontWeight="800"
textAnchor="middle"
className="fill-white transition-transform duration-400 ease-[var(--ease-out)] group-hover:-translate-y-0.5"
>
4
</text>
</svg>
);
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

-466
View File
@@ -1,466 +0,0 @@
@import url("https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=Geist+Mono:wght@300;400;500;600&display=swap");
@font-face {
font-family: "Monument Extended";
src: url("/fonts/MonumentExtended-Regular.otf") format("opentype");
font-weight: 400;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: "Monument Extended";
src: url("/fonts/MonumentExtended-Ultrabold.otf") format("opentype");
font-weight: 800;
font-style: normal;
font-display: swap;
}
@tailwind base;
@tailwind components;
@tailwind utilities;
@theme {
--spacing-sp-1: var(--sp-1);
--spacing-sp-2: var(--sp-2);
--spacing-sp-3: var(--sp-3);
--spacing-sp-4: var(--sp-4);
--spacing-sp-5: var(--sp-5);
--spacing-sp-6: var(--sp-6);
--spacing-sp-8: var(--sp-8);
--spacing-sp-10: var(--sp-10);
--spacing-sp-12: var(--sp-12);
--spacing-sp-16: var(--sp-16);
--spacing-sp-20: var(--sp-20);
--spacing-sp-24: var(--sp-24);
}
:root {
--ink: #0a0a0a;
--ink-80: rgba(10, 10, 10, 0.8);
--ink-40: rgba(10, 10, 10, 0.4);
--ink-12: rgba(10, 10, 10, 0.12);
--ink-06: rgba(10, 10, 10, 0.06);
--paper: #f4f2ed;
--paper-dark: #eceae4;
--white: #ffffff;
--slash: #ccff00;
--slash-dim: rgba(204, 255, 0, 0.16);
--meta: #777;
--border: rgba(10, 10, 10, 0.1);
--border-light: rgba(10, 10, 10, 0.06);
--sp-1: 4px;
--sp-2: 8px;
--sp-3: 12px;
--sp-4: 16px;
--sp-5: 20px;
--sp-6: 24px;
--sp-8: 32px;
--sp-10: 40px;
--sp-12: 48px;
--sp-16: 64px;
--sp-20: 80px;
--sp-24: 96px;
--r-sm: 4px;
--r-md: 8px;
--r-lg: 16px;
--r-full: 999px;
--font-display: "Syne", sans-serif;
--font-hero: "Monument Extended", sans-serif;
--font-mono: "Geist Mono", monospace;
--ease-out: cubic-bezier(0.16, 1, 0.3, 1);
--ease-in: cubic-bezier(0.4, 0, 1, 1);
}
*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
html {
scroll-behavior: smooth;
}
body {
background: var(--paper);
color: var(--ink);
font-family: var(--font-mono);
font-size: 13px;
line-height: 1.6;
overflow-x: hidden;
}
a {
color: inherit;
}
button,
input,
select,
textarea {
font: inherit;
}
::selection {
background: var(--slash);
color: var(--ink);
}
.bg-grid {
background-image:
linear-gradient(rgba(10, 10, 10, 0.03) 1px, transparent 1px),
linear-gradient(90deg, rgba(10, 10, 10, 0.03) 1px, transparent 1px);
background-size: 48px 48px;
}
.bg-grid-light {
background-image:
linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
background-size: 48px 48px;
}
.ds-main {
/* padding-top: 52px; removed since there is no header now */
}
.ds-section {
padding: var(--sp-20) var(--sp-16);
border-bottom: 1px solid var(--border);
}
.ds-section:nth-of-type(even):not(.ds-section-dark) {
background: var(--paper-dark);
}
.ds-section-dark {
background: var(--ink);
border-bottom-color: rgba(255, 255, 255, 0.06);
color: var(--white);
}
.ds-section-shell,
.ds-loading,
.ds-error {
width: min(1240px, 100%);
margin: 0 auto;
}
.ds-section-header {
display: flex;
justify-content: space-between;
align-items: flex-start;
gap: var(--sp-8);
margin-bottom: var(--sp-12);
}
.ds-section-meta {
max-width: 700px;
}
.ds-eyebrow,
.ds-kicker {
font-size: 9px;
letter-spacing: 0.16em;
text-transform: uppercase;
color: var(--meta);
}
.ds-eyebrow {
margin-bottom: var(--sp-2);
}
.ds-section-title {
font-family: var(--font-display);
font-size: clamp(24px, 4vw, 40px);
line-height: 1.05;
font-weight: 800;
letter-spacing: -0.03em;
}
.ds-section-description {
color: var(--meta);
font-size: 11px;
line-height: 1.8;
}
.ds-grid-2,
.ds-grid-4 {
display: grid;
gap: var(--sp-6);
}
.ds-grid-2 {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.ds-grid-4 {
grid-template-columns: repeat(4, minmax(0, 1fr));
}
.ds-card,
.ds-panel {
border: 1px solid var(--border);
min-width: 0;
height: 100%;
}
.ds-card {
background: rgba(255, 255, 255, 0.55);
padding: var(--sp-6);
display: flex;
flex-direction: column;
}
.ds-panel {
background: rgba(10, 10, 10, 0.02);
padding: var(--sp-5);
display: flex;
flex-direction: column;
}
.ds-card-title {
font-family: var(--font-display);
font-size: clamp(18px, 2.4vw, 28px);
line-height: 1.1;
letter-spacing: -0.02em;
margin-top: var(--sp-3);
}
.ds-copy {
margin-top: var(--sp-4);
color: var(--ink-80);
font-size: 12px;
line-height: 1.8;
flex-grow: 1;
}
.ds-tags {
display: flex;
flex-wrap: wrap;
gap: var(--sp-3);
list-style: none;
margin-top: auto;
padding-top: var(--sp-8);
}
.ds-tag {
padding: 8px 12px;
border: 1px solid var(--border);
background: rgba(10, 10, 10, 0.03);
font-size: 10px;
letter-spacing: 0.12em;
text-transform: uppercase;
font-weight: 500;
}
.ds-metric {
display: inline-flex;
align-items: center;
gap: var(--sp-2);
color: var(--meta);
font-size: 10px;
letter-spacing: 0.1em;
text-transform: uppercase;
}
.ds-link {
display: inline-flex;
align-items: center;
gap: var(--sp-2);
text-decoration: none;
font-size: 10px;
letter-spacing: 0.12em;
text-transform: uppercase;
transition:
transform 0.2s ease,
background 0.2s ease,
border-color 0.2s ease;
}
.ds-link:hover {
transform: translateY(-1px);
}
.ds-link-accent {
color: var(--ink);
background: var(--slash);
padding: 12px 18px;
}
.ds-link-muted {
padding: 12px 18px;
border: 1px solid var(--border);
}
.ds-list {
margin-top: var(--sp-6);
padding-left: var(--sp-5);
font-size: 12px;
line-height: 1.8;
flex-grow: 1;
}
.ds-list li::marker {
color: var(--slash);
}
.ds-loading,
.ds-error {
padding: var(--sp-10) var(--sp-16);
font-size: 11px;
letter-spacing: 0.14em;
text-transform: uppercase;
}
.ds-section-dark .ds-eyebrow,
.ds-section-dark .ds-kicker,
.ds-section-dark .ds-metric {
color: rgba(255, 255, 255, 0.3);
}
.ds-section-dark .ds-section-description {
color: rgba(255, 255, 255, 0.38);
}
.ds-section-dark .ds-card,
.ds-section-dark .ds-panel {
background: rgba(255, 255, 255, 0.02);
border-color: rgba(255, 255, 255, 0.08);
}
.ds-section-dark .ds-copy,
.ds-section-dark .ds-list {
color: rgba(255, 255, 255, 0.68);
}
.ds-section-dark .ds-tag {
border-color: rgba(255, 255, 255, 0.1);
background: rgba(255, 255, 255, 0.04);
}
.ds-section-dark .ds-link-muted {
border-color: rgba(255, 255, 255, 0.12);
}
.ds-draw-line {
display: block;
width: 100%;
height: 1px;
margin-top: var(--sp-5);
background: linear-gradient(
90deg,
rgba(10, 10, 10, 0.55) 0%,
rgba(10, 10, 10, 0.08) 100%
);
}
.ds-section-dark .ds-draw-line {
background: linear-gradient(
90deg,
rgba(204, 255, 0, 0.75) 0%,
rgba(204, 255, 0, 0.1) 100%
);
}
@keyframes ds-shimmer {
0% {
background-position: 200% 0;
}
100% {
background-position: -200% 0;
}
}
@keyframes marquee {
0% {
transform: translateX(0);
}
100% {
transform: translateX(-50%);
}
}
@keyframes marquee-reverse {
0% {
transform: translateX(-50%);
}
100% {
transform: translateX(0);
}
}
.animate-marquee {
animation: marquee 40s linear infinite;
}
.animate-marquee-reverse {
animation: marquee-reverse 45s linear infinite;
}
.ds-skeleton-card {
display: flex;
flex-direction: column;
gap: var(--sp-3);
}
.ds-skeleton {
position: relative;
overflow: hidden;
border-radius: 4px;
background: #111;
}
.ds-skeleton::before {
content: "";
position: absolute;
inset: 0;
background: linear-gradient(90deg, #111 0%, #1f1f1f 50%, #111 100%);
background-size: 220% 100%;
animation: ds-shimmer 1.4s linear infinite;
}
.ds-skeleton-kicker {
height: 10px;
width: 30%;
}
.ds-skeleton-title {
height: 26px;
width: 72%;
}
.ds-skeleton-line {
height: 12px;
width: 100%;
}
.ds-skeleton-line-short {
width: 62%;
}
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
scroll-behavior: auto !important;
}
}
@media (max-width: 1024px) {
.ds-section {
padding: var(--sp-16) var(--sp-6);
}
.ds-section-header,
.ds-grid-2,
.ds-grid-4 {
grid-template-columns: 1fr;
}
}
-49
View File
@@ -1,49 +0,0 @@
import { renderHook } from "@testing-library/react";
import { useReducedMotion } from "./useReducedMotion";
// Mock do Framer Motion
jest.mock("framer-motion", () => ({
useReducedMotion: jest.fn(),
}));
describe("useReducedMotion", () => {
it("deve retornar false quando prefers-reduced-motion não está ativo", () => {
const { useReducedMotion: mockUseReducedMotion } =
jest.requireMock("framer-motion");
mockUseReducedMotion.mockReturnValue(false);
const { result } = renderHook(() => useReducedMotion());
expect(result.current).toBe(false);
});
it("deve retornar true quando prefers-reduced-motion está ativo", () => {
const { useReducedMotion: mockUseReducedMotion } =
jest.requireMock("framer-motion");
mockUseReducedMotion.mockReturnValue(true);
const { result } = renderHook(() => useReducedMotion());
expect(result.current).toBe(true);
});
it("deve retornar false quando o hook do Framer Motion retorna null", () => {
const { useReducedMotion: mockUseReducedMotion } =
jest.requireMock("framer-motion");
mockUseReducedMotion.mockReturnValue(null);
const { result } = renderHook(() => useReducedMotion());
expect(result.current).toBe(false);
});
it("deve retornar false quando o hook do Framer Motion retorna undefined", () => {
const { useReducedMotion: mockUseReducedMotion } =
jest.requireMock("framer-motion");
mockUseReducedMotion.mockReturnValue(undefined);
const { result } = renderHook(() => useReducedMotion());
expect(result.current).toBe(false);
});
});
-24
View File
@@ -1,24 +0,0 @@
"use client";
import { useReducedMotion as useFramerReducedMotion } from "framer-motion";
/**
* Hook que detecta a preferência prefers-reduced-motion do sistema operacional.
* Wrapper sobre o hook useReducedMotion do Framer Motion.
*
* @returns {boolean} true se prefers-reduced-motion está ativo, false caso contrário
*
* @example
* ```tsx
* const reducedMotion = useReducedMotion();
*
* return (
* <motion.div
* animate={{ opacity: 1, y: reducedMotion ? 0 : 20 }}
* />
* );
* ```
*/
export function useReducedMotion(): boolean {
return useFramerReducedMotion() ?? false;
}
-56
View File
@@ -1,56 +0,0 @@
"use client";
import { useEffect, useRef } from "react";
import { gsap } from "gsap";
import { ScrollTrigger } from "gsap/ScrollTrigger";
export function useScrollReveal(options?: {
y?: number;
duration?: number;
delay?: number;
ease?: string;
start?: string;
end?: string;
scrub?: boolean | number;
}) {
const ref = useRef<HTMLElement>(null);
useEffect(() => {
if (!ref.current) return;
// Lazy registration to avoid Next.js hydration mismatch issues
gsap.registerPlugin(ScrollTrigger);
const ctx = gsap.context(() => {
gsap.fromTo(
ref.current,
{ y: options?.y ?? 60, opacity: 0 },
{
y: 0,
opacity: 1,
duration: options?.duration ?? 0.9,
delay: options?.delay ?? 0,
ease: options?.ease ?? "power3.out",
scrollTrigger: {
trigger: ref.current,
start: options?.start ?? "top 85%",
end: options?.end ?? "top 50%",
scrub: options?.scrub ?? false,
},
},
);
}, ref);
return () => ctx.revert();
}, [
options?.y,
options?.duration,
options?.delay,
options?.ease,
options?.start,
options?.end,
options?.scrub,
]);
return ref;
}
-8
View File
@@ -1,8 +0,0 @@
<svg version="1.2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="1024" height="1024">
<defs>
<image width="978" height="981" id="img1" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA9IAAAPVCAYAAACKltJmAAAAAXNSR0IB2cksfwAEfEJJREFUeJzsvXm0Jkd1Jxj5vVf1ql5tUpV2CUlVkkAyCNk0NqoqYQw2Mw2a6WamZzxeMCCVBO0+42PPZp85Ph77jGfc03+224dxj+0zAwZj9+nFxjYYA8YsAiQWIwHaN1Sral9e1au35mRkZmRGRN5YMyK/zO+7Pykrv5cZcSMyMpb7i3sjMiEIBALRExw48MA/zU7vT5Lkv9q8eTOhx9zcHJmZmSGzs7Mku07SNM3Djkaj/O/iWpJfY3/TYz1dz440D7++vl7FY2B/s3OSitdllElU4YSwSZ54I35SXuPBXxPCAumzsGl+pHVSJBHuF7fS8lzklS+L8kmJ/GQJ/Khg/qpyouU+KssYKFcxX3WeoGcR4lRPpS5X+V1VYcvnJWX9YMeIlQFJRJl5BPWzcleztAyFJMgQ62Hzfv0mmFRVfSCa+6r3lkpJlrkpi7HOU94uoHcgXRLaU/au2fumdWA0Sqp3IzwbyyNQB6D3Wgso/0nFvPI5rWSTug3w9SKX2Sx2I7TlatG2Vc9enQG58rsqBTTaC8nLgjTLS4EkkfJSlVaiLNc6/TIPpH4HNn2Hqb1CKNrmKI8itG1DexCyK5U7X1Z8PyA8t6HPFZ6Ry0sCPFf9jkijjlR1lt1OxarJ1xFZJj/OVeeqOTXroPx8pvpoKmvbcQsKV1xX10EoP7q0qjSBoFTeCHivVRzCjZtcuZrqJjgGK8onSZvX+LzyZcAuC/WmHItUY0adJsn7XL5PHo1myEwyI+hCqryy/nt1dZVcvnyZLC0tZedFcnnpMlnMzouLxbGysvJcFvwj9PhP/+HPDykzhKjgMeQgEAhEHCCRRiItpItEGok0Emkk0gogkUYijUQaifS4gUQagUBExa/92q9ty07X0CPD6LrrriPXX389/YNce+21ZNu2bTlRpscnP/kXbz148OC7Ll68+OOUQM/NbSQbNmyo7hddljgwFoMjIYSISkVOoEvCAA2caaW0Mm2KNO/XYqWbUjimwBFRZJOvSRc06WuSrIhRMwAXKjCRFuSO1MpyUoap8iQpXVBeeMInpMuIUVrG0JUXH7Z87yPSVE64qgI8MCQ4Nb6bxpNoFCJB0eb0qSqJZsGA9+UUVFnk64pAosBnJVIVEol0RUxKhU4gd/w7atRxUtUD+dl0aYuX0ur1NJ5dniSxRiqUKxhTkMlNgFT/ply1SevHTzjiAKYM56dRBoqJHzCb+Q++fRS5qYiMJEvIAzeRUaXNCW6GpbcYYWpkoup3VXlNEp5aNJV/E4mW43CR8wQEctrod/kOXJ9Go/9o1GOxnJjMVKor0CQVO0NEmqXF95RQVtmzsTM/rlXtRZ6IabwvxTUpjTqccoBj01uC2Lp/b05MQHAh0onQOfKpSpeTpGqtaTkuaV+93I9J1xL+mpRnmEgT+PmTOm+qybKqPym7XNZ2KIEe0cmoZMTVp2ZXy/JBD0qkM7JMlpeXi2NliSxlZ0qsl7MjE3vwql1X/8299+799J7dtx2/cOECWVhYIOfOnSXnz58jp06dIocPHyaHDh2ixPt8Jvo4Pf7oj/7IepScNCCRRiAQUZER6d3ZaS89MvI8pyPSR48eueX48eOvzTrvW2dmZsns7Ew+61rMxI5qfpbWA0oNcZBK2UBZDZiikgpd00FQDZiuypPESuEuBmpOpxR+cMGs8lAQ4bQKlkj36myJJFq+ryNaPIwKLK+MCwRXvA0lWj2LUrSkQPOFRYhYrnx+K0WEFQMrrEQxyEGC6P/ixcS2clR50SuIXFJEramJOVDeNwUtLzYuc4pnU/8UyQx/Fi2/7HqDPXBEUsquioAAeQAnP4S/gEmXSi4ossmxhWorymxAJhygnFS43yQf+jyC4UiT0OqRAr+Txr8qgay/FNK1Sqv4OyVineC9aGQoW6bBMgqFkwQT1hHwIXjCBbY8eULQkLa+jhZ/i0Qalm8zaQDQQiKMd+KfEpHi6rYw7jTbqdB2QUCstdlHQdUeet8uVu48TIO0Kx+aQLPECanHnzq4rjGq+l+uNQETEGn5t1CXpRw3nlNf8PV8TcLJSWpPk1qmOEnK60z0YJbptbW18lglq+VvSrJnZ2bPXblz53M3XH/js5m8iwYiTa3XX82Or2VEel2Z+QkHEmkEAhEVGZH+0ez03uz4hYw8b9ER6QyjbPAZZR39yIaQBIVmRr4RFHCd07kkqp7FpEB5uf0GKDdjWnCsgp8qLDidv08teDWXQSaG0wfTu2r7LmPVBZ98m+q4T/ohZLUDVK8hJNKZk+BEpJttSJ6MglPRSO1lf2EGRKTZGSLSFC7PONRycQE0QSHcNwvg5ufs2kFz8tQRCiItTxgz0h3//aXSWc6Fvo/Mzun6evZ/hkuXFlMDkf5KFuWP6ZER6bUIDzMITG6LRCAQneCXf/mXr85Ou+lxyy23jPbs2UNuvvlmctVVV+XHwYMHb3vppZd+/OzZsz+ekea5K664guzYsaM6Nm3alLsolUR6PLA11xI9+dVZF0B3NRORLiIaZbpYU0zgrVIqecpcQ5Yag3LUPVSKBhJpCqMy20Kht7U2+spUyR0HkW4jzx+2RJoCru/jJtIsD/3qM8yASl2wyLbso6edSNuQaIbEtGapDjl4Ig33PfqJYlP/Xlis18nS0nK+npqtn15cvJSR6gvk9OnT+ZHpbE9fd911X3rLW97ypSNHjqy/8sor5MSJE4uZmJey48X3vve9F8I8Zb8xuS0SgUB0goxIvz47/VR2vDMj0rMykc465h3nzp27cWFh4YYNGzbMFGuf58jGjRvzg20iJiu5rciga3zmCiUNitWfBgWch8sGLtWaU8DxMncNM6Rhs45QlXYjL2LGtHEd5h16iOES6T5ZhF1dYeUwofJi0wZsJ7Fi5KVb4tOeSLdLKwyRNqbcY6INWaYLEuU3iSS3E9c6FqqsXNprDNIfi0i71E7wuVSu3UQk00VKXfQv8PiWMn9zME4znWI99Vp5rBYu4Pn66uVqs7KMSJ/ZunXr4e3btx85dOhQWhLpU5mIz2bH5zIiPRWblfWzJ0IgEL3Eb/zGb2zOTpu3bdu28Q1veAOhx6c//ekfO378+E8vLy//9E033bSBkujsTHbu3Jkf1OLsgrZWK6/4uU7YHKSqnbotyLHrTqi8ezij0Y0hUZF9VyINpS8DItIu1oHhDCZIpLtw/4fCRfGg6BGRjinXMnVi69IqnkOlFZ9Ix/BqCAmdtw6FD4mW47Vpe75wkVX3M/m/rdKtZBoDxCXSyufXEOnid1kWrWm0S9+iaJupLo4qTVLu/cHeZ50XttaaEuwjR47kLt+nTp06tnHjxn939dVX/7sbb7zxhaeffprQIwt3OYu2+Cu/8itL1okPBP3rhRAIRG+REek3ZKc3ZET6FkakFxcXbz127Nibzp87/4+uuPKKmZ1X7iTUfXt+yzzZsmVLvuu2K0IQBneLNPejNCOkijyAm820ItJNi7SKRPOyQhLpXF6dOW2cYRNpCvtyKzD+pwtJPkPBpf6ZENqt2ka268ZWtnkcH9lTEWkoD63VeiCtgphAV0Ohj+1ABlgjHccHPowPSY49WaWW59InWLYnq0BjItJQWE1qbWH3XnXP75YLPjk5KbZxGT3OnTtHzp49m+/knel939q1a9e3FhYWTnJE+uksynczIv2iUwYGgP71QAgEorfIiDT9zvN7MiL9Fkaks9/zq6urO9ZW13ZkpDmhxDn/ZNVssYGY7Lbtgs7XhaWSO1YAFzymCLm4h5tgS6TlPFmT6chE2sU9Pi7SSlEokrSbxXdRLFV12FbZluVA9SkUfKypqnfpswFYWw8UFUKSiH67f6vILX9W58ltwkFNpNldE3lsyjTDFF/Z3sbozQGVRcz23MX6f7V8lcdPI4Z0NqSvyn/jvbCvC9hMpo+fSMepl/K4Fmc85esw+6xWRphXZ2dnz2bHuePHjy9zRPrTWdA/z4j0l6NkZoxAIo1AILQ4fPjg9ux0FT2+/vVH333u3Pn7M6L8ZroW+rbbbss3DJvNP1U124hbuTUNhUi3SNfWIh3Ciucii7douFrUYq2P7g+Rlt0Qm/lK02bZwYpq/q8cGybi6sw0wsppxiLSundiY61VXXedYHB9LiTSgnTSFyKtkjsOIj2W5UIKGbGJtKo9dEukXSzC/FmTvgeRpmL1DtXdEWml/T7SBM84dSd20B2+X3755fyYmZn53Pbt2//69ttv/2IW7CQ9Mh1ysdPMRQISaQQCoUVGpF+bnd6SHfeeP3/hdYuLi3cmyehGfg30KBnlO2+DGHMvY3Lz1t3XDVJW1l1LRdIWshLmQqjbKJBWJJCl4yDXN186uX7yVFYUWNFrkiuTfNkaXRLsRL4Lq322yrFuTaUtGfYvwzrdkJNFujxB6UATRy7PJIeN4UocbyLJj0gbpXoSaXeZdnHkd+zi5uzTl+vqgG97URHpkKRfh7aTF2p59kS6EGue5NVJA6YupTwkfGJSWmV95RNQ8nX7fsCFSCtltOyHQ8K1/2TnS5cu8Tt8P79hw4an5+bmvp/dfjQ7vp4R6aPxct0d+vGWEAhEb5ER6bdmp5+nx6ZNmzfMzW2a3bhx4wwlzvTQzvj2gETn2XAkyvJ9PkxXio4MH6tLDEtMoaKU6StesCmlGES6vUx7YuBGLPhzGSpNG94aRUp2ZFFIwWDhciEZba0YbSeM+PRN+VeRaD6cauLJlL4qrdjutzzC1mH+7CE1ApHm5foSaZ867vNemYVNVa9cnsHmWXy8iGS5NvAl0/rndyPS9LB5VpVEFZFOq23vuLw2ypWSaCBN4JLLe2lLpGNNNPvAyRIvhaVrp4sdv9foTt+ri4uLq0tLS8ey2x+nR0akn4Line truncated
</defs>
<style>
</style>
<use id="Background" href="#img1" x="13" y="21"/>
</svg>

Before

Width:  |  Height:  |  Size: 383 KiB

-148
View File
@@ -1,148 +0,0 @@
import type { Metadata, Viewport } from "next";
import type { ReactNode } from "react";
import GoogleAnalytics from "./components/GoogleAnalytics";
import { RouteTransition } from "./components/RouteTransition";
import { SmoothScrollProvider } from "./providers/SmoothScrollProvider";
import { AnimationProvider } from "./providers/AnimationProvider";
import "./globals.css";
export const metadata: Metadata = {
title:
"Evandro Fonseca Junior | Engenheiro de Software (Next.js, Tauri & Rust)",
description:
"Engenheiro Full-Stack especializado em aplicacoes de alta performance e sistemas criticos. Desenvolvimento com Next.js, React, Tauri e arquitetura escalavel.",
keywords: [
"engenheiro full-stack",
"engenheiro de software",
"Next.js",
"React",
"Tauri",
"Rust",
"Python",
"TypeScript",
"PostgreSQL",
"MySQL",
"cloud computing",
"IoT",
"automacao",
"arquitetura de software",
"sistemas escalaveis",
"high performance",
],
authors: [{ name: "Evandro Fonseca Junior" }],
creator: "Evandro Fonseca Junior",
publisher: "Evandro Fonseca Junior",
formatDetection: {
email: false,
address: false,
telephone: false,
},
metadataBase: new URL("https://evandro.dev.br"),
alternates: {
canonical: "/",
},
openGraph: {
title:
"Evandro Fonseca Junior | Engenheiro de Software (Next.js, Tauri & Rust)",
description:
"Engenheiro Full-Stack especializado em aplicacoes de alta performance e sistemas criticos. Desenvolvimento com Next.js, React, Tauri e arquitetura escalavel.",
url: "https://evandro.dev.br",
siteName: "Evandro Fonseca Junior",
locale: "pt_BR",
type: "website",
images: [
{
url: "/opengraph-image",
width: 1200,
height: 630,
alt: "Evandro Fonseca Junior - Engenheiro de Software",
},
],
},
twitter: {
card: "summary_large_image",
title:
"Evandro Fonseca Junior | Engenheiro de Software (Next.js, Tauri & Rust)",
description:
"Engenheiro Full-Stack especializado em aplicacoes de alta performance e sistemas criticos.",
creator: "@evandrodevbr",
images: ["/opengraph-image"],
},
robots: {
index: true,
follow: true,
googleBot: {
index: true,
follow: true,
"max-video-preview": -1,
"max-image-preview": "large",
"max-snippet": -1,
},
},
};
export const viewport: Viewport = {
themeColor: "#000000",
width: "device-width",
initialScale: 1,
maximumScale: 5,
};
interface RootLayoutProps {
children: ReactNode;
}
export default function RootLayout({ children }: Readonly<RootLayoutProps>) {
const jsonLd = {
"@context": "https://schema.org",
"@type": "ProfilePage",
mainEntity: {
"@type": "Person",
name: "Evandro Fonseca Junior",
alternateName: "Evandro.dev",
jobTitle: "Engenheiro de Software",
url: "https://evandro.dev.br",
sameAs: [
"https://github.com/evandrodevbr",
"https://www.linkedin.com/in/evandro-fonseca-junior-0969aa1b0/",
],
knowsAbout: [
"Software Engineering",
"Next.js",
"React",
"Tauri",
"Rust",
"TypeScript",
"System Architecture",
"Cloud Computing",
"IoT",
],
worksFor: {
"@type": "Organization",
name: "Freelancer / Consultor Independente",
},
description:
"Engenheiro de software especializado em aplicacoes de alta performance e sistemas criticos. Desenvolvimento com Next.js 15, React 19, Tauri e arquitetura escalavel.",
},
};
return (
<html lang="pt-BR">
<head>
<link rel="canonical" href="https://evandro.dev.br" />
</head>
<body>
<SmoothScrollProvider>
<AnimationProvider>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
/>
<RouteTransition>{children}</RouteTransition>
<GoogleAnalytics />
</AnimationProvider>
</SmoothScrollProvider>
</body>
</html>
);
}
-70
View File
@@ -1,70 +0,0 @@
/**
* Animation Configuration
* Centralized configuration for all animations in the portfolio
*/
export const animationConfig = {
// Easing curves
easings: {
easeOut: "cubic-bezier(0.16, 1, 0.3, 1)",
easeIn: "cubic-bezier(0.4, 0, 1, 1)",
spring: {
default: { stiffness: 200, damping: 20 },
hover: { stiffness: 260, damping: 20 },
magnetic: { stiffness: 150, damping: 15 },
gentle: { stiffness: 60, damping: 20 },
},
},
// Durations (in seconds)
durations: {
instant: 0.15,
fast: 0.3,
normal: 0.6,
slow: 0.9,
verySlow: 1.2,
},
// Scroll trigger
scrollTrigger: {
threshold: 0.2,
once: true,
margin: "0px",
},
// Stagger
stagger: {
default: 0.08,
fast: 0.04,
slow: 0.12,
reducedMotion: 0.03,
},
// Parallax
parallax: {
speed: 0.5, // 50% mais lento que scroll normal
maxDistance: 100, // pixels
},
// Magnetic effect
magnetic: {
radius: 80, // pixels
strength: 12, // max movement in pixels
},
// Cursor
cursor: {
size: 40,
expandedSize: 60,
followDelay: 0.1,
},
// Reduced motion overrides
reducedMotion: {
duration: 0.15,
stagger: 0.03,
disableParallax: true,
disableMagnetic: true,
disableCursor: true,
},
} as const;
-98
View File
@@ -1,98 +0,0 @@
/**
* Animation Variants
* Preset variants for Framer Motion animations
*/
export const variants = {
// Fade in
fadeIn: {
initial: { opacity: 0 },
animate: { opacity: 1 },
exit: { opacity: 0 },
},
// Fade in + slide up
fadeInUp: {
initial: { opacity: 0, y: 24, filter: "blur(8px)" },
animate: { opacity: 1, y: 0, filter: "blur(0px)" },
exit: { opacity: 0, y: -24, filter: "blur(8px)" },
},
// Fade in + slide down
fadeInDown: {
initial: { opacity: 0, y: -24, filter: "blur(8px)" },
animate: { opacity: 1, y: 0, filter: "blur(0px)" },
exit: { opacity: 0, y: 24, filter: "blur(8px)" },
},
// Fade in + slide left
fadeInLeft: {
initial: { opacity: 0, x: 24, filter: "blur(8px)" },
animate: { opacity: 1, x: 0, filter: "blur(0px)" },
exit: { opacity: 0, x: -24, filter: "blur(8px)" },
},
// Fade in + slide right
fadeInRight: {
initial: { opacity: 0, x: -24, filter: "blur(8px)" },
animate: { opacity: 1, x: 0, filter: "blur(0px)" },
exit: { opacity: 0, x: 24, filter: "blur(8px)" },
},
// Scale in
scaleIn: {
initial: { opacity: 0, scale: 0.95 },
animate: { opacity: 1, scale: 1 },
exit: { opacity: 0, scale: 0.95 },
},
// Image reveal
imageReveal: {
initial: {
opacity: 0,
scale: 0.98,
filter: "blur(8px)",
clipPath: "inset(0 100% 0 0)",
},
animate: {
opacity: 1,
scale: 1,
filter: "blur(0px)",
clipPath: "inset(0 0% 0 0)",
},
},
// Text reveal (per word)
textReveal: {
initial: {
opacity: 0,
scale: 0.95,
filter: "blur(6px)",
clipPath: "inset(0 100% 0 0)",
},
animate: {
opacity: 1,
scale: 1,
filter: "blur(0px)",
clipPath: "inset(0 0% 0 0)",
},
},
// Stagger container
staggerContainer: {
animate: {
transition: {
staggerChildren: 0.08,
},
},
},
// Reduced motion variants
reducedMotion: {
fadeIn: {
initial: { opacity: 0 },
animate: { opacity: 1 },
exit: { opacity: 0 },
},
},
} as const;
-30
View File
@@ -1,30 +0,0 @@
import { MetadataRoute } from "next";
export default function manifest(): MetadataRoute.Manifest {
return {
name: "Evandro Fonseca Junior - Portfólio",
short_name: "Evandro.dev",
description:
"Portfólio profissional de Evandro Fonseca Junior, Desenvolvedor Full-Stack",
start_url: "/",
display: "standalone",
background_color: "#000000",
theme_color: "#000000",
orientation: "portrait-primary",
categories: ["portfolio", "developer", "technology"],
lang: "pt-BR",
dir: "ltr",
icons: [
{
src: "/favicon.ico",
sizes: "any",
type: "image/x-icon",
},
{
src: "/icon.svg",
sizes: "any",
type: "image/svg+xml",
},
],
};
}
-40
View File
@@ -1,40 +0,0 @@
import Link from "next/link";
import { Home, ArrowLeft, Code2 } from "lucide-react";
export default function NotFound() {
return (
<div className="min-h-screen bg-[#030712] flex items-center justify-center px-6">
<div className="max-w-2xl mx-auto text-center">
<div className="mb-8">
<Code2 className="w-24 h-24 text-blue-500 mx-auto mb-4 opacity-50" />
<h1 className="text-6xl md:text-8xl font-black text-white mb-4">
404
</h1>
<h2 className="text-2xl md:text-3xl font-bold text-slate-400 mb-4">
Página não encontrada
</h2>
<p className="text-slate-500 mb-8">
A página que você está procurando não existe ou foi movida.
</p>
</div>
<div className="flex flex-col sm:flex-row gap-4 justify-center">
<Link
href="/"
className="px-6 py-3 bg-blue-600 hover:bg-blue-500 text-white rounded-lg font-semibold transition-all flex items-center justify-center gap-2"
>
<Home className="w-5 h-5" />
Voltar para Home
</Link>
<Link
href="/#projects"
className="px-6 py-3 border border-slate-800 hover:border-slate-600 text-slate-400 hover:text-white rounded-lg font-semibold transition-all flex items-center justify-center gap-2"
>
<ArrowLeft className="w-5 h-5" />
Ver Projetos
</Link>
</div>
</div>
</div>
);
}
-49
View File
@@ -1,49 +0,0 @@
import { ImageResponse } from "next/og";
export const runtime = "edge";
export const alt = "Evandro Fonseca Junior - Engenheiro de Software";
export const size = {
width: 1200,
height: 630,
};
export const contentType = "image/png";
export default async function Image() {
return new ImageResponse(
<div
style={{
background: "#030712",
width: "100%",
height: "100%",
display: "flex",
flexDirection: "column",
alignItems: "center",
justifyContent: "center",
color: "white",
fontFamily: "system-ui",
}}
>
<div
style={{
fontSize: 64,
fontWeight: "bold",
marginBottom: 20,
textAlign: "center",
}}
>
Evandro Fonseca Junior
</div>
<div
style={{
fontSize: 32,
color: "#3b82f6",
marginTop: 10,
textAlign: "center",
}}
>
Engenheiro de Software
</div>
</div>,
{ ...size },
);
}
-35
View File
@@ -1,35 +0,0 @@
"use client";
import dynamic from "next/dynamic";
import { Suspense } from "react";
import About from "./components/About";
import Contact from "./components/Contact";
import Experience from "./components/Experience";
import Footer from "./components/Footer";
import Hero from "./components/Hero";
import { SectionLoading } from "./components/SectionLoading";
import Skills from "./components/Skills";
import { WorkModalities } from "./components/WorkModalities";
const Projects = dynamic(() => import("./components/Projects"));
export default function Home() {
return (
<div className="flex min-h-screen flex-col overflow-x-hidden">
<main className="ds-main">
<Hero />
<About />
<Skills />
<Experience />
<Suspense
fallback={<SectionLoading message="Carregando projetos..." />}
>
<Projects />
</Suspense>
<WorkModalities />
<Contact />
</main>
<Footer />
</div>
);
}
-148
View File
@@ -1,148 +0,0 @@
import { render, screen } from "@testing-library/react";
import { AnimationProvider, useAnimationConfig } from "./AnimationProvider";
// Mock do useReducedMotion
jest.mock("@/app/hooks/useReducedMotion", () => ({
useReducedMotion: jest.fn(),
}));
// Test component that uses the hook
function TestComponent() {
const config = useAnimationConfig();
return (
<div>
<div data-testid="reduced-motion">{String(config.reducedMotion)}</div>
<div data-testid="ease-out">{config.easings.easeOut}</div>
<div data-testid="duration-normal">{config.durations.normal}</div>
<div data-testid="spring-default-stiffness">
{config.easings.spring.default.stiffness}
</div>
</div>
);
}
describe("AnimationProvider", () => {
beforeEach(() => {
jest.clearAllMocks();
});
it("provides animation config with reducedMotion false", () => {
const { useReducedMotion } = jest.requireMock(
"@/app/hooks/useReducedMotion",
);
useReducedMotion.mockReturnValue(false);
render(
<AnimationProvider>
<TestComponent />
</AnimationProvider>,
);
expect(screen.getByTestId("reduced-motion")).toHaveTextContent("false");
expect(screen.getByTestId("ease-out")).toHaveTextContent(
"cubic-bezier(0.16, 1, 0.3, 1)",
);
expect(screen.getByTestId("duration-normal")).toHaveTextContent("0.6");
expect(screen.getByTestId("spring-default-stiffness")).toHaveTextContent(
"200",
);
});
it("provides animation config with reducedMotion true", () => {
const { useReducedMotion } = jest.requireMock(
"@/app/hooks/useReducedMotion",
);
useReducedMotion.mockReturnValue(true);
render(
<AnimationProvider>
<TestComponent />
</AnimationProvider>,
);
expect(screen.getByTestId("reduced-motion")).toHaveTextContent("true");
});
it("provides all easing configurations", () => {
const { useReducedMotion } = jest.requireMock(
"@/app/hooks/useReducedMotion",
);
useReducedMotion.mockReturnValue(false);
render(
<AnimationProvider>
<TestComponent />
</AnimationProvider>,
);
const config = screen.getByTestId("ease-out").textContent;
expect(config).toBe("cubic-bezier(0.16, 1, 0.3, 1)");
});
it("provides all duration configurations", () => {
const { useReducedMotion } = jest.requireMock(
"@/app/hooks/useReducedMotion",
);
useReducedMotion.mockReturnValue(false);
render(
<AnimationProvider>
<TestComponent />
</AnimationProvider>,
);
const duration = screen.getByTestId("duration-normal").textContent;
expect(duration).toBe("0.6");
});
it("throws error when useAnimationConfig is used outside provider", () => {
// Suppress console.error for this test
const consoleError = jest
.spyOn(console, "error")
.mockImplementation(() => {});
expect(() => {
render(<TestComponent />);
}).toThrow("useAnimationConfig must be used within AnimationProvider");
consoleError.mockRestore();
});
});
describe("useAnimationConfig", () => {
it("returns config object with correct structure", () => {
const { useReducedMotion } = jest.requireMock(
"@/app/hooks/useReducedMotion",
);
useReducedMotion.mockReturnValue(false);
function ConfigStructureTest() {
const config = useAnimationConfig();
return (
<div>
<div data-testid="has-reduced-motion">
{String("reducedMotion" in config)}
</div>
<div data-testid="has-easings">{String("easings" in config)}</div>
<div data-testid="has-durations">{String("durations" in config)}</div>
<div data-testid="has-spring">
{String("spring" in config.easings)}
</div>
</div>
);
}
render(
<AnimationProvider>
<ConfigStructureTest />
</AnimationProvider>,
);
expect(screen.getByTestId("has-reduced-motion")).toHaveTextContent("true");
expect(screen.getByTestId("has-easings")).toHaveTextContent("true");
expect(screen.getByTestId("has-durations")).toHaveTextContent("true");
expect(screen.getByTestId("has-spring")).toHaveTextContent("true");
});
});
-93
View File
@@ -1,93 +0,0 @@
"use client";
import { createContext, useContext, type ReactNode } from "react";
import { useReducedMotion } from "@/app/hooks/useReducedMotion";
import { animationConfig } from "@/app/lib/animations/config";
/**
* Animation Configuration Context
* Provides global animation settings including reduced motion detection
*/
interface AnimationConfig {
reducedMotion: boolean;
easings: typeof animationConfig.easings;
durations: typeof animationConfig.durations;
}
const AnimationContext = createContext<AnimationConfig | undefined>(undefined);
interface AnimationProviderProps {
children: ReactNode;
}
/**
* AnimationProvider
*
* Provider component that supplies global animation configuration through React context.
* Automatically detects user's reduced motion preference and provides centralized
* animation settings (easings, durations) to all child components.
*
* @example
* ```tsx
* // In app/layout.tsx
* <AnimationProvider>
* <YourApp />
* </AnimationProvider>
* ```
*
* @see useAnimationConfig - Hook to consume this context
*/
export function AnimationProvider({ children }: AnimationProviderProps) {
const reducedMotion = useReducedMotion();
const config: AnimationConfig = {
reducedMotion,
easings: animationConfig.easings,
durations: animationConfig.durations,
};
return (
<AnimationContext.Provider value={config}>
{children}
</AnimationContext.Provider>
);
}
/**
* useAnimationConfig
*
* Hook to access global animation configuration from AnimationProvider context.
* Provides reduced motion state, easing curves, and duration presets.
*
* @returns {AnimationConfig} Animation configuration object
* @throws {Error} If used outside of AnimationProvider
*
* @example
* ```tsx
* function MyComponent() {
* const { reducedMotion, easings, durations } = useAnimationConfig();
*
* return (
* <motion.div
* animate={{
* opacity: 1,
* y: reducedMotion ? 0 : 20
* }}
* transition={{
* duration: durations.normal,
* ease: easings.easeOut
* }}
* />
* );
* }
* ```
*/
export function useAnimationConfig(): AnimationConfig {
const context = useContext(AnimationContext);
if (context === undefined) {
throw new Error("useAnimationConfig must be used within AnimationProvider");
}
return context;
}
-42
View File
@@ -1,42 +0,0 @@
"use client";
import { useEffect, useRef } from "react";
import Lenis from "lenis";
import { gsap } from "gsap";
import { ScrollTrigger } from "gsap/ScrollTrigger";
gsap.registerPlugin(ScrollTrigger);
export function SmoothScrollProvider({
children,
}: {
children: React.ReactNode;
}) {
const lenisRef = useRef<Lenis | null>(null);
useEffect(() => {
const lenis = new Lenis({
duration: 1.2,
easing: (t) => Math.min(1, 1.001 - Math.pow(2, -10 * t)), // Expo ease
smoothWheel: true,
});
lenisRef.current = lenis;
// Sincroniza Lenis com GSAP ScrollTrigger — critico para evitar dessync
lenis.on("scroll", ScrollTrigger.update);
gsap.ticker.add((time) => {
lenis.raf(time * 1000);
});
gsap.ticker.lagSmoothing(0);
return () => {
lenis.destroy();
gsap.ticker.remove((time) => lenis.raf(time * 1000));
};
}, []);
return <>{children}</>;
}
-14
View File
@@ -1,14 +0,0 @@
import { MetadataRoute } from "next";
export default function robots(): MetadataRoute.Robots {
return {
rules: [
{
userAgent: "*",
allow: "/",
disallow: ["/api/", "/_next/", "/admin/"],
},
],
sitemap: "https://evandro.dev.br/sitemap.xml",
};
}
-45
View File
@@ -1,45 +0,0 @@
import { MetadataRoute } from "next";
export default function sitemap(): MetadataRoute.Sitemap {
const baseUrl = "https://evandro.dev.br";
const currentDate = new Date().toISOString();
return [
{
url: baseUrl,
lastModified: currentDate,
changeFrequency: "monthly",
priority: 1.0,
},
{
url: `${baseUrl}/#about`,
lastModified: currentDate,
changeFrequency: "monthly",
priority: 0.8,
},
{
url: `${baseUrl}/#skills`,
lastModified: currentDate,
changeFrequency: "monthly",
priority: 0.8,
},
{
url: `${baseUrl}/#experience`,
lastModified: currentDate,
changeFrequency: "monthly",
priority: 0.8,
},
{
url: `${baseUrl}/#projects`,
lastModified: currentDate,
changeFrequency: "monthly",
priority: 0.8,
},
{
url: `${baseUrl}/#contact`,
lastModified: currentDate,
changeFrequency: "monthly",
priority: 0.8,
},
];
}
-37
View File
@@ -1,37 +0,0 @@
{
"$schema": "https://biomejs.dev/schemas/2.2.0/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"ignoreUnknown": true,
"includes": ["**", "!node_modules", "!.next", "!dist", "!build"]
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"suspicious": {
"noUnknownAtRules": "off"
}
},
"domains": {
"next": "recommended",
"react": "recommended"
}
},
"assist": {
"actions": {
"source": {
"organizeImports": "on"
}
}
}
}
-21
View File
@@ -1,21 +0,0 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": true,
"tsx": true,
"tailwind": {
"config": "",
"css": "app/globals.css",
"baseColor": "neutral",
"cssVariables": true,
"prefix": ""
},
"iconLibrary": "lucide",
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
}
}
-304
View File
@@ -1,304 +0,0 @@
"use client";
import React, { useRef, useEffect, useCallback, useMemo } from "react";
import { gsap } from "gsap";
import { InertiaPlugin } from "gsap/InertiaPlugin";
gsap.registerPlugin(InertiaPlugin);
const throttle = (func: (...args: any[]) => void, limit: number) => {
let lastCall = 0;
return function (this: any, ...args: any[]) {
const now = performance.now();
if (now - lastCall >= limit) {
lastCall = now;
func.apply(this, args);
}
};
};
interface Dot {
cx: number;
cy: number;
xOffset: number;
yOffset: number;
_inertiaApplied: boolean;
}
export interface DotGridProps {
dotSize?: number;
gap?: number;
baseColor?: string;
activeColor?: string;
proximity?: number;
speedTrigger?: number;
shockRadius?: number;
shockStrength?: number;
maxSpeed?: number;
resistance?: number;
returnDuration?: number;
className?: string;
style?: React.CSSProperties;
}
function hexToRgb(hex: string) {
const m = hex.match(/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i);
if (!m) return { r: 0, g: 0, b: 0 };
return {
r: parseInt(m[1], 16),
g: parseInt(m[2], 16),
b: parseInt(m[3], 16),
};
}
const DotGrid: React.FC<DotGridProps> = ({
dotSize = 16,
gap = 32,
baseColor = "#5227FF",
activeColor = "#5227FF",
proximity = 150,
speedTrigger = 100,
shockRadius = 250,
shockStrength = 5,
maxSpeed = 5000,
resistance = 750,
returnDuration = 1.5,
className = "",
style,
}) => {
const wrapperRef = useRef<HTMLDivElement>(null);
const canvasRef = useRef<HTMLCanvasElement>(null);
const dotsRef = useRef<Dot[]>([]);
const pointerRef = useRef({
x: 0,
y: 0,
vx: 0,
vy: 0,
speed: 0,
lastTime: 0,
lastX: 0,
lastY: 0,
});
const baseRgb = useMemo(() => hexToRgb(baseColor), [baseColor]);
const activeRgb = useMemo(() => hexToRgb(activeColor), [activeColor]);
const circlePath = useMemo(() => {
if (typeof window === "undefined" || !window.Path2D) return null;
const p = new Path2D();
p.arc(0, 0, dotSize / 2, 0, Math.PI * 2);
return p;
}, [dotSize]);
const buildGrid = useCallback(() => {
const wrap = wrapperRef.current;
const canvas = canvasRef.current;
if (!wrap || !canvas) return;
const { width, height } = wrap.getBoundingClientRect();
const dpr = window.devicePixelRatio || 1;
canvas.width = width * dpr;
canvas.height = height * dpr;
canvas.style.width = `${width}px`;
canvas.style.height = `${height}px`;
const ctx = canvas.getContext("2d");
if (ctx) ctx.scale(dpr, dpr);
const cols = Math.floor((width + gap) / (dotSize + gap));
const rows = Math.floor((height + gap) / (dotSize + gap));
const cell = dotSize + gap;
const gridW = cell * cols - gap;
const gridH = cell * rows - gap;
const extraX = width - gridW;
const extraY = height - gridH;
const startX = extraX / 2 + dotSize / 2;
const startY = extraY / 2 + dotSize / 2;
const dots: Dot[] = [];
for (let y = 0; y < rows; y++) {
for (let x = 0; x < cols; x++) {
const cx = startX + x * cell;
const cy = startY + y * cell;
dots.push({ cx, cy, xOffset: 0, yOffset: 0, _inertiaApplied: false });
}
}
dotsRef.current = dots;
}, [dotSize, gap]);
useEffect(() => {
if (!circlePath) return;
let rafId: number;
const proxSq = proximity * proximity;
const draw = () => {
const canvas = canvasRef.current;
if (!canvas) return;
const ctx = canvas.getContext("2d");
if (!ctx) return;
ctx.clearRect(0, 0, canvas.width, canvas.height);
const { x: px, y: py } = pointerRef.current;
for (const dot of dotsRef.current) {
const ox = dot.cx + dot.xOffset;
const oy = dot.cy + dot.yOffset;
const dx = dot.cx - px;
const dy = dot.cy - py;
const dsq = dx * dx + dy * dy;
let style = baseColor;
if (dsq <= proxSq) {
const dist = Math.sqrt(dsq);
const t = 1 - dist / proximity;
const r = Math.round(baseRgb.r + (activeRgb.r - baseRgb.r) * t);
const g = Math.round(baseRgb.g + (activeRgb.g - baseRgb.g) * t);
const b = Math.round(baseRgb.b + (activeRgb.b - baseRgb.b) * t);
style = `rgb(${r},${g},${b})`;
}
ctx.save();
ctx.translate(ox, oy);
ctx.fillStyle = style;
ctx.fill(circlePath);
ctx.restore();
}
rafId = requestAnimationFrame(draw);
};
draw();
return () => cancelAnimationFrame(rafId);
}, [proximity, baseColor, activeRgb, baseRgb, circlePath]);
useEffect(() => {
buildGrid();
let ro: ResizeObserver | null = null;
if ("ResizeObserver" in window) {
ro = new ResizeObserver(buildGrid);
wrapperRef.current && ro.observe(wrapperRef.current);
} else {
(window as Window).addEventListener("resize", buildGrid);
}
return () => {
if (ro) ro.disconnect();
else window.removeEventListener("resize", buildGrid);
};
}, [buildGrid]);
useEffect(() => {
const onMove = (e: MouseEvent) => {
const now = performance.now();
const pr = pointerRef.current;
const dt = pr.lastTime ? now - pr.lastTime : 16;
const dx = e.clientX - pr.lastX;
const dy = e.clientY - pr.lastY;
let vx = (dx / dt) * 1000;
let vy = (dy / dt) * 1000;
let speed = Math.hypot(vx, vy);
if (speed > maxSpeed) {
const scale = maxSpeed / speed;
vx *= scale;
vy *= scale;
speed = maxSpeed;
}
pr.lastTime = now;
pr.lastX = e.clientX;
pr.lastY = e.clientY;
pr.vx = vx;
pr.vy = vy;
pr.speed = speed;
const rect = canvasRef.current!.getBoundingClientRect();
pr.x = e.clientX - rect.left;
pr.y = e.clientY - rect.top;
for (const dot of dotsRef.current) {
const dist = Math.hypot(dot.cx - pr.x, dot.cy - pr.y);
if (speed > speedTrigger && dist < proximity && !dot._inertiaApplied) {
dot._inertiaApplied = true;
gsap.killTweensOf(dot);
const pushX = dot.cx - pr.x + vx * 0.005;
const pushY = dot.cy - pr.y + vy * 0.005;
gsap.to(dot, {
inertia: { xOffset: pushX, yOffset: pushY, resistance },
onComplete: () => {
gsap.to(dot, {
xOffset: 0,
yOffset: 0,
duration: returnDuration,
ease: "elastic.out(1,0.75)",
});
dot._inertiaApplied = false;
},
});
}
}
};
const onClick = (e: MouseEvent) => {
const rect = canvasRef.current!.getBoundingClientRect();
const cx = e.clientX - rect.left;
const cy = e.clientY - rect.top;
for (const dot of dotsRef.current) {
const dist = Math.hypot(dot.cx - cx, dot.cy - cy);
if (dist < shockRadius && !dot._inertiaApplied) {
dot._inertiaApplied = true;
gsap.killTweensOf(dot);
const falloff = Math.max(0, 1 - dist / shockRadius);
const pushX = (dot.cx - cx) * shockStrength * falloff;
const pushY = (dot.cy - cy) * shockStrength * falloff;
gsap.to(dot, {
inertia: { xOffset: pushX, yOffset: pushY, resistance },
onComplete: () => {
gsap.to(dot, {
xOffset: 0,
yOffset: 0,
duration: returnDuration,
ease: "elastic.out(1,0.75)",
});
dot._inertiaApplied = false;
},
});
}
}
};
const throttledMove = throttle(onMove, 50);
window.addEventListener("mousemove", throttledMove, { passive: true });
window.addEventListener("click", onClick);
return () => {
window.removeEventListener("mousemove", throttledMove);
window.removeEventListener("click", onClick);
};
}, [
maxSpeed,
speedTrigger,
proximity,
resistance,
returnDuration,
shockRadius,
shockStrength,
]);
return (
<section
className={`p-4 flex items-center justify-center h-full w-full relative ${className}`}
style={style}
>
<div ref={wrapperRef} className="w-full h-full relative">
<canvas
ref={canvasRef}
className="absolute inset-0 w-full h-full pointer-events-none"
/>
</div>
</section>
);
};
export default DotGrid;
-445
View File
@@ -1,445 +0,0 @@
"use client";
import { Renderer, Program, Mesh, Color, Triangle } from "ogl";
import React, { useEffect, useRef, useMemo, useCallback } from "react";
type Vec2 = [number, number];
export interface FaultyTerminalProps
extends React.HTMLAttributes<HTMLDivElement> {
scale?: number;
gridMul?: Vec2;
digitSize?: number;
timeScale?: number;
pause?: boolean;
scanlineIntensity?: number;
glitchAmount?: number;
flickerAmount?: number;
noiseAmp?: number;
chromaticAberration?: number;
dither?: number | boolean;
curvature?: number;
tint?: string;
mouseReact?: boolean;
mouseStrength?: number;
dpr?: number;
pageLoadAnimation?: boolean;
brightness?: number;
}
const vertexShader = `
attribute vec2 position;
attribute vec2 uv;
varying vec2 vUv;
void main() {
vUv = uv;
gl_Position = vec4(position, 0.0, 1.0);
}
`;
const fragmentShader = `
precision mediump float;
varying vec2 vUv;
uniform float iTime;
uniform vec3 iResolution;
uniform float uScale;
uniform vec2 uGridMul;
uniform float uDigitSize;
uniform float uScanlineIntensity;
uniform float uGlitchAmount;
uniform float uFlickerAmount;
uniform float uNoiseAmp;
uniform float uChromaticAberration;
uniform float uDither;
uniform float uCurvature;
uniform vec3 uTint;
uniform vec2 uMouse;
uniform float uMouseStrength;
uniform float uUseMouse;
uniform float uPageLoadProgress;
uniform float uUsePageLoadAnimation;
uniform float uBrightness;
float time;
float hash21(vec2 p){
p = fract(p * 234.56);
p += dot(p, p + 34.56);
return fract(p.x * p.y);
}
float noise(vec2 p)
{
return sin(p.x * 10.0) * sin(p.y * (3.0 + sin(time * 0.090909))) + 0.2;
}
mat2 rotate(float angle)
{
float c = cos(angle);
float s = sin(angle);
return mat2(c, -s, s, c);
}
float fbm(vec2 p)
{
p *= 1.1;
float f = 0.0;
float amp = 0.5 * uNoiseAmp;
mat2 modify0 = rotate(time * 0.02);
f += amp * noise(p);
p = modify0 * p * 2.0;
amp *= 0.454545;
mat2 modify1 = rotate(time * 0.02);
f += amp * noise(p);
p = modify1 * p * 2.0;
amp *= 0.454545;
mat2 modify2 = rotate(time * 0.08);
f += amp * noise(p);
return f;
}
float pattern(vec2 p, out vec2 q, out vec2 r) {
vec2 offset1 = vec2(1.0);
vec2 offset0 = vec2(0.0);
mat2 rot01 = rotate(0.1 * time);
mat2 rot1 = rotate(0.1);
q = vec2(fbm(p + offset1), fbm(rot01 * p + offset1));
r = vec2(fbm(rot1 * q + offset0), fbm(q + offset0));
return fbm(p + r);
}
float digit(vec2 p){
vec2 grid = uGridMul * 15.0;
vec2 s = floor(p * grid) / grid;
p = p * grid;
vec2 q, r;
float intensity = pattern(s * 0.1, q, r) * 1.3 - 0.03;
if(uUseMouse > 0.5){
vec2 mouseWorld = uMouse * uScale;
float distToMouse = distance(s, mouseWorld);
float mouseInfluence = exp(-distToMouse * 8.0) * uMouseStrength * 10.0;
intensity += mouseInfluence;
float ripple = sin(distToMouse * 20.0 - iTime * 5.0) * 0.1 * mouseInfluence;
intensity += ripple;
}
if(uUsePageLoadAnimation > 0.5){
float cellRandom = fract(sin(dot(s, vec2(12.9898, 78.233))) * 43758.5453);
float cellDelay = cellRandom * 0.8;
float cellProgress = clamp((uPageLoadProgress - cellDelay) / 0.2, 0.0, 1.0);
float fadeAlpha = smoothstep(0.0, 1.0, cellProgress);
intensity *= fadeAlpha;
}
p = fract(p);
p *= uDigitSize;
float px5 = p.x * 5.0;
float py5 = (1.0 - p.y) * 5.0;
float x = fract(px5);
float y = fract(py5);
float i = floor(py5) - 2.0;
float j = floor(px5) - 2.0;
float n = i * i + j * j;
float f = n * 0.0625;
float isOn = step(0.1, intensity - f);
float brightness = isOn * (0.2 + y * 0.8) * (0.75 + x * 0.25);
return step(0.0, p.x) * step(p.x, 1.0) * step(0.0, p.y) * step(p.y, 1.0) * brightness;
}
float onOff(float a, float b, float c)
{
return step(c, sin(iTime + a * cos(iTime * b))) * uFlickerAmount;
}
float displace(vec2 look)
{
float y = look.y - mod(iTime * 0.25, 1.0);
float window = 1.0 / (1.0 + 50.0 * y * y);
return sin(look.y * 20.0 + iTime) * 0.0125 * onOff(4.0, 2.0, 0.8) * (1.0 + cos(iTime * 60.0)) * window;
}
vec3 getColor(vec2 p){
float bar = step(mod(p.y + time * 20.0, 1.0), 0.2) * 0.4 + 1.0;
bar *= uScanlineIntensity;
float displacement = displace(p);
p.x += displacement;
if (uGlitchAmount != 1.0) {
float extra = displacement * (uGlitchAmount - 1.0);
p.x += extra;
}
float middle = digit(p);
const float off = 0.002;
float sum = digit(p + vec2(-off, -off)) + digit(p + vec2(0.0, -off)) + digit(p + vec2(off, -off)) +
digit(p + vec2(-off, 0.0)) + digit(p + vec2(0.0, 0.0)) + digit(p + vec2(off, 0.0)) +
digit(p + vec2(-off, off)) + digit(p + vec2(0.0, off)) + digit(p + vec2(off, off));
vec3 baseColor = vec3(0.9) * middle + sum * 0.1 * vec3(1.0) * bar;
return baseColor;
}
vec2 barrel(vec2 uv){
vec2 c = uv * 2.0 - 1.0;
float r2 = dot(c, c);
c *= 1.0 + uCurvature * r2;
return c * 0.5 + 0.5;
}
void main() {
time = iTime * 0.333333;
vec2 uv = vUv;
if(uCurvature != 0.0){
uv = barrel(uv);
}
vec2 p = uv * uScale;
vec3 col = getColor(p);
if(uChromaticAberration != 0.0){
vec2 ca = vec2(uChromaticAberration) / iResolution.xy;
col.r = getColor(p + ca).r;
col.b = getColor(p - ca).b;
}
col *= uTint;
col *= uBrightness;
if(uDither > 0.0){
float rnd = hash21(gl_FragCoord.xy);
col += (rnd - 0.5) * (uDither * 0.003922);
}
gl_FragColor = vec4(col, 1.0);
}
`;
function hexToRgb(hex: string): [number, number, number] {
let h = hex.replace("#", "").trim();
if (h.length === 3)
h = h
.split("")
.map((c) => c + c)
.join("");
const num = parseInt(h, 16);
return [
((num >> 16) & 255) / 255,
((num >> 8) & 255) / 255,
(num & 255) / 255,
];
}
export default function FaultyTerminal({
scale = 1,
gridMul = [2, 1],
digitSize = 1.5,
timeScale = 0.3,
pause = false,
scanlineIntensity = 0.3,
glitchAmount = 1,
flickerAmount = 1,
noiseAmp = 1,
chromaticAberration = 0,
dither = 0,
curvature = 0.2,
tint = "#ffffff",
mouseReact = true,
mouseStrength = 0.2,
dpr = Math.min(window.devicePixelRatio || 1, 2),
pageLoadAnimation = true,
brightness = 1,
className,
style,
...rest
}: FaultyTerminalProps) {
const containerRef = useRef<HTMLDivElement>(null);
const programRef = useRef<Program>(null);
const rendererRef = useRef<Renderer>(null);
const mouseRef = useRef({ x: 0.5, y: 0.5 });
const smoothMouseRef = useRef({ x: 0.5, y: 0.5 });
const frozenTimeRef = useRef(0);
const rafRef = useRef<number>(0);
const loadAnimationStartRef = useRef<number>(0);
const timeOffsetRef = useRef<number>(Math.random() * 100);
const tintVec = useMemo(() => hexToRgb(tint), [tint]);
const ditherValue = useMemo(
() => (typeof dither === "boolean" ? (dither ? 1 : 0) : dither),
[dither],
);
const handleMouseMove = useCallback((e: MouseEvent) => {
const ctn = containerRef.current;
if (!ctn) return;
const rect = ctn.getBoundingClientRect();
const x = (e.clientX - rect.left) / rect.width;
const y = 1 - (e.clientY - rect.top) / rect.height;
mouseRef.current = { x, y };
}, []);
useEffect(() => {
const ctn = containerRef.current;
if (!ctn) return;
const renderer = new Renderer({ dpr });
rendererRef.current = renderer;
const gl = renderer.gl;
gl.clearColor(0, 0, 0, 1);
const geometry = new Triangle(gl);
const program = new Program(gl, {
vertex: vertexShader,
fragment: fragmentShader,
uniforms: {
iTime: { value: 0 },
iResolution: {
value: new Color(
gl.canvas.width,
gl.canvas.height,
gl.canvas.width / gl.canvas.height,
),
},
uScale: { value: scale },
uGridMul: { value: new Float32Array(gridMul) },
uDigitSize: { value: digitSize },
uScanlineIntensity: { value: scanlineIntensity },
uGlitchAmount: { value: glitchAmount },
uFlickerAmount: { value: flickerAmount },
uNoiseAmp: { value: noiseAmp },
uChromaticAberration: { value: chromaticAberration },
uDither: { value: ditherValue },
uCurvature: { value: curvature },
uTint: { value: new Color(tintVec[0], tintVec[1], tintVec[2]) },
uMouse: {
value: new Float32Array([
smoothMouseRef.current.x,
smoothMouseRef.current.y,
]),
},
uMouseStrength: { value: mouseStrength },
uUseMouse: { value: mouseReact ? 1 : 0 },
uPageLoadProgress: { value: pageLoadAnimation ? 0 : 1 },
uUsePageLoadAnimation: { value: pageLoadAnimation ? 1 : 0 },
uBrightness: { value: brightness },
},
});
programRef.current = program;
const mesh = new Mesh(gl, { geometry, program });
function resize() {
if (!ctn || !renderer) return;
renderer.setSize(ctn.offsetWidth, ctn.offsetHeight);
program.uniforms.iResolution.value = new Color(
gl.canvas.width,
gl.canvas.height,
gl.canvas.width / gl.canvas.height,
);
}
const resizeObserver = new ResizeObserver(() => resize());
resizeObserver.observe(ctn);
resize();
const update = (t: number) => {
rafRef.current = requestAnimationFrame(update);
if (pageLoadAnimation && loadAnimationStartRef.current === 0) {
loadAnimationStartRef.current = t;
}
if (!pause) {
const elapsed = (t * 0.001 + timeOffsetRef.current) * timeScale;
program.uniforms.iTime.value = elapsed;
frozenTimeRef.current = elapsed;
} else {
program.uniforms.iTime.value = frozenTimeRef.current;
}
if (pageLoadAnimation && loadAnimationStartRef.current > 0) {
const animationDuration = 2000;
const animationElapsed = t - loadAnimationStartRef.current;
const progress = Math.min(animationElapsed / animationDuration, 1);
program.uniforms.uPageLoadProgress.value = progress;
}
if (mouseReact) {
const dampingFactor = 0.08;
const smoothMouse = smoothMouseRef.current;
const mouse = mouseRef.current;
smoothMouse.x += (mouse.x - smoothMouse.x) * dampingFactor;
smoothMouse.y += (mouse.y - smoothMouse.y) * dampingFactor;
const mouseUniform = program.uniforms.uMouse.value as Float32Array;
mouseUniform[0] = smoothMouse.x;
mouseUniform[1] = smoothMouse.y;
}
renderer.render({ scene: mesh });
};
rafRef.current = requestAnimationFrame(update);
ctn.appendChild(gl.canvas);
if (mouseReact) ctn.addEventListener("mousemove", handleMouseMove);
return () => {
cancelAnimationFrame(rafRef.current);
resizeObserver.disconnect();
if (mouseReact) ctn.removeEventListener("mousemove", handleMouseMove);
if (gl.canvas.parentElement === ctn) ctn.removeChild(gl.canvas);
gl.getExtension("WEBGL_lose_context")?.loseContext();
loadAnimationStartRef.current = 0;
timeOffsetRef.current = Math.random() * 100;
};
}, [
dpr,
pause,
timeScale,
scale,
gridMul,
digitSize,
scanlineIntensity,
glitchAmount,
flickerAmount,
noiseAmp,
chromaticAberration,
ditherValue,
curvature,
tintVec,
mouseReact,
mouseStrength,
pageLoadAnimation,
brightness,
handleMouseMove,
]);
return (
<div
ref={containerRef}
className={`w-full h-full relative overflow-hidden ${className}`}
style={style}
{...rest}
/>
);
}
-443
View File
@@ -1,443 +0,0 @@
import React, {
useCallback,
useEffect,
useMemo,
useRef,
useState,
} from "react";
export type LogoItem =
| {
node: React.ReactNode;
href?: string;
title?: string;
ariaLabel?: string;
}
| {
src: string;
alt?: string;
href?: string;
title?: string;
srcSet?: string;
sizes?: string;
width?: number;
height?: number;
};
export interface LogoLoopProps {
logos: LogoItem[];
speed?: number;
direction?: "left" | "right";
width?: number | string;
logoHeight?: number;
gap?: number;
pauseOnHover?: boolean;
fadeOut?: boolean;
fadeOutColor?: string;
scaleOnHover?: boolean;
ariaLabel?: string;
className?: string;
style?: React.CSSProperties;
}
const ANIMATION_CONFIG = {
SMOOTH_TAU: 0.25,
MIN_COPIES: 2,
COPY_HEADROOM: 2,
} as const;
const toCssLength = (value?: number | string): string | undefined =>
typeof value === "number" ? `${value}px` : (value ?? undefined);
const cx = (...parts: Array<string | false | null | undefined>) =>
parts.filter(Boolean).join(" ");
const useResizeObserver = (
callback: () => void,
elements: Array<React.RefObject<Element | null>>,
dependencies: React.DependencyList,
) => {
useEffect(() => {
if (!window.ResizeObserver) {
const handleResize = () => callback();
window.addEventListener("resize", handleResize);
callback();
return () => window.removeEventListener("resize", handleResize);
}
const observers = elements.map((ref) => {
if (!ref.current) return null;
const observer = new ResizeObserver(callback);
observer.observe(ref.current);
return observer;
});
callback();
return () => {
observers.forEach((observer) => observer?.disconnect());
};
}, dependencies);
};
const useImageLoader = (
seqRef: React.RefObject<HTMLUListElement | null>,
onLoad: () => void,
dependencies: React.DependencyList,
) => {
useEffect(() => {
const images = seqRef.current?.querySelectorAll("img") ?? [];
if (images.length === 0) {
onLoad();
return;
}
let remainingImages = images.length;
const handleImageLoad = () => {
remainingImages -= 1;
if (remainingImages === 0) {
onLoad();
}
};
images.forEach((img) => {
const htmlImg = img as HTMLImageElement;
if (htmlImg.complete) {
handleImageLoad();
} else {
htmlImg.addEventListener("load", handleImageLoad, { once: true });
htmlImg.addEventListener("error", handleImageLoad, { once: true });
}
});
return () => {
images.forEach((img) => {
img.removeEventListener("load", handleImageLoad);
img.removeEventListener("error", handleImageLoad);
});
};
}, dependencies);
};
const useAnimationLoop = (
trackRef: React.RefObject<HTMLDivElement | null>,
targetVelocity: number,
seqWidth: number,
isHovered: boolean,
pauseOnHover: boolean,
) => {
const rafRef = useRef<number | null>(null);
const lastTimestampRef = useRef<number | null>(null);
const offsetRef = useRef(0);
const velocityRef = useRef(0);
useEffect(() => {
const track = trackRef.current;
if (!track) return;
const prefersReduced =
typeof window !== "undefined" &&
window.matchMedia &&
window.matchMedia("(prefers-reduced-motion: reduce)").matches;
if (seqWidth > 0) {
offsetRef.current =
((offsetRef.current % seqWidth) + seqWidth) % seqWidth;
track.style.transform = `translate3d(${-offsetRef.current}px, 0, 0)`;
}
if (prefersReduced) {
track.style.transform = "translate3d(0, 0, 0)";
return () => {
lastTimestampRef.current = null;
};
}
const animate = (timestamp: number) => {
if (lastTimestampRef.current === null) {
lastTimestampRef.current = timestamp;
}
const deltaTime =
Math.max(0, timestamp - lastTimestampRef.current) / 1000;
lastTimestampRef.current = timestamp;
const target = pauseOnHover && isHovered ? 0 : targetVelocity;
const easingFactor =
1 - Math.exp(-deltaTime / ANIMATION_CONFIG.SMOOTH_TAU);
velocityRef.current += (target - velocityRef.current) * easingFactor;
if (seqWidth > 0) {
let nextOffset = offsetRef.current + velocityRef.current * deltaTime;
nextOffset = ((nextOffset % seqWidth) + seqWidth) % seqWidth;
offsetRef.current = nextOffset;
const translateX = -offsetRef.current;
track.style.transform = `translate3d(${translateX}px, 0, 0)`;
}
rafRef.current = requestAnimationFrame(animate);
};
rafRef.current = requestAnimationFrame(animate);
return () => {
if (rafRef.current !== null) {
cancelAnimationFrame(rafRef.current);
rafRef.current = null;
}
lastTimestampRef.current = null;
};
}, [targetVelocity, seqWidth, isHovered, pauseOnHover]);
};
export const LogoLoop = React.memo<LogoLoopProps>(
({
logos,
speed = 120,
direction = "left",
width = "100%",
logoHeight = 28,
gap = 32,
pauseOnHover = true,
fadeOut = false,
fadeOutColor,
scaleOnHover = false,
ariaLabel = "Partner logos",
className,
style,
}) => {
const containerRef = useRef<HTMLDivElement>(null);
const trackRef = useRef<HTMLDivElement>(null);
const seqRef = useRef<HTMLUListElement>(null);
const [seqWidth, setSeqWidth] = useState<number>(0);
const [copyCount, setCopyCount] = useState<number>(
ANIMATION_CONFIG.MIN_COPIES,
);
const [isHovered, setIsHovered] = useState<boolean>(false);
const targetVelocity = useMemo(() => {
const magnitude = Math.abs(speed);
const directionMultiplier = direction === "left" ? 1 : -1;
const speedMultiplier = speed < 0 ? -1 : 1;
return magnitude * directionMultiplier * speedMultiplier;
}, [speed, direction]);
const updateDimensions = useCallback(() => {
const containerWidth = containerRef.current?.clientWidth ?? 0;
const sequenceWidth =
seqRef.current?.getBoundingClientRect?.()?.width ?? 0;
if (sequenceWidth > 0) {
setSeqWidth(Math.ceil(sequenceWidth));
const copiesNeeded =
Math.ceil(containerWidth / sequenceWidth) +
ANIMATION_CONFIG.COPY_HEADROOM;
setCopyCount(Math.max(ANIMATION_CONFIG.MIN_COPIES, copiesNeeded));
}
}, []);
useResizeObserver(
updateDimensions,
[containerRef, seqRef],
[logos, gap, logoHeight],
);
useImageLoader(seqRef, updateDimensions, [logos, gap, logoHeight]);
useAnimationLoop(
trackRef,
targetVelocity,
seqWidth,
isHovered,
pauseOnHover,
);
const cssVariables = useMemo(
() =>
({
"--logoloop-gap": `${gap}px`,
"--logoloop-logoHeight": `${logoHeight}px`,
...(fadeOutColor && { "--logoloop-fadeColor": fadeOutColor }),
}) as React.CSSProperties,
[gap, logoHeight, fadeOutColor],
);
const rootClasses = useMemo(
() =>
cx(
"relative overflow-x-hidden group",
"[--logoloop-gap:32px]",
"[--logoloop-logoHeight:28px]",
"[--logoloop-fadeColorAuto:#ffffff]",
"dark:[--logoloop-fadeColorAuto:#0b0b0b]",
scaleOnHover && "py-[calc(var(--logoloop-logoHeight)*0.1)]",
className,
),
[scaleOnHover, className],
);
const handleMouseEnter = useCallback(() => {
if (pauseOnHover) setIsHovered(true);
}, [pauseOnHover]);
const handleMouseLeave = useCallback(() => {
if (pauseOnHover) setIsHovered(false);
}, [pauseOnHover]);
const renderLogoItem = useCallback(
(item: LogoItem, key: React.Key) => {
const isNodeItem = "node" in item;
const content = isNodeItem ? (
<span
className={cx(
"inline-flex items-center",
"motion-reduce:transition-none",
scaleOnHover &&
"transition-transform duration-300 ease-[cubic-bezier(0.4,0,0.2,1)] group-hover/item:scale-120",
)}
aria-hidden={!!(item as any).href && !(item as any).ariaLabel}
>
{(item as any).node}
</span>
) : (
<img
className={cx(
"h-[var(--logoloop-logoHeight)] w-auto block object-contain",
"[-webkit-user-drag:none] pointer-events-none",
"[image-rendering:-webkit-optimize-contrast]",
"motion-reduce:transition-none",
scaleOnHover &&
"transition-transform duration-300 ease-[cubic-bezier(0.4,0,0.2,1)] group-hover/item:scale-120",
)}
src={(item as any).src}
srcSet={(item as any).srcSet}
sizes={(item as any).sizes}
width={(item as any).width}
height={(item as any).height}
alt={(item as any).alt ?? ""}
title={(item as any).title}
loading="lazy"
decoding="async"
draggable={false}
/>
);
const itemAriaLabel = isNodeItem
? ((item as any).ariaLabel ?? (item as any).title)
: ((item as any).alt ?? (item as any).title);
const inner = (item as any).href ? (
<a
className={cx(
"inline-flex items-center no-underline rounded",
"transition-opacity duration-200 ease-linear",
"hover:opacity-80",
"focus-visible:outline focus-visible:outline-current focus-visible:outline-offset-2",
)}
href={(item as any).href}
aria-label={itemAriaLabel || "logo link"}
target="_blank"
rel="noreferrer noopener"
>
{content}
</a>
) : (
content
);
return (
<li
className={cx(
"flex-none mr-[var(--logoloop-gap)] text-[length:var(--logoloop-logoHeight)] leading-[1]",
scaleOnHover && "overflow-visible group/item",
)}
key={key}
role="listitem"
>
{inner}
</li>
);
},
[scaleOnHover],
);
const logoLists = useMemo(
() =>
Array.from({ length: copyCount }, (_, copyIndex) => (
<ul
className="flex items-center"
key={`copy-${copyIndex}`}
role="list"
aria-hidden={copyIndex > 0}
ref={copyIndex === 0 ? seqRef : undefined}
>
{logos.map((item, itemIndex) =>
renderLogoItem(item, `${copyIndex}-${itemIndex}`),
)}
</ul>
)),
[copyCount, logos, renderLogoItem],
);
const containerStyle = useMemo(
(): React.CSSProperties => ({
width: toCssLength(width) ?? "100%",
...cssVariables,
...style,
}),
[width, cssVariables, style],
);
return (
<div
ref={containerRef}
className={rootClasses}
style={containerStyle}
role="region"
aria-label={ariaLabel}
onMouseEnter={handleMouseEnter}
onMouseLeave={handleMouseLeave}
>
{fadeOut && (
<>
<div
aria-hidden
className={cx(
"pointer-events-none absolute inset-y-0 left-0 z-[1]",
"w-[clamp(24px,8%,120px)]",
"bg-[linear-gradient(to_right,var(--logoloop-fadeColor,var(--logoloop-fadeColorAuto))_0%,rgba(0,0,0,0)_100%)]",
)}
/>
<div
aria-hidden
className={cx(
"pointer-events-none absolute inset-y-0 right-0 z-[1]",
"w-[clamp(24px,8%,120px)]",
"bg-[linear-gradient(to_left,var(--logoloop-fadeColor,var(--logoloop-fadeColorAuto))_0%,rgba(0,0,0,0)_100%)]",
)}
/>
</>
)}
<div
className={cx(
"flex w-max will-change-transform select-none",
"motion-reduce:transform-none",
)}
ref={trackRef}
>
{logoLists}
</div>
</div>
);
},
);
LogoLoop.displayName = "LogoLoop";
export default LogoLoop;
-44
View File
@@ -1,44 +0,0 @@
"use client";
import React, { useState, useEffect } from "react";
import { motion, AnimatePresence } from "framer-motion";
import { cn } from "@/lib/utils";
interface RotatingTextProps {
words: string[];
className?: string;
interval?: number; // Intervalo em milissegundos para a rotação
}
export function RotatingText({
words,
className,
interval = 3000,
}: RotatingTextProps) {
const [currentIndex, setCurrentIndex] = useState(0);
useEffect(() => {
const timer = setInterval(() => {
setCurrentIndex((prevIndex) => (prevIndex + 1) % words.length);
}, interval);
return () => clearInterval(timer);
}, [words, interval]);
return (
<div className={cn("relative inline-block min-h-[1.5em]", className)}>
<AnimatePresence mode="wait">
<motion.span
key={currentIndex}
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
exit={{ opacity: 0, y: -20 }}
transition={{ duration: 0.5 }}
className="block text-center"
>
{words[currentIndex]}
</motion.span>
</AnimatePresence>
</div>
);
}
-157
View File
@@ -1,157 +0,0 @@
"use client";
import React, { useRef, useEffect } from "react";
type CanvasStrokeStyle = string | CanvasGradient | CanvasPattern;
interface GridOffset {
x: number;
y: number;
}
interface SquaresProps {
direction?: "diagonal" | "up" | "right" | "down" | "left";
speed?: number;
borderColor?: CanvasStrokeStyle;
squareSize?: number;
hoverFillColor?: CanvasStrokeStyle;
}
const Squares: React.FC<SquaresProps> = ({
direction = "right",
speed = 1,
borderColor = "#999",
squareSize = 40,
hoverFillColor = "#222",
}) => {
const canvasRef = useRef<HTMLCanvasElement>(null);
const requestRef = useRef<number | null>(null);
const numSquaresX = useRef<number>(0);
const numSquaresY = useRef<number>(0);
const gridOffset = useRef<GridOffset>({ x: 0, y: 0 });
const hoveredSquareRef = useRef<GridOffset | null>(null);
useEffect(() => {
const canvas = canvasRef.current;
if (!canvas) return;
const ctx = canvas.getContext("2d");
const resizeCanvas = () => {
canvas.width = canvas.offsetWidth;
canvas.height = canvas.offsetHeight;
numSquaresX.current = Math.ceil(canvas.width / squareSize) + 1;
numSquaresY.current = Math.ceil(canvas.height / squareSize) + 1;
};
window.addEventListener("resize", resizeCanvas);
resizeCanvas();
const drawGrid = () => {
if (!ctx) return;
ctx.clearRect(0, 0, canvas.width, canvas.height);
const startX = Math.floor(gridOffset.current.x / squareSize) * squareSize;
const startY = Math.floor(gridOffset.current.y / squareSize) * squareSize;
for (let x = startX; x < canvas.width + squareSize; x += squareSize) {
for (let y = startY; y < canvas.height + squareSize; y += squareSize) {
const squareX = x - (gridOffset.current.x % squareSize);
const squareY = y - (gridOffset.current.y % squareSize);
if (
hoveredSquareRef.current &&
hoveredSquareRef.current.x >= squareX &&
hoveredSquareRef.current.x < squareX + squareSize &&
hoveredSquareRef.current.y >= squareY &&
hoveredSquareRef.current.y < squareY + squareSize
) {
ctx.fillStyle = hoverFillColor;
ctx.fillRect(squareX, squareY, squareSize, squareSize);
}
ctx.strokeStyle = borderColor;
ctx.strokeRect(squareX, squareY, squareSize, squareSize);
}
}
const gradient = ctx.createRadialGradient(
canvas.width / 2,
canvas.height / 2,
0,
canvas.width / 2,
canvas.height / 2,
Math.sqrt(canvas.width ** 2 + canvas.height ** 2) / 2,
);
gradient.addColorStop(0, "rgba(0, 0, 0, 0)");
gradient.addColorStop(1, "#060010");
ctx.fillStyle = gradient;
ctx.fillRect(0, 0, canvas.width, canvas.height);
};
const updateAnimation = () => {
const effectiveSpeed = Math.max(speed, 0.1);
switch (direction) {
case "right":
gridOffset.current.x =
(gridOffset.current.x - effectiveSpeed + squareSize) % squareSize;
break;
case "left":
gridOffset.current.x =
(gridOffset.current.x + effectiveSpeed + squareSize) % squareSize;
break;
case "up":
gridOffset.current.y =
(gridOffset.current.y + effectiveSpeed + squareSize) % squareSize;
break;
case "down":
gridOffset.current.y =
(gridOffset.current.y - effectiveSpeed + squareSize) % squareSize;
break;
case "diagonal":
gridOffset.current.x =
(gridOffset.current.x - effectiveSpeed + squareSize) % squareSize;
gridOffset.current.y =
(gridOffset.current.y - effectiveSpeed + squareSize) % squareSize;
break;
default:
break;
}
drawGrid();
requestRef.current = requestAnimationFrame(updateAnimation);
};
const handleMouseMove = (event: MouseEvent) => {
if (!canvas) return;
const rect = canvas.getBoundingClientRect();
const mouseX = event.clientX - rect.left;
const mouseY = event.clientY - rect.top;
hoveredSquareRef.current = { x: mouseX, y: mouseY };
};
const handleMouseLeave = () => {
hoveredSquareRef.current = null;
};
window.addEventListener("mousemove", handleMouseMove);
document.addEventListener("mouseleave", handleMouseLeave); // Use document for leaving window
requestRef.current = requestAnimationFrame(updateAnimation);
return () => {
window.removeEventListener("resize", resizeCanvas);
if (requestRef.current) cancelAnimationFrame(requestRef.current);
window.removeEventListener("mousemove", handleMouseMove);
document.removeEventListener("mouseleave", handleMouseLeave);
};
}, [direction, speed, borderColor, hoverFillColor, squareSize]);
return (
<canvas
ref={canvasRef}
className="w-full h-full border-none block max-w-full"
></canvas>
);
};
export default Squares;
-209
View File
@@ -1,209 +0,0 @@
"use client";
import {
ElementType,
useEffect,
useRef,
useState,
createElement,
useMemo,
useCallback,
} from "react";
import { gsap } from "gsap";
interface TextTypeProps {
className?: string;
showCursor?: boolean;
hideCursorWhileTyping?: boolean;
cursorCharacter?: string | React.ReactNode;
cursorBlinkDuration?: number;
cursorClassName?: string;
text: string | string[];
as?: ElementType;
typingSpeed?: number;
initialDelay?: number;
pauseDuration?: number;
deletingSpeed?: number;
loop?: boolean;
textColors?: string[];
variableSpeed?: { min: number; max: number };
onSentenceComplete?: (sentence: string, index: number) => void;
startOnVisible?: boolean;
reverseMode?: boolean;
}
const TextType = ({
text,
as: Component = "div",
typingSpeed = 50,
initialDelay = 0,
pauseDuration = 2000,
deletingSpeed = 30,
loop = true,
className = "",
showCursor = true,
hideCursorWhileTyping = false,
cursorCharacter = "|",
cursorClassName = "",
cursorBlinkDuration = 0.5,
textColors = [],
variableSpeed,
onSentenceComplete,
startOnVisible = false,
reverseMode = false,
...props
}: TextTypeProps & React.HTMLAttributes<HTMLElement>) => {
const [displayedText, setDisplayedText] = useState("");
const [currentCharIndex, setCurrentCharIndex] = useState(0);
const [isDeleting, setIsDeleting] = useState(false);
const [currentTextIndex, setCurrentTextIndex] = useState(0);
const [isVisible, setIsVisible] = useState(!startOnVisible);
const cursorRef = useRef<HTMLSpanElement>(null);
const containerRef = useRef<HTMLElement>(null);
const textArray = useMemo(
() => (Array.isArray(text) ? text : [text]),
[text],
);
const getRandomSpeed = useCallback(() => {
if (!variableSpeed) return typingSpeed;
const { min, max } = variableSpeed;
return Math.random() * (max - min) + min;
}, [variableSpeed, typingSpeed]);
const getCurrentTextColor = () => {
if (textColors.length === 0) return "#ffffff";
return textColors[currentTextIndex % textColors.length];
};
useEffect(() => {
if (!startOnVisible || !containerRef.current) return;
const observer = new IntersectionObserver(
(entries) => {
entries.forEach((entry) => {
if (entry.isIntersecting) {
setIsVisible(true);
}
});
},
{ threshold: 0.1 },
);
observer.observe(containerRef.current);
return () => observer.disconnect();
}, [startOnVisible]);
useEffect(() => {
if (showCursor && cursorRef.current) {
gsap.set(cursorRef.current, { opacity: 1 });
gsap.to(cursorRef.current, {
opacity: 0,
duration: cursorBlinkDuration,
repeat: -1,
yoyo: true,
ease: "power2.inOut",
});
}
}, [showCursor, cursorBlinkDuration]);
useEffect(() => {
if (!isVisible) return;
let timeout: NodeJS.Timeout;
const currentText = textArray[currentTextIndex];
const processedText = reverseMode
? currentText.split("").reverse().join("")
: currentText;
const executeTypingAnimation = () => {
if (isDeleting) {
if (displayedText === "") {
setIsDeleting(false);
if (currentTextIndex === textArray.length - 1 && !loop) {
return;
}
if (onSentenceComplete) {
onSentenceComplete(textArray[currentTextIndex], currentTextIndex);
}
setCurrentTextIndex((prev) => (prev + 1) % textArray.length);
setCurrentCharIndex(0);
timeout = setTimeout(() => {}, pauseDuration);
} else {
timeout = setTimeout(() => {
setDisplayedText((prev) => prev.slice(0, -1));
}, deletingSpeed);
}
} else {
if (currentCharIndex < processedText.length) {
timeout = setTimeout(
() => {
setDisplayedText(
(prev) => prev + processedText[currentCharIndex],
);
setCurrentCharIndex((prev) => prev + 1);
},
variableSpeed ? getRandomSpeed() : typingSpeed,
);
} else if (textArray.length > 1) {
timeout = setTimeout(() => {
setIsDeleting(true);
}, pauseDuration);
}
}
};
if (currentCharIndex === 0 && !isDeleting && displayedText === "") {
timeout = setTimeout(executeTypingAnimation, initialDelay);
} else {
executeTypingAnimation();
}
return () => clearTimeout(timeout);
}, [
currentCharIndex,
displayedText,
isDeleting,
typingSpeed,
deletingSpeed,
pauseDuration,
textArray,
currentTextIndex,
loop,
initialDelay,
isVisible,
reverseMode,
variableSpeed,
onSentenceComplete,
]);
const shouldHideCursor =
hideCursorWhileTyping &&
(currentCharIndex < textArray[currentTextIndex].length || isDeleting);
return createElement(
Component,
{
ref: containerRef,
className: `inline-block whitespace-pre-wrap tracking-tight ${className}`,
...props,
},
<span className="inline" style={{ color: getCurrentTextColor() }}>
{displayedText}
</span>,
showCursor && (
<span
ref={cursorRef}
className={`ml-1 inline-block opacity-100 ${shouldHideCursor ? "hidden" : ""} ${cursorClassName}`}
>
{cursorCharacter}
</span>
),
);
};
export default TextType;
@@ -1,36 +0,0 @@
"use client";
import { motion } from "motion/react";
import { cn } from "@/lib/utils";
interface AnimatedGradientTextProps {
children: React.ReactNode;
className?: string;
}
export function AnimatedGradientText({
children,
className,
}: AnimatedGradientTextProps) {
return (
<motion.span
className={cn(
"bg-gradient-to-r from-cyan-400 via-blue-500 to-blue-600 bg-clip-text text-transparent font-bold",
className,
)}
animate={{
backgroundPosition: ["0% 50%", "100% 50%", "0% 50%"],
}}
transition={{
duration: 4,
repeat: Infinity,
ease: "easeInOut",
}}
style={{
backgroundSize: "200% 200%",
}}
>
{children}
</motion.span>
);
}
-33
View File
@@ -1,33 +0,0 @@
"use client";
import { motion } from "motion/react";
import { cn } from "@/lib/utils";
interface AuroraTextProps {
children: React.ReactNode;
className?: string;
}
export function AuroraText({ children, className }: AuroraTextProps) {
return (
<motion.span
className={cn(
"bg-gradient-to-r from-blue-400 via-cyan-500 to-blue-500 bg-clip-text text-transparent",
className,
)}
animate={{
backgroundPosition: ["0% 50%", "100% 50%", "0% 50%"],
}}
transition={{
duration: 3,
repeat: Infinity,
ease: "linear",
}}
style={{
backgroundSize: "200% 200%",
}}
>
{children}
</motion.span>
);
}
-54
View File
@@ -1,54 +0,0 @@
"use client";
import { motion } from "motion/react";
import { cn } from "@/lib/utils";
interface BentoGridProps {
children: React.ReactNode;
className?: string;
}
interface BentoGridItemProps {
children: React.ReactNode;
className?: string;
colSpan?: number;
rowSpan?: number;
}
export function BentoGrid({ children, className }: BentoGridProps) {
return (
<div
className={cn(
"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 max-w-6xl mx-auto justify-center",
className,
)}
>
{children}
</div>
);
}
export function BentoGridItem({
children,
className,
colSpan = 1,
rowSpan = 1,
}: BentoGridItemProps) {
return (
<motion.div
className={cn(
"relative overflow-hidden rounded-lg border border-white/20 bg-white/5 backdrop-blur-sm p-6",
`col-span-${colSpan} row-span-${rowSpan}`,
className,
)}
initial={{ opacity: 0, y: 20 }}
whileInView={{ opacity: 1, y: 0 }}
transition={{ duration: 0.6 }}
viewport={{ once: true }}
whileHover={{ scale: 1.02 }}
>
<div className="absolute inset-0 bg-gradient-to-br from-blue-500/10 via-blue-400/10 to-cyan-500/10 opacity-0 hover:opacity-100 transition-opacity duration-300" />
<div className="relative z-10">{children}</div>
</motion.div>
);
}
-153
View File
@@ -1,153 +0,0 @@
"use client";
import { cva, type VariantProps } from "class-variance-authority";
import {
motion,
MotionValue,
useMotionValue,
useSpring,
useTransform,
} from "motion/react";
import type { MotionProps } from "motion/react";
import React, { PropsWithChildren, useRef } from "react";
import { cn } from "@/lib/utils";
export interface DockProps extends VariantProps<typeof dockVariants> {
className?: string;
iconSize?: number;
iconMagnification?: number;
disableMagnification?: boolean;
iconDistance?: number;
direction?: "top" | "middle" | "bottom";
children: React.ReactNode;
}
const DEFAULT_SIZE = 40;
const DEFAULT_MAGNIFICATION = 60;
const DEFAULT_DISTANCE = 140;
const DEFAULT_DISABLEMAGNIFICATION = false;
const dockVariants = cva(
"supports-backdrop-blur:bg-white/10 supports-backdrop-blur:dark:bg-black/10 mx-auto mt-8 flex h-[58px] w-max items-center justify-center gap-2 rounded-2xl border p-2 backdrop-blur-md",
);
const Dock = React.forwardRef<HTMLDivElement, DockProps>(
(
{
className,
children,
iconSize = DEFAULT_SIZE,
iconMagnification = DEFAULT_MAGNIFICATION,
disableMagnification = DEFAULT_DISABLEMAGNIFICATION,
iconDistance = DEFAULT_DISTANCE,
direction = "middle",
...props
},
ref,
) => {
const mouseX = useMotionValue(Infinity);
const renderChildren = () => {
return React.Children.map(children, (child) => {
if (
React.isValidElement<DockIconProps>(child) &&
child.type === DockIcon
) {
return React.cloneElement(child, {
...child.props,
mouseX: mouseX,
size: iconSize,
magnification: iconMagnification,
disableMagnification: disableMagnification,
distance: iconDistance,
});
}
return child;
});
};
return (
<motion.div
ref={ref}
onMouseMove={(e) => mouseX.set(e.pageX)}
onMouseLeave={() => mouseX.set(Infinity)}
{...props}
className={cn(dockVariants({ className }), {
"items-start": direction === "top",
"items-center": direction === "middle",
"items-end": direction === "bottom",
})}
>
{renderChildren()}
</motion.div>
);
},
);
Dock.displayName = "Dock";
export interface DockIconProps
extends Omit<MotionProps & React.HTMLAttributes<HTMLDivElement>, "children"> {
size?: number;
magnification?: number;
disableMagnification?: boolean;
distance?: number;
mouseX?: MotionValue<number>;
className?: string;
children?: React.ReactNode;
props?: PropsWithChildren;
}
const DockIcon = ({
size = DEFAULT_SIZE,
magnification = DEFAULT_MAGNIFICATION,
disableMagnification,
distance = DEFAULT_DISTANCE,
mouseX,
className,
children,
...props
}: DockIconProps) => {
const ref = useRef<HTMLDivElement>(null);
const padding = Math.max(6, size * 0.2);
const defaultMouseX = useMotionValue(Infinity);
const distanceCalc = useTransform(mouseX ?? defaultMouseX, (val: number) => {
const bounds = ref.current?.getBoundingClientRect() ?? { x: 0, width: 0 };
return val - bounds.x - bounds.width / 2;
});
const targetSize = disableMagnification ? size : magnification;
const sizeTransform = useTransform(
distanceCalc,
[-distance, 0, distance],
[size, targetSize, size],
);
const scaleSize = useSpring(sizeTransform, {
mass: 0.1,
stiffness: 150,
damping: 12,
});
return (
<motion.div
ref={ref}
style={{ width: scaleSize, height: scaleSize, padding }}
className={cn(
"flex aspect-square cursor-pointer items-center justify-center rounded-full",
disableMagnification && "transition-colors hover:bg-muted-foreground",
className,
)}
{...props}
>
<div>{children}</div>
</motion.div>
);
};
DockIcon.displayName = "DockIcon";
export { Dock, DockIcon, dockVariants };
-158
View File
@@ -1,158 +0,0 @@
"use client";
import { cn } from "@/lib/utils";
import { motion } from "motion/react";
import React, { useEffect, useId, useRef, useState } from "react";
/**
* DotPattern Component Props
*
* @param {number} [width=16] - The horizontal spacing between dots
* @param {number} [height=16] - The vertical spacing between dots
* @param {number} [x=0] - The x-offset of the entire pattern
* @param {number} [y=0] - The y-offset of the entire pattern
* @param {number} [cx=1] - The x-offset of individual dots
* @param {number} [cy=1] - The y-offset of individual dots
* @param {number} [cr=1] - The radius of each dot
* @param {string} [className] - Additional CSS classes to apply to the SVG container
* @param {boolean} [glow=false] - Whether dots should have a glowing animation effect
*/
interface DotPatternProps extends React.SVGProps<SVGSVGElement> {
width?: number;
height?: number;
x?: number;
y?: number;
cx?: number;
cy?: number;
cr?: number;
className?: string;
glow?: boolean;
[key: string]: unknown;
}
/**
* DotPattern Component
*
* A React component that creates an animated or static dot pattern background using SVG.
* The pattern automatically adjusts to fill its container and can optionally display glowing dots.
*
* @component
*
* @see DotPatternProps for the props interface.
*
* @example
* // Basic usage
* <DotPattern />
*
* // With glowing effect and custom spacing
* <DotPattern
* width={20}
* height={20}
* glow={true}
* className="opacity-50"
* />
*
* @notes
* - The component is client-side only ("use client")
* - Automatically responds to container size changes
* - When glow is enabled, dots will animate with random delays and durations
* - Uses Motion for animations
* - Dots color can be controlled via the text color utility classes
*/
export function DotPattern({
width = 16,
height = 16,
x = 0,
y = 0,
cx = 1,
cy = 1,
cr = 1,
className,
glow = false,
...props
}: DotPatternProps) {
const id = useId();
const containerRef = useRef<SVGSVGElement>(null);
const [dimensions, setDimensions] = useState({ width: 0, height: 0 });
useEffect(() => {
const updateDimensions = () => {
if (containerRef.current) {
const { width, height } = containerRef.current.getBoundingClientRect();
setDimensions({ width, height });
}
};
updateDimensions();
window.addEventListener("resize", updateDimensions);
return () => window.removeEventListener("resize", updateDimensions);
}, []);
const dots = Array.from(
{
length:
Math.ceil(dimensions.width / width) *
Math.ceil(dimensions.height / height),
},
(_, i) => {
const col = i % Math.ceil(dimensions.width / width);
const row = Math.floor(i / Math.ceil(dimensions.width / width));
return {
x: col * width + cx,
y: row * height + cy,
delay: Math.random() * 5,
duration: Math.random() * 3 + 2,
};
},
);
return (
<svg
ref={containerRef}
aria-hidden="true"
className={cn(
"pointer-events-none absolute inset-0 h-full w-full",
className,
)}
{...props}
>
<defs>
<radialGradient id={`${id}-gradient`}>
<stop offset="0%" stopColor="currentColor" stopOpacity="1" />
<stop offset="100%" stopColor="currentColor" stopOpacity="0" />
</radialGradient>
</defs>
{dots.map((dot, index) => (
<motion.circle
key={`${dot.x}-${dot.y}`}
cx={dot.x}
cy={dot.y}
r={cr}
fill={glow ? `url(#${id}-gradient)` : "currentColor"}
className="text-neutral-400/80"
initial={glow ? { opacity: 0.4, scale: 1 } : {}}
animate={
glow
? {
opacity: [0.4, 1, 0.4],
scale: [1, 1.5, 1],
}
: {}
}
transition={
glow
? {
duration: dot.duration,
repeat: Infinity,
repeatType: "reverse",
delay: dot.delay,
ease: "easeInOut",
}
: {}
}
/>
))}
</svg>
);
}
-128
View File
@@ -1,128 +0,0 @@
"use client";
import createGlobe, { COBEOptions } from "cobe";
import { useMotionValue, useSpring } from "motion/react";
import { useEffect, useRef } from "react";
import { cn } from "@/lib/utils";
const MOVEMENT_DAMPING = 1400;
const GLOBE_CONFIG: COBEOptions = {
width: 800,
height: 800,
onRender: () => {},
devicePixelRatio: 2,
phi: 0,
theta: 0.3,
dark: 0,
diffuse: 0.4,
mapSamples: 16000,
mapBrightness: 1.2,
baseColor: [1, 1, 1],
markerColor: [251 / 255, 100 / 255, 21 / 255],
glowColor: [1, 1, 1],
markers: [
{ location: [14.5995, 120.9842], size: 0.03 },
{ location: [19.076, 72.8777], size: 0.1 },
{ location: [23.8103, 90.4125], size: 0.05 },
{ location: [30.0444, 31.2357], size: 0.07 },
{ location: [39.9042, 116.4074], size: 0.08 },
{ location: [-23.5505, -46.6333], size: 0.1 },
{ location: [19.4326, -99.1332], size: 0.1 },
{ location: [40.7128, -74.006], size: 0.1 },
{ location: [34.6937, 135.5022], size: 0.05 },
{ location: [41.0082, 28.9784], size: 0.06 },
],
};
export function Globe({
className,
config = GLOBE_CONFIG,
}: {
className?: string;
config?: COBEOptions;
}) {
let phi = 0;
let width = 0;
const canvasRef = useRef<HTMLCanvasElement>(null);
const pointerInteracting = useRef<number | null>(null);
const pointerInteractionMovement = useRef(0);
const r = useMotionValue(0);
const rs = useSpring(r, {
mass: 1,
damping: 30,
stiffness: 100,
});
const updatePointerInteraction = (value: number | null) => {
pointerInteracting.current = value;
if (canvasRef.current) {
canvasRef.current.style.cursor = value !== null ? "grabbing" : "grab";
}
};
const updateMovement = (clientX: number) => {
if (pointerInteracting.current !== null) {
const delta = clientX - pointerInteracting.current;
pointerInteractionMovement.current = delta;
r.set(r.get() + delta / MOVEMENT_DAMPING);
}
};
useEffect(() => {
const onResize = () => {
if (canvasRef.current) {
width = canvasRef.current.offsetWidth;
}
};
window.addEventListener("resize", onResize);
onResize();
const globe = createGlobe(canvasRef.current!, {
...config,
width: width * 2,
height: width * 2,
onRender: (state) => {
if (!pointerInteracting.current) phi += 0.005;
state.phi = phi + rs.get();
state.width = width * 2;
state.height = width * 2;
},
});
setTimeout(() => (canvasRef.current!.style.opacity = "1"), 0);
return () => {
globe.destroy();
window.removeEventListener("resize", onResize);
};
}, [rs, config]);
return (
<div
className={cn(
"absolute inset-0 mx-auto aspect-[1/1] w-full max-w-[600px]",
className,
)}
>
<canvas
className={cn(
"size-full opacity-0 transition-opacity duration-500 [contain:layout_paint_size]",
)}
ref={canvasRef}
onPointerDown={(e) => {
pointerInteracting.current = e.clientX;
updatePointerInteraction(e.clientX);
}}
onPointerUp={() => updatePointerInteraction(null)}
onPointerOut={() => updatePointerInteraction(null)}
onMouseMove={(e) => updateMovement(e.clientX)}
onTouchMove={(e) =>
e.touches[0] && updateMovement(e.touches[0].clientX)
}
/>
</div>
);
}
-25
View File
@@ -1,25 +0,0 @@
"use client";
import { motion } from "motion/react";
import { cn } from "@/lib/utils";
interface MagicCardProps {
children: React.ReactNode;
className?: string;
}
export function MagicCard({ children, className }: MagicCardProps) {
return (
<motion.div
className={cn(
"relative overflow-hidden rounded-lg border border-white/20 bg-white/5 backdrop-blur-sm",
className,
)}
whileHover={{ scale: 1.02 }}
transition={{ duration: 0.2 }}
>
<div className="absolute inset-0 bg-gradient-to-r from-transparent via-white/10 to-transparent -translate-x-full animate-shimmer" />
{children}
</motion.div>
);
}
-31
View File
@@ -1,31 +0,0 @@
"use client";
import { motion } from "motion/react";
import { cn } from "@/lib/utils";
interface ShimmerButtonProps {
children: React.ReactNode;
className?: string;
onClick?: () => void;
}
export function ShimmerButton({
children,
className,
onClick,
}: ShimmerButtonProps) {
return (
<motion.button
className={cn(
"relative overflow-hidden rounded-lg bg-gradient-to-r from-cyan-500 to-blue-600 px-6 py-3 font-semibold text-white shadow-lg",
className,
)}
whileHover={{ scale: 1.05 }}
whileTap={{ scale: 0.95 }}
onClick={onClick}
>
<div className="absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent -translate-x-full animate-shimmer" />
<span className="relative z-10">{children}</span>
</motion.button>
);
}
-23
View File
@@ -1,23 +0,0 @@
"use client";
import { motion } from "motion/react";
import { cn } from "@/lib/utils";
interface TextRevealProps {
children: React.ReactNode;
className?: string;
}
export function TextReveal({ children, className }: TextRevealProps) {
return (
<motion.p
className={cn("text-gray-300 leading-relaxed", className)}
initial={{ opacity: 0, y: 20 }}
whileInView={{ opacity: 1, y: 0 }}
transition={{ duration: 0.8 }}
viewport={{ once: true }}
>
{children}
</motion.p>
);
}
-5
View File
@@ -1,5 +0,0 @@
link meu portifólio atual:https://evandro.dev.br/
minha imagem:./imagens
markdown linkedin:
-19
View File
@@ -1,19 +0,0 @@
---
plan name: frontend-review
plan description: Analyze frontend for improvements and performance.
plan status: active
---
## Idea
Review the project's UI/UX, performance, and animation usage, then provide actionable improvement recommendations.
## Implementation
- Analyze UI components for Web Interface Guidelines compliance.
- Audit Next.js App Router and React patterns for performance.
- Review animation (GSAP/Framer Motion) usage and performance.
- Synthesize findings into an actionable improvement roadmap.
- Present plan and recommendations to the user for feedback.
## Required Specs
<!-- SPECS_START -->
<!-- SPECS_END -->
-50
View File
@@ -1,50 +0,0 @@
# Hero Circuit Board Animation Plan
## Goal
Implementar um novo design para o componente `Hero.tsx` com uma estética "Hardware / Circuit Board", utilizando SVGs animados via Framer Motion para simular trilhas de circuito impresso, mantendo o conteúdo atual (títulos, links, botões) e garantindo alta performance e acessibilidade.
## Design Direction & DFII
- **Aesthetic Direction:** Industrial / Utilitarian (Cybernetic Hardware). Foco na convergência entre hardware e web moderna.
- **Differentiation Anchor:** Um fundo SVG com linhas ortogonais (traços 90° e 45°) que se desenham sutilmente do centro para as bordas (ou vice-versa) reagindo ao scroll ou carregamento inicial, substituindo o letreiro atual.
- **DFII Assessment:** Impacto (4) + Context Fit (5) + Viabilidade (4) + Performance (4) - Risco de Consistência (2) = **15 (Excelente)**.
## Tasks
- [ ] **Task 1: Preparar o ambiente e limpar o Hero atual**
- **Ação:** Criar uma branch `feature/hero-circuit-board` (opcional). Fazer backup mental do componente atual. Remover elementos antigos (`Marquee`, `bg-grid-light`) de `app/components/Hero.tsx`.
- **Verify:** O projeto compila sem erros (`pnpm run build`), o Hero renderiza apenas fundo escuro e o texto central sem as marcações infinitas.
- [ ] **Task 2: Extrair o background para um novo componente**
- **Ação:** Criar o arquivo `app/components/animations/CircuitBoardBackground.tsx`. Configurar o componente base de UI.
- **Verify:** Importar no `Hero.tsx` e garantir que renderiza um `div` simples preenchendo a tela por trás do texto sem quebrar o layout.
- [ ] **Task 3: Desenhar os caminhos SVG (PCB Traces)**
- **Ação:** No `CircuitBoardBackground.tsx`, adicionar um elemento `<svg>` que ocupe todo o fundo. Criar múltiplos `<path>` estáticos com ângulos característicos de placas eletrônicas (45° e 90°). Adicionar nós circulares (`<circle>`) nas extremidades. Usar opacidade baixa para manter sutil.
- **Verify:** No navegador, as trilhas da placa de circuito estão visíveis no fundo do Hero, não atrapalhando a legibilidade do texto.
- [ ] **Task 4: Animar o desenho dos caminhos com Framer Motion**
- **Ação:** Converter `<svg>` e `<path>` para `<motion.svg>` e `<motion.path>`. Aplicar animações usando `strokeDasharray` e `strokeDashoffset` (ou propriedades nativas do framer motion como `pathLength: 1`) para animar a renderização do centro para fora no carregamento (`initial` e `animate`).
- **Verify:** Ao recarregar a página, as linhas do circuito "crescem" de forma animada até o estado final.
- [ ] **Task 5: Animar pontos de dados ("pulsos" ou dados fluindo)**
- **Ação:** Adicionar pequenos círculos ou feixes de luz que percorrem os caminhos SVG periodicamente, simbolizando dados fluindo pelos barramentos.
- **Verify:** A animação tem movimento contínuo (mas muito sutil), validando o efeito estético de hardware ativo.
- [ ] **Task 6: Refinar o Conteúdo do Hero e "System Online"**
- **Ação:** Ajustar cores, espaçamentos e z-index em `Hero.tsx` para garantir que o texto "EVANDRO.DEV.BR" e a badge "System Online" fiquem totalmente legíveis e contrastem perfeitamente com o novo fundo.
- **Verify:** Contrast-ratio acessível; botões e links funcionais no topo das animações SVG.
- [ ] **Task 7: Garantir responsividade e Reduced Motion**
- **Ação:** Ajustar viewBox do SVG para funcionar bem em telas mobile. Garantir suporte ao hook `useReducedMotion` já existente no Hero, desativando ou encurtando animações longas para quem prefere movimento reduzido.
- **Verify:** Animações desligadas/suaves quando o sistema pedir. Nenhum scroll horizontal na tela do mobile (`max-w-full`).
- [ ] **Task 8: Validar performance e arrumar testes**
- **Ação:** Executar suítes de teste (especialmente de responsividade e animações baseadas em propriedades) para corrigir qualquer erro causado pela mudança no DOM. Corrigir falhas pendentes de chaves duplicadas.
- **Verify:** `pnpm test` passa sem os warnings do framer-motion em elementos normais e sem erros de `Experience`. (Nota: Consertar testes antigos se possível, mas isolar o teste do Hero).
## Done When
- [ ] O componente Hero exibe trilhas de circuito SVG animadas atrás do texto.
- [ ] O carregamento inicial transmite a estética de "hardware sendo ativado".
- [ ] Acessibilidade e regras de contraste de texto estão intactas.
- [ ] Respeita preferência de `prefers-reduced-motion`.
- [ ] Todos os testes locais e builds não apresentam regressões críticas do frontend.
-31
View File
@@ -1,31 +0,0 @@
import type { Config } from "jest";
const config: Config = {
coverageProvider: "v8",
testEnvironment: "jsdom",
setupFilesAfterEnv: ["<rootDir>/jest.setup.ts"],
moduleNameMapper: {
"^@/(.*)$": "<rootDir>/$1",
"^.+\\.(css|sass|scss)$": "identity-obj-proxy",
"^.+/animations/PointCloud$":
"<rootDir>/app/components/animations/__mocks__/PointCloud.tsx",
},
testMatch: ["**/__tests__/**/*.[jt]s?(x)", "**/?(*.)+(spec|test).[jt]s?(x)"],
transform: {
"^.+\\.(ts|tsx)$": [
"ts-jest",
{
tsconfig: {
jsx: "react-jsx",
esModuleInterop: true,
},
},
],
},
moduleFileExtensions: ["ts", "tsx", "js", "jsx"],
testEnvironmentOptions: {
customExportConditions: [""],
},
};
export default config;
Loaded 100 of 132 files, more files were not shown because too many files have changed in this diff. Show more