Compare commits

..

No commits in common. "6f76316612a464f6688a0497caea2d786a8c0d36" and "536936f65faa3a20e6ddb5efd12131e0c277e61c" have entirely different histories.

7 changed files with 11 additions and 50 deletions

View file

@ -28,9 +28,6 @@ let nextUpdate = DEFAULT_UPDATE;
let resetFlag; let resetFlag;
let defaultScreensLoaded = true; let defaultScreensLoaded = true;
const isRadarDisplay = (display) => display?.elemId === 'radar';
const isHazardsDisplay = (display) => display?.elemId === 'hazards';
// start drawing conditions // start drawing conditions
// reset starts from the first item in the text scroll list // reset starts from the first item in the text scroll list
const start = () => { const start = () => {
@ -73,7 +70,7 @@ const incrementInterval = (force) => {
// test current screen // test current screen
const display = currentDisplay(); const display = currentDisplay();
if (!display || isHazardsDisplay(display) || (!display.okToDrawCurrentConditions && !isRadarDisplay(display))) { if (!display?.okToDrawCurrentConditions) {
stop(display?.elemId === 'progress'); stop(display?.elemId === 'progress');
hide(); hide();
return; return;
@ -85,20 +82,14 @@ const incrementInterval = (force) => {
}; };
const drawScreen = async () => { const drawScreen = async () => {
const display = currentDisplay();
if (!display || isHazardsDisplay(display) || (!display.okToDrawCurrentConditions && !isRadarDisplay(display))) {
hide();
return;
}
// get the conditions // get the conditions
const { data, parameters } = await getCurrentWeather(); const { data, parameters } = await getCurrentWeather();
// create a data object (empty if no valid current weather conditions) // create a data object (empty if no valid current weather conditions)
const scrollData = data || {}; const scrollData = data || {};
// add the hazards if on screen 0 or for Radar's hazard-only crawl // add the hazards if on screen 0
if (screenIndex === 0 || isRadarDisplay(display)) { if (screenIndex === 0) {
const hazards = await getHazards(); const hazards = await getHazards();
if (hazards && hazards.length > 0) { if (hazards && hazards.length > 0) {
scrollData.hazards = hazards; scrollData.hazards = hazards;
@ -106,24 +97,7 @@ const drawScreen = async () => {
} }
// if we have no current weather and no hazards, there's nothing to display // if we have no current weather and no hazards, there's nothing to display
if (!data && (!scrollData.hazards || scrollData.hazards.length === 0)) { if (!data && (!scrollData.hazards || scrollData.hazards.length === 0)) return;
hide();
return;
}
if (isRadarDisplay(display)) {
const radarHazard = hazards(scrollData);
if (!radarHazard) {
hide();
return;
}
mainScroll.classList.forEach((cls) => { if (cls !== 'scroll') mainScroll.classList.remove(cls); });
radarHazard.classes.forEach((cls) => mainScroll.classList.add(cls));
setHeader(radarHazard.header);
drawScrollCondition(radarHazard);
show();
return;
}
const thisScreen = workingScreens[screenIndex](scrollData, parameters); const thisScreen = workingScreens[screenIndex](scrollData, parameters);

View file

@ -171,9 +171,9 @@ class WeatherDisplay {
// clean up the first-run flag in screen index // clean up the first-run flag in screen index
if (this.screenIndex < 0) this.screenIndex = 0; if (this.screenIndex < 0) this.screenIndex = 0;
if (this.okToDrawCurrentDateTime) this.drawCurrentDateTime(); if (this.okToDrawCurrentDateTime) this.drawCurrentDateTime();
if (this.okToDrawCurrentConditions || this.elemId === 'radar') postMessage({ type: 'current-weather-scroll', method: 'start' }); if (this.okToDrawCurrentConditions) postMessage({ type: 'current-weather-scroll', method: 'start' });
if (!this.okToDrawCurrentConditions && this.elemId !== 'radar') postMessage({ type: 'current-weather-scroll', method: 'non-display' }); if (!this.okToDrawCurrentConditions) postMessage({ type: 'current-weather-scroll', method: 'non-display' });
if (this.okToDrawCurrentConditions === false && this.elemId !== 'radar') postMessage({ type: 'current-weather-scroll', method: 'hide' }); if (this.okToDrawCurrentConditions === false) postMessage({ type: 'current-weather-scroll', method: 'hide' });
} }
finishDraw() { finishDraw() {

View file

@ -100,7 +100,6 @@
.col { .col {
&.left { &.left {
margin-top: 35px; margin-top: 35px;
font-size: 20pt;
} }
&.right { &.right {

View file

@ -30,7 +30,6 @@
.story { .story {
height: 116px; height: 116px;
overflow: hidden; overflow: hidden;
margin-top: 20px;
} }
.headline { .headline {
@ -45,12 +44,11 @@
.blurb { .blurb {
font-family: 'Star4000'; font-family: 'Star4000';
font-size: 12pt; font-size: 14pt;
line-height: 10pt; line-height: 16px;
color: #fff; color: #fff;
@include u.text-shadow(); @include u.text-shadow();
overflow: hidden; overflow: hidden;
padding-right: 30px;
} }
} }
} }

View file

@ -36,8 +36,6 @@
height: 250px; height: 250px;
padding: 0 8px; padding: 0 8px;
box-sizing: border-box; box-sizing: border-box;
margin-top: 16px;
padding-right: 30px;
} }
.server-line { .server-line {

View file

@ -80,7 +80,7 @@
font-family: 'Star4000 Small'; font-family: 'Star4000 Small';
font-size: 24pt; font-size: 24pt;
@include u.text-shadow(3px, 1.5px); @include u.text-shadow(3px, 1.5px);
left: 436px; left: 415px;
width: 170px; width: 170px;
text-align: right; text-align: right;
position: absolute; position: absolute;
@ -167,14 +167,6 @@
} }
.radar #container>.scroll {
z-index: 100;
}
.radar #container>.scroll.hazard {
z-index: 1000 !important;
}
.wide #container>.scroll { .wide #container>.scroll {
width: 854px; width: 854px;
margin-left: -107px; margin-left: -107px;

File diff suppressed because one or more lines are too long