Combine hero and filter sections into unified search block
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:
@@ -7,6 +7,35 @@
|
|||||||
box-shadow: var(--shadow-soft, 0 2px 8px rgba(26, 22, 18, 0.06));
|
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 {
|
.searchModeToggle {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
@@ -168,6 +197,23 @@
|
|||||||
border-radius: 8px;
|
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 {
|
.locationForm {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,9 +14,11 @@ import styles from './FilterBar.module.css';
|
|||||||
interface FilterBarProps {
|
interface FilterBarProps {
|
||||||
filters: Filters;
|
filters: Filters;
|
||||||
showLocationSearch?: boolean;
|
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 router = useRouter();
|
||||||
const pathname = usePathname();
|
const pathname = usePathname();
|
||||||
const searchParams = useSearchParams();
|
const searchParams = useSearchParams();
|
||||||
@@ -104,7 +106,14 @@ export function FilterBar({ filters, showLocationSearch = true }: FilterBarProps
|
|||||||
const hasActiveFilters = currentSearch || currentLA || currentType || currentPostcode;
|
const hasActiveFilters = currentSearch || currentLA || currentType || currentPostcode;
|
||||||
|
|
||||||
return (
|
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 && (
|
{showLocationSearch && (
|
||||||
<div className={styles.searchModeToggle}>
|
<div className={styles.searchModeToggle}>
|
||||||
<button
|
<button
|
||||||
|
|||||||
@@ -2,56 +2,6 @@
|
|||||||
width: 100%;
|
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 {
|
.locationBanner {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -188,25 +138,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@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 {
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,18 +28,13 @@ export function HomeView({ initialSchools, filters }: HomeViewProps) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.homeView}>
|
<div className={styles.homeView}>
|
||||||
{/* Hero Section */}
|
{/* Combined Hero + Search and Filters */}
|
||||||
<section className={styles.hero}>
|
<FilterBar
|
||||||
<h1 className={styles.heroTitle}>
|
filters={filters}
|
||||||
Compare Primary School Performance
|
showLocationSearch
|
||||||
</h1>
|
heroTitle="Compare Primary School Performance"
|
||||||
<p className={styles.heroDescription}>
|
heroDescription="Search and compare KS2 results for thousands of schools across England"
|
||||||
Search and compare KS2 results for thousands of schools across England
|
/>
|
||||||
</p>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
{/* Search and Filters */}
|
|
||||||
<FilterBar filters={filters} showLocationSearch />
|
|
||||||
|
|
||||||
{/* Location Info Banner */}
|
{/* Location Info Banner */}
|
||||||
{isLocationSearch && initialSchools.location_info && (
|
{isLocationSearch && initialSchools.location_info && (
|
||||||
|
|||||||
Reference in New Issue
Block a user