Combine hero and filter sections into unified search block
All checks were successful
Build and Push Docker Images / Build Backend (FastAPI) (push) Successful in 35s
Build and Push Docker Images / Build Frontend (Next.js) (push) Successful in 1m17s
Build and Push Docker Images / Trigger Portainer Update (push) Successful in 0s

Merged the hero title/description into FilterBar component to save
vertical space. The combined block has a gradient background flowing
from cream to white with the search controls below the header.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Tudor
2026-02-04 09:54:27 +00:00
parent 1b9220d51b
commit ea6820f1c4
4 changed files with 64 additions and 83 deletions

View File

@@ -7,6 +7,35 @@
box-shadow: var(--shadow-soft, 0 2px 8px rgba(26, 22, 18, 0.06));
}
.filterBar.withHero {
background: linear-gradient(180deg, var(--bg-secondary, #f3ede4) 0%, var(--bg-card, white) 40%);
padding: 1.75rem 1.5rem 1.5rem;
}
.heroSection {
text-align: center;
margin-bottom: 1.25rem;
padding-bottom: 1.25rem;
border-bottom: 1px solid var(--border-color, #e5dfd5);
}
.heroTitle {
font-size: 1.75rem;
font-weight: 700;
color: var(--text-primary, #1a1612);
margin: 0 0 0.375rem;
line-height: 1.2;
letter-spacing: -0.02em;
font-family: var(--font-playfair), 'Playfair Display', serif;
}
.heroDescription {
font-size: 0.9375rem;
color: var(--text-secondary, #5c564d);
margin: 0;
line-height: 1.4;
}
.searchModeToggle {
display: flex;
gap: 0.5rem;
@@ -168,6 +197,23 @@
border-radius: 8px;
}
.filterBar.withHero {
padding: 1.25rem 1rem 1rem;
}
.heroSection {
margin-bottom: 1rem;
padding-bottom: 1rem;
}
.heroTitle {
font-size: 1.375rem;
}
.heroDescription {
font-size: 0.875rem;
}
.locationForm {
flex-direction: column;
}

View File

@@ -14,9 +14,11 @@ import styles from './FilterBar.module.css';
interface FilterBarProps {
filters: Filters;
showLocationSearch?: boolean;
heroTitle?: string;
heroDescription?: string;
}
export function FilterBar({ filters, showLocationSearch = true }: FilterBarProps) {
export function FilterBar({ filters, showLocationSearch = true, heroTitle, heroDescription }: FilterBarProps) {
const router = useRouter();
const pathname = usePathname();
const searchParams = useSearchParams();
@@ -104,7 +106,14 @@ export function FilterBar({ filters, showLocationSearch = true }: FilterBarProps
const hasActiveFilters = currentSearch || currentLA || currentType || currentPostcode;
return (
<div className={styles.filterBar}>
<div className={`${styles.filterBar} ${heroTitle ? styles.withHero : ''}`}>
{heroTitle && (
<div className={styles.heroSection}>
<h1 className={styles.heroTitle}>{heroTitle}</h1>
{heroDescription && <p className={styles.heroDescription}>{heroDescription}</p>}
</div>
)}
{showLocationSearch && (
<div className={styles.searchModeToggle}>
<button

View File

@@ -2,56 +2,6 @@
width: 100%;
}
.hero {
text-align: center;
margin-bottom: 2.5rem;
padding: 2rem 2rem 1.75rem;
background: linear-gradient(135deg, var(--bg-secondary, #f3ede4) 0%, var(--bg-primary, #faf7f2) 100%);
border-radius: 16px;
border: 1px solid var(--border-color, #e5dfd5);
animation: heroFadeIn 0.5s ease-out;
}
@keyframes heroFadeIn {
from {
opacity: 0;
transform: translateY(-8px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.heroTitle {
font-size: 2.25rem;
font-weight: 700;
color: var(--text-primary, #1a1612);
margin-bottom: 0.5rem;
line-height: 1.2;
letter-spacing: -0.02em;
font-family: var(--font-playfair), 'Playfair Display', serif;
}
/* Coral accent bar under title */
.heroTitle::after {
content: '';
display: block;
width: 80px;
height: 3px;
background: var(--accent-coral, #e07256);
border-radius: 2px;
margin: 0.75rem auto 0;
}
.heroDescription {
font-size: 1rem;
color: var(--text-secondary, #5c564d);
max-width: 520px;
margin: 0.75rem auto 0;
line-height: 1.5;
}
.locationBanner {
display: flex;
align-items: center;
@@ -188,25 +138,6 @@
}
@media (max-width: 768px) {
.hero {
padding: 1.5rem 1rem 1.25rem;
margin-bottom: 1.5rem;
border-radius: 12px;
}
.heroTitle {
font-size: 1.75rem;
}
.heroTitle::after {
width: 60px;
margin-top: 0.5rem;
}
.heroDescription {
font-size: 0.9375rem;
}
.grid {
grid-template-columns: 1fr;
}

View File

@@ -28,18 +28,13 @@ export function HomeView({ initialSchools, filters }: HomeViewProps) {
return (
<div className={styles.homeView}>
{/* Hero Section */}
<section className={styles.hero}>
<h1 className={styles.heroTitle}>
Compare Primary School Performance
</h1>
<p className={styles.heroDescription}>
Search and compare KS2 results for thousands of schools across England
</p>
</section>
{/* Search and Filters */}
<FilterBar filters={filters} showLocationSearch />
{/* Combined Hero + Search and Filters */}
<FilterBar
filters={filters}
showLocationSearch
heroTitle="Compare Primary School Performance"
heroDescription="Search and compare KS2 results for thousands of schools across England"
/>
{/* Location Info Banner */}
{isLocationSearch && initialSchools.location_info && (