regional forecast/observation title close #11

This commit is contained in:
Matt Walsh 2022-08-04 20:12:44 -05:00
parent d34b0ca224
commit 902818d7a0
7 changed files with 16 additions and 6 deletions

View file

@ -61,7 +61,7 @@ const currentWeatherScroll = (() => {
if (!data) return; if (!data) return;
// clean up any old text // clean up any old text
if (context) context.putImageData(blankDrawArea, 0, 405); if (context && blankDrawArea) context.putImageData(blankDrawArea, 0, 405);
drawCondition(screens[screenIndex](data)); drawCondition(screens[screenIndex](data));
}; };

View file

@ -30,6 +30,7 @@ class Hourly extends WeatherDisplay {
console.error('Get hourly forecast failed'); console.error('Get hourly forecast failed');
console.error(e.status, e.responseJSON); console.error(e.status, e.responseJSON);
this.setStatus(STATUS.failed); this.setStatus(STATUS.failed);
return;
} }
this.data = await Hourly.parseForecast(forecast.properties); this.data = await Hourly.parseForecast(forecast.properties);

View file

@ -343,17 +343,24 @@ class RegionalForecast extends WeatherDisplay {
draw.triangle(this.context, 'rgb(28, 10, 87)', 500, 30, 450, 90, 500, 90); draw.triangle(this.context, 'rgb(28, 10, 87)', 500, 30, 450, 90, 500, 90);
// draw the appropriate title // draw the appropriate title
const titleTop = this.elem.querySelector('.title.dual .top');
const titleBottom = this.elem.querySelector('.title.dual .bottom');
if (this.screenIndex === 0) { if (this.screenIndex === 0) {
titleTop.innerHTML = 'Regional';
titleBottom.innerHTML = 'Observations';
draw.titleText(this.context, 'Regional', 'Observations'); draw.titleText(this.context, 'Regional', 'Observations');
} else { } else {
const forecastDate = DateTime.fromISO(data[0][this.screenIndex].time); const forecastDate = DateTime.fromISO(data[0][this.screenIndex].time);
// get the name of the day // get the name of the day
const dayName = forecastDate.toLocaleString({ weekday: 'long' }); const dayName = forecastDate.toLocaleString({ weekday: 'long' });
titleTop.innerHTML = 'Forecast for';
// draw the title // draw the title
if (data[0][this.screenIndex].daytime) { if (data[0][this.screenIndex].daytime) {
titleBottom.innerHTML = dayName;
draw.titleText(this.context, 'Forecast for', dayName); draw.titleText(this.context, 'Forecast for', dayName);
} else { } else {
titleBottom.innerHTML = `${dayName} Night`;
draw.titleText(this.context, 'Forecast for', `${dayName} Night`); draw.titleText(this.context, 'Forecast for', `${dayName} Night`);
} }
} }

View file

@ -27,6 +27,7 @@
font-family: "Star4000"; font-family: "Star4000";
font-size: 24pt; font-size: 24pt;
position: absolute; position: absolute;
width: 200px;
} }
.weather-display .header .title.single { .weather-display .header .title.single {
left: 170px; left: 170px;
@ -350,7 +351,7 @@
position: absolute; position: absolute;
width: 140px; width: 140px;
margin-left: -40px; margin-left: -40px;
margin-top: -30px; margin-top: -35px;
} }
.weather-display .main.regional-forecast .location > div { .weather-display .main.regional-forecast .location > div {
position: absolute; position: absolute;
@ -370,7 +371,7 @@
font-family: "Star4000 Large Compressed"; font-family: "Star4000 Large Compressed";
font-size: 28px; font-size: 28px;
color: yellow; color: yellow;
top: 22px; top: 32px;
text-align: right; text-align: right;
width: 40px; width: 40px;
} }

View file

