fix: date input overflow, 7-day forecast on Home, screensaver button in settings
All checks were successful
Deploy / deploy (push) Successful in 2m45s
All checks were successful
Deploy / deploy (push) Successful in 2m45s
This commit is contained in:
22
app/page.tsx
22
app/page.tsx
@@ -334,7 +334,7 @@ function HomeTab({ weather, sensors }: { weather: WeatherData | null; sensors: S
|
|||||||
</div>
|
</div>
|
||||||
{weather.forecast && weather.forecast.length > 0 && (
|
{weather.forecast && weather.forecast.length > 0 && (
|
||||||
<div style={{ display: 'flex', gap: 8 }}>
|
<div style={{ display: 'flex', gap: 8 }}>
|
||||||
{weather.forecast.slice(0, 3).map(day => {
|
{weather.forecast.map(day => {
|
||||||
const d = new Date(day.date)
|
const d = new Date(day.date)
|
||||||
return (
|
return (
|
||||||
<div key={day.date} style={{ flex: 1, background: 'rgba(255,255,255,0.04)', borderRadius: 14, padding: '10px 8px', textAlign: 'center', border: '1px solid rgba(255,255,255,0.04)' }}>
|
<div key={day.date} style={{ flex: 1, background: 'rgba(255,255,255,0.04)', borderRadius: 14, padding: '10px 8px', textAlign: 'center', border: '1px solid rgba(255,255,255,0.04)' }}>
|
||||||
@@ -549,6 +549,19 @@ function SettingsTab({ city, onCityChange, onLogout, theme, onThemeChange }: { c
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* Lock screen */}
|
||||||
|
<button onClick={() => { const e = new CustomEvent('activate-screensaver'); window.dispatchEvent(e) }} style={{
|
||||||
|
display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 10,
|
||||||
|
padding: '16px', borderRadius: 18,
|
||||||
|
background: 'rgba(99,102,241,0.08)',
|
||||||
|
border: '1px solid rgba(129,140,248,0.15)',
|
||||||
|
color: '#a5b4fc', fontSize: 15, fontWeight: 600,
|
||||||
|
transition: 'all 0.25s ease',
|
||||||
|
}}>
|
||||||
|
<Lock size={18} />
|
||||||
|
Режим часов
|
||||||
|
</button>
|
||||||
|
|
||||||
{/* Logout */}
|
{/* Logout */}
|
||||||
<button onClick={onLogout} style={{
|
<button onClick={onLogout} style={{
|
||||||
display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 10,
|
display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 10,
|
||||||
@@ -650,6 +663,13 @@ function HomePageInner() {
|
|||||||
return () => clearInterval(t)
|
return () => clearInterval(t)
|
||||||
}, [loadHA, unlocked])
|
}, [loadHA, unlocked])
|
||||||
|
|
||||||
|
// Listen for manual screensaver activation
|
||||||
|
useEffect(() => {
|
||||||
|
const handler = () => setScreensaverActive(true)
|
||||||
|
window.addEventListener('activate-screensaver', handler)
|
||||||
|
return () => window.removeEventListener('activate-screensaver', handler)
|
||||||
|
}, [])
|
||||||
|
|
||||||
// Screensaver idle detection
|
// Screensaver idle detection
|
||||||
const resetIdle = useCallback(() => {
|
const resetIdle = useCallback(() => {
|
||||||
if (screensaverActive) { setScreensaverActive(false); return }
|
if (screensaverActive) { setScreensaverActive(false); return }
|
||||||
|
|||||||
@@ -66,13 +66,13 @@ function AddEventModal({ defaultDate, onClose, onSaved }: { defaultDate: string;
|
|||||||
<div style={{
|
<div style={{
|
||||||
background: 'rgba(16,16,30,0.97)', backdropFilter: 'blur(40px)',
|
background: 'rgba(16,16,30,0.97)', backdropFilter: 'blur(40px)',
|
||||||
border: '1px solid rgba(255,255,255,0.07)', borderRadius: 28,
|
border: '1px solid rgba(255,255,255,0.07)', borderRadius: 28,
|
||||||
width: 420, maxWidth: '95vw', overflow: 'hidden',
|
width: 400, maxWidth: '90vw', overflow: 'hidden',
|
||||||
boxShadow: '0 30px 90px rgba(0,0,0,0.6)',
|
boxShadow: '0 30px 90px rgba(0,0,0,0.6)',
|
||||||
}} onClick={e => e.stopPropagation()}>
|
}} onClick={e => e.stopPropagation()}>
|
||||||
|
|
||||||
{/* Header */}
|
{/* Header */}
|
||||||
<div style={{
|
<div style={{
|
||||||
padding: '24px 28px 20px',
|
padding: '22px 24px 18px',
|
||||||
borderBottom: '1px solid rgba(255,255,255,0.05)',
|
borderBottom: '1px solid rgba(255,255,255,0.05)',
|
||||||
display: 'flex', justifyContent: 'space-between', alignItems: 'center',
|
display: 'flex', justifyContent: 'space-between', alignItems: 'center',
|
||||||
}}>
|
}}>
|
||||||
@@ -90,7 +90,7 @@ function AddEventModal({ defaultDate, onClose, onSaved }: { defaultDate: string;
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Body */}
|
{/* Body */}
|
||||||
<div style={{ padding: '20px 28px 28px' }}>
|
<div style={{ padding: '20px 24px 24px' }}>
|
||||||
|
|
||||||
{/* Calendar selector */}
|
{/* Calendar selector */}
|
||||||
<div style={{ display: 'flex', gap: 8, marginBottom: 20 }}>
|
<div style={{ display: 'flex', gap: 8, marginBottom: 20 }}>
|
||||||
@@ -125,7 +125,7 @@ function AddEventModal({ defaultDate, onClose, onSaved }: { defaultDate: string;
|
|||||||
placeholder="Название события"
|
placeholder="Название события"
|
||||||
autoFocus
|
autoFocus
|
||||||
style={{
|
style={{
|
||||||
width: '100%', padding: '15px 18px', borderRadius: 14,
|
width: '100%', padding: '15px 18px', borderRadius: 14, boxSizing: 'border-box' as any,
|
||||||
background: 'rgba(255,255,255,0.04)',
|
background: 'rgba(255,255,255,0.04)',
|
||||||
border: '1px solid rgba(255,255,255,0.07)',
|
border: '1px solid rgba(255,255,255,0.07)',
|
||||||
color: 'var(--text-primary)', fontSize: 16, fontWeight: 500,
|
color: 'var(--text-primary)', fontSize: 16, fontWeight: 500,
|
||||||
@@ -144,7 +144,7 @@ function AddEventModal({ defaultDate, onClose, onSaved }: { defaultDate: string;
|
|||||||
<input
|
<input
|
||||||
type="date" value={date} onChange={e => setDate(e.target.value)}
|
type="date" value={date} onChange={e => setDate(e.target.value)}
|
||||||
style={{
|
style={{
|
||||||
width: '100%', padding: '14px 18px', borderRadius: 14,
|
width: '100%', padding: '14px 18px', borderRadius: 14, boxSizing: 'border-box' as any,
|
||||||
background: 'rgba(255,255,255,0.04)',
|
background: 'rgba(255,255,255,0.04)',
|
||||||
border: '1px solid rgba(255,255,255,0.07)',
|
border: '1px solid rgba(255,255,255,0.07)',
|
||||||
color: 'var(--text-primary)', fontSize: 15,
|
color: 'var(--text-primary)', fontSize: 15,
|
||||||
@@ -305,7 +305,7 @@ function EventDetailModal({ event, onClose, onDelete, onUpdate }: {
|
|||||||
<div style={{
|
<div style={{
|
||||||
background: 'rgba(16,16,30,0.97)', backdropFilter: 'blur(40px)',
|
background: 'rgba(16,16,30,0.97)', backdropFilter: 'blur(40px)',
|
||||||
border: '1px solid rgba(255,255,255,0.07)', borderRadius: 28,
|
border: '1px solid rgba(255,255,255,0.07)', borderRadius: 28,
|
||||||
width: 480, maxWidth: '95vw', overflow: 'hidden',
|
width: 440, maxWidth: '90vw', overflow: 'hidden',
|
||||||
boxShadow: '0 30px 90px rgba(0,0,0,0.6)',
|
boxShadow: '0 30px 90px rgba(0,0,0,0.6)',
|
||||||
}} onClick={e => e.stopPropagation()}>
|
}} onClick={e => e.stopPropagation()}>
|
||||||
|
|
||||||
@@ -313,7 +313,7 @@ function EventDetailModal({ event, onClose, onDelete, onUpdate }: {
|
|||||||
<div style={{
|
<div style={{
|
||||||
background: `linear-gradient(135deg, ${event.color}20, ${event.color}08)`,
|
background: `linear-gradient(135deg, ${event.color}20, ${event.color}08)`,
|
||||||
borderBottom: `1px solid ${event.color}15`,
|
borderBottom: `1px solid ${event.color}15`,
|
||||||
padding: '24px 28px 20px',
|
padding: '22px 24px 18px',
|
||||||
}}>
|
}}>
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start' }}>
|
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start' }}>
|
||||||
<div style={{ flex: 1, minWidth: 0 }}>
|
<div style={{ flex: 1, minWidth: 0 }}>
|
||||||
@@ -361,7 +361,7 @@ function EventDetailModal({ event, onClose, onDelete, onUpdate }: {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Content */}
|
{/* Content */}
|
||||||
<div style={{ padding: '20px 28px 24px', display: 'flex', flexDirection: 'column', gap: 14 }}>
|
<div style={{ padding: '20px 24px 22px', display: 'flex', flexDirection: 'column', gap: 14 }}>
|
||||||
|
|
||||||
{editing ? (
|
{editing ? (
|
||||||
<>
|
<>
|
||||||
@@ -369,7 +369,7 @@ function EventDetailModal({ event, onClose, onDelete, onUpdate }: {
|
|||||||
<div>
|
<div>
|
||||||
<div style={{ fontSize: 11, color: 'var(--text-secondary)', fontWeight: 600, textTransform: 'uppercase', letterSpacing: '0.08em', marginBottom: 8 }}>Дата</div>
|
<div style={{ fontSize: 11, color: 'var(--text-secondary)', fontWeight: 600, textTransform: 'uppercase', letterSpacing: '0.08em', marginBottom: 8 }}>Дата</div>
|
||||||
<input type="date" value={editDate} onChange={e => setEditDate(e.target.value)} style={{
|
<input type="date" value={editDate} onChange={e => setEditDate(e.target.value)} style={{
|
||||||
width: '100%', padding: '12px 16px', borderRadius: 12,
|
width: '100%', padding: '12px 16px', borderRadius: 12, boxSizing: 'border-box' as any,
|
||||||
background: 'rgba(255,255,255,0.04)', border: '1px solid rgba(255,255,255,0.07)',
|
background: 'rgba(255,255,255,0.04)', border: '1px solid rgba(255,255,255,0.07)',
|
||||||
color: 'var(--text-primary)', fontSize: 15, outline: 'none', fontFamily: 'inherit',
|
color: 'var(--text-primary)', fontSize: 15, outline: 'none', fontFamily: 'inherit',
|
||||||
}} />
|
}} />
|
||||||
|
|||||||
Reference in New Issue
Block a user