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 defaultScreensLoaded = true;
const isRadarDisplay = (display) => display?.elemId === 'radar';
const isHazardsDisplay = (display) => display?.elemId === 'hazards';
// start drawing conditions
// reset starts from the first item in the text scroll list
const start = () => {
@ -73,7 +70,7 @@ const incrementInterval = (force) => {
// test current screen
const display = currentDisplay();
if (!display || isHazardsDisplay(display) || (!display.okToDrawCurrentConditions && !isRadarDisplay(display))) {
if (!display?.okToDrawCurrentConditions) {
stop(display?.elemId === 'progress');
hide();
return;
@ -85,20 +82,14 @@ const incrementInterval = (force) => {
};
const drawScreen = async () => {
const display = currentDisplay();
if (!display || isHazardsDisplay(display) || (!display.okToDrawCurrentConditions && !isRadarDisplay(display))) {
hide();
return;
}
// get the conditions
const { data, parameters } = await getCurrentWeather();
// create a data object (empty if no valid current weather conditions)
const scrollData = data || {};
// add the hazards if on screen 0 or for Radar's hazard-only crawl
if (screenIndex === 0 || isRadarDisplay(display)) {
// add the hazards if on screen 0
if (screenIndex === 0) {
const hazards = await getHazards();
if (hazards && hazards.length > 0) {
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 (!data && (!scrollData.hazards || scrollData.hazards.length === 0)) {
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;
}
if (!data && (!scrollData.hazards || scrollData.hazards.length === 0)) return;
const thisScreen = workingScreens[screenIndex](scrollData, parameters);

View file

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

View file

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

View file

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

View file

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

View file

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

File diff suppressed because one or more lines are too long