mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-04-18 09:39:30 -07:00
Merge remote-tracking branch 'eddyg/station-name-improvements' into code-refactor
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
|
||||
@use 'shared/_colors'as c;
|
||||
@use 'shared/_utils'as u;
|
||||
@use 'shared/_colors' as c;
|
||||
@use 'shared/_utils' as u;
|
||||
|
||||
#almanac-html.weather-display {
|
||||
background-image: url('../images/backgrounds/3.png');
|
||||
@@ -11,62 +11,57 @@
|
||||
@include u.text-shadow();
|
||||
|
||||
.sun {
|
||||
display: table;
|
||||
margin-left: 50px;
|
||||
height: 100px;
|
||||
// Use CSS Grid for cross-browser consistency
|
||||
// Grid is populated in reading order (left-to-right, top-to-bottom):
|
||||
display: grid;
|
||||
grid-template-columns: auto auto auto;
|
||||
grid-template-rows: auto auto auto;
|
||||
gap: 0px 90px;
|
||||
margin: 3px auto 5px auto; // align the bottom of the div with the background
|
||||
width: fit-content;
|
||||
line-height: 30px;
|
||||
|
||||
|
||||
&>div {
|
||||
display: table-row;
|
||||
.grid-item {
|
||||
// Reset inherited styles that interfere with grid layout
|
||||
width: auto;
|
||||
height: auto;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
position: relative;
|
||||
|
||||
&>div {
|
||||
display: table-cell;
|
||||
}
|
||||
}
|
||||
|
||||
.days {
|
||||
color: c.$column-header-text;
|
||||
text-align: right;
|
||||
top: -5px;
|
||||
|
||||
.day {
|
||||
padding-right: 10px;
|
||||
// Column headers (day names)
|
||||
&.header {
|
||||
color: c.$column-header-text;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.times {
|
||||
text-align: right;
|
||||
|
||||
.sun-time {
|
||||
width: 200px;
|
||||
// Row labels (Sunrise:, Sunset:)
|
||||
&.row-label {
|
||||
// color: c.$column-header-text; // screenshots show labels were white
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
&.times-1 {
|
||||
top: -10px;
|
||||
}
|
||||
|
||||
&.times-2 {
|
||||
top: -15px;
|
||||
// Time values (sunrise/sunset)
|
||||
&.time {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.moon {
|
||||
position: relative;
|
||||
top: -10px;
|
||||
|
||||
padding: 0px 60px;
|
||||
padding: 7px 50px;
|
||||
line-height: 36px;
|
||||
|
||||
.title {
|
||||
color: c.$column-header-text;
|
||||
padding-left: 13px;
|
||||
}
|
||||
|
||||
.day {
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
width: 130px;
|
||||
width: 132px;
|
||||
|
||||
.icon {
|
||||
// shadow in image make it look off center
|
||||
@@ -82,4 +77,4 @@
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@use 'shared/_colors'as c;
|
||||
@use 'shared/_utils'as u;
|
||||
@use 'shared/_colors' as c;
|
||||
@use 'shared/_utils' as u;
|
||||
|
||||
.weather-display .main.current-weather {
|
||||
&.main {
|
||||
@@ -58,27 +58,19 @@
|
||||
font-size: 24pt;
|
||||
}
|
||||
|
||||
.condition {}
|
||||
|
||||
.icon {
|
||||
height: 100px;
|
||||
|
||||
img {
|
||||
max-width: 126px;
|
||||
margin: 0 auto;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.wind-container {
|
||||
margin-bottom: 10px;
|
||||
margin-left: 10px;
|
||||
display: flex;
|
||||
|
||||
&>div {
|
||||
width: 45%;
|
||||
display: inline-block;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
.wind-label {
|
||||
margin-left: 5px;
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.wind {
|
||||
@@ -87,7 +79,8 @@
|
||||
}
|
||||
|
||||
.wind-gusts {
|
||||
margin-left: 5px;
|
||||
text-align: right;
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
.location {
|
||||
@@ -99,4 +92,4 @@
|
||||
text-wrap: nowrap;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
@use 'shared/_colors'as c;
|
||||
@use 'shared/_utils'as u;
|
||||
@use 'shared/_colors' as c;
|
||||
@use 'shared/_utils' as u;
|
||||
|
||||
.weather-display .main.hazards {
|
||||
&.main {
|
||||
overflow-y: hidden;
|
||||
height: 480px;
|
||||
background-color: rgb(112, 35, 35);
|
||||
|
||||
.hazard-lines {
|
||||
min-height: 400px;
|
||||
padding-top: 10px;
|
||||
|
||||
background-color: rgb(112, 35, 35);
|
||||
|
||||
.hazard {
|
||||
font-family: 'Star4000';
|
||||
font-size: 24pt;
|
||||
@@ -26,4 +25,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@use 'shared/_utils'as u;
|
||||
@use 'shared/_colors'as c;
|
||||
@use 'shared/_utils' as u;
|
||||
@use 'shared/_colors' as c;
|
||||
|
||||
@font-face {
|
||||
font-family: "Star4000";
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
body {
|
||||
font-family: "Star4000";
|
||||
margin: 0;
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
background-color: #000000;
|
||||
@@ -23,13 +24,17 @@ body {
|
||||
|
||||
&.kiosk {
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
overflow: hidden;
|
||||
width: 100vw;
|
||||
// Always use black background in kiosk mode, regardless of light/dark preference
|
||||
background-color: #000000 !important;
|
||||
}
|
||||
}
|
||||
|
||||
#divQuery {
|
||||
max-width: 640px;
|
||||
padding: 8px;
|
||||
|
||||
.buttons {
|
||||
display: inline-block;
|
||||
@@ -89,17 +94,22 @@ body {
|
||||
font-family: "Star4000";
|
||||
}
|
||||
|
||||
#txtAddress {
|
||||
#txtLocation {
|
||||
width: calc(100% - 170px);
|
||||
max-width: 490px;
|
||||
font-size: 16pt;
|
||||
min-width: 200px;
|
||||
display: inline-block;
|
||||
|
||||
// Ensure consistent styling across light and dark modes
|
||||
background-color: white;
|
||||
color: black;
|
||||
border: 2px inset #808080;
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
background-color: #000000;
|
||||
color: white;
|
||||
border: 1px solid darkgray;
|
||||
border: 2px inset #808080;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,12 +147,26 @@ body {
|
||||
color: #ffffff;
|
||||
width: 100%;
|
||||
max-width: 640px;
|
||||
margin: 0; // Ensure edge-to-edge display
|
||||
|
||||
&.wide {
|
||||
max-width: 854px;
|
||||
}
|
||||
}
|
||||
|
||||
.content-wrapper {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
#divTwcMain {
|
||||
width: 640px;
|
||||
height: 480px;
|
||||
|
||||
.wide & {
|
||||
width: 854px;
|
||||
}
|
||||
}
|
||||
|
||||
.kiosk #divTwc {
|
||||
max-width: unset;
|
||||
}
|
||||
@@ -184,7 +208,11 @@ body {
|
||||
background-color: #000000;
|
||||
|
||||
color: #ffffff;
|
||||
width: 100%;
|
||||
width: 640px;
|
||||
|
||||
.wide & {
|
||||
width: 854px;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
background-color: rgb(48, 48, 48);
|
||||
@@ -196,25 +224,26 @@ body {
|
||||
padding-left: 6px;
|
||||
padding-right: 6px;
|
||||
|
||||
// scale down the buttons on narrower screens
|
||||
// Use font-size scaling instead of zoom/transform to avoid layout gaps and preserve icon tap targets.
|
||||
// While not semantically ideal, it works well for our fixed-layout design.
|
||||
@media (max-width: 550px) {
|
||||
zoom: 0.90;
|
||||
font-size: 0.90em;
|
||||
}
|
||||
|
||||
@media (max-width: 500px) {
|
||||
zoom: 0.80;
|
||||
font-size: 0.80em;
|
||||
}
|
||||
|
||||
@media (max-width: 450px) {
|
||||
zoom: 0.70;
|
||||
font-size: 0.70em;
|
||||
}
|
||||
|
||||
@media (max-width: 400px) {
|
||||
zoom: 0.60;
|
||||
font-size: 0.60em;
|
||||
}
|
||||
|
||||
@media (max-width: 350px) {
|
||||
zoom: 0.50;
|
||||
font-size: 0.50em;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -325,7 +354,6 @@ body {
|
||||
// background-image: none;
|
||||
width: unset;
|
||||
height: unset;
|
||||
transform-origin: unset;
|
||||
}
|
||||
|
||||
#loading {
|
||||
@@ -399,7 +427,8 @@ body {
|
||||
|
||||
label {
|
||||
display: block;
|
||||
max-width: 300px;
|
||||
max-width: fit-content;
|
||||
cursor: pointer;
|
||||
|
||||
.alert {
|
||||
display: none;
|
||||
@@ -414,6 +443,13 @@ body {
|
||||
|
||||
#divTwcBottom img {
|
||||
transform: scale(0.75);
|
||||
|
||||
// Make icons larger in widescreen mode on mobile
|
||||
@media (max-width: 550px) {
|
||||
.wide & {
|
||||
transform: scale(1.0); // Larger icons in widescreen
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#divTwc:fullscreen,
|
||||
@@ -446,9 +482,7 @@ body {
|
||||
|
||||
.kiosk {
|
||||
#divTwc #divTwcBottom {
|
||||
>div {
|
||||
display: none;
|
||||
}
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -768,15 +802,15 @@ body {
|
||||
display: none;
|
||||
}
|
||||
|
||||
// Hide instructions in kiosk mode (higher specificity than the show rule)
|
||||
body.kiosk #loading .instructions {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.kiosk {
|
||||
|
||||
#divQuery,
|
||||
>.info,
|
||||
>.related-links,
|
||||
>.heading,
|
||||
#enabledDisplays,
|
||||
#settings,
|
||||
#divInfo {
|
||||
display: none;
|
||||
// In kiosk mode, hide everything except the main weather display
|
||||
>*:not(#divTwc) {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@use 'shared/_colors'as c;
|
||||
@use 'shared/_utils'as u;
|
||||
@use 'shared/_colors' as c;
|
||||
@use 'shared/_utils' as u;
|
||||
|
||||
.weather-display .progress {
|
||||
@include u.text-shadow();
|
||||
@@ -13,6 +13,7 @@
|
||||
box-sizing: border-box;
|
||||
height: 310px;
|
||||
overflow: hidden;
|
||||
line-height: 28px;
|
||||
|
||||
.item {
|
||||
position: relative;
|
||||
@@ -117,4 +118,4 @@
|
||||
transition: width 1s steps(6);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@use 'shared/_colors'as c;
|
||||
@use 'shared/_utils'as u;
|
||||
@use 'shared/_colors' as c;
|
||||
@use 'shared/_utils' as u;
|
||||
|
||||
.weather-display .main.travel {
|
||||
&.main {
|
||||
@@ -8,14 +8,11 @@
|
||||
.column-headers {
|
||||
background-color: c.$column-header;
|
||||
height: 20px;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.column-headers {
|
||||
position: sticky;
|
||||
top: 0px;
|
||||
width: 100%;
|
||||
z-index: 5;
|
||||
overflow: hidden; // prevent thin gaps between header and content
|
||||
|
||||
div {
|
||||
display: inline-block;
|
||||
@@ -100,4 +97,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@use 'shared/_colors'as c;
|
||||
@use 'shared/_utils'as u;
|
||||
@use 'shared/_colors' as c;
|
||||
@use 'shared/_utils' as u;
|
||||
|
||||
.weather-display {
|
||||
width: 640px;
|
||||
@@ -94,11 +94,13 @@
|
||||
|
||||
&.has-scroll {
|
||||
width: 640px;
|
||||
margin-top: 0;
|
||||
height: 310px;
|
||||
overflow: hidden;
|
||||
|
||||
&.no-header {
|
||||
height: 400px;
|
||||
margin-top: 0; // Reset for no-header case since the gap issue is header-related
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,6 +131,12 @@
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
// Remove margins for hazard scrolls to maximize text space
|
||||
&.hazard .fixed {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.scroll-header {
|
||||
height: 26px;
|
||||
font-family: "Star4000 Small";
|
||||
@@ -150,4 +158,4 @@
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
/* REGULAR SCANLINES SETTINGS */
|
||||
|
||||
// width of 1 scanline (min.: 1px)
|
||||
// width of 1 scanline (responsive units to prevent banding)
|
||||
$scan-width: 1px;
|
||||
$scan-width-scaled: 0.15vh; // viewport-relative unit for better scaling
|
||||
|
||||
// emulates a damage-your-eyes bad pre-2000 CRT screen ♥ (true, false)
|
||||
$scan-crt: false;
|
||||
@@ -75,18 +76,41 @@ $scan-opacity: .75;
|
||||
@include scan-moving($scan-moving-line);
|
||||
}
|
||||
|
||||
// the scanlines, so!
|
||||
// the scanlines, so! - with responsive scaling for low-res displays
|
||||
&:after {
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: $scan-z-index;
|
||||
background: linear-gradient(to bottom,
|
||||
transparent 50%,
|
||||
$scan-color 51%);
|
||||
background-size: 100% $scan-width*2;
|
||||
// repeating-linear-gradient is more efficient than linear-gradient+background-size because it doesn't require the browser to calculate tiling
|
||||
background: repeating-linear-gradient(to bottom,
|
||||
transparent 0,
|
||||
transparent $scan-width,
|
||||
$scan-color $scan-width,
|
||||
$scan-color calc($scan-width * 2));
|
||||
@include scan-crt($scan-crt);
|
||||
|
||||
// Prevent sub-pixel aliasing on scaled displays
|
||||
image-rendering: crisp-edges;
|
||||
image-rendering: pixelated;
|
||||
}
|
||||
|
||||
// Scanlines use dynamic thickness calculated by JavaScript
|
||||
// JavaScript calculates optimal thickness to prevent banding at any scale factor
|
||||
// The --scanline-thickness custom property is set by applyScanlineScaling()
|
||||
// The modes (hairline, thin, medium, thick) force the base thickness selection
|
||||
// Some modes may appear the same (e.g. hairline and thin) depending on the display
|
||||
&:before {
|
||||
height: var(--scanline-thickness, $scan-width);
|
||||
}
|
||||
|
||||
&:after {
|
||||
background: repeating-linear-gradient(to bottom,
|
||||
transparent 0,
|
||||
transparent var(--scanline-thickness, $scan-width),
|
||||
$scan-color var(--scanline-thickness, $scan-width),
|
||||
$scan-color calc(var(--scanline-thickness, $scan-width) * 2));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,4 +127,4 @@ $scan-opacity: .75;
|
||||
background-position: 0 50%;
|
||||
// bottom: 0%; // to have a continuous scanline move, use this line (here in 0% step) instead of transform and write, in &:before, { position: absolute; bottom: 100%; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user