@ -1 +1 @@
{"version":3,"sources":["scss/_weatherdisplay.scss","compiled.css","scss/_colors.scss","scss/_utils.scss","scss/_hourly.scss","scss/_current-weather.scss","scss/_local-forecast.scss","scss/_latest-observations.scss","scss/_regional-forecast.scss"],"names":[],"mappings":"AAGA;EACC,YAAA;EACA,aAAA;EACA,gBAAA;EACA,kBAAA;EACA,kDAAA;EAEA,oFAAA;EACA,WAAA;ACHD;ADKC;EACC,aAAA;ACHF;ADMC;EACC,aAAA;ACJF;ADOC;EACC,YAAA;EACA,YAAA;EACA,iBAAA;ACLF;ADOE;EACC,aE3BW;ECGb,mEAAA;EACA,oCAAA;EACA,8BAAA;EACA,0LACC;EHsBC,uBAAA;EACA,eAAA;EACA,kBAAA;ACFH;ADIG;EACC,WAAA;EACA,SAAA;ACFJ;ADKG;EACC,WAAA;ACHJ;ADKI;EACC,kBAAA;ACHL;ADMI;EACC,SAAA;ACJL;ADOI;EACC,SAAA;ACLL;ADWE;EACC,SAAA;EACA,UAAA;EACA,kBAAA;EACA,WAAA;ACTH;ADYE;EACC,kBA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iRL;AM5QE;EACC,WAAA;AN8QH;AM3QE;EACC,WAAA;AN6QH;AM1QE;EACC,WAAA;AN4QH;AMzQE;EACC,iBAAA;EACA,iBAAA;AN2QH;AMzQG;EACC,uBAAA;EACA,eAAA;EJnDH,mEAAA;EACA,oCAAA;EACA,8BAAA;EACA,0LACC;EIiDE,kBAAA;EACA,YAAA;AN8QJ;AM5QI;EACC,kBAAA;EACA,QAAA;AN8QL;AM3QI;EACC,gBAAA;EACA,iBAAA;AN6QL;;AO5UA;EACC,oDAAA;AP+UD;;AO5UA;EAGC,kBAAA;AP6UD;AO3UC;EACC,kBAAA;AP6UF;AO1UC;EACC,kBAAA;EACA,YAAA;EACA,kBAAA;EACA,iBAAA;AP4UF;AO1UE;EACC,kBAAA;ELpBF,mEAAA;EACA,oCAAA;EACA,8BAAA;EACA,0LACC;AFgWF;AO5UE;EACC,SAAA;EACA,UAAA;AP8UH;AO5UG;EACC,eAAA;AP8UJ;AO1UE;EACC,wCAAA;EACA,eAAA;EACA,aNvCW;EMwCX,SAAA;EACA,iBAAA;EACA,WAAA;AP4UH;AOzUE;EACC,qBAAA;EACA,eAAA;AP2UH","file":"compiled.css"} {"version":3,"sources":["scss/_weatherdisplay.scss","compiled.css","scss/_colors.scss","scss/_utils.scss","scss/_hourly.scss","scss/_current-weather.scss","scss/_local-forecast.scss","scss/_latest-observations.scss","scss/_regional-forecast.scss"],"names":[],"mappings":"AAGA;EACC,YAAA;EACA,aAAA;EACA,gBAAA;EACA,kBAAA;EACA,kDAAA;EAEA,oFAAA;EACA,WAAA;ACHD;ADKC;EACC,aAAA;ACHF;ADMC;EACC,aAAA;ACJF;ADOC;EACC,YAAA;EACA,YAAA;EACA,iBAAA;ACLF;ADOE;EACC,aE3BW;ECGb,mEAAA;EACA,oCAAA;EACA,8BAAA;EACA,0LACC;EHsBC,uBAAA;EACA,eAAA;EACA,kBAAA;EACA,YAAA;ACFH;ADIG;EACC,WAAA;EACA,SAAA;ACFJ;ADKG;EACC,WA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EACA,6BAAA;EACA,eAAA;EACA,kBAAA;EACA,UAAA;EJnBH,mEAAA;EACA,oCAAA;EACA,8BAAA;EACA,0LACC;AFoSF;AMjRG;EAEC,aAAA;ANkRJ;AMhRI;EACC,qBAAA;ANkRL;AM7QE;EACC,WAAA;AN+QH;AM5QE;EACC,WAAA;AN8QH;AM3QE;EACC,WAAA;AN6QH;AM1QE;EACC,iBAAA;EACA,iBAAA;AN4QH;AM1QG;EACC,uBAAA;EACA,eAAA;EJnDH,mEAAA;EACA,oCAAA;EACA,8BAAA;EACA,0LACC;EIiDE,kBAAA;EACA,YAAA;AN+QJ;AM7QI;EACC,kBAAA;EACA,QAAA;AN+QL;AM5QI;EACC,gBAAA;EACA,iBAAA;AN8QL;;AO7UA;EACC,oDAAA;APgVD;;AO7UA;EAGC,kBAAA;AP8UD;AO5UC;EACC,kBAAA;AP8UF;AO3UC;EACC,kBAAA;EACA,YAAA;EACA,kBAAA;EACA,iBAAA;AP6UF;AO3UE;EACC,kBAAA;ELpBF,mEAAA;EACA,oCAAA;EACA,8BAAA;EACA,0LACC;AFiWF;AO7UE;EACC,SAAA;EACA,UAAA;AP+UH;AO7UG;EACC,eAAA;AP+UJ;AO3UE;EACC,wCAAA;EACA,eAAA;EACA,aNvCW;EMwCX,SAAA;EACA,iBAAA;EACA,WAAA;AP6UH;AO1UE;EACC,qBAAA;EACA,eAAA;AP4UH","file":"compiled.css"}

View file

@ -18,7 +18,7 @@
position: absolute; position: absolute;
width: 140px; width: 140px;
margin-left: -40px; margin-left: -40px;
margin-top: -30px; margin-top: -35px;
>div { >div {
position: absolute; position: absolute;
@ -38,7 +38,7 @@
font-family: 'Star4000 Large Compressed'; font-family: 'Star4000 Large Compressed';
font-size: 28px; font-size: 28px;
color: c.$title-color; color: c.$title-color;
top: 22px; top: 32px;
text-align: right; text-align: right;
width: 40px; width: 40px;
} }

View file

@ -30,6 +30,7 @@
font-family: 'Star4000'; font-family: 'Star4000';
font-size: 24pt; font-size: 24pt;
position: absolute; position: absolute;
width: 200px;
&.single { &.single {
left: 170px; left: 170px;