The user wants me to create a responsive grid layout using BeercSS framework with card components and modals. Let me think about what to build:
I'll create a striking project showcase with cards, modals, and meaningful interactions. BeercSS is a lightweight Material Design-inspired framework.
html
<!DOCTYPE html>
<html lang="en" data-theme="dark">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Project Showcase | BeercSS Grid</title>
<link href="https://cdn.jsdelivr.net/npm/beercss@3.7.11/dist/cdn/beer.min.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/beercss@3.7.11/dist/cdn/beer.min.js" type="module"></script>
<style>
:root {
--accent: #00e5a0;
--accent-dim: #00b37d;
--surface-elevated: rgba(30, 35, 45, 0.85);
--glow: rgba(0, 229, 160, 0.15);
}
[data-theme="light"] {
--accent: #00996b;
--accent-dim: #007a55;
--surface-elevated: rgba(255, 255, 255, 0.95);
--glow: rgba(0, 153, 107, 0.1);
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Space Grotesk', sans-serif;
background: var(--background);
min-height: 100vh;
overflow-x: hidden;
}
/* Background atmosphere */
.bg-atmosphere {
position: fixed;
inset: 0;
pointer-events: none;
z-index: -1;
background:
radial-gradient(ellipse 80% 50% at 20% 20%, var(--glow) 0%, transparent 50%),
radial-gradient(ellipse 60% 40% at 80% 80%, rgba(100, 120, 255, 0.08) 0%, transparent 50%),
var(--background);
}
.bg-grid {
position: fixed;
inset: 0;
pointer-events: none;
z-index: -1;
background-image:
linear-gradient(var(--outline-variant) 1px, transparent 1px),
linear-gradient(90deg, var(--outline-variant) 1px, transparent 1px);
background-size: 60px 60px;
opacity: 0.3;
mask-image: radial-gradient(ellipse 70% 70% at 50% 30%, black 0%, transparent 70%);
}
/* Header */
header {
position: sticky;
top: 0;
z-index: 100;
backdrop-filter: blur(20px);
background: var(--surface-elevated);
border-bottom: 1px solid var(--outline-variant);
}
.logo {
font-family: 'JetBrains Mono', monospace;
font-weight: 500;
font-size: 1.25rem;
color: var(--accent);
letter-spacing: -0.5px;
}
.logo span {
color: var(--on-background);
}
/* Hero */
.hero {
padding: 4rem 1rem 3rem;
text-align: center;
}
.hero h1 {
font-size: clamp(2.5rem, 8vw, 4.5rem);
font-weight: 700;
letter-spacing: -2px;
line-height: 1.1;
margin-bottom: 1rem;
}
.hero h1 .highlight {
color: var(--accent);
position: relative;
}
.hero p {
font-size: 1.125rem;
color: var(--on-surface-variant);
max-width: 500px;
margin: 0 auto;
line-height: 1.6;
}
/* Filter tabs */
.filter-tabs {
display: flex;
gap: 0.5rem;
flex-wrap: wrap;
justify-content: center;
padding: 1rem;
margin-bottom: 1rem;
}
.filter-btn {
padding: 0.625rem 1.25rem;
border-radius: 100px;
font-size: 0.875rem;
font-weight: 500;
letter-spacing: 0.25px;
background: transparent;
border: 1px solid var(--outline-variant);
color: var(--on-surface-variant);
cursor: pointer;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.filter-btn:hover {
border-color: var(--accent);
color: var(--accent);
}
.filter-btn.active {
background: var(--accent);
border-color: var(--accent);
color: var(--on-primary);
}
/* Card grid */
.card-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
gap: 1.5rem;
padding: 0 1.5rem 4rem;
max-width: 1400px;
margin: 0 auto;
}
@media (max-width: 360px) {
.card-grid {
grid-template-columns: 1fr;
padding: 0 1rem 3rem;
}
}
/* Card styles */
.project-card {
background: var(--surface-container);
border: 1px solid var(--outline-variant);
border-radius: 16px;
overflow: hidden;
cursor: pointer;
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
opacity: 0;
transform: translateY(30px);
}
.project-card.visible {
opacity: 1;
transform: translateY(0);
}
.project-card:hover {
transform: translateY(-8px);
border-color: var(--accent-dim);
box-shadow:
0 20px 40px -15px rgba(0, 0, 0, 0.3),
0 0 0 1px var(--accent-dim);
}
.project-card:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 2px;
}
.card-media {
position: relative;
height: 200px;
overflow: hidden;
}
.card-media img {
width: 100%;
height: 100%;
object-fit: cover;
transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.project-card:hover .card-media img {
transform: scale(1.08);
}
.card-badge {
position: absolute;
top: 1rem;
left: 1rem;
padding: 0.375rem 0.75rem;
background: var(--surface-elevated);
backdrop-filter: blur(10px);
border-radius: 100px;
font-size: 0.75rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.card-badge.web { color: #60a5fa; }
.card-badge.mobile { color: #f472b6; }
.card-card.ui { color: var(--accent); }
.card-badge.brand { color: #fbbf24; }
.card-content {
padding: 1.5rem;
}
.card-title {
font-size: 1.25rem;
font-weight: 600;
margin-bottom: 0.5rem;
letter-spacing: -0.25px;
}
.card-desc {
color: var(--on-surface-variant);
font-size: 0.9rem;
line-height: 1.6;
margin-bottom: 1rem;
}
.card-tags {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
}
.card-tag {
padding: 0.25rem 0.625rem;
background: var(--surface-container-highest);
border-radius: 6px;
font-family: 'JetBrains Mono', monospace;
font-size: 0.7rem;
color: var(--on-surface-variant);
}
.card-footer {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem 1.5rem;
border-top: 1px solid var(--outline-variant);
}
.card-meta {
display: flex;
align-items: center;
gap: 0.5rem;
font-size: 0.8rem;
color: var(--on-surface-variant);
}
.card-meta svg {
width: 16px;
height: 16px;
}
/* Buttons */
.btn-icon {
width: 40px;
height: 40px;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
background: var(--accent);
color: var(--on-primary);
border: none;
cursor: pointer;
transition: all 0.2s;
}
.btn-icon:hover {
transform: scale(1.1);
box-shadow: 0 4px 15px var(--glow);
}
.btn-icon svg {
width: 18px;
height: 18px;
}
/* Modal styles */
.modal {
display: none;
position: fixed;
inset: 0;
z-index: 1000;
align-items: center;
justify-content: center;
padding: 1rem;
background: rgba(0, 0, 0, 0.7);
backdrop-filter: blur(8px);
opacity: 0;
transition: opacity 0.3s;
}
.modal.active {
display: flex;
opacity: 1;
}
.modal-content {
background: var(--surface-container-high);
border: 1px solid var(--outline-variant);
border-radius: 20px;
max-width: 700px;
width: 100%;
max-height: 90vh;
overflow-y: auto;
transform: scale(0.9) translateY(20px);
transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal.active .modal-content {
transform: scale(1) translateY(0);
}
.modal-header {
position: relative;
height: 280px;
overflow: hidden;
}
.modal-header img {
width: 100%;
height: 100%;
object-fit: cover;
}
.modal-close {
position: absolute;
top: 1rem;
right: 1rem;
width: 44px;
height: 44px;
border-radius: 50%;
background: var(--surface-elevated);
backdrop-filter: blur(10px);
border: none;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
color: var(--on-surface);
transition: all 0.2s;
}
.modal-close:hover {
background: var(--error);
color: white;
}
.modal-body {
padding: 2rem;
}
.modal-title {
font-size: 1.75rem;
font-weight: 700;
margin-bottom: 0.5rem;
letter-spacing: -0.5px;
}
.modal-subtitle {
color: var(--on-surface-variant);
margin-bottom: 1.5rem;
}
.modal-section {
margin-bottom: 1.5rem;
}
.modal-section h4 {
font-size: 0.8rem;
text-transform: uppercase;
letter-spacing: 1px;
color: var(--accent);
margin-bottom: 0.75rem;
}
.modal-section p {
color: var(--on-surface-variant);
line-height: 1.7;
}
.tech-stack {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
}
.tech-item {
padding: 0.5rem 1rem;
background: var(--surface-container-highest);
border-radius: 8px;
font-size: 0.85rem;
font-weight: 500;
}
.modal-actions {
display: flex;
gap: 1rem;
padding-top: 1rem;
border-top: 1px solid var(--outline-variant);
}
.btn-primary {
flex: 1;
padding: 0.875rem 1.5rem;
background: var(--accent);
color: var(--on-primary);
border: none;
border-radius: 12px;
font-size: 0.95rem;
font-weight: 600;
cursor: pointer;
transition: all 0.2s;
}
.btn-primary:hover {
box-shadow: 0 8px 25px var(--glow);
transform: translateY(-2px);
}
.btn-secondary {
flex: 1;
padding: 0.875rem 1.5rem;
background: transparent;
color: var(--on-surface);
border: 1px solid var(--outline-variant);
border-radius: 12px;
font-size: 0.95rem;
font-weight: 500;
cursor: pointer;
transition: all 0.2s;
}
.btn-secondary:hover {
border-color: var(--on-surface);
}
/* Stats row */
.stats-row {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 1rem;
margin-bottom: 1.5rem;
}
.stat-item {
text-align: center;
padding: 1rem;
background: var(--surface-container-highest);
border-radius: 12px;
}
.stat-value {
font-size: 1.5rem;
font-weight: 700;
color: var(--accent);
}
.stat-label {
font-size: 0.75rem;
color: var(--on-surface-variant);
text-transform: uppercase;
letter-spacing: 0.5px;
}
/* Theme toggle */
.theme-toggle {
position: relative;
width: 56px;
height: 32px;
background: var(--surface-container-highest);
border-radius: 100px;
cursor: pointer;
border: 1px solid var(--outline-variant);
transition: all 0.3s;
}
.theme-toggle::after {
content: '';
position: absolute;
top: 3px;
left: 3px;
width: 24px;
height: 24px;
background: var(--accent);
border-radius: 50%;
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
[data-theme="light"] .theme-toggle::after {
transform: translateX(24px);
}
/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
.project-card {
opacity: 1;
transform: none;
}
}
</style>
</head>
<body>
<!-- Background -->
<div class="bg-atmosphere"></div>
<div class="bg-grid"></div>
<!-- Header -->
<header>
<nav class="padding">
<div class="logo"><span><</span>dev<span>/</span>></div>
<div class="max"></div>
<button class="theme-toggle" onclick="toggleTheme()" aria-label="Toggle theme"></button>
</nav>
</header>
<!-- Hero -->
<section class="hero">
<h1>Selected <span class="highlight">Works</span></h1>
<p>A curated collection of digital experiences crafted with precision and passion for detail.</p>
</section>
<!-- Filters -->
<div class="filter-tabs">
<button class="filter-btn active" data-filter="all">All Projects</button>
<button class="filter-btn" data-filter="web">Web Apps</button>
<button class="filter-btn" data-filter="mobile">Mobile</button>
<button class="filter-btn" data-filter="ui">UI Design</button>
<button class="filter-btn" data-filter="brand">Branding</button>
</div>
<!-- Card Grid -->
<main class="card-grid" id="cardGrid"></main>
<!-- Modal -->
<div class="modal" id="projectModal" role="dialog" aria-modal="true">
<div class="modal-content">
<div class="modal-header">
<img id="modalImage" src="" alt="">
<button class="modal-close" onclick="closeModal()" aria-label="Close modal">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
<path d="M18 6L6 18M6 6l12 12"/>
</svg>
</button>
</div>
<div class="modal-body">
<h2 class="modal-title" id="modalTitle"></h2>
<p class="modal-subtitle" id="modalSubtitle"></p>
<div class="stats-row" id="modalStats"></div>
<div class="modal-section">
<h4>About the project</h4>
<p id="modalDescription"></p>
</div>
<div class="modal-section">
<h4>Technologies Used</h4>
<div class="tech-stack" id="modalTech"></div>
</div>
<div class="modal-actions">
<button class="btn-secondary" onclick="closeModal()">Close</button>
<button class="btn-primary">View Live Project</button>
</div>
</div>
</div>
</div>
<script>
// Project data
const projects = [
{
id: 1,
title: "Nebula Dashboard",
category: "web",
desc: "Real-time analytics platform with AI-powered insights and customizable widgets.",
fullDesc: "A comprehensive analytics dashboard designed for enterprise clients. Features real-time data visualization, predictive analytics, and seamless integration with existing business tools.",
image: "https://images.unsplash.com/photo-1551288049-bebda4e38f71?w=800&q=80",
tags: ["React", "D3.js", "Node.js"],
tech: ["React 18", "TypeScript", "D3.js", "Node.js", "PostgreSQL", "Redis"],
stats: { views: "24K", time: "3 months", rating: "4.9" }
},
{
id: 2,
title: "Pulse Fitness App",
category: "mobile",
desc: "Cross-platform fitness tracking with personalized workout plans and social features.",
fullDesc: "A mobile-first fitness application that adapts to user behavior. Includes workout tracking, nutrition planning, and a vibrant community of fitness enthusiasts.",
image: "https://images.unsplash.com/photo-1526256262350-7da7584cf5eb?w=800&q=80",
tags: ["Flutter", "Firebase", "ML Kit"],
tech: ["Flutter", "Dart", "Firebase", "ML Kit", "Stripe API", "HealthKit"],
stats: { users: "150K", downloads: "500K", rating: "4.8" }
},
{
id: 3,
title: "Cipher Design System",
category: "ui",
desc: "Comprehensive component library with 200+ accessible UI components.",
fullDesc: "An extensive design system built from the ground up with accessibility at its core. Features automatic documentation, theming support, and seamless Figma integration.",
image: "https://images.unsplash.com/photo-1558655146-9f40138edfeb?w=800&q=80",
tags: ["Figma", "Storybook", "WCAG 2.1"],
tech: ["Figma", "Storybook", "React", "CSS Variables", "Chromatic", "Jest"],
stats: { components: "200+", contributors: "45", adoption: "12 teams" }
},
{
id: 4,
title: "Bloom E-Commerce",
category: "web",
desc: "Sustainable fashion marketplace with AR try-on and carbon tracking.",
fullDesc: "A next-generation e-commerce platform focusing on sustainability. Features include AR-powered virtual try-on, supply chain transparency, and carbon footprint tracking.",
image: "https://images.unsplash.com/photo-1441986300917-64674bd600d8?w=800&q=80",
tags: ["Next.js", "Three.js", "Stripe"],
tech: ["Next.js 14", "Three.js", "Stripe", "Sanity CMS", "Vercel", "Mixpanel"],
stats: { gmv: "$2.4M", conversion: "4.2%", returns: "-35%" }
},
{
id: 5,
title: "Artisan Brand Identity",
category: "brand",
desc: "Complete visual identity for a boutique coffee roastery chain.",
fullDesc: "A holistic brand identity project covering logo design, packaging, environmental design, and digital presence. Created to reflect the artisanal craft of specialty coffee.",
image: "https://images.unsplash.com/photo-1495474472287-4d71bcdd2085?w=800&q=80",
tags: ["Branding", "Packaging", "Motion"],
tech: ["Adobe Illustrator", "After Effects", "Blender", "Figma", "Procreate"],
stats: { stores: "28", recognition: "+67%", loyalty: "89%" }
},
{
id: 6,
title: "Terra Weather",
category: "mobile",
desc: "Hyperlocal weather predictions using microclimate data and AI.",
fullDesc: "An innovative weather application that provides hyperlocal forecasts by analyzing microclimate patterns. Features beautiful visualizations and severe weather alerts.",
image: "https://images.unsplash.com/photo-1592210454359-9043f067919b?w=800&q=80",
tags: ["Swift", "CoreML", "WeatherAPI"],
tech: ["Swift UI", "CoreML", "Weather API", "MapKit", "CloudKit", "Push Notifications"],
stats: { accuracy: "94%", locations: "2M+", alerts: "Real-time" }
}
];
// DOM elements - initialized after definition
const cardGrid = document.getElementById('cardGrid');
const modal = document.getElementById('projectModal');
const filterBtns = document.querySelectorAll('.filter-btn');
// Render cards
function renderCards(filter = 'all') {
const filtered = filter === 'all'
? projects
: projects.filter(p => p.category === filter);
cardGrid.innerHTML = filtered.map((project, index) => `
<article class="project-card"
tabindex="0"
data-id="${project.id}"
style="transition-delay: ${index * 80}ms"
onclick="openModal(${project.id})"
onkeydown="handleCardKey(event, ${project.id})">
<div class="card-media">
<img src="${project.image}" alt="${project.title}" loading="lazy">
<span class="card-badge ${project.category}">${project.category}</span>
</div>
<div class="card-content">
<h3 class="card-title">${project.title}</h3>
<p class="card-desc">${project.desc}</p>
<div class="card-tags">
${project.tags.map(tag => `<span class="card-tag">${tag}</span>`).join('')}
</div>
</div>
<div class="card-footer">
<div class="card-meta">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="10"/>
<path d="M12 6v6l4 2"/>
</svg>
<span>View Details</span>
</div>
<button class="btn-icon" aria-label="Open project">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M7 17L17 7M17 7H7M17 7v10"/>
</svg>
</button>
</div>
</article>
`).join('');
// Trigger entrance animation
requestAnimationFrame(() => {
document.querySelectorAll('.project-card').forEach(card => {
card.classList.add('visible');
});
});
}
// Open modal
function openModal(id) {
const project = projects.find(p => p.id === id);
if (!project) return;
document.getElementById('modalImage').src = project.image;
document.getElementById('modalImage').alt = project.title;
document.getElementById('modalTitle').textContent = project.title;
document.getElementById('modalSubtitle').textContent = project.desc;
document.getElementById('modalDescription').textContent = project.fullDesc;
// Render stats
const statsEl = document.getElementById('modalStats');
const statLabels = Object.keys(project.stats);
statsEl.innerHTML = statLabels.map(key => `
<div class="stat-item">
<div class="stat-value">${project.stats[key]}</div>
<div class="stat-label">${key}</div>
</div>
`).join('');
// Render tech stack
document.getElementById('modalTech').innerHTML = project.tech.map(t =>
`<span class="tech-item">${t}</span>`
).join('');
modal.classList.add('active');
document.body.style.overflow = 'hidden';
// Focus management
modal.querySelector('.modal-close').focus();
}
// Close modal
function closeModal() {
modal.classList.remove('active');
document.body.style.overflow = '';
}
// Keyboard handling for cards
function handleCardKey(event, id) {
if (event.key === 'Enter' || event.key === ' ') {
event.preventDefault();
openModal(id);
}
}
// Theme toggle
function toggleTheme() {
const html = document.documentElement;
const currentTheme = html.getAttribute('data-theme');
html.setAttribute('data-theme', currentTheme === 'dark' ? 'light' : 'dark');
}
// Filter handling
filterBtns.forEach(btn => {
btn.addEventListener('click', () => {
filterBtns.forEach(b => b.classList.remove('active'));
btn.classList.add('active');
renderCards(btn.dataset.filter);
});
});
// Close modal on backdrop click
modal.addEventListener('click', (e) => {
if (e.target === modal) closeModal();
});
// Close modal on Escape
document.addEventListener('keydown', (e) => {
if (e.key === 'Escape' && modal.classList.contains('active')) {
closeModal();
}
});
// Initialize
renderCards();
</script>
</body>
</html>