style(home): drop weather-hint block; recolor trams 23 green, 27 blue, 39 red
All checks were successful
Deploy / deploy (push) Successful in 2m47s
All checks were successful
Deploy / deploy (push) Successful in 2m47s
Weather hint (оденьтесь потеплее / не забудьте зонт) was pushing the home screen past one viewport on the tablet — removed the block and its helper fn. New tram color palette per user preference.
This commit is contained in:
24
app/page.tsx
24
app/page.tsx
@@ -416,21 +416,7 @@ function HomeTab({ weather, sensors }: { weather: WeatherData | null; sensors: S
|
||||
return () => clearInterval(t)
|
||||
}, [])
|
||||
|
||||
// Weather hint
|
||||
const getWeatherHint = (): string | null => {
|
||||
if (!weather) return null
|
||||
const desc = weather.desc.toLowerCase()
|
||||
const temp = parseInt(weather.temp)
|
||||
if (desc.includes('дождь') || desc.includes('ливен') || desc.includes('морос')) return '☂️ Не забудьте зонт'
|
||||
if (desc.includes('снег')) return '🧤 На улице снег, одевайтесь теплее'
|
||||
if (desc.includes('гроз')) return '⛈️ Ожидается гроза'
|
||||
if (temp <= 0) return '🥶 На улице мороз'
|
||||
if (temp <= 5) return '🧥 Оденьтесь потеплее'
|
||||
if (temp >= 30) return '🥵 Очень жарко, пейте воду'
|
||||
return null
|
||||
}
|
||||
|
||||
const hint = getWeatherHint()
|
||||
|
||||
return (
|
||||
<div style={{ flex: 1, overflowY: 'auto', WebkitOverflowScrolling: 'touch' as any, padding: '20px 24px 28px', display: 'flex', flexDirection: 'column', gap: 14 }}>
|
||||
@@ -439,16 +425,6 @@ function HomeTab({ weather, sensors }: { weather: WeatherData | null; sensors: S
|
||||
<h1 style={{ fontSize: 26, fontWeight: 800, color: 'var(--text-primary)', letterSpacing: '-0.5px', margin: 0 }}>
|
||||
{greeting} 👋
|
||||
</h1>
|
||||
{hint && (
|
||||
<div style={{
|
||||
fontSize: 14, color: 'var(--text-primary)', marginTop: 8,
|
||||
padding: '10px 16px', borderRadius: 12,
|
||||
background: 'rgba(251,191,36,0.08)', border: '1px solid rgba(251,191,36,0.15)',
|
||||
fontWeight: 500,
|
||||
}}>
|
||||
{hint}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Weather — full width compact */}
|
||||
|
||||
@@ -22,9 +22,9 @@ const DIRECTIONS: Direction[] = [
|
||||
]
|
||||
|
||||
const ROUTES: { num: string; color: string; bg: string }[] = [
|
||||
{ num: '23', color: '#60a5fa', bg: 'linear-gradient(135deg, #3b82f6, #2563eb)' },
|
||||
{ num: '27', color: '#fbbf24', bg: 'linear-gradient(135deg, #f59e0b, #d97706)' },
|
||||
{ num: '39', color: '#c084fc', bg: 'linear-gradient(135deg, #a855f7, #7c3aed)' },
|
||||
{ num: '23', color: '#34d399', bg: 'linear-gradient(135deg, #10b981, #059669)' },
|
||||
{ num: '27', color: '#60a5fa', bg: 'linear-gradient(135deg, #3b82f6, #2563eb)' },
|
||||
{ num: '39', color: '#f87171', bg: 'linear-gradient(135deg, #ef4444, #dc2626)' },
|
||||
]
|
||||
|
||||
function formatMinutes(m: number): string {
|
||||
|
||||
Reference in New Issue
Block a user