Complete Phase 1: React modernization foundation
- Initialize Vite + React 19 + TypeScript project - Configure Tailwind CSS v4 with design tokens - Add Button component (13 tests) - Add Card component (11 tests) - Add Container component (9 tests) - Add Header component with glassmorphism (17 tests) - Add Footer component (13 tests) - Add MobileNav with slide-out menu (19 tests) - Update App.tsx with layout preview 82 tests passing Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
24
.gitignore
vendored
Normal file
24
.gitignore
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
dist
|
||||
dist-ssr
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.idea
|
||||
.DS_Store
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
73
README.md
Normal file
73
README.md
Normal file
@ -0,0 +1,73 @@
|
||||
# React + TypeScript + Vite
|
||||
|
||||
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
||||
|
||||
Currently, two official plugins are available:
|
||||
|
||||
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh
|
||||
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
||||
|
||||
## React Compiler
|
||||
|
||||
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
|
||||
|
||||
## Expanding the ESLint configuration
|
||||
|
||||
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
|
||||
|
||||
```js
|
||||
export default defineConfig([
|
||||
globalIgnores(['dist']),
|
||||
{
|
||||
files: ['**/*.{ts,tsx}'],
|
||||
extends: [
|
||||
// Other configs...
|
||||
|
||||
// Remove tseslint.configs.recommended and replace with this
|
||||
tseslint.configs.recommendedTypeChecked,
|
||||
// Alternatively, use this for stricter rules
|
||||
tseslint.configs.strictTypeChecked,
|
||||
// Optionally, add this for stylistic rules
|
||||
tseslint.configs.stylisticTypeChecked,
|
||||
|
||||
// Other configs...
|
||||
],
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
||||
tsconfigRootDir: import.meta.dirname,
|
||||
},
|
||||
// other options...
|
||||
},
|
||||
},
|
||||
])
|
||||
```
|
||||
|
||||
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
|
||||
|
||||
```js
|
||||
// eslint.config.js
|
||||
import reactX from 'eslint-plugin-react-x'
|
||||
import reactDom from 'eslint-plugin-react-dom'
|
||||
|
||||
export default defineConfig([
|
||||
globalIgnores(['dist']),
|
||||
{
|
||||
files: ['**/*.{ts,tsx}'],
|
||||
extends: [
|
||||
// Other configs...
|
||||
// Enable lint rules for React
|
||||
reactX.configs['recommended-typescript'],
|
||||
// Enable lint rules for React DOM
|
||||
reactDom.configs.recommended,
|
||||
],
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
||||
tsconfigRootDir: import.meta.dirname,
|
||||
},
|
||||
// other options...
|
||||
},
|
||||
},
|
||||
])
|
||||
```
|
||||
23
eslint.config.js
Normal file
23
eslint.config.js
Normal file
@ -0,0 +1,23 @@
|
||||
import js from '@eslint/js'
|
||||
import globals from 'globals'
|
||||
import reactHooks from 'eslint-plugin-react-hooks'
|
||||
import reactRefresh from 'eslint-plugin-react-refresh'
|
||||
import tseslint from 'typescript-eslint'
|
||||
import { defineConfig, globalIgnores } from 'eslint/config'
|
||||
|
||||
export default defineConfig([
|
||||
globalIgnores(['dist']),
|
||||
{
|
||||
files: ['**/*.{ts,tsx}'],
|
||||
extends: [
|
||||
js.configs.recommended,
|
||||
tseslint.configs.recommended,
|
||||
reactHooks.configs.flat.recommended,
|
||||
reactRefresh.configs.vite,
|
||||
],
|
||||
languageOptions: {
|
||||
ecmaVersion: 2020,
|
||||
globals: globals.browser,
|
||||
},
|
||||
},
|
||||
])
|
||||
769
index.html
769
index.html
@ -1,756 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Maverick Applications - Custom Software Solutions</title>
|
||||
<meta name="description" content="Professional software development and custom application solutions. Built with precision, delivered with excellence.">
|
||||
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
:root {
|
||||
--primary: #2563eb;
|
||||
--primary-dark: #1d4ed8;
|
||||
--secondary: #64748b;
|
||||
--accent: #f59e0b;
|
||||
--text-primary: #1e293b;
|
||||
--text-secondary: #64748b;
|
||||
--bg-primary: #ffffff;
|
||||
--bg-secondary: #f8fafc;
|
||||
--border: #e2e8f0;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
||||
line-height: 1.6;
|
||||
color: var(--text-primary);
|
||||
background: var(--bg-primary);
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
padding: 0 2rem;
|
||||
}
|
||||
|
||||
/* Header */
|
||||
header {
|
||||
background: rgba(255, 255, 255, 0.95);
|
||||
backdrop-filter: blur(10px);
|
||||
border-bottom: 1px solid var(--border);
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 1000;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
nav {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 1rem 0;
|
||||
}
|
||||
|
||||
.logo {
|
||||
font-size: 1.5rem;
|
||||
font-weight: 700;
|
||||
color: var(--primary);
|
||||
text-decoration: none;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.logo::before {
|
||||
content: "◆";
|
||||
font-size: 1.2rem;
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
.nav-links {
|
||||
display: flex;
|
||||
list-style: none;
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
.nav-links a {
|
||||
text-decoration: none;
|
||||
color: var(--text-secondary);
|
||||
font-weight: 500;
|
||||
transition: color 0.3s ease;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.nav-links a:hover {
|
||||
color: var(--primary);
|
||||
}
|
||||
|
||||
.nav-links a::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: -5px;
|
||||
left: 0;
|
||||
width: 0;
|
||||
height: 2px;
|
||||
background: var(--primary);
|
||||
transition: width 0.3s ease;
|
||||
}
|
||||
|
||||
.nav-links a:hover::after {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* Hero Section */
|
||||
.hero {
|
||||
background: linear-gradient(135deg, var(--bg-secondary) 0%, #f1f5f9 100%);
|
||||
padding: 8rem 0 6rem;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.hero::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: -50%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: linear-gradient(135deg, transparent 0%, rgba(37, 99, 235, 0.05) 100%);
|
||||
transform: skewX(-15deg);
|
||||
}
|
||||
|
||||
.hero-content {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 4rem;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.hero-text h1 {
|
||||
font-size: 3.5rem;
|
||||
font-weight: 800;
|
||||
line-height: 1.1;
|
||||
margin-bottom: 1.5rem;
|
||||
background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary) 100%);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
background-clip: text;
|
||||
}
|
||||
|
||||
.hero-text p {
|
||||
font-size: 1.25rem;
|
||||
color: var(--text-secondary);
|
||||
margin-bottom: 2rem;
|
||||
max-width: 500px;
|
||||
}
|
||||
|
||||
.cta-buttons {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.btn {
|
||||
padding: 0.875rem 2rem;
|
||||
border-radius: 0.5rem;
|
||||
text-decoration: none;
|
||||
font-weight: 600;
|
||||
transition: all 0.3s ease;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background: var(--primary);
|
||||
color: white;
|
||||
box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.39);
|
||||
}
|
||||
|
||||
.btn-primary:hover {
|
||||
background: var(--primary-dark);
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 8px 25px 0 rgba(37, 99, 235, 0.5);
|
||||
}
|
||||
|
||||
.btn-secondary {
|
||||
background: transparent;
|
||||
color: var(--primary);
|
||||
border: 2px solid var(--primary);
|
||||
}
|
||||
|
||||
.btn-secondary:hover {
|
||||
background: var(--primary);
|
||||
color: white;
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.hero-visual {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.tech-stack {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 1rem;
|
||||
max-width: 400px;
|
||||
}
|
||||
|
||||
.tech-item {
|
||||
background: white;
|
||||
padding: 1.5rem;
|
||||
border-radius: 1rem;
|
||||
text-align: center;
|
||||
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
|
||||
transition: transform 0.3s ease;
|
||||
border: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.tech-item:hover {
|
||||
transform: translateY(-5px);
|
||||
}
|
||||
|
||||
.tech-item::before {
|
||||
content: attr(data-icon);
|
||||
font-size: 2rem;
|
||||
display: block;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
/* Services Section */
|
||||
.services {
|
||||
padding: 6rem 0;
|
||||
background: var(--bg-primary);
|
||||
}
|
||||
|
||||
.section-header {
|
||||
text-align: center;
|
||||
margin-bottom: 4rem;
|
||||
}
|
||||
|
||||
.section-header h2 {
|
||||
font-size: 2.5rem;
|
||||
font-weight: 700;
|
||||
margin-bottom: 1rem;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.section-header p {
|
||||
font-size: 1.125rem;
|
||||
color: var(--text-secondary);
|
||||
max-width: 600px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.services-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
.service-card {
|
||||
background: white;
|
||||
padding: 2rem;
|
||||
border-radius: 1rem;
|
||||
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
|
||||
border: 1px solid var(--border);
|
||||
transition: all 0.3s ease;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.service-card::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 4px;
|
||||
background: linear-gradient(90deg, var(--primary), var(--accent));
|
||||
}
|
||||
|
||||
.service-card:hover {
|
||||
transform: translateY(-5px);
|
||||
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.service-icon {
|
||||
font-size: 3rem;
|
||||
margin-bottom: 1rem;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.service-card h3 {
|
||||
font-size: 1.5rem;
|
||||
font-weight: 600;
|
||||
margin-bottom: 1rem;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.service-card p {
|
||||
color: var(--text-secondary);
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
/* Stats Section */
|
||||
.stats {
|
||||
background: var(--primary);
|
||||
padding: 4rem 0;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.stats-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
||||
gap: 2rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.stat-item h3 {
|
||||
font-size: 3rem;
|
||||
font-weight: 800;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.stat-item p {
|
||||
font-size: 1.125rem;
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
/* Contact Section */
|
||||
.contact {
|
||||
padding: 6rem 0;
|
||||
background: var(--bg-secondary);
|
||||
}
|
||||
|
||||
.contact-content {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 4rem;
|
||||
align-items: start;
|
||||
}
|
||||
|
||||
.contact-info h3 {
|
||||
font-size: 1.5rem;
|
||||
font-weight: 600;
|
||||
margin-bottom: 1rem;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.contact-info p {
|
||||
color: var(--text-secondary);
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.contact-methods {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.contact-method {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
padding: 1rem;
|
||||
background: white;
|
||||
border-radius: 0.5rem;
|
||||
border: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.contact-method span {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.contact-form {
|
||||
background: white;
|
||||
padding: 2rem;
|
||||
border-radius: 1rem;
|
||||
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
|
||||
border: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
.form-group label {
|
||||
display: block;
|
||||
margin-bottom: 0.5rem;
|
||||
font-weight: 500;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.form-group input,
|
||||
.form-group textarea {
|
||||
width: 100%;
|
||||
padding: 0.75rem;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 0.5rem;
|
||||
font-size: 1rem;
|
||||
transition: border-color 0.3s ease;
|
||||
}
|
||||
|
||||
.form-group input:focus,
|
||||
.form-group textarea:focus {
|
||||
outline: none;
|
||||
border-color: var(--primary);
|
||||
}
|
||||
|
||||
.form-group textarea {
|
||||
height: 120px;
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
/* Footer */
|
||||
footer {
|
||||
background: var(--text-primary);
|
||||
color: white;
|
||||
padding: 2rem 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.footer-content {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.footer-links {
|
||||
display: flex;
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
.footer-links a {
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
text-decoration: none;
|
||||
transition: color 0.3s ease;
|
||||
}
|
||||
|
||||
.footer-links a:hover {
|
||||
color: white;
|
||||
}
|
||||
|
||||
/* Responsive Design */
|
||||
@media (max-width: 768px) {
|
||||
.container {
|
||||
padding: 0 1rem;
|
||||
}
|
||||
|
||||
.hero {
|
||||
padding: 6rem 0 4rem;
|
||||
}
|
||||
|
||||
.hero-content {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 3rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.hero-text h1 {
|
||||
font-size: 2.5rem;
|
||||
}
|
||||
|
||||
.nav-links {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.contact-content {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
.cta-buttons {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.footer-content {
|
||||
flex-direction: column;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
/* Animations */
|
||||
@keyframes fadeInUp {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(30px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
.animate-fade-in {
|
||||
animation: fadeInUp 0.6s ease-out;
|
||||
}
|
||||
|
||||
/* Smooth scroll */
|
||||
html {
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<nav class="container">
|
||||
<a href="#" class="logo">Maverick Applications</a>
|
||||
<ul class="nav-links">
|
||||
<li><a href="#home">Home</a></li>
|
||||
<li><a href="#services">Services</a></li>
|
||||
<li><a href="#about">About</a></li>
|
||||
<li><a href="#contact">Contact</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<section id="home" class="hero">
|
||||
<div class="container">
|
||||
<div class="hero-content">
|
||||
<div class="hero-text animate-fade-in">
|
||||
<h1>Custom Software Solutions</h1>
|
||||
<p>Building robust, scalable applications with cutting-edge technology. From concept to deployment, we deliver excellence in every line of code.</p>
|
||||
<div class="cta-buttons">
|
||||
<a href="#contact" class="btn btn-primary">Get Started</a>
|
||||
<a href="#services" class="btn btn-secondary">Our Services</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hero-visual">
|
||||
<div class="tech-stack">
|
||||
<div class="tech-item" data-icon="⚡">
|
||||
<strong>Fast</strong>
|
||||
</div>
|
||||
<div class="tech-item" data-icon="🔒">
|
||||
<strong>Secure</strong>
|
||||
</div>
|
||||
<div class="tech-item" data-icon="📱">
|
||||
<strong>Modern</strong>
|
||||
</div>
|
||||
<div class="tech-item" data-icon="☁️">
|
||||
<strong>Cloud</strong>
|
||||
</div>
|
||||
<div class="tech-item" data-icon="🚀">
|
||||
<strong>Scalable</strong>
|
||||
</div>
|
||||
<div class="tech-item" data-icon="🎯">
|
||||
<strong>Precise</strong>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="services" class="services">
|
||||
<div class="container">
|
||||
<div class="section-header">
|
||||
<h2>Our Services</h2>
|
||||
<p>Comprehensive software development solutions tailored to your business needs</p>
|
||||
</div>
|
||||
<div class="services-grid">
|
||||
<div class="service-card">
|
||||
<span class="service-icon">💻</span>
|
||||
<h3>Web Applications</h3>
|
||||
<p>Full-stack web development using modern frameworks and technologies. Responsive, fast, and user-friendly applications that scale with your business.</p>
|
||||
</div>
|
||||
<div class="service-card">
|
||||
<span class="service-icon">📱</span>
|
||||
<h3>Mobile Development</h3>
|
||||
<p>Native and cross-platform mobile applications for iOS and Android. Beautiful interfaces with seamless user experiences.</p>
|
||||
</div>
|
||||
<div class="service-card">
|
||||
<span class="service-icon">🔧</span>
|
||||
<h3>DevOps & Infrastructure</h3>
|
||||
<p>Server setup, containerization, CI/CD pipelines, and cloud deployment. Like our Traefik-powered infrastructure for optimal performance.</p>
|
||||
</div>
|
||||
<div class="service-card">
|
||||
<span class="service-icon">🔍</span>
|
||||
<h3>System Integration</h3>
|
||||
<p>Connecting disparate systems and APIs to create unified solutions. Data synchronization and workflow automation.</p>
|
||||
</div>
|
||||
<div class="service-card">
|
||||
<span class="service-icon">🛡️</span>
|
||||
<h3>Security Solutions</h3>
|
||||
<p>Implementing robust security measures, authentication systems, and compliance frameworks to protect your digital assets.</p>
|
||||
</div>
|
||||
<div class="service-card">
|
||||
<span class="service-icon">📊</span>
|
||||
<h3>Data Analytics</h3>
|
||||
<p>Transform your data into actionable insights with custom dashboards, reporting tools, and business intelligence solutions.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="stats">
|
||||
<div class="container">
|
||||
<div class="stats-grid">
|
||||
<div class="stat-item">
|
||||
<h3>100+</h3>
|
||||
<p>Projects Delivered</p>
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
<h3>99.9%</h3>
|
||||
<p>Uptime</p>
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
<h3>24/7</h3>
|
||||
<p>Support</p>
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
<h3>5⭐</h3>
|
||||
<p>Client Rating</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="contact" class="contact">
|
||||
<div class="container">
|
||||
<div class="section-header">
|
||||
<h2>Get In Touch</h2>
|
||||
<p>Ready to start your next project? Let's discuss how we can help bring your ideas to life.</p>
|
||||
</div>
|
||||
<div class="contact-content">
|
||||
<div class="contact-info">
|
||||
<h3>Let's Work Together</h3>
|
||||
<p>We're always excited to take on new challenges and help businesses grow through innovative software solutions.</p>
|
||||
<div class="contact-methods">
|
||||
<div class="contact-method">
|
||||
<span>📧</span>
|
||||
<div>
|
||||
<strong>Email</strong>
|
||||
<p>hello@maverickapplications.com</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="contact-method">
|
||||
<span>💬</span>
|
||||
<div>
|
||||
<strong>Response Time</strong>
|
||||
<p>Within 24 hours</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="contact-method">
|
||||
<span>🌐</span>
|
||||
<div>
|
||||
<strong>Location</strong>
|
||||
<p>Worldwide Remote</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<form class="contact-form" onsubmit="handleSubmit(event)">
|
||||
<div class="form-group">
|
||||
<label for="name">Name</label>
|
||||
<input type="text" id="name" name="name" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="email">Email</label>
|
||||
<input type="email" id="email" name="email" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="project">Project Type</label>
|
||||
<input type="text" id="project" name="project" placeholder="Web App, Mobile App, etc.">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="message">Message</label>
|
||||
<textarea id="message" name="message" placeholder="Tell us about your project..." required></textarea>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary" style="width: 100%;">Send Message</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<footer>
|
||||
<div class="container">
|
||||
<div class="footer-content">
|
||||
<div class="logo">Maverick Applications</div>
|
||||
<div class="footer-links">
|
||||
<a href="#home">Home</a>
|
||||
<a href="#services">Services</a>
|
||||
<a href="#contact">Contact</a>
|
||||
</div>
|
||||
<p>© 2025 Maverick Applications. All rights reserved.</p>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script>
|
||||
// Smooth scrolling for navigation links
|
||||
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
|
||||
anchor.addEventListener('click', function (e) {
|
||||
e.preventDefault();
|
||||
const target = document.querySelector(this.getAttribute('href'));
|
||||
if (target) {
|
||||
target.scrollIntoView({
|
||||
behavior: 'smooth',
|
||||
block: 'start'
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Header scroll effect
|
||||
window.addEventListener('scroll', () => {
|
||||
const header = document.querySelector('header');
|
||||
if (window.scrollY > 100) {
|
||||
header.style.background = 'rgba(255, 255, 255, 0.98)';
|
||||
header.style.boxShadow = '0 4px 6px -1px rgba(0, 0, 0, 0.1)';
|
||||
} else {
|
||||
header.style.background = 'rgba(255, 255, 255, 0.95)';
|
||||
header.style.boxShadow = 'none';
|
||||
}
|
||||
});
|
||||
|
||||
// Form submission handler
|
||||
function handleSubmit(event) {
|
||||
event.preventDefault();
|
||||
const form = event.target;
|
||||
const formData = new FormData(form);
|
||||
|
||||
// Show success message
|
||||
alert('Thank you for your message! We\'ll get back to you within 24 hours.');
|
||||
form.reset();
|
||||
}
|
||||
|
||||
// Animate elements on scroll
|
||||
const observerOptions = {
|
||||
threshold: 0.1,
|
||||
rootMargin: '0px 0px -50px 0px'
|
||||
};
|
||||
|
||||
const observer = new IntersectionObserver((entries) => {
|
||||
entries.forEach(entry => {
|
||||
if (entry.isIntersecting) {
|
||||
entry.target.classList.add('animate-fade-in');
|
||||
}
|
||||
});
|
||||
}, observerOptions);
|
||||
|
||||
// Observe service cards and other elements
|
||||
document.querySelectorAll('.service-card, .stat-item').forEach(el => {
|
||||
observer.observe(el);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Maverick Applications - Software Development Services</title>
|
||||
<meta name="description" content="Professional software development services. From concept to deployment, we build modern web applications that drive business growth." />
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/src/main.tsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
<!-- Last updated: $(date) -->
|
||||
|
||||
756
index.html.backup
Normal file
756
index.html.backup
Normal file
@ -0,0 +1,756 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Maverick Applications - Custom Software Solutions</title>
|
||||
<meta name="description" content="Professional software development and custom application solutions. Built with precision, delivered with excellence.">
|
||||
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
:root {
|
||||
--primary: #2563eb;
|
||||
--primary-dark: #1d4ed8;
|
||||
--secondary: #64748b;
|
||||
--accent: #f59e0b;
|
||||
--text-primary: #1e293b;
|
||||
--text-secondary: #64748b;
|
||||
--bg-primary: #ffffff;
|
||||
--bg-secondary: #f8fafc;
|
||||
--border: #e2e8f0;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
||||
line-height: 1.6;
|
||||
color: var(--text-primary);
|
||||
background: var(--bg-primary);
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
padding: 0 2rem;
|
||||
}
|
||||
|
||||
/* Header */
|
||||
header {
|
||||
background: rgba(255, 255, 255, 0.95);
|
||||
backdrop-filter: blur(10px);
|
||||
border-bottom: 1px solid var(--border);
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 1000;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
nav {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 1rem 0;
|
||||
}
|
||||
|
||||
.logo {
|
||||
font-size: 1.5rem;
|
||||
font-weight: 700;
|
||||
color: var(--primary);
|
||||
text-decoration: none;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.logo::before {
|
||||
content: "◆";
|
||||
font-size: 1.2rem;
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
.nav-links {
|
||||
display: flex;
|
||||
list-style: none;
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
.nav-links a {
|
||||
text-decoration: none;
|
||||
color: var(--text-secondary);
|
||||
font-weight: 500;
|
||||
transition: color 0.3s ease;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.nav-links a:hover {
|
||||
color: var(--primary);
|
||||
}
|
||||
|
||||
.nav-links a::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: -5px;
|
||||
left: 0;
|
||||
width: 0;
|
||||
height: 2px;
|
||||
background: var(--primary);
|
||||
transition: width 0.3s ease;
|
||||
}
|
||||
|
||||
.nav-links a:hover::after {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* Hero Section */
|
||||
.hero {
|
||||
background: linear-gradient(135deg, var(--bg-secondary) 0%, #f1f5f9 100%);
|
||||
padding: 8rem 0 6rem;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.hero::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: -50%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: linear-gradient(135deg, transparent 0%, rgba(37, 99, 235, 0.05) 100%);
|
||||
transform: skewX(-15deg);
|
||||
}
|
||||
|
||||
.hero-content {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 4rem;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.hero-text h1 {
|
||||
font-size: 3.5rem;
|
||||
font-weight: 800;
|
||||
line-height: 1.1;
|
||||
margin-bottom: 1.5rem;
|
||||
background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary) 100%);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
background-clip: text;
|
||||
}
|
||||
|
||||
.hero-text p {
|
||||
font-size: 1.25rem;
|
||||
color: var(--text-secondary);
|
||||
margin-bottom: 2rem;
|
||||
max-width: 500px;
|
||||
}
|
||||
|
||||
.cta-buttons {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.btn {
|
||||
padding: 0.875rem 2rem;
|
||||
border-radius: 0.5rem;
|
||||
text-decoration: none;
|
||||
font-weight: 600;
|
||||
transition: all 0.3s ease;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background: var(--primary);
|
||||
color: white;
|
||||
box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.39);
|
||||
}
|
||||
|
||||
.btn-primary:hover {
|
||||
background: var(--primary-dark);
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 8px 25px 0 rgba(37, 99, 235, 0.5);
|
||||
}
|
||||
|
||||
.btn-secondary {
|
||||
background: transparent;
|
||||
color: var(--primary);
|
||||
border: 2px solid var(--primary);
|
||||
}
|
||||
|
||||
.btn-secondary:hover {
|
||||
background: var(--primary);
|
||||
color: white;
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.hero-visual {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.tech-stack {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 1rem;
|
||||
max-width: 400px;
|
||||
}
|
||||
|
||||
.tech-item {
|
||||
background: white;
|
||||
padding: 1.5rem;
|
||||
border-radius: 1rem;
|
||||
text-align: center;
|
||||
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
|
||||
transition: transform 0.3s ease;
|
||||
border: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.tech-item:hover {
|
||||
transform: translateY(-5px);
|
||||
}
|
||||
|
||||
.tech-item::before {
|
||||
content: attr(data-icon);
|
||||
font-size: 2rem;
|
||||
display: block;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
/* Services Section */
|
||||
.services {
|
||||
padding: 6rem 0;
|
||||
background: var(--bg-primary);
|
||||
}
|
||||
|
||||
.section-header {
|
||||
text-align: center;
|
||||
margin-bottom: 4rem;
|
||||
}
|
||||
|
||||
.section-header h2 {
|
||||
font-size: 2.5rem;
|
||||
font-weight: 700;
|
||||
margin-bottom: 1rem;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.section-header p {
|
||||
font-size: 1.125rem;
|
||||
color: var(--text-secondary);
|
||||
max-width: 600px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.services-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
.service-card {
|
||||
background: white;
|
||||
padding: 2rem;
|
||||
border-radius: 1rem;
|
||||
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
|
||||
border: 1px solid var(--border);
|
||||
transition: all 0.3s ease;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.service-card::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 4px;
|
||||
background: linear-gradient(90deg, var(--primary), var(--accent));
|
||||
}
|
||||
|
||||
.service-card:hover {
|
||||
transform: translateY(-5px);
|
||||
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.service-icon {
|
||||
font-size: 3rem;
|
||||
margin-bottom: 1rem;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.service-card h3 {
|
||||
font-size: 1.5rem;
|
||||
font-weight: 600;
|
||||
margin-bottom: 1rem;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.service-card p {
|
||||
color: var(--text-secondary);
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
/* Stats Section */
|
||||
.stats {
|
||||
background: var(--primary);
|
||||
padding: 4rem 0;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.stats-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
||||
gap: 2rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.stat-item h3 {
|
||||
font-size: 3rem;
|
||||
font-weight: 800;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.stat-item p {
|
||||
font-size: 1.125rem;
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
/* Contact Section */
|
||||
.contact {
|
||||
padding: 6rem 0;
|
||||
background: var(--bg-secondary);
|
||||
}
|
||||
|
||||
.contact-content {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 4rem;
|
||||
align-items: start;
|
||||
}
|
||||
|
||||
.contact-info h3 {
|
||||
font-size: 1.5rem;
|
||||
font-weight: 600;
|
||||
margin-bottom: 1rem;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.contact-info p {
|
||||
color: var(--text-secondary);
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.contact-methods {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.contact-method {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
padding: 1rem;
|
||||
background: white;
|
||||
border-radius: 0.5rem;
|
||||
border: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.contact-method span {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.contact-form {
|
||||
background: white;
|
||||
padding: 2rem;
|
||||
border-radius: 1rem;
|
||||
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
|
||||
border: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
.form-group label {
|
||||
display: block;
|
||||
margin-bottom: 0.5rem;
|
||||
font-weight: 500;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.form-group input,
|
||||
.form-group textarea {
|
||||
width: 100%;
|
||||
padding: 0.75rem;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 0.5rem;
|
||||
font-size: 1rem;
|
||||
transition: border-color 0.3s ease;
|
||||
}
|
||||
|
||||
.form-group input:focus,
|
||||
.form-group textarea:focus {
|
||||
outline: none;
|
||||
border-color: var(--primary);
|
||||
}
|
||||
|
||||
.form-group textarea {
|
||||
height: 120px;
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
/* Footer */
|
||||
footer {
|
||||
background: var(--text-primary);
|
||||
color: white;
|
||||
padding: 2rem 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.footer-content {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.footer-links {
|
||||
display: flex;
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
.footer-links a {
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
text-decoration: none;
|
||||
transition: color 0.3s ease;
|
||||
}
|
||||
|
||||
.footer-links a:hover {
|
||||
color: white;
|
||||
}
|
||||
|
||||
/* Responsive Design */
|
||||
@media (max-width: 768px) {
|
||||
.container {
|
||||
padding: 0 1rem;
|
||||
}
|
||||
|
||||
.hero {
|
||||
padding: 6rem 0 4rem;
|
||||
}
|
||||
|
||||
.hero-content {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 3rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.hero-text h1 {
|
||||
font-size: 2.5rem;
|
||||
}
|
||||
|
||||
.nav-links {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.contact-content {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
.cta-buttons {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.footer-content {
|
||||
flex-direction: column;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
/* Animations */
|
||||
@keyframes fadeInUp {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(30px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
.animate-fade-in {
|
||||
animation: fadeInUp 0.6s ease-out;
|
||||
}
|
||||
|
||||
/* Smooth scroll */
|
||||
html {
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<nav class="container">
|
||||
<a href="#" class="logo">Maverick Applications</a>
|
||||
<ul class="nav-links">
|
||||
<li><a href="#home">Home</a></li>
|
||||
<li><a href="#services">Services</a></li>
|
||||
<li><a href="#about">About</a></li>
|
||||
<li><a href="#contact">Contact</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<section id="home" class="hero">
|
||||
<div class="container">
|
||||
<div class="hero-content">
|
||||
<div class="hero-text animate-fade-in">
|
||||
<h1>Custom Software Solutions</h1>
|
||||
<p>Building robust, scalable applications with cutting-edge technology. From concept to deployment, we deliver excellence in every line of code.</p>
|
||||
<div class="cta-buttons">
|
||||
<a href="#contact" class="btn btn-primary">Get Started</a>
|
||||
<a href="#services" class="btn btn-secondary">Our Services</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hero-visual">
|
||||
<div class="tech-stack">
|
||||
<div class="tech-item" data-icon="⚡">
|
||||
<strong>Fast</strong>
|
||||
</div>
|
||||
<div class="tech-item" data-icon="🔒">
|
||||
<strong>Secure</strong>
|
||||
</div>
|
||||
<div class="tech-item" data-icon="📱">
|
||||
<strong>Modern</strong>
|
||||
</div>
|
||||
<div class="tech-item" data-icon="☁️">
|
||||
<strong>Cloud</strong>
|
||||
</div>
|
||||
<div class="tech-item" data-icon="🚀">
|
||||
<strong>Scalable</strong>
|
||||
</div>
|
||||
<div class="tech-item" data-icon="🎯">
|
||||
<strong>Precise</strong>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="services" class="services">
|
||||
<div class="container">
|
||||
<div class="section-header">
|
||||
<h2>Our Services</h2>
|
||||
<p>Comprehensive software development solutions tailored to your business needs</p>
|
||||
</div>
|
||||
<div class="services-grid">
|
||||
<div class="service-card">
|
||||
<span class="service-icon">💻</span>
|
||||
<h3>Web Applications</h3>
|
||||
<p>Full-stack web development using modern frameworks and technologies. Responsive, fast, and user-friendly applications that scale with your business.</p>
|
||||
</div>
|
||||
<div class="service-card">
|
||||
<span class="service-icon">📱</span>
|
||||
<h3>Mobile Development</h3>
|
||||
<p>Native and cross-platform mobile applications for iOS and Android. Beautiful interfaces with seamless user experiences.</p>
|
||||
</div>
|
||||
<div class="service-card">
|
||||
<span class="service-icon">🔧</span>
|
||||
<h3>DevOps & Infrastructure</h3>
|
||||
<p>Server setup, containerization, CI/CD pipelines, and cloud deployment. Like our Traefik-powered infrastructure for optimal performance.</p>
|
||||
</div>
|
||||
<div class="service-card">
|
||||
<span class="service-icon">🔍</span>
|
||||
<h3>System Integration</h3>
|
||||
<p>Connecting disparate systems and APIs to create unified solutions. Data synchronization and workflow automation.</p>
|
||||
</div>
|
||||
<div class="service-card">
|
||||
<span class="service-icon">🛡️</span>
|
||||
<h3>Security Solutions</h3>
|
||||
<p>Implementing robust security measures, authentication systems, and compliance frameworks to protect your digital assets.</p>
|
||||
</div>
|
||||
<div class="service-card">
|
||||
<span class="service-icon">📊</span>
|
||||
<h3>Data Analytics</h3>
|
||||
<p>Transform your data into actionable insights with custom dashboards, reporting tools, and business intelligence solutions.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="stats">
|
||||
<div class="container">
|
||||
<div class="stats-grid">
|
||||
<div class="stat-item">
|
||||
<h3>100+</h3>
|
||||
<p>Projects Delivered</p>
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
<h3>99.9%</h3>
|
||||
<p>Uptime</p>
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
<h3>24/7</h3>
|
||||
<p>Support</p>
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
<h3>5⭐</h3>
|
||||
<p>Client Rating</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="contact" class="contact">
|
||||
<div class="container">
|
||||
<div class="section-header">
|
||||
<h2>Get In Touch</h2>
|
||||
<p>Ready to start your next project? Let's discuss how we can help bring your ideas to life.</p>
|
||||
</div>
|
||||
<div class="contact-content">
|
||||
<div class="contact-info">
|
||||
<h3>Let's Work Together</h3>
|
||||
<p>We're always excited to take on new challenges and help businesses grow through innovative software solutions.</p>
|
||||
<div class="contact-methods">
|
||||
<div class="contact-method">
|
||||
<span>📧</span>
|
||||
<div>
|
||||
<strong>Email</strong>
|
||||
<p>hello@maverickapplications.com</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="contact-method">
|
||||
<span>💬</span>
|
||||
<div>
|
||||
<strong>Response Time</strong>
|
||||
<p>Within 24 hours</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="contact-method">
|
||||
<span>🌐</span>
|
||||
<div>
|
||||
<strong>Location</strong>
|
||||
<p>Worldwide Remote</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<form class="contact-form" onsubmit="handleSubmit(event)">
|
||||
<div class="form-group">
|
||||
<label for="name">Name</label>
|
||||
<input type="text" id="name" name="name" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="email">Email</label>
|
||||
<input type="email" id="email" name="email" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="project">Project Type</label>
|
||||
<input type="text" id="project" name="project" placeholder="Web App, Mobile App, etc.">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="message">Message</label>
|
||||
<textarea id="message" name="message" placeholder="Tell us about your project..." required></textarea>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary" style="width: 100%;">Send Message</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<footer>
|
||||
<div class="container">
|
||||
<div class="footer-content">
|
||||
<div class="logo">Maverick Applications</div>
|
||||
<div class="footer-links">
|
||||
<a href="#home">Home</a>
|
||||
<a href="#services">Services</a>
|
||||
<a href="#contact">Contact</a>
|
||||
</div>
|
||||
<p>© 2025 Maverick Applications. All rights reserved.</p>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script>
|
||||
// Smooth scrolling for navigation links
|
||||
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
|
||||
anchor.addEventListener('click', function (e) {
|
||||
e.preventDefault();
|
||||
const target = document.querySelector(this.getAttribute('href'));
|
||||
if (target) {
|
||||
target.scrollIntoView({
|
||||
behavior: 'smooth',
|
||||
block: 'start'
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Header scroll effect
|
||||
window.addEventListener('scroll', () => {
|
||||
const header = document.querySelector('header');
|
||||
if (window.scrollY > 100) {
|
||||
header.style.background = 'rgba(255, 255, 255, 0.98)';
|
||||
header.style.boxShadow = '0 4px 6px -1px rgba(0, 0, 0, 0.1)';
|
||||
} else {
|
||||
header.style.background = 'rgba(255, 255, 255, 0.95)';
|
||||
header.style.boxShadow = 'none';
|
||||
}
|
||||
});
|
||||
|
||||
// Form submission handler
|
||||
function handleSubmit(event) {
|
||||
event.preventDefault();
|
||||
const form = event.target;
|
||||
const formData = new FormData(form);
|
||||
|
||||
// Show success message
|
||||
alert('Thank you for your message! We\'ll get back to you within 24 hours.');
|
||||
form.reset();
|
||||
}
|
||||
|
||||
// Animate elements on scroll
|
||||
const observerOptions = {
|
||||
threshold: 0.1,
|
||||
rootMargin: '0px 0px -50px 0px'
|
||||
};
|
||||
|
||||
const observer = new IntersectionObserver((entries) => {
|
||||
entries.forEach(entry => {
|
||||
if (entry.isIntersecting) {
|
||||
entry.target.classList.add('animate-fade-in');
|
||||
}
|
||||
});
|
||||
}, observerOptions);
|
||||
|
||||
// Observe service cards and other elements
|
||||
document.querySelectorAll('.service-card, .stat-item').forEach(el => {
|
||||
observer.observe(el);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
<!-- Last updated: $(date) -->
|
||||
6579
package-lock.json
generated
Normal file
6579
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
48
package.json
Normal file
48
package.json
Normal file
@ -0,0 +1,48 @@
|
||||
{
|
||||
"name": "maverick-applications",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "tsc -b && vite build",
|
||||
"lint": "eslint .",
|
||||
"preview": "vite preview",
|
||||
"test": "vitest",
|
||||
"test:ui": "vitest --ui",
|
||||
"test:coverage": "vitest --coverage"
|
||||
},
|
||||
"dependencies": {
|
||||
"clsx": "^2.1.0",
|
||||
"framer-motion": "^11.0.0",
|
||||
"lucide-react": "^0.400.0",
|
||||
"react": "^19.2.0",
|
||||
"react-dom": "^19.2.0",
|
||||
"tailwind-merge": "^2.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.39.1",
|
||||
"@tailwindcss/vite": "^4.1.18",
|
||||
"@testing-library/jest-dom": "^6.4.0",
|
||||
"@testing-library/react": "^16.0.0",
|
||||
"@testing-library/user-event": "^14.5.0",
|
||||
"@types/node": "^24.10.1",
|
||||
"@types/react": "^19.2.5",
|
||||
"@types/react-dom": "^19.2.3",
|
||||
"@vitejs/plugin-react": "^5.1.1",
|
||||
"autoprefixer": "^10.4.24",
|
||||
"babel-plugin-react-compiler": "19.1.0-rc.3",
|
||||
"eslint": "^9.39.1",
|
||||
"eslint-plugin-react-compiler": "19.1.0-rc.2",
|
||||
"eslint-plugin-react-hooks": "^7.0.1",
|
||||
"eslint-plugin-react-refresh": "^0.4.24",
|
||||
"globals": "^16.5.0",
|
||||
"jsdom": "^24.0.0",
|
||||
"postcss": "^8.5.6",
|
||||
"tailwindcss": "^4.1.18",
|
||||
"typescript": "~5.9.3",
|
||||
"typescript-eslint": "^8.46.4",
|
||||
"vite": "^7.2.4",
|
||||
"vitest": "^2.0.0"
|
||||
}
|
||||
}
|
||||
7
postcss.config.js
Normal file
7
postcss.config.js
Normal file
@ -0,0 +1,7 @@
|
||||
export default {
|
||||
plugins: {
|
||||
// Note: With Tailwind v4 and @tailwindcss/vite, Tailwind is processed
|
||||
// directly by Vite, not PostCSS. This config is for autoprefixer only.
|
||||
autoprefixer: {},
|
||||
},
|
||||
}
|
||||
1
public/vite.svg
Normal file
1
public/vite.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
104
src/App.tsx
Normal file
104
src/App.tsx
Normal file
@ -0,0 +1,104 @@
|
||||
import { Header, Footer, Container } from './components/layout'
|
||||
import { Button } from './components/ui/Button'
|
||||
import { Card } from './components/ui/Card'
|
||||
|
||||
function App() {
|
||||
return (
|
||||
<div className="min-h-screen flex flex-col">
|
||||
<Header />
|
||||
|
||||
{/* Main content with top padding for fixed header */}
|
||||
<main className="flex-1 pt-20">
|
||||
{/* Hero Section Placeholder */}
|
||||
<section id="home" className="py-20 bg-gradient-to-br from-bg-primary to-bg-secondary">
|
||||
<Container>
|
||||
<div className="text-center max-w-3xl mx-auto">
|
||||
<h1 className="text-5xl md:text-6xl font-bold text-text-primary mb-6">
|
||||
Building <span className="text-primary">Digital</span> Experiences
|
||||
</h1>
|
||||
<p className="text-xl text-text-secondary mb-8">
|
||||
Custom software solutions that transform your business ideas into reality.
|
||||
</p>
|
||||
<div className="flex flex-wrap justify-center gap-4">
|
||||
<Button variant="primary" size="lg">
|
||||
Get Started
|
||||
</Button>
|
||||
<Button variant="secondary" size="lg">
|
||||
Learn More
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</Container>
|
||||
</section>
|
||||
|
||||
{/* Services Section Placeholder */}
|
||||
<section id="services" className="py-20">
|
||||
<Container>
|
||||
<h2 className="text-3xl md:text-4xl font-bold text-center text-text-primary mb-12">
|
||||
Our Services
|
||||
</h2>
|
||||
<div className="grid md:grid-cols-3 gap-6">
|
||||
<Card variant="default" padding="lg">
|
||||
<h3 className="text-xl font-semibold text-text-primary mb-3">
|
||||
Web Development
|
||||
</h3>
|
||||
<p className="text-text-secondary">
|
||||
Modern, responsive websites built with the latest technologies.
|
||||
</p>
|
||||
</Card>
|
||||
<Card variant="elevated" padding="lg">
|
||||
<h3 className="text-xl font-semibold text-text-primary mb-3">
|
||||
Mobile Apps
|
||||
</h3>
|
||||
<p className="text-text-secondary">
|
||||
Native and cross-platform mobile applications.
|
||||
</p>
|
||||
</Card>
|
||||
<Card variant="outlined" padding="lg">
|
||||
<h3 className="text-xl font-semibold text-text-primary mb-3">
|
||||
Cloud Solutions
|
||||
</h3>
|
||||
<p className="text-text-secondary">
|
||||
Scalable infrastructure and cloud architecture.
|
||||
</p>
|
||||
</Card>
|
||||
</div>
|
||||
</Container>
|
||||
</section>
|
||||
|
||||
{/* Process Section Placeholder */}
|
||||
<section id="process" className="py-20 bg-bg-secondary">
|
||||
<Container>
|
||||
<h2 className="text-3xl md:text-4xl font-bold text-center text-text-primary mb-12">
|
||||
Our Process
|
||||
</h2>
|
||||
<p className="text-center text-text-secondary max-w-2xl mx-auto">
|
||||
Phase 2 will add the animated workflow carousel here.
|
||||
</p>
|
||||
</Container>
|
||||
</section>
|
||||
|
||||
{/* Contact Section Placeholder */}
|
||||
<section id="contact" className="py-20">
|
||||
<Container>
|
||||
<h2 className="text-3xl md:text-4xl font-bold text-center text-text-primary mb-12">
|
||||
Get In Touch
|
||||
</h2>
|
||||
<div className="max-w-md mx-auto text-center">
|
||||
<p className="text-text-secondary mb-8">
|
||||
Ready to start your project? Contact us today.
|
||||
</p>
|
||||
<Button variant="primary" size="lg">
|
||||
Contact Us
|
||||
</Button>
|
||||
</div>
|
||||
</Container>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<Footer />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default App
|
||||
1
src/assets/react.svg
Normal file
1
src/assets/react.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="35.93" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 228"><path fill="#00D8FF" d="M210.483 73.824a171.49 171.49 0 0 0-8.24-2.597c.465-1.9.893-3.777 1.273-5.621c6.238-30.281 2.16-54.676-11.769-62.708c-13.355-7.7-35.196.329-57.254 19.526a171.23 171.23 0 0 0-6.375 5.848a155.866 155.866 0 0 0-4.241-3.917C100.759 3.829 77.587-4.822 63.673 3.233C50.33 10.957 46.379 33.89 51.995 62.588a170.974 170.974 0 0 0 1.892 8.48c-3.28.932-6.445 1.924-9.474 2.98C17.309 83.498 0 98.307 0 113.668c0 15.865 18.582 31.778 46.812 41.427a145.52 145.52 0 0 0 6.921 2.165a167.467 167.467 0 0 0-2.01 9.138c-5.354 28.2-1.173 50.591 12.134 58.266c13.744 7.926 36.812-.22 59.273-19.855a145.567 145.567 0 0 0 5.342-4.923a168.064 168.064 0 0 0 6.92 6.314c21.758 18.722 43.246 26.282 56.54 18.586c13.731-7.949 18.194-32.003 12.4-61.268a145.016 145.016 0 0 0-1.535-6.842c1.62-.48 3.21-.974 4.76-1.488c29.348-9.723 48.443-25.443 48.443-41.52c0-15.417-17.868-30.326-45.517-39.844Zm-6.365 70.984c-1.4.463-2.836.91-4.3 1.345c-3.24-10.257-7.612-21.163-12.963-32.432c5.106-11 9.31-21.767 12.459-31.957c2.619.758 5.16 1.557 7.61 2.4c23.69 8.156 38.14 20.213 38.14 29.504c0 9.896-15.606 22.743-40.946 31.14Zm-10.514 20.834c2.562 12.94 2.927 24.64 1.23 33.787c-1.524 8.219-4.59 13.698-8.382 15.893c-8.067 4.67-25.32-1.4-43.927-17.412a156.726 156.726 0 0 1-6.437-5.87c7.214-7.889 14.423-17.06 21.459-27.246c12.376-1.098 24.068-2.894 34.671-5.345a134.17 134.17 0 0 1 1.386 6.193ZM87.276 214.515c-7.882 2.783-14.16 2.863-17.955.675c-8.075-4.657-11.432-22.636-6.853-46.752a156.923 156.923 0 0 1 1.869-8.499c10.486 2.32 22.093 3.988 34.498 4.994c7.084 9.967 14.501 19.128 21.976 27.15a134.668 134.668 0 0 1-4.877 4.492c-9.933 8.682-19.886 14.842-28.658 17.94ZM50.35 144.747c-12.483-4.267-22.792-9.812-29.858-15.863c-6.35-5.437-9.555-10.836-9.555-15.216c0-9.322 13.897-21.212 37.076-29.293c2.813-.98 5.757-1.905 8.812-2.773c3.204 10.42 7.406 21.315 12.477 32.332c-5.137 11.18-9.399 22.249-12.634 32.792a134.718 134.718 0 0 1-6.318-1.979Zm12.378-84.26c-4.811-24.587-1.616-43.134 6.425-47.789c8.564-4.958 27.502 2.111 47.463 19.835a144.318 144.318 0 0 1 3.841 3.545c-7.438 7.987-14.787 17.08-21.808 26.988c-12.04 1.116-23.565 2.908-34.161 5.309a160.342 160.342 0 0 1-1.76-7.887Zm110.427 27.268a347.8 347.8 0 0 0-7.785-12.803c8.168 1.033 15.994 2.404 23.343 4.08c-2.206 7.072-4.956 14.465-8.193 22.045a381.151 381.151 0 0 0-7.365-13.322Zm-45.032-43.861c5.044 5.465 10.096 11.566 15.065 18.186a322.04 322.04 0 0 0-30.257-.006c4.974-6.559 10.069-12.652 15.192-18.18ZM82.802 87.83a323.167 323.167 0 0 0-7.227 13.238c-3.184-7.553-5.909-14.98-8.134-22.152c7.304-1.634 15.093-2.97 23.209-3.984a321.524 321.524 0 0 0-7.848 12.897Zm8.081 65.352c-8.385-.936-16.291-2.203-23.593-3.793c2.26-7.3 5.045-14.885 8.298-22.6a321.187 321.187 0 0 0 7.257 13.246c2.594 4.48 5.28 8.868 8.038 13.147Zm37.542 31.03c-5.184-5.592-10.354-11.779-15.403-18.433c4.902.192 9.899.29 14.978.29c5.218 0 10.376-.117 15.453-.343c-4.985 6.774-10.018 12.97-15.028 18.486Zm52.198-57.817c3.422 7.8 6.306 15.345 8.596 22.52c-7.422 1.694-15.436 3.058-23.88 4.071a382.417 382.417 0 0 0 7.859-13.026a347.403 347.403 0 0 0 7.425-13.565Zm-16.898 8.101a358.557 358.557 0 0 1-12.281 19.815a329.4 329.4 0 0 1-23.444.823c-7.967 0-15.716-.248-23.178-.732a310.202 310.202 0 0 1-12.513-19.846h.001a307.41 307.41 0 0 1-10.923-20.627a310.278 310.278 0 0 1 10.89-20.637l-.001.001a307.318 307.318 0 0 1 12.413-19.761c7.613-.576 15.42-.876 23.31-.876H128c7.926 0 15.743.303 23.354.883a329.357 329.357 0 0 1 12.335 19.695a358.489 358.489 0 0 1 11.036 20.54a329.472 329.472 0 0 1-11 20.722Zm22.56-122.124c8.572 4.944 11.906 24.881 6.52 51.026c-.344 1.668-.73 3.367-1.15 5.09c-10.622-2.452-22.155-4.275-34.23-5.408c-7.034-10.017-14.323-19.124-21.64-27.008a160.789 160.789 0 0 1 5.888-5.4c18.9-16.447 36.564-22.941 44.612-18.3ZM128 90.808c12.625 0 22.86 10.235 22.86 22.86s-10.235 22.86-22.86 22.86s-22.86-10.235-22.86-22.86s10.235-22.86 22.86-22.86Z"></path></svg>
|
||||
|
After Width: | Height: | Size: 4.0 KiB |
80
src/components/layout/Container.test.tsx
Normal file
80
src/components/layout/Container.test.tsx
Normal file
@ -0,0 +1,80 @@
|
||||
import { render, screen } from '@testing-library/react'
|
||||
import { describe, it, expect } from 'vitest'
|
||||
import { Container } from './Container'
|
||||
|
||||
describe('Container', () => {
|
||||
it('renders children correctly', () => {
|
||||
render(<Container>Test Content</Container>)
|
||||
expect(screen.getByText('Test Content')).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('applies max-width class', () => {
|
||||
render(<Container data-testid="container">Content</Container>)
|
||||
const container = screen.getByTestId('container')
|
||||
expect(container).toHaveClass('max-w-7xl')
|
||||
})
|
||||
|
||||
it('applies padding classes', () => {
|
||||
render(<Container data-testid="container">Content</Container>)
|
||||
const container = screen.getByTestId('container')
|
||||
expect(container).toHaveClass('px-4')
|
||||
expect(container).toHaveClass('md:px-8')
|
||||
})
|
||||
|
||||
it('applies auto margin for centering', () => {
|
||||
render(<Container data-testid="container">Content</Container>)
|
||||
const container = screen.getByTestId('container')
|
||||
expect(container).toHaveClass('mx-auto')
|
||||
})
|
||||
|
||||
it('renders as div by default', () => {
|
||||
render(<Container data-testid="container">Content</Container>)
|
||||
const container = screen.getByTestId('container')
|
||||
expect(container.tagName).toBe('DIV')
|
||||
})
|
||||
|
||||
it('renders as section when as="section"', () => {
|
||||
render(
|
||||
<Container as="section" data-testid="container">
|
||||
Content
|
||||
</Container>
|
||||
)
|
||||
const container = screen.getByTestId('container')
|
||||
expect(container.tagName).toBe('SECTION')
|
||||
})
|
||||
|
||||
it('renders as article when as="article"', () => {
|
||||
render(
|
||||
<Container as="article" data-testid="container">
|
||||
Content
|
||||
</Container>
|
||||
)
|
||||
const container = screen.getByTestId('container')
|
||||
expect(container.tagName).toBe('ARTICLE')
|
||||
})
|
||||
|
||||
it('renders as main when as="main"', () => {
|
||||
render(
|
||||
<Container as="main" data-testid="container">
|
||||
Content
|
||||
</Container>
|
||||
)
|
||||
const container = screen.getByTestId('container')
|
||||
expect(container.tagName).toBe('MAIN')
|
||||
})
|
||||
|
||||
it('merges custom className', () => {
|
||||
render(
|
||||
<Container className="bg-blue-500 mt-4" data-testid="container">
|
||||
Content
|
||||
</Container>
|
||||
)
|
||||
const container = screen.getByTestId('container')
|
||||
expect(container).toHaveClass('max-w-7xl')
|
||||
expect(container).toHaveClass('mx-auto')
|
||||
expect(container).toHaveClass('px-4')
|
||||
expect(container).toHaveClass('md:px-8')
|
||||
expect(container).toHaveClass('bg-blue-500')
|
||||
expect(container).toHaveClass('mt-4')
|
||||
})
|
||||
})
|
||||
28
src/components/layout/Container.tsx
Normal file
28
src/components/layout/Container.tsx
Normal file
@ -0,0 +1,28 @@
|
||||
import { cn } from '../../lib/utils'
|
||||
|
||||
interface ContainerProps {
|
||||
/** Container content */
|
||||
children: React.ReactNode
|
||||
/** Additional CSS classes */
|
||||
className?: string
|
||||
/** HTML element to render as */
|
||||
as?: 'div' | 'section' | 'article' | 'main'
|
||||
/** Test ID for testing */
|
||||
'data-testid'?: string
|
||||
}
|
||||
|
||||
export function Container({
|
||||
children,
|
||||
className,
|
||||
as: Component = 'div',
|
||||
'data-testid': testId,
|
||||
}: ContainerProps) {
|
||||
return (
|
||||
<Component
|
||||
className={cn('max-w-7xl mx-auto px-4 md:px-8', className)}
|
||||
data-testid={testId}
|
||||
>
|
||||
{children}
|
||||
</Component>
|
||||
)
|
||||
}
|
||||
121
src/components/layout/Footer.test.tsx
Normal file
121
src/components/layout/Footer.test.tsx
Normal file
@ -0,0 +1,121 @@
|
||||
import { render, screen } from '@testing-library/react'
|
||||
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'
|
||||
import { Footer } from './Footer'
|
||||
|
||||
describe('Footer', () => {
|
||||
// Mock the current year for consistent testing
|
||||
const mockYear = 2026
|
||||
let originalDate: DateConstructor
|
||||
|
||||
beforeEach(() => {
|
||||
originalDate = global.Date
|
||||
vi.useFakeTimers()
|
||||
vi.setSystemTime(new Date(mockYear, 0, 1))
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
vi.useRealTimers()
|
||||
global.Date = originalDate
|
||||
})
|
||||
|
||||
describe('Logo', () => {
|
||||
it('renders logo correctly', () => {
|
||||
render(<Footer />)
|
||||
expect(screen.getByText('Maverick')).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('logo has correct styling', () => {
|
||||
render(<Footer />)
|
||||
const logo = screen.getByText('Maverick').closest('a')
|
||||
expect(logo).toHaveClass('text-white')
|
||||
})
|
||||
})
|
||||
|
||||
describe('Navigation Links', () => {
|
||||
it('renders default navigation links', () => {
|
||||
render(<Footer />)
|
||||
|
||||
expect(screen.getByRole('link', { name: 'Home' })).toBeInTheDocument()
|
||||
expect(screen.getByRole('link', { name: 'Services' })).toBeInTheDocument()
|
||||
expect(screen.getByRole('link', { name: 'Contact' })).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('renders custom links when provided', () => {
|
||||
const customLinks = [
|
||||
{ label: 'About', href: '#about' },
|
||||
{ label: 'Portfolio', href: '#portfolio' },
|
||||
]
|
||||
|
||||
render(<Footer links={customLinks} />)
|
||||
|
||||
expect(screen.getByRole('link', { name: 'About' })).toBeInTheDocument()
|
||||
expect(screen.getByRole('link', { name: 'Portfolio' })).toBeInTheDocument()
|
||||
expect(screen.queryByRole('link', { name: 'Home' })).not.toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('links have correct href attributes', () => {
|
||||
render(<Footer />)
|
||||
|
||||
expect(screen.getByRole('link', { name: 'Home' })).toHaveAttribute('href', '#home')
|
||||
expect(screen.getByRole('link', { name: 'Services' })).toHaveAttribute('href', '#services')
|
||||
expect(screen.getByRole('link', { name: 'Contact' })).toHaveAttribute('href', '#contact')
|
||||
})
|
||||
|
||||
it('links are accessible with proper roles', () => {
|
||||
render(<Footer />)
|
||||
|
||||
const nav = screen.getByRole('navigation', { name: /footer/i })
|
||||
expect(nav).toBeInTheDocument()
|
||||
|
||||
const links = screen.getAllByRole('link')
|
||||
// Logo link + 3 nav links
|
||||
expect(links.length).toBeGreaterThanOrEqual(3)
|
||||
})
|
||||
})
|
||||
|
||||
describe('Copyright', () => {
|
||||
it('renders copyright with current year', () => {
|
||||
render(<Footer />)
|
||||
expect(screen.getByText(new RegExp(`${mockYear}`))).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('includes company name in copyright', () => {
|
||||
render(<Footer />)
|
||||
expect(screen.getByText(/Maverick Applications/i)).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('includes "All rights reserved" text', () => {
|
||||
render(<Footer />)
|
||||
expect(screen.getByText(/All rights reserved/i)).toBeInTheDocument()
|
||||
})
|
||||
})
|
||||
|
||||
describe('Styling', () => {
|
||||
it('applies dark background', () => {
|
||||
render(<Footer />)
|
||||
const footer = screen.getByRole('contentinfo')
|
||||
expect(footer).toHaveClass('bg-text-primary')
|
||||
})
|
||||
|
||||
it('has proper footer role', () => {
|
||||
render(<Footer />)
|
||||
expect(screen.getByRole('contentinfo')).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('applies white text color', () => {
|
||||
render(<Footer />)
|
||||
const footer = screen.getByRole('contentinfo')
|
||||
expect(footer).toHaveClass('text-white')
|
||||
})
|
||||
})
|
||||
|
||||
describe('Responsive Layout', () => {
|
||||
it('uses flex container with wrap', () => {
|
||||
render(<Footer />)
|
||||
// The inner container should have flex and flex-wrap classes
|
||||
const footer = screen.getByRole('contentinfo')
|
||||
const innerContainer = footer.querySelector('[class*="flex"]')
|
||||
expect(innerContainer).toBeInTheDocument()
|
||||
})
|
||||
})
|
||||
})
|
||||
63
src/components/layout/Footer.tsx
Normal file
63
src/components/layout/Footer.tsx
Normal file
@ -0,0 +1,63 @@
|
||||
import { Diamond } from 'lucide-react'
|
||||
import { cn } from '../../lib/utils'
|
||||
import { Container } from './Container'
|
||||
|
||||
interface FooterLink {
|
||||
label: string
|
||||
href: string
|
||||
}
|
||||
|
||||
interface FooterProps {
|
||||
links?: FooterLink[]
|
||||
}
|
||||
|
||||
const defaultLinks: FooterLink[] = [
|
||||
{ label: 'Home', href: '#home' },
|
||||
{ label: 'Services', href: '#services' },
|
||||
{ label: 'Contact', href: '#contact' },
|
||||
]
|
||||
|
||||
export function Footer({ links = defaultLinks }: FooterProps) {
|
||||
const currentYear = new Date().getFullYear()
|
||||
|
||||
return (
|
||||
<footer className="bg-text-primary text-white py-8">
|
||||
<Container>
|
||||
<div className="flex flex-wrap items-center justify-between gap-4">
|
||||
{/* Logo */}
|
||||
<a
|
||||
href="#home"
|
||||
className="flex items-center gap-2 text-xl font-bold text-white"
|
||||
>
|
||||
<Diamond className="h-5 w-5 text-accent" />
|
||||
<span>Maverick</span>
|
||||
</a>
|
||||
|
||||
{/* Navigation */}
|
||||
<nav aria-label="Footer navigation">
|
||||
<ul className="flex flex-wrap items-center gap-6">
|
||||
{links.map((link) => (
|
||||
<li key={link.href}>
|
||||
<a
|
||||
href={link.href}
|
||||
className={cn(
|
||||
'text-white/80 transition-colors duration-200',
|
||||
'hover:text-white'
|
||||
)}
|
||||
>
|
||||
{link.label}
|
||||
</a>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
{/* Copyright */}
|
||||
<p className="w-full text-center text-sm text-white/60 mt-4 md:w-auto md:mt-0">
|
||||
© {currentYear} Maverick Applications. All rights reserved.
|
||||
</p>
|
||||
</div>
|
||||
</Container>
|
||||
</footer>
|
||||
)
|
||||
}
|
||||
200
src/components/layout/Header.test.tsx
Normal file
200
src/components/layout/Header.test.tsx
Normal file
@ -0,0 +1,200 @@
|
||||
import { render, screen, fireEvent } from '@testing-library/react'
|
||||
import userEvent from '@testing-library/user-event'
|
||||
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'
|
||||
import { Header } from './Header'
|
||||
|
||||
const mockScrollTo = vi.fn()
|
||||
|
||||
describe('Header', () => {
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks()
|
||||
// Reset scroll position
|
||||
Object.defineProperty(window, 'scrollY', { value: 0, writable: true })
|
||||
// Mock scrollIntoView
|
||||
Element.prototype.scrollIntoView = mockScrollTo
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
document.body.style.overflow = ''
|
||||
})
|
||||
|
||||
describe('Logo', () => {
|
||||
it('renders logo correctly', () => {
|
||||
render(<Header />)
|
||||
expect(screen.getByText('Maverick')).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('logo links to home', () => {
|
||||
render(<Header />)
|
||||
const logo = screen.getByRole('link', { name: /maverick/i })
|
||||
expect(logo).toHaveAttribute('href', '#home')
|
||||
})
|
||||
})
|
||||
|
||||
describe('Navigation Links', () => {
|
||||
it('renders default navigation links', () => {
|
||||
render(<Header />)
|
||||
|
||||
expect(screen.getByRole('link', { name: 'Home' })).toBeInTheDocument()
|
||||
expect(screen.getByRole('link', { name: 'Services' })).toBeInTheDocument()
|
||||
expect(screen.getByRole('link', { name: 'Process' })).toBeInTheDocument()
|
||||
expect(screen.getByRole('link', { name: 'Contact' })).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('renders custom navigation links when provided', () => {
|
||||
const customLinks = [
|
||||
{ label: 'About', href: '#about' },
|
||||
{ label: 'Portfolio', href: '#portfolio' },
|
||||
]
|
||||
|
||||
render(<Header links={customLinks} />)
|
||||
|
||||
expect(screen.getByRole('link', { name: 'About' })).toBeInTheDocument()
|
||||
expect(screen.getByRole('link', { name: 'Portfolio' })).toBeInTheDocument()
|
||||
expect(screen.queryByRole('link', { name: 'Home' })).not.toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('links have correct href attributes', () => {
|
||||
render(<Header />)
|
||||
|
||||
expect(screen.getByRole('link', { name: 'Home' })).toHaveAttribute('href', '#home')
|
||||
expect(screen.getByRole('link', { name: 'Services' })).toHaveAttribute('href', '#services')
|
||||
expect(screen.getByRole('link', { name: 'Process' })).toHaveAttribute('href', '#process')
|
||||
expect(screen.getByRole('link', { name: 'Contact' })).toHaveAttribute('href', '#contact')
|
||||
})
|
||||
})
|
||||
|
||||
describe('Styling', () => {
|
||||
it('applies fixed positioning', () => {
|
||||
render(<Header />)
|
||||
const header = screen.getByRole('banner')
|
||||
expect(header).toHaveClass('fixed')
|
||||
expect(header).toHaveClass('top-0')
|
||||
expect(header).toHaveClass('left-0')
|
||||
expect(header).toHaveClass('right-0')
|
||||
})
|
||||
|
||||
it('applies glassmorphism styles', () => {
|
||||
render(<Header />)
|
||||
const header = screen.getByRole('banner')
|
||||
expect(header).toHaveClass('backdrop-blur-md')
|
||||
})
|
||||
|
||||
it('has appropriate z-index', () => {
|
||||
render(<Header />)
|
||||
const header = screen.getByRole('banner')
|
||||
expect(header).toHaveClass('z-50')
|
||||
})
|
||||
})
|
||||
|
||||
describe('Scroll Behavior', () => {
|
||||
it('applies scrolled styles after 100px scroll', () => {
|
||||
render(<Header />)
|
||||
const header = screen.getByRole('banner')
|
||||
|
||||
// Initially not scrolled
|
||||
expect(header).not.toHaveClass('shadow-md')
|
||||
|
||||
// Simulate scroll past 100px
|
||||
Object.defineProperty(window, 'scrollY', { value: 150, writable: true })
|
||||
fireEvent.scroll(window)
|
||||
|
||||
expect(header).toHaveClass('shadow-md')
|
||||
})
|
||||
|
||||
it('removes scrolled styles when scrolled back up', () => {
|
||||
render(<Header />)
|
||||
const header = screen.getByRole('banner')
|
||||
|
||||
// Scroll down
|
||||
Object.defineProperty(window, 'scrollY', { value: 150, writable: true })
|
||||
fireEvent.scroll(window)
|
||||
expect(header).toHaveClass('shadow-md')
|
||||
|
||||
// Scroll back up
|
||||
Object.defineProperty(window, 'scrollY', { value: 50, writable: true })
|
||||
fireEvent.scroll(window)
|
||||
expect(header).not.toHaveClass('shadow-md')
|
||||
})
|
||||
|
||||
it('handles smooth scroll on link click', async () => {
|
||||
const user = userEvent.setup()
|
||||
|
||||
// Create a target element
|
||||
const targetElement = document.createElement('div')
|
||||
targetElement.id = 'services'
|
||||
document.body.appendChild(targetElement)
|
||||
|
||||
render(<Header />)
|
||||
|
||||
await user.click(screen.getByRole('link', { name: 'Services' }))
|
||||
|
||||
expect(mockScrollTo).toHaveBeenCalledWith({
|
||||
behavior: 'smooth',
|
||||
block: 'start',
|
||||
})
|
||||
|
||||
// Cleanup
|
||||
document.body.removeChild(targetElement)
|
||||
})
|
||||
})
|
||||
|
||||
describe('Mobile Navigation', () => {
|
||||
it('renders mobile menu button', () => {
|
||||
render(<Header />)
|
||||
expect(screen.getByRole('button', { name: /toggle menu/i })).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('opens mobile menu when hamburger is clicked', async () => {
|
||||
const user = userEvent.setup()
|
||||
|
||||
render(<Header />)
|
||||
|
||||
await user.click(screen.getByRole('button', { name: /toggle menu/i }))
|
||||
|
||||
// Mobile nav should be visible
|
||||
expect(screen.getByRole('navigation', { name: /mobile/i })).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('closes mobile menu when close button is clicked', async () => {
|
||||
const user = userEvent.setup()
|
||||
|
||||
render(<Header />)
|
||||
|
||||
// Open menu
|
||||
await user.click(screen.getByRole('button', { name: /toggle menu/i }))
|
||||
expect(screen.getByRole('navigation', { name: /mobile/i })).toBeInTheDocument()
|
||||
|
||||
// Close menu
|
||||
await user.click(screen.getByRole('button', { name: /close menu/i }))
|
||||
expect(screen.queryByRole('navigation', { name: /mobile/i })).not.toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('mobile menu has same links as desktop nav', async () => {
|
||||
const user = userEvent.setup()
|
||||
|
||||
render(<Header />)
|
||||
|
||||
await user.click(screen.getByRole('button', { name: /toggle menu/i }))
|
||||
|
||||
const mobileNav = screen.getByRole('navigation', { name: /mobile/i })
|
||||
|
||||
expect(mobileNav.querySelector('a[href="#home"]')).toBeInTheDocument()
|
||||
expect(mobileNav.querySelector('a[href="#services"]')).toBeInTheDocument()
|
||||
expect(mobileNav.querySelector('a[href="#process"]')).toBeInTheDocument()
|
||||
expect(mobileNav.querySelector('a[href="#contact"]')).toBeInTheDocument()
|
||||
})
|
||||
})
|
||||
|
||||
describe('Accessibility', () => {
|
||||
it('has a proper banner role', () => {
|
||||
render(<Header />)
|
||||
expect(screen.getByRole('banner')).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('desktop navigation has navigation role', () => {
|
||||
render(<Header />)
|
||||
expect(screen.getByRole('navigation', { name: /main/i })).toBeInTheDocument()
|
||||
})
|
||||
})
|
||||
})
|
||||
112
src/components/layout/Header.tsx
Normal file
112
src/components/layout/Header.tsx
Normal file
@ -0,0 +1,112 @@
|
||||
import { useState, useEffect } from 'react'
|
||||
import { Diamond } from 'lucide-react'
|
||||
import { cn } from '../../lib/utils'
|
||||
import { MobileNav } from './MobileNav'
|
||||
import { Container } from './Container'
|
||||
|
||||
interface NavLink {
|
||||
label: string
|
||||
href: string
|
||||
}
|
||||
|
||||
interface HeaderProps {
|
||||
links?: NavLink[]
|
||||
}
|
||||
|
||||
const defaultLinks: NavLink[] = [
|
||||
{ label: 'Home', href: '#home' },
|
||||
{ label: 'Services', href: '#services' },
|
||||
{ label: 'Process', href: '#process' },
|
||||
{ label: 'Contact', href: '#contact' },
|
||||
]
|
||||
|
||||
export function Header({ links = defaultLinks }: HeaderProps) {
|
||||
const [isScrolled, setIsScrolled] = useState(false)
|
||||
const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false)
|
||||
|
||||
// Handle scroll detection
|
||||
useEffect(() => {
|
||||
const handleScroll = () => {
|
||||
setIsScrolled(window.scrollY > 100)
|
||||
}
|
||||
|
||||
window.addEventListener('scroll', handleScroll)
|
||||
return () => window.removeEventListener('scroll', handleScroll)
|
||||
}, [])
|
||||
|
||||
// Handle smooth scroll to section
|
||||
const handleLinkClick = (e: React.MouseEvent<HTMLAnchorElement>, href: string) => {
|
||||
e.preventDefault()
|
||||
const targetId = href.replace('#', '')
|
||||
const targetElement = document.getElementById(targetId)
|
||||
|
||||
if (targetElement) {
|
||||
targetElement.scrollIntoView({
|
||||
behavior: 'smooth',
|
||||
block: 'start',
|
||||
})
|
||||
}
|
||||
|
||||
// Close mobile menu if open
|
||||
setIsMobileMenuOpen(false)
|
||||
}
|
||||
|
||||
return (
|
||||
<header
|
||||
className={cn(
|
||||
'fixed top-0 left-0 right-0 z-50',
|
||||
'bg-white/95 backdrop-blur-md',
|
||||
'border-b border-border',
|
||||
'transition-all duration-300',
|
||||
isScrolled && 'shadow-md bg-white'
|
||||
)}
|
||||
>
|
||||
<Container>
|
||||
<div className="flex items-center justify-between py-4">
|
||||
{/* Logo */}
|
||||
<a
|
||||
href="#home"
|
||||
onClick={(e) => handleLinkClick(e, '#home')}
|
||||
className="flex items-center gap-2 text-xl font-bold text-primary"
|
||||
>
|
||||
<Diamond className="h-5 w-5 text-accent" />
|
||||
<span>Maverick</span>
|
||||
</a>
|
||||
|
||||
{/* Desktop Navigation */}
|
||||
<nav aria-label="Main navigation" className="hidden md:block">
|
||||
<ul className="flex items-center gap-8">
|
||||
{links.map((link) => (
|
||||
<li key={link.href}>
|
||||
<a
|
||||
href={link.href}
|
||||
onClick={(e) => handleLinkClick(e, link.href)}
|
||||
className={cn(
|
||||
'relative font-medium text-text-secondary',
|
||||
'transition-colors duration-200 hover:text-primary',
|
||||
'after:absolute after:bottom-0 after:left-0 after:h-0.5',
|
||||
'after:w-0 after:bg-primary after:transition-all after:duration-200',
|
||||
'hover:after:w-full'
|
||||
)}
|
||||
>
|
||||
{link.label}
|
||||
</a>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
{/* Mobile Navigation */}
|
||||
<div className="md:hidden">
|
||||
<MobileNav
|
||||
links={links}
|
||||
isOpen={isMobileMenuOpen}
|
||||
onClose={() => setIsMobileMenuOpen(false)}
|
||||
onToggle={() => setIsMobileMenuOpen((prev) => !prev)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</Container>
|
||||
</header>
|
||||
)
|
||||
}
|
||||
188
src/components/layout/MobileNav.test.tsx
Normal file
188
src/components/layout/MobileNav.test.tsx
Normal file
@ -0,0 +1,188 @@
|
||||
import { render, screen } from '@testing-library/react'
|
||||
import userEvent from '@testing-library/user-event'
|
||||
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'
|
||||
import { MobileNav, HamburgerButton } from './MobileNav'
|
||||
|
||||
const mockLinks = [
|
||||
{ label: 'Home', href: '#home' },
|
||||
{ label: 'Services', href: '#services' },
|
||||
{ label: 'Contact', href: '#contact' },
|
||||
]
|
||||
|
||||
describe('HamburgerButton', () => {
|
||||
it('renders three lines when closed', () => {
|
||||
render(<HamburgerButton isOpen={false} onClick={vi.fn()} />)
|
||||
const button = screen.getByRole('button', { name: /toggle menu/i })
|
||||
const lines = button.querySelectorAll('span')
|
||||
expect(lines).toHaveLength(3)
|
||||
})
|
||||
|
||||
it('renders as X when open', () => {
|
||||
render(<HamburgerButton isOpen={true} onClick={vi.fn()} />)
|
||||
const button = screen.getByRole('button', { name: /toggle menu/i })
|
||||
// When open, lines should have rotation transforms applied
|
||||
const lines = button.querySelectorAll('span')
|
||||
expect(lines).toHaveLength(3)
|
||||
// Middle line should be hidden (opacity-0)
|
||||
expect(lines[1]).toHaveClass('opacity-0')
|
||||
})
|
||||
|
||||
it('calls onClick when clicked', async () => {
|
||||
const handleClick = vi.fn()
|
||||
const user = userEvent.setup()
|
||||
|
||||
render(<HamburgerButton isOpen={false} onClick={handleClick} />)
|
||||
await user.click(screen.getByRole('button', { name: /toggle menu/i }))
|
||||
|
||||
expect(handleClick).toHaveBeenCalledTimes(1)
|
||||
})
|
||||
|
||||
it('has correct accessible name', () => {
|
||||
render(<HamburgerButton isOpen={false} onClick={vi.fn()} />)
|
||||
expect(screen.getByRole('button', { name: /toggle menu/i })).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('indicates expanded state for accessibility', () => {
|
||||
const { rerender } = render(<HamburgerButton isOpen={false} onClick={vi.fn()} />)
|
||||
expect(screen.getByRole('button')).toHaveAttribute('aria-expanded', 'false')
|
||||
|
||||
rerender(<HamburgerButton isOpen={true} onClick={vi.fn()} />)
|
||||
expect(screen.getByRole('button')).toHaveAttribute('aria-expanded', 'true')
|
||||
})
|
||||
})
|
||||
|
||||
describe('MobileNav', () => {
|
||||
const defaultProps = {
|
||||
links: mockLinks,
|
||||
isOpen: false,
|
||||
onClose: vi.fn(),
|
||||
onToggle: vi.fn(),
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks()
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
// Ensure body scroll is restored
|
||||
document.body.style.overflow = ''
|
||||
})
|
||||
|
||||
it('renders hamburger button', () => {
|
||||
render(<MobileNav {...defaultProps} />)
|
||||
expect(screen.getByRole('button', { name: /toggle menu/i })).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('hamburger button calls onToggle when clicked', async () => {
|
||||
const onToggle = vi.fn()
|
||||
const user = userEvent.setup()
|
||||
|
||||
render(<MobileNav {...defaultProps} onToggle={onToggle} />)
|
||||
await user.click(screen.getByRole('button', { name: /toggle menu/i }))
|
||||
|
||||
expect(onToggle).toHaveBeenCalledTimes(1)
|
||||
})
|
||||
|
||||
it('menu is hidden when isOpen is false', () => {
|
||||
render(<MobileNav {...defaultProps} isOpen={false} />)
|
||||
// Menu should not be in the document when closed
|
||||
expect(screen.queryByRole('navigation')).not.toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('menu is visible when isOpen is true', () => {
|
||||
render(<MobileNav {...defaultProps} isOpen={true} />)
|
||||
expect(screen.getByRole('navigation')).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('renders all navigation links', () => {
|
||||
render(<MobileNav {...defaultProps} isOpen={true} />)
|
||||
|
||||
mockLinks.forEach((link) => {
|
||||
expect(screen.getByRole('link', { name: link.label })).toBeInTheDocument()
|
||||
})
|
||||
})
|
||||
|
||||
it('navigation links have correct href attributes', () => {
|
||||
render(<MobileNav {...defaultProps} isOpen={true} />)
|
||||
|
||||
mockLinks.forEach((link) => {
|
||||
expect(screen.getByRole('link', { name: link.label })).toHaveAttribute('href', link.href)
|
||||
})
|
||||
})
|
||||
|
||||
it('calls onClose when link is clicked', async () => {
|
||||
const onClose = vi.fn()
|
||||
const user = userEvent.setup()
|
||||
|
||||
render(<MobileNav {...defaultProps} isOpen={true} onClose={onClose} />)
|
||||
await user.click(screen.getByRole('link', { name: 'Home' }))
|
||||
|
||||
expect(onClose).toHaveBeenCalledTimes(1)
|
||||
})
|
||||
|
||||
it('calls onClose when overlay is clicked', async () => {
|
||||
const onClose = vi.fn()
|
||||
const user = userEvent.setup()
|
||||
|
||||
render(<MobileNav {...defaultProps} isOpen={true} onClose={onClose} />)
|
||||
|
||||
// Click on overlay (background)
|
||||
const overlay = screen.getByTestId('mobile-nav-overlay')
|
||||
await user.click(overlay)
|
||||
|
||||
expect(onClose).toHaveBeenCalledTimes(1)
|
||||
})
|
||||
|
||||
it('does not call onClose when menu panel is clicked', async () => {
|
||||
const onClose = vi.fn()
|
||||
const user = userEvent.setup()
|
||||
|
||||
render(<MobileNav {...defaultProps} isOpen={true} onClose={onClose} />)
|
||||
|
||||
// Click on menu panel (not overlay)
|
||||
const panel = screen.getByRole('navigation')
|
||||
await user.click(panel)
|
||||
|
||||
expect(onClose).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('locks body scroll when menu is open', () => {
|
||||
const { rerender } = render(<MobileNav {...defaultProps} isOpen={false} />)
|
||||
expect(document.body.style.overflow).toBe('')
|
||||
|
||||
rerender(<MobileNav {...defaultProps} isOpen={true} />)
|
||||
expect(document.body.style.overflow).toBe('hidden')
|
||||
})
|
||||
|
||||
it('restores body scroll when menu is closed', () => {
|
||||
const { rerender } = render(<MobileNav {...defaultProps} isOpen={true} />)
|
||||
expect(document.body.style.overflow).toBe('hidden')
|
||||
|
||||
rerender(<MobileNav {...defaultProps} isOpen={false} />)
|
||||
expect(document.body.style.overflow).toBe('')
|
||||
})
|
||||
|
||||
it('restores body scroll on unmount', () => {
|
||||
const { unmount } = render(<MobileNav {...defaultProps} isOpen={true} />)
|
||||
expect(document.body.style.overflow).toBe('hidden')
|
||||
|
||||
unmount()
|
||||
expect(document.body.style.overflow).toBe('')
|
||||
})
|
||||
|
||||
it('renders close button inside menu', () => {
|
||||
render(<MobileNav {...defaultProps} isOpen={true} />)
|
||||
// There should be a close button in the menu panel
|
||||
expect(screen.getByRole('button', { name: /close menu/i })).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('close button calls onClose when clicked', async () => {
|
||||
const onClose = vi.fn()
|
||||
const user = userEvent.setup()
|
||||
|
||||
render(<MobileNav {...defaultProps} isOpen={true} onClose={onClose} />)
|
||||
await user.click(screen.getByRole('button', { name: /close menu/i }))
|
||||
|
||||
expect(onClose).toHaveBeenCalledTimes(1)
|
||||
})
|
||||
})
|
||||
146
src/components/layout/MobileNav.tsx
Normal file
146
src/components/layout/MobileNav.tsx
Normal file
@ -0,0 +1,146 @@
|
||||
import { useEffect } from 'react'
|
||||
import { motion, AnimatePresence } from 'framer-motion'
|
||||
import { X } from 'lucide-react'
|
||||
import { cn } from '../../lib/utils'
|
||||
|
||||
interface NavLink {
|
||||
label: string
|
||||
href: string
|
||||
}
|
||||
|
||||
interface HamburgerButtonProps {
|
||||
isOpen: boolean
|
||||
onClick: () => void
|
||||
className?: string
|
||||
}
|
||||
|
||||
interface MobileNavProps {
|
||||
links: NavLink[]
|
||||
isOpen: boolean
|
||||
onClose: () => void
|
||||
onToggle: () => void
|
||||
}
|
||||
|
||||
export function HamburgerButton({ isOpen, onClick, className }: HamburgerButtonProps) {
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
onClick={onClick}
|
||||
aria-label="Toggle menu"
|
||||
aria-expanded={isOpen}
|
||||
className={cn(
|
||||
'relative flex h-6 w-6 flex-col items-center justify-center gap-1.5',
|
||||
'focus:outline-none focus-visible:ring-2 focus-visible:ring-primary',
|
||||
className
|
||||
)}
|
||||
>
|
||||
<span
|
||||
className={cn(
|
||||
'block h-0.5 w-6 bg-current transition-all duration-300',
|
||||
isOpen && 'translate-y-2 rotate-45'
|
||||
)}
|
||||
/>
|
||||
<span
|
||||
className={cn(
|
||||
'block h-0.5 w-6 bg-current transition-all duration-300',
|
||||
isOpen && 'opacity-0'
|
||||
)}
|
||||
/>
|
||||
<span
|
||||
className={cn(
|
||||
'block h-0.5 w-6 bg-current transition-all duration-300',
|
||||
isOpen && '-translate-y-2 -rotate-45'
|
||||
)}
|
||||
/>
|
||||
</button>
|
||||
)
|
||||
}
|
||||
|
||||
export function MobileNav({ links, isOpen, onClose, onToggle }: MobileNavProps) {
|
||||
// Lock body scroll when menu is open
|
||||
useEffect(() => {
|
||||
if (isOpen) {
|
||||
document.body.style.overflow = 'hidden'
|
||||
} else {
|
||||
document.body.style.overflow = ''
|
||||
}
|
||||
|
||||
return () => {
|
||||
document.body.style.overflow = ''
|
||||
}
|
||||
}, [isOpen])
|
||||
|
||||
return (
|
||||
<>
|
||||
<HamburgerButton isOpen={isOpen} onClick={onToggle} />
|
||||
|
||||
<AnimatePresence>
|
||||
{isOpen && (
|
||||
<>
|
||||
{/* Overlay */}
|
||||
<motion.div
|
||||
data-testid="mobile-nav-overlay"
|
||||
initial={{ opacity: 0 }}
|
||||
animate={{ opacity: 1 }}
|
||||
exit={{ opacity: 0 }}
|
||||
transition={{ duration: 0.2 }}
|
||||
className="fixed inset-0 z-40 bg-black/50"
|
||||
onClick={onClose}
|
||||
aria-hidden="true"
|
||||
/>
|
||||
|
||||
{/* Menu Panel */}
|
||||
<motion.nav
|
||||
aria-label="Mobile navigation"
|
||||
initial={{ x: '100%' }}
|
||||
animate={{ x: 0 }}
|
||||
exit={{ x: '100%' }}
|
||||
transition={{ type: 'tween', duration: 0.3, ease: 'easeInOut' }}
|
||||
className={cn(
|
||||
'fixed right-0 top-0 z-50 h-full w-[80vw] max-w-[300px]',
|
||||
'bg-white shadow-[-4px_0_16px_rgba(0,0,0,0.1)]'
|
||||
)}
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
>
|
||||
{/* Close button */}
|
||||
<div className="flex justify-end p-4">
|
||||
<button
|
||||
type="button"
|
||||
onClick={onClose}
|
||||
aria-label="Close menu"
|
||||
className={cn(
|
||||
'flex h-10 w-10 items-center justify-center rounded-full',
|
||||
'text-text-secondary hover:bg-gray-100',
|
||||
'focus:outline-none focus-visible:ring-2 focus-visible:ring-primary'
|
||||
)}
|
||||
>
|
||||
<X className="h-6 w-6" />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* Navigation links */}
|
||||
<ul className="flex flex-col px-4">
|
||||
{links.map((link) => (
|
||||
<li key={link.href}>
|
||||
<a
|
||||
href={link.href}
|
||||
onClick={onClose}
|
||||
className={cn(
|
||||
'block py-4 text-xl font-medium',
|
||||
'text-text-secondary hover:text-primary',
|
||||
'border-b border-gray-100 last:border-b-0',
|
||||
'transition-colors duration-200'
|
||||
)}
|
||||
>
|
||||
{link.label}
|
||||
</a>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</motion.nav>
|
||||
</>
|
||||
)}
|
||||
</AnimatePresence>
|
||||
</>
|
||||
)
|
||||
}
|
||||
4
src/components/layout/index.ts
Normal file
4
src/components/layout/index.ts
Normal file
@ -0,0 +1,4 @@
|
||||
export { Container } from './Container'
|
||||
export { Footer } from './Footer'
|
||||
export { Header } from './Header'
|
||||
export { MobileNav, HamburgerButton } from './MobileNav'
|
||||
148
src/components/ui/Button.test.tsx
Normal file
148
src/components/ui/Button.test.tsx
Normal file
@ -0,0 +1,148 @@
|
||||
import { render, screen } from '@testing-library/react'
|
||||
import userEvent from '@testing-library/user-event'
|
||||
import { describe, it, expect, vi } from 'vitest'
|
||||
import { Button } from './Button'
|
||||
|
||||
describe('Button', () => {
|
||||
it('renders children correctly', () => {
|
||||
render(<Button variant="primary">Click me</Button>)
|
||||
expect(screen.getByText('Click me')).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('applies primary variant styles by default', () => {
|
||||
render(<Button variant="primary">Primary</Button>)
|
||||
const button = screen.getByRole('button')
|
||||
expect(button).toHaveClass('bg-primary')
|
||||
expect(button).toHaveClass('text-white')
|
||||
})
|
||||
|
||||
it('applies secondary variant styles', () => {
|
||||
render(<Button variant="secondary">Secondary</Button>)
|
||||
const button = screen.getByRole('button')
|
||||
expect(button).toHaveClass('border-primary')
|
||||
expect(button).toHaveClass('text-primary')
|
||||
expect(button).toHaveClass('bg-transparent')
|
||||
})
|
||||
|
||||
it('applies ghost variant styles', () => {
|
||||
render(<Button variant="ghost">Ghost</Button>)
|
||||
const button = screen.getByRole('button')
|
||||
expect(button).toHaveClass('bg-transparent')
|
||||
expect(button).toHaveClass('text-primary')
|
||||
})
|
||||
|
||||
it('renders as anchor when href is provided', () => {
|
||||
render(
|
||||
<Button variant="primary" href="https://example.com">
|
||||
Link
|
||||
</Button>
|
||||
)
|
||||
const link = screen.getByRole('link')
|
||||
expect(link).toBeInTheDocument()
|
||||
expect(link).toHaveAttribute('href', 'https://example.com')
|
||||
})
|
||||
|
||||
it('renders as button when href is not provided', () => {
|
||||
render(<Button variant="primary">Button</Button>)
|
||||
expect(screen.getByRole('button')).toBeInTheDocument()
|
||||
expect(screen.queryByRole('link')).not.toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('calls onClick when clicked', async () => {
|
||||
const handleClick = vi.fn()
|
||||
const user = userEvent.setup()
|
||||
|
||||
render(
|
||||
<Button variant="primary" onClick={handleClick}>
|
||||
Click me
|
||||
</Button>
|
||||
)
|
||||
|
||||
await user.click(screen.getByRole('button'))
|
||||
expect(handleClick).toHaveBeenCalledTimes(1)
|
||||
})
|
||||
|
||||
it('does not call onClick when disabled', async () => {
|
||||
const handleClick = vi.fn()
|
||||
const user = userEvent.setup()
|
||||
|
||||
render(
|
||||
<Button variant="primary" onClick={handleClick} disabled>
|
||||
Click me
|
||||
</Button>
|
||||
)
|
||||
|
||||
await user.click(screen.getByRole('button'))
|
||||
expect(handleClick).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('applies disabled styles when disabled', () => {
|
||||
render(
|
||||
<Button variant="primary" disabled>
|
||||
Disabled
|
||||
</Button>
|
||||
)
|
||||
const button = screen.getByRole('button')
|
||||
expect(button).toBeDisabled()
|
||||
expect(button).toHaveClass('opacity-50')
|
||||
expect(button).toHaveClass('cursor-not-allowed')
|
||||
})
|
||||
|
||||
it('applies size classes correctly', () => {
|
||||
const { rerender } = render(
|
||||
<Button variant="primary" size="sm">
|
||||
Small
|
||||
</Button>
|
||||
)
|
||||
expect(screen.getByRole('button')).toHaveClass('py-2', 'px-4', 'text-sm')
|
||||
|
||||
rerender(
|
||||
<Button variant="primary" size="md">
|
||||
Medium
|
||||
</Button>
|
||||
)
|
||||
expect(screen.getByRole('button')).toHaveClass('py-3', 'px-6', 'text-base')
|
||||
|
||||
rerender(
|
||||
<Button variant="primary" size="lg">
|
||||
Large
|
||||
</Button>
|
||||
)
|
||||
expect(screen.getByRole('button')).toHaveClass('py-4', 'px-8', 'text-lg')
|
||||
})
|
||||
|
||||
it('defaults to md size when not specified', () => {
|
||||
render(<Button variant="primary">Default Size</Button>)
|
||||
const button = screen.getByRole('button')
|
||||
expect(button).toHaveClass('py-3', 'px-6', 'text-base')
|
||||
})
|
||||
|
||||
it('merges custom className', () => {
|
||||
render(
|
||||
<Button variant="primary" className="custom-class">
|
||||
Custom
|
||||
</Button>
|
||||
)
|
||||
const button = screen.getByRole('button')
|
||||
expect(button).toHaveClass('custom-class')
|
||||
})
|
||||
|
||||
it('applies correct button type attribute', () => {
|
||||
const { rerender } = render(
|
||||
<Button variant="primary" type="submit">
|
||||
Submit
|
||||
</Button>
|
||||
)
|
||||
expect(screen.getByRole('button')).toHaveAttribute('type', 'submit')
|
||||
|
||||
rerender(
|
||||
<Button variant="primary" type="reset">
|
||||
Reset
|
||||
</Button>
|
||||
)
|
||||
expect(screen.getByRole('button')).toHaveAttribute('type', 'reset')
|
||||
|
||||
rerender(<Button variant="primary">Default</Button>)
|
||||
expect(screen.getByRole('button')).toHaveAttribute('type', 'button')
|
||||
})
|
||||
})
|
||||
74
src/components/ui/Button.tsx
Normal file
74
src/components/ui/Button.tsx
Normal file
@ -0,0 +1,74 @@
|
||||
import { cn } from '../../lib/utils'
|
||||
|
||||
interface ButtonProps {
|
||||
/** Visual style variant */
|
||||
variant: 'primary' | 'secondary' | 'ghost'
|
||||
/** Size variant */
|
||||
size?: 'sm' | 'md' | 'lg'
|
||||
/** Button content */
|
||||
children: React.ReactNode
|
||||
/** If provided, renders as an anchor tag */
|
||||
href?: string
|
||||
/** Click handler (for button behavior) */
|
||||
onClick?: () => void
|
||||
/** Disabled state */
|
||||
disabled?: boolean
|
||||
/** Additional CSS classes */
|
||||
className?: string
|
||||
/** Button type attribute */
|
||||
type?: 'button' | 'submit' | 'reset'
|
||||
}
|
||||
|
||||
const variantStyles = {
|
||||
primary: 'bg-primary text-white shadow-[0_4px_14px_0_rgba(37,99,235,0.39)] hover:bg-primary-dark hover:-translate-y-0.5 hover:shadow-[0_6px_20px_0_rgba(37,99,235,0.5)]',
|
||||
secondary: 'bg-transparent border-2 border-primary text-primary hover:bg-primary hover:text-white',
|
||||
ghost: 'bg-transparent text-primary hover:underline',
|
||||
}
|
||||
|
||||
const sizeStyles = {
|
||||
sm: 'py-2 px-4 text-sm',
|
||||
md: 'py-3 px-6 text-base',
|
||||
lg: 'py-4 px-8 text-lg',
|
||||
}
|
||||
|
||||
export function Button({
|
||||
variant,
|
||||
size = 'md',
|
||||
children,
|
||||
href,
|
||||
onClick,
|
||||
disabled = false,
|
||||
className,
|
||||
type = 'button',
|
||||
}: ButtonProps) {
|
||||
const baseStyles = 'inline-flex items-center justify-center font-semibold rounded-lg transition-all duration-300'
|
||||
|
||||
const disabledStyles = disabled ? 'opacity-50 cursor-not-allowed' : ''
|
||||
|
||||
const combinedClassName = cn(
|
||||
baseStyles,
|
||||
variantStyles[variant],
|
||||
sizeStyles[size],
|
||||
disabledStyles,
|
||||
className
|
||||
)
|
||||
|
||||
if (href) {
|
||||
return (
|
||||
<a href={href} className={combinedClassName}>
|
||||
{children}
|
||||
</a>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<button
|
||||
type={type}
|
||||
onClick={onClick}
|
||||
disabled={disabled}
|
||||
className={combinedClassName}
|
||||
>
|
||||
{children}
|
||||
</button>
|
||||
)
|
||||
}
|
||||
162
src/components/ui/Card.test.tsx
Normal file
162
src/components/ui/Card.test.tsx
Normal file
@ -0,0 +1,162 @@
|
||||
import { describe, it, expect, vi } from 'vitest';
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { Card } from './Card';
|
||||
|
||||
describe('Card', () => {
|
||||
it('renders children correctly', () => {
|
||||
render(
|
||||
<Card>
|
||||
<p>Test content</p>
|
||||
</Card>
|
||||
);
|
||||
|
||||
expect(screen.getByText('Test content')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('applies base styles', () => {
|
||||
render(
|
||||
<Card data-testid="card">
|
||||
<p>Content</p>
|
||||
</Card>
|
||||
);
|
||||
|
||||
const card = screen.getByTestId('card');
|
||||
// Base styles: white bg, border, rounded-2xl, p-8, shadow-md
|
||||
expect(card).toHaveClass('bg-white');
|
||||
expect(card).toHaveClass('border');
|
||||
expect(card).toHaveClass('border-border');
|
||||
expect(card).toHaveClass('rounded-2xl');
|
||||
expect(card).toHaveClass('p-8');
|
||||
expect(card).toHaveClass('shadow-md');
|
||||
});
|
||||
|
||||
it('applies hover classes when hover prop is true', () => {
|
||||
render(
|
||||
<Card hover data-testid="card">
|
||||
<p>Hoverable card</p>
|
||||
</Card>
|
||||
);
|
||||
|
||||
const card = screen.getByTestId('card');
|
||||
// Hover state should add hover transform and shadow classes
|
||||
expect(card).toHaveClass('hover:-translate-y-1.5');
|
||||
expect(card).toHaveClass('hover:shadow-xl');
|
||||
});
|
||||
|
||||
it('does not apply hover classes when hover prop is false', () => {
|
||||
render(
|
||||
<Card hover={false} data-testid="card">
|
||||
<p>Non-hoverable card</p>
|
||||
</Card>
|
||||
);
|
||||
|
||||
const card = screen.getByTestId('card');
|
||||
expect(card).not.toHaveClass('hover:-translate-y-1.5');
|
||||
expect(card).not.toHaveClass('hover:shadow-xl');
|
||||
});
|
||||
|
||||
it('renders gradient border when gradientBorder is true', () => {
|
||||
render(
|
||||
<Card gradientBorder data-testid="card">
|
||||
<p>Card with gradient border</p>
|
||||
</Card>
|
||||
);
|
||||
|
||||
const card = screen.getByTestId('card');
|
||||
// Should have relative positioning for the pseudo-element
|
||||
expect(card).toHaveClass('relative');
|
||||
expect(card).toHaveClass('overflow-hidden');
|
||||
// The gradient border is implemented via a before pseudo-element
|
||||
// We check for the class that enables the gradient border styling
|
||||
expect(card).toHaveClass('before:absolute');
|
||||
expect(card).toHaveClass('before:inset-x-0');
|
||||
expect(card).toHaveClass('before:top-0');
|
||||
expect(card).toHaveClass('before:h-1');
|
||||
expect(card).toHaveClass('before:bg-gradient-to-r');
|
||||
expect(card).toHaveClass('before:from-primary');
|
||||
expect(card).toHaveClass('before:to-accent');
|
||||
});
|
||||
|
||||
it('does not render gradient border when gradientBorder is false', () => {
|
||||
render(
|
||||
<Card gradientBorder={false} data-testid="card">
|
||||
<p>Card without gradient border</p>
|
||||
</Card>
|
||||
);
|
||||
|
||||
const card = screen.getByTestId('card');
|
||||
expect(card).not.toHaveClass('before:absolute');
|
||||
expect(card).not.toHaveClass('before:bg-gradient-to-r');
|
||||
});
|
||||
|
||||
it('merges custom className', () => {
|
||||
render(
|
||||
<Card className="custom-class another-class" data-testid="card">
|
||||
<p>Card with custom classes</p>
|
||||
</Card>
|
||||
);
|
||||
|
||||
const card = screen.getByTestId('card');
|
||||
// Should have custom classes merged with base classes
|
||||
expect(card).toHaveClass('custom-class');
|
||||
expect(card).toHaveClass('another-class');
|
||||
// Should still have base classes
|
||||
expect(card).toHaveClass('bg-white');
|
||||
expect(card).toHaveClass('rounded-2xl');
|
||||
});
|
||||
|
||||
it('calls onClick when clicked', async () => {
|
||||
const handleClick = vi.fn();
|
||||
const user = userEvent.setup();
|
||||
|
||||
render(
|
||||
<Card onClick={handleClick} data-testid="card">
|
||||
<p>Clickable card</p>
|
||||
</Card>
|
||||
);
|
||||
|
||||
const card = screen.getByTestId('card');
|
||||
await user.click(card);
|
||||
|
||||
expect(handleClick).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('has correct transition styles', () => {
|
||||
render(
|
||||
<Card data-testid="card">
|
||||
<p>Card with transitions</p>
|
||||
</Card>
|
||||
);
|
||||
|
||||
const card = screen.getByTestId('card');
|
||||
// Should have transition classes for smooth animations
|
||||
expect(card).toHaveClass('transition-all');
|
||||
expect(card).toHaveClass('duration-300');
|
||||
expect(card).toHaveClass('ease-in-out');
|
||||
});
|
||||
|
||||
it('applies cursor-pointer when onClick is provided', () => {
|
||||
const handleClick = vi.fn();
|
||||
|
||||
render(
|
||||
<Card onClick={handleClick} data-testid="card">
|
||||
<p>Clickable card</p>
|
||||
</Card>
|
||||
);
|
||||
|
||||
const card = screen.getByTestId('card');
|
||||
expect(card).toHaveClass('cursor-pointer');
|
||||
});
|
||||
|
||||
it('does not apply cursor-pointer when onClick is not provided', () => {
|
||||
render(
|
||||
<Card data-testid="card">
|
||||
<p>Non-clickable card</p>
|
||||
</Card>
|
||||
);
|
||||
|
||||
const card = screen.getByTestId('card');
|
||||
expect(card).not.toHaveClass('cursor-pointer');
|
||||
});
|
||||
});
|
||||
45
src/components/ui/Card.tsx
Normal file
45
src/components/ui/Card.tsx
Normal file
@ -0,0 +1,45 @@
|
||||
import { cn } from '../../lib/utils'
|
||||
|
||||
interface CardProps {
|
||||
/** Card content */
|
||||
children: React.ReactNode
|
||||
/** Additional CSS classes */
|
||||
className?: string
|
||||
/** Enable hover lift effect */
|
||||
hover?: boolean
|
||||
/** Show gradient top border */
|
||||
gradientBorder?: boolean
|
||||
/** Click handler */
|
||||
onClick?: () => void
|
||||
/** Test ID for testing */
|
||||
'data-testid'?: string
|
||||
}
|
||||
|
||||
export function Card({
|
||||
children,
|
||||
className,
|
||||
hover = false,
|
||||
gradientBorder = false,
|
||||
onClick,
|
||||
'data-testid': testId,
|
||||
}: CardProps) {
|
||||
const baseStyles = 'bg-white border border-border rounded-2xl p-8 shadow-md transition-all duration-300 ease-in-out'
|
||||
|
||||
const hoverStyles = hover ? 'hover:-translate-y-1.5 hover:shadow-xl' : ''
|
||||
|
||||
const gradientBorderStyles = gradientBorder
|
||||
? 'relative overflow-hidden before:absolute before:inset-x-0 before:top-0 before:h-1 before:bg-gradient-to-r before:from-primary before:to-accent'
|
||||
: ''
|
||||
|
||||
const clickableStyles = onClick ? 'cursor-pointer' : ''
|
||||
|
||||
return (
|
||||
<div
|
||||
className={cn(baseStyles, hoverStyles, gradientBorderStyles, clickableStyles, className)}
|
||||
onClick={onClick}
|
||||
data-testid={testId}
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
2
src/components/ui/index.ts
Normal file
2
src/components/ui/index.ts
Normal file
@ -0,0 +1,2 @@
|
||||
export { Button } from './Button'
|
||||
export { Card } from './Card'
|
||||
6
src/lib/utils.ts
Normal file
6
src/lib/utils.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import { clsx, type ClassValue } from 'clsx'
|
||||
import { twMerge } from 'tailwind-merge'
|
||||
|
||||
export function cn(...inputs: ClassValue[]) {
|
||||
return twMerge(clsx(inputs))
|
||||
}
|
||||
10
src/main.tsx
Normal file
10
src/main.tsx
Normal file
@ -0,0 +1,10 @@
|
||||
import { StrictMode } from 'react'
|
||||
import { createRoot } from 'react-dom/client'
|
||||
import './styles/index.css'
|
||||
import App from './App.tsx'
|
||||
|
||||
createRoot(document.getElementById('root')!).render(
|
||||
<StrictMode>
|
||||
<App />
|
||||
</StrictMode>,
|
||||
)
|
||||
76
src/styles/index.css
Normal file
76
src/styles/index.css
Normal file
@ -0,0 +1,76 @@
|
||||
@import "tailwindcss";
|
||||
|
||||
/* Design Tokens - Tailwind v4 CSS-first configuration */
|
||||
@theme {
|
||||
/* Colors */
|
||||
--color-primary: #2563eb;
|
||||
--color-primary-dark: #1d4ed8;
|
||||
--color-primary-light: #3b82f6;
|
||||
--color-accent: #f59e0b;
|
||||
--color-secondary: #64748b;
|
||||
--color-text-primary: #1e293b;
|
||||
--color-text-secondary: #64748b;
|
||||
--color-bg-primary: #ffffff;
|
||||
--color-bg-secondary: #f8fafc;
|
||||
--color-border: #e2e8f0;
|
||||
|
||||
/* Font family */
|
||||
--font-sans: 'Inter', system-ui, -apple-system, sans-serif;
|
||||
|
||||
/* Custom animations */
|
||||
--animate-fade-in-up: fade-in-up 0.6s ease-out;
|
||||
--animate-slide-in: slide-in 0.5s ease-out;
|
||||
--animate-count-up: count-up 2s ease-out;
|
||||
|
||||
/* Keyframes */
|
||||
@keyframes fade-in-up {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: translateY(30px);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes slide-in {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: translateX(-20px);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: translateX(0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes count-up {
|
||||
0% {
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Base styles */
|
||||
@layer base {
|
||||
html {
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
body {
|
||||
@apply antialiased text-text-primary;
|
||||
}
|
||||
}
|
||||
|
||||
/* Component styles */
|
||||
@layer components {
|
||||
.gradient-text {
|
||||
@apply bg-gradient-to-r from-slate-900 to-primary bg-clip-text text-transparent;
|
||||
}
|
||||
.glassmorphism {
|
||||
@apply bg-white/95 backdrop-blur-md;
|
||||
}
|
||||
}
|
||||
1
src/test/setup.ts
Normal file
1
src/test/setup.ts
Normal file
@ -0,0 +1 @@
|
||||
import '@testing-library/jest-dom'
|
||||
41
src/types/index.ts
Normal file
41
src/types/index.ts
Normal file
@ -0,0 +1,41 @@
|
||||
// Navigation types
|
||||
export interface NavLink {
|
||||
label: string
|
||||
href: string
|
||||
}
|
||||
|
||||
// Service types
|
||||
export interface Service {
|
||||
id: string
|
||||
title: string
|
||||
description: string
|
||||
icon: string
|
||||
features: string[]
|
||||
}
|
||||
|
||||
// Workflow types
|
||||
export interface WorkflowStep {
|
||||
id: number
|
||||
title: string
|
||||
description: string
|
||||
icon: string
|
||||
}
|
||||
|
||||
// Stats types
|
||||
export interface Stat {
|
||||
value: number
|
||||
label: string
|
||||
suffix?: string
|
||||
}
|
||||
|
||||
// Contact types
|
||||
export interface ContactMethod {
|
||||
icon: string
|
||||
title: string
|
||||
value: string
|
||||
href?: string
|
||||
}
|
||||
|
||||
// Component prop types
|
||||
export type Size = 'sm' | 'md' | 'lg'
|
||||
export type Variant = 'primary' | 'secondary' | 'ghost'
|
||||
34
tsconfig.app.json
Normal file
34
tsconfig.app.json
Normal file
@ -0,0 +1,34 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
||||
"target": "ES2022",
|
||||
"useDefineForClassFields": true,
|
||||
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
||||
"module": "ESNext",
|
||||
"types": ["vite/client", "vitest/globals"],
|
||||
"skipLibCheck": true,
|
||||
|
||||
/* Bundler mode */
|
||||
"moduleResolution": "bundler",
|
||||
"allowImportingTsExtensions": true,
|
||||
"verbatimModuleSyntax": true,
|
||||
"moduleDetection": "force",
|
||||
"noEmit": true,
|
||||
"jsx": "react-jsx",
|
||||
|
||||
/* Linting */
|
||||
"strict": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"erasableSyntaxOnly": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noUncheckedSideEffectImports": true,
|
||||
|
||||
/* Path aliases */
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/*": ["./src/*"]
|
||||
}
|
||||
},
|
||||
"include": ["src"]
|
||||
}
|
||||
7
tsconfig.json
Normal file
7
tsconfig.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"files": [],
|
||||
"references": [
|
||||
{ "path": "./tsconfig.app.json" },
|
||||
{ "path": "./tsconfig.node.json" }
|
||||
]
|
||||
}
|
||||
26
tsconfig.node.json
Normal file
26
tsconfig.node.json
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
||||
"target": "ES2023",
|
||||
"lib": ["ES2023"],
|
||||
"module": "ESNext",
|
||||
"types": ["node"],
|
||||
"skipLibCheck": true,
|
||||
|
||||
/* Bundler mode */
|
||||
"moduleResolution": "bundler",
|
||||
"allowImportingTsExtensions": true,
|
||||
"verbatimModuleSyntax": true,
|
||||
"moduleDetection": "force",
|
||||
"noEmit": true,
|
||||
|
||||
/* Linting */
|
||||
"strict": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"erasableSyntaxOnly": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noUncheckedSideEffectImports": true
|
||||
},
|
||||
"include": ["vite.config.ts"]
|
||||
}
|
||||
21
vite.config.ts
Normal file
21
vite.config.ts
Normal file
@ -0,0 +1,21 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import react from '@vitejs/plugin-react'
|
||||
import tailwindcss from '@tailwindcss/vite'
|
||||
import path from 'path'
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
tailwindcss(),
|
||||
react({
|
||||
babel: {
|
||||
plugins: ['babel-plugin-react-compiler'],
|
||||
},
|
||||
}),
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, './src'),
|
||||
},
|
||||
},
|
||||
})
|
||||
18
vitest.config.ts
Normal file
18
vitest.config.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import { defineConfig, mergeConfig } from 'vitest/config'
|
||||
import viteConfig from './vite.config'
|
||||
|
||||
export default mergeConfig(
|
||||
viteConfig,
|
||||
defineConfig({
|
||||
test: {
|
||||
globals: true,
|
||||
environment: 'jsdom',
|
||||
setupFiles: ['./src/test/setup.ts'],
|
||||
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
||||
coverage: {
|
||||
reporter: ['text', 'json', 'html'],
|
||||
exclude: ['node_modules/', 'src/test/'],
|
||||
},
|
||||
},
|
||||
})
|
||||
)
|
||||
Reference in New Issue
Block a user