Make info-panel fully responsive with vh/vw units

This commit is contained in:
Richard Zink committed 2026-10-07 08:49:28 +02:00
1 parent 70c4d72a03
commit 386588a118
1 file changed
+42 -41
+42 -41
View File
@@ -10,45 +10,46 @@
#vanta { width: 100vw; height: 100vh; position: fixed; top: 0; left: 0; } #vanta { width: 100vw; height: 100vh; position: fixed; top: 0; left: 0; }
#info-panel { #info-panel {
position: fixed; position: fixed;
bottom: 20px; top: 2vh;
right: 20px; bottom: 2vh;
right: 1.5vw;
color: #e6dfd1; color: #e6dfd1;
background: rgba(28, 27, 31, 0.7); background: rgba(28, 27, 31, 0.7);
padding: 14px 18px; padding: 1.2vh 1.2vw;
border-radius: 8px; border-radius: 0.6vh;
z-index: 9999; z-index: 9999;
font-size: 13px; font-size: clamp(11px, 1.5vh, 16px);
line-height: 1.6; line-height: 1.6;
min-width: 340px; min-width: 22vw;
display: flex;
flex-direction: column;
overflow-y: auto;
max-height: calc(100vh - 4vh);
} }
#analog-clock { #analog-clock {
width: 280px; width: min(70vh, 35vw);
height: 280px; height: min(70vh, 35vw);
margin: 0 auto 10px auto; margin: 0 auto 1vh auto;
display: block; display: block;
} flex-shrink: 0;
#info-panel:not(:has(.weather-forecast)) #analog-clock,
#analog-clock {
width: 280px;
} }
#digital-clock { #digital-clock {
text-align: center; text-align: center;
font-size: 16px; font-size: 1.3em;
letter-spacing: 2px; letter-spacing: 2px;
margin-bottom: 12px; margin-bottom: 1vh;
padding-bottom: 10px; padding-bottom: 0.8vh;
border-bottom: 1px solid rgba(230, 223, 209, 0.2); border-bottom: 1px solid rgba(230, 223, 209, 0.2);
} }
.info-row { .info-row {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 10px; gap: 0.8vw;
padding: 3px 0; padding: 0.2vh 0;
} }
.info-icon { .info-icon {
width: 18px; width: 1.5em;
height: 18px; height: 1.5em;
flex-shrink: 0; flex-shrink: 0;
display: flex; display: flex;
align-items: center; align-items: center;
@@ -62,7 +63,7 @@
flex-grow: 1; flex-grow: 1;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
gap: 10px; gap: 0.8vw;
} }
.info-label { .info-label {
color: #b0a89a; color: #b0a89a;
@@ -73,46 +74,46 @@
} }
.info-sub { .info-sub {
color: #999187; color: #999187;
font-size: 11px; font-size: 0.85em;
margin-left: 4px; margin-left: 4px;
} }
.weather-divider { .weather-divider {
height: 1px; height: 1px;
background: rgba(230, 223, 209, 0.2); background: rgba(230, 223, 209, 0.2);
margin: 8px 0; margin: 0.8vh 0;
} }
.weather-current { .weather-current {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 12px; gap: 0.8vw;
padding: 4px 0 8px 0; padding: 0.4vh 0 0.8vh 0;
border-bottom: 1px solid rgba(230, 223, 209, 0.2); border-bottom: 1px solid rgba(230, 223, 209, 0.2);
margin-bottom: 8px; margin-bottom: 0.8vh;
} }
.weather-current-icon { .weather-current-icon {
width: 36px; width: 2.5em;
height: 36px; height: 2.5em;
flex-shrink: 0; flex-shrink: 0;
} }
.weather-current-icon svg { width: 100%; height: 100%; } .weather-current-icon svg { width: 100%; height: 100%; }
.weather-current-temp { .weather-current-temp {
font-size: 22px; font-size: 1.7em;
font-weight: bold; font-weight: bold;
} }
.weather-current-detail { .weather-current-detail {
font-size: 11px; font-size: 0.85em;
color: #b0a89a; color: #b0a89a;
line-height: 1.4; line-height: 1.4;
} }
.weather-day { .weather-day {
margin-bottom: 6px; margin-bottom: 0.5vh;
} }
.weather-day-header { .weather-day-header {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: baseline; align-items: baseline;
padding: 2px 0; padding: 0.2vh 0;
font-size: 12px; font-size: 0.95em;
} }
.weather-day-name { .weather-day-name {
color: #e6dfd1; color: #e6dfd1;
@@ -120,29 +121,29 @@
} }
.weather-day-minmax { .weather-day-minmax {
color: #999187; color: #999187;
font-size: 11px; font-size: 0.85em;
} }
.weather-day-slots { .weather-day-slots {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
gap: 4px; gap: 0.3vw;
font-size: 11px; font-size: 0.85em;
} }
.weather-slot { .weather-slot {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
flex: 1; flex: 1;
gap: 2px; gap: 0.2vh;
} }
.weather-slot-icon { .weather-slot-icon {
width: 22px; width: 1.8em;
height: 22px; height: 1.8em;
} }
.weather-slot-icon svg { width: 100%; height: 100%; } .weather-slot-icon svg { width: 100%; height: 100%; }
.weather-slot-label { .weather-slot-label {
color: #999187; color: #999187;
font-size: 9px; font-size: 0.7em;
} }
.weather-slot-temp { .weather-slot-temp {
color: #e6dfd1; color: #e6dfd1;