Files
school_compare/nextjs-app/components/ComparisonView.module.css
T
Tudor Sitaru 56ab1368b1
Build and Push Docker Images / Build Backend (FastAPI) (push) Successful in 12s
Build and Push Docker Images / Build Frontend (Next.js) (push) Successful in 48s
Build and Push Docker Images / Build Pipeline (Meltano + dbt + Airflow) (push) Successful in 14s
Build and Push Docker Images / Trigger Portainer Update (push) Successful in 1s
feat(mobile): compare table scroll fade and native share sheet
MOB-14: PerformanceChart and ComparisonChart both already configure
legend position 'top' — no change needed.

MOB-15: Compare's detailedTable is 774px wide inside an overflow-x:
auto wrapper. Add a right-edge mask-image fade at ≤640px so phone
users see the table extends past the viewport.

MOB-16: ComparisonView's Share button previously did clipboard-only.
Prefer navigator.share when available (iOS/Android native sheet) so
users can send straight to Messages / WhatsApp / Mail / etc. Fall
back to clipboard with the existing "Copied!" toast otherwise. User
cancellations swallow silently; only real errors trigger fallback.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-19 09:40:23 +01:00

477 lines
9.3 KiB
CSS

.container {
width: 100%;
}
/* Header */
.header {
margin-bottom: 2rem;
}
.headerContent {
display: flex;
justify-content: space-between;
align-items: flex-start;
gap: 2rem;
flex-wrap: wrap;
}
.header h1 {
font-size: 2.25rem;
font-weight: 700;
color: var(--text-primary, #1a1612);
margin-bottom: 0.5rem;
font-family: var(--font-playfair), 'Playfair Display', serif;
}
.subtitle {
font-size: 1rem;
color: var(--text-secondary, #5c564d);
margin: 0;
line-height: 1.6;
}
/* Phase Tabs */
.phaseTabs {
display: flex;
gap: 0;
margin-bottom: 1.5rem;
border: 1px solid var(--border-color, #e5dfd5);
border-radius: 8px;
overflow: hidden;
width: fit-content;
}
.phaseTab {
padding: 0.625rem 1.5rem;
font-size: 0.9375rem;
font-weight: 500;
background: var(--bg-card, white);
color: var(--text-secondary, #5c564d);
border: none;
cursor: pointer;
transition: all 0.15s ease;
font-family: inherit;
}
.phaseTab:not(:last-child) {
border-right: 1px solid var(--border-color, #e5dfd5);
}
.phaseTab:hover {
background: var(--bg-secondary, #f3ede4);
}
.phaseTabActive {
background: var(--accent-coral, #e07256);
color: white;
font-weight: 600;
}
.phaseTabActive:hover {
background: var(--accent-coral, #e07256);
}
/* Metric Selector */
.metricSelector {
background: var(--bg-card, white);
border: 1px solid var(--border-color, #e5dfd5);
border-radius: 12px;
padding: 1.5rem;
margin-bottom: 2rem;
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 1rem;
box-shadow: var(--shadow-soft, 0 2px 8px rgba(26, 22, 18, 0.06));
}
.metricLabel {
font-size: 0.9375rem;
font-weight: 600;
color: var(--text-primary, #1a1612);
white-space: nowrap;
}
.metricSelect {
flex: 1;
max-width: 400px;
padding: 0.625rem 1rem;
font-size: 0.9375rem;
border: 1px solid var(--border-color, #e5dfd5);
border-radius: 8px;
background: var(--bg-card, white);
color: var(--text-primary, #1a1612);
cursor: pointer;
transition: all 0.2s ease;
}
.metricSelect:hover {
border-color: var(--accent-coral, #e07256);
}
.metricSelect:focus {
outline: none;
border-color: var(--accent-coral, #e07256);
box-shadow: 0 0 0 3px var(--accent-coral-bg);
}
.metricSelect optgroup {
font-weight: 700;
color: var(--text-primary, #1a1612);
background: var(--bg-secondary, #f3ede4);
padding: 0.5rem 0;
}
.metricSelect option {
font-weight: 400;
color: var(--text-secondary, #5c564d);
padding: 0.375rem 1rem;
}
/* Schools Section */
.schoolsSection {
margin-bottom: 2rem;
}
.schoolsGrid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
gap: 1.5rem;
}
.schoolCard {
background: var(--bg-card, white);
border: 1px solid var(--border-color, #e5dfd5);
border-left: 3px solid var(--accent-teal, #2d7d7d);
border-radius: 12px;
padding: 1.5rem;
position: relative;
box-shadow: var(--shadow-soft, 0 2px 8px rgba(26, 22, 18, 0.06));
transition: all 0.3s ease;
display: flex;
flex-direction: column;
}
.schoolCard:hover {
box-shadow: var(--shadow-medium, 0 4px 20px rgba(26, 22, 18, 0.1));
transform: translateY(-2px);
}
.removeButton {
position: absolute;
top: 0.75rem;
right: 0.75rem;
width: 28px;
height: 28px;
display: flex;
align-items: center;
justify-content: center;
background: var(--accent-coral, #e07256);
color: white;
border: none;
border-radius: 50%;
font-size: 1.25rem;
line-height: 1;
cursor: pointer;
transition: all 0.2s ease;
}
.removeButton:hover {
background: var(--accent-coral-dark, #c45a3f);
transform: scale(1.1);
}
.schoolName {
font-size: 1.125rem;
font-weight: 600;
margin-bottom: 0.75rem;
padding-right: 2rem;
line-height: 1.3;
font-family: var(--font-playfair), 'Playfair Display', serif;
}
.schoolName a {
color: var(--text-primary, #1a1612);
text-decoration: none;
transition: color 0.2s ease;
}
.schoolName a:hover {
color: var(--accent-coral, #e07256);
}
.schoolMeta {
display: flex;
flex-direction: column;
gap: 0.5rem;
margin-bottom: 1rem;
flex: 1;
}
.metaItem {
font-size: 0.875rem;
color: var(--text-secondary, #5c564d);
display: flex;
align-items: center;
gap: 0.25rem;
}
.latestValue {
margin-top: auto;
padding-top: 1rem;
border-top: 1px solid var(--border-color, #e5dfd5);
text-align: center;
background: var(--bg-secondary, #f3ede4);
margin-left: -1.5rem;
margin-right: -1.5rem;
margin-bottom: -1.5rem;
padding: 1.25rem 1.5rem;
border-radius: 0 0 12px 9px;
}
.latestLabel {
font-size: 0.75rem;
color: var(--text-muted, #8a847a);
margin-bottom: 0.25rem;
text-transform: uppercase;
letter-spacing: 0.05em;
}
.latestNumber {
font-size: 1.75rem;
font-weight: 700;
color: var(--accent-teal, #2d7d7d);
}
/* Chart Section */
.chartSection {
background: var(--bg-card, white);
border: 1px solid var(--border-color, #e5dfd5);
border-radius: 12px;
padding: 2rem;
margin-bottom: 2rem;
box-shadow: var(--shadow-soft, 0 2px 8px rgba(26, 22, 18, 0.06));
}
.sectionTitle {
font-size: 1.5rem;
font-weight: 600;
color: var(--text-primary, #1a1612);
margin-bottom: 1.5rem;
padding-bottom: 0.75rem;
border-bottom: 2px solid var(--border-color, #e5dfd5);
font-family: var(--font-playfair), 'Playfair Display', serif;
display: flex;
align-items: center;
gap: 0.5rem;
}
.sectionTitle::before {
content: '';
display: inline-block;
width: 4px;
height: 1em;
background: var(--accent-coral, #e07256);
border-radius: 2px;
}
.chartContainer {
width: 100%;
height: 400px;
position: relative;
}
.loadingMessage {
text-align: center;
padding: 3rem;
color: var(--text-secondary, #5c564d);
font-size: 1rem;
}
/* Table Section */
.tableSection {
background: var(--bg-card, white);
border: 1px solid var(--border-color, #e5dfd5);
border-radius: 12px;
padding: 2rem;
margin-bottom: 2rem;
box-shadow: var(--shadow-soft, 0 2px 8px rgba(26, 22, 18, 0.06));
}
.tableWrapper {
overflow-x: auto;
max-width: 100%;
margin-top: 1rem;
-webkit-overflow-scrolling: touch;
}
/* Right-edge fade so phone users see the comparison table scrolls.
Otherwise the wider-than-viewport table silently clips. */
@media (max-width: 640px) {
.tableWrapper {
-webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
}
}
.comparisonTable {
width: 100%;
border-collapse: separate;
border-spacing: 0;
font-size: 0.9375rem;
}
.comparisonTable thead {
background: var(--bg-secondary, #f3ede4);
}
.comparisonTable th {
padding: 1rem;
text-align: left;
font-weight: 600;
color: var(--text-primary, #1a1612);
border-bottom: 2px solid var(--border-color, #e5dfd5);
background: var(--bg-secondary, #f3ede4);
white-space: nowrap;
text-transform: uppercase;
font-size: 0.75rem;
letter-spacing: 0.05em;
}
.comparisonTable td {
padding: 1rem;
border-bottom: 1px solid var(--border-color, #e5dfd5);
color: var(--text-secondary, #5c564d);
text-align: left;
background: var(--bg-card, white);
}
/* Sticky first column (Year) so labels remain visible while scrolling */
.comparisonTable th:first-child,
.comparisonTable td:first-child {
position: sticky;
left: 0;
z-index: 1;
box-shadow: 2px 0 4px -2px rgba(26, 22, 18, 0.08);
}
.comparisonTable thead th:first-child {
z-index: 2;
}
.comparisonTable tbody tr:hover td:first-child {
background: var(--bg-secondary, #f3ede4);
}
.comparisonTable tbody tr:last-child td {
border-bottom: none;
}
.comparisonTable tbody tr:hover {
background: var(--bg-secondary, #f3ede4);
}
.yearCell {
font-weight: 700;
color: var(--accent-gold, #c9a227);
}
/* Empty State */
.emptyState {
text-align: center;
padding: 4rem 2rem;
background: var(--bg-card, white);
border: 1px solid var(--border-color, #e5dfd5);
border-radius: 12px;
}
.emptyStateTitle {
font-size: 1.5rem;
font-weight: 600;
color: var(--text-primary, #1a1612);
margin-bottom: 0.5rem;
font-family: var(--font-playfair), 'Playfair Display', serif;
}
.emptyStateDescription {
font-size: 1rem;
color: var(--text-secondary, #5c564d);
max-width: 400px;
margin: 0 auto 1.5rem;
}
.metricDescription {
margin-top: 0.5rem;
font-size: 0.85rem;
color: var(--text-secondary);
max-width: 600px;
flex-basis: 100%;
margin-top: 0.25rem;
}
.progressNote {
background: var(--bg-secondary);
border-left: 3px solid var(--accent-teal);
padding: 0.75rem 1rem;
margin: 0 0 1.5rem;
font-size: 0.875rem;
color: var(--text-secondary);
border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
/* Responsive Design */
@media (max-width: 768px) {
.headerContent {
flex-direction: column;
align-items: stretch;
}
.header h1 {
font-size: 1.75rem;
}
.metricSelector {
flex-direction: column;
align-items: stretch;
padding: 1rem;
border-radius: 8px;
}
.metricSelect {
max-width: 100%;
}
.schoolsGrid {
grid-template-columns: 1fr;
}
.chartSection,
.tableSection {
padding: 1rem;
border-radius: 8px;
}
.chartContainer {
height: 300px;
}
.comparisonTable {
font-size: 0.875rem;
}
.comparisonTable th,
.comparisonTable td {
padding: 0.75rem 0.5rem;
}
.latestValue {
margin-left: -1rem;
margin-right: -1rem;
margin-bottom: -1rem;
padding: 1rem;
border-radius: 0 0 8px 5px;
}
}