From 3e9d7708fa216e01962b76a03f543d4ee83f5f12 Mon Sep 17 00:00:00 2001 From: Matt Walsh Date: Thu, 4 Aug 2022 11:07:35 -0500 Subject: [PATCH] local forecast as html --- package.json | 4 +- server/scripts/modules/localforecast.js | 83 +++++---------------- server/scripts/modules/navigation.js | 2 +- server/scripts/modules/weatherdisplay.js | 2 +- server/styles/compiled.css | 94 +++++++++++++++--------- server/styles/compiled.css.map | 2 +- server/styles/scss/_current-weather.scss | 2 +- server/styles/scss/_hourly.scss | 2 +- server/styles/scss/_local-forecast.scss | 26 +++++++ server/styles/scss/_weatherdisplay.scss | 6 +- server/styles/scss/compiled.scss | 3 +- views/index.ejs | 10 +-- views/partials/local-forecast.ejs | 12 +++ 13 files changed, 133 insertions(+), 115 deletions(-) create mode 100644 server/styles/scss/_local-forecast.scss create mode 100644 views/partials/local-forecast.ejs diff --git a/package.json b/package.json index 58b879b..cf5d9a2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ws4kp", - "version": "4.1.3", + "version": "5.0.0", "description": "Welcome to the WeatherStar 4000+ project page!", "main": "index.js", "scripts": { @@ -43,4 +43,4 @@ "eslint": "^8.21.0", "eslint-plugin-import": "^2.26.0" } -} +} \ No newline at end of file diff --git a/server/scripts/modules/localforecast.js b/server/scripts/modules/localforecast.js index 5b2e884..22f5c63 100644 --- a/server/scripts/modules/localforecast.js +++ b/server/scripts/modules/localforecast.js @@ -1,17 +1,14 @@ // display text based local forecast -/* globals WeatherDisplay, utils, STATUS, UNITS, draw, navigation */ +/* globals WeatherDisplay, utils, STATUS, UNITS, navigation */ // eslint-disable-next-line no-unused-vars class LocalForecast extends WeatherDisplay { constructor(navId, elemId) { - super(navId, elemId, 'Local Forecast'); + super(navId, elemId, 'Local Forecast', true, true); // set timings this.timing.baseDelay = 5000; - - // pre-load background image (returns promise) - this.backgroundImage = utils.image.load('images/BackGround1_1.png'); } async getData(_weatherParameters) { @@ -28,14 +25,8 @@ class LocalForecast extends WeatherDisplay { // parse raw data const conditions = LocalForecast.parse(rawData); - // split this forecast into the correct number of screens - const maxRows = 7; - const maxCols = 32; - - this.screenTexts = []; - // read each text - conditions.forEach((condition) => { + this.screenTexts = conditions.map((condition) => { // process the text let text = `${condition.DayName.toUpperCase()}...`; let conditionText = condition.Text; @@ -44,44 +35,23 @@ class LocalForecast extends WeatherDisplay { } text += conditionText.toUpperCase().replace('...', ' '); - text = utils.string.wordWrap(text, maxCols, '\n'); - const lines = text.split('\n'); - const lineCount = lines.length; - let ScreenText = ''; - const maxRowCount = maxRows; - let rowCount = 0; - - // if (PrependAlert) { - // ScreenText = LocalForecastScreenTexts[LocalForecastScreenTexts.length - 1]; - // rowCount = ScreenText.split('\n').length - 1; - // } - - for (let i = 0; i <= lineCount - 1; i += 1) { - if (lines[i] !== '') { - if (rowCount > maxRowCount - 1) { - // if (PrependAlert) { - // LocalForecastScreenTexts[LocalForecastScreenTexts.length - 1] = ScreenText; - // PrependAlert = false; - // } else { - this.screenTexts.push(ScreenText); - // } - ScreenText = ''; - rowCount = 0; - } - - ScreenText += `${lines[i]}\n`; - rowCount += 1; - } - } - // if (PrependAlert) { - // this.screenTexts[this.screenTexts.length - 1] = ScreenText; - // PrependAlert = false; - // } else { - this.screenTexts.push(ScreenText); - // } + return text; }); - this.timing.totalScreens = this.screenTexts.length; + // fill the forecast texts + const templates = this.screenTexts.map((text) => this.fillTemplate('forecast', { text })); + const forecastsElem = this.elem.querySelector('.forecasts'); + forecastsElem.innerHTML = ''; + forecastsElem.append(...templates); + + // increase each forecast height to a multiple of container height + this.pageHeight = forecastsElem.parentNode.getBoundingClientRect().height; + templates.forEach((forecast) => { + const newHeight = Math.ceil(forecast.scrollHeight / this.pageHeight) * this.pageHeight; + forecast.style.height = `${newHeight}px`; + }); + + this.timing.totalScreens = forecastsElem.scrollHeight / this.pageHeight; this.calcNavTiming(); this.setStatus(STATUS.loaded); } @@ -105,25 +75,12 @@ class LocalForecast extends WeatherDisplay { } } - // TODO: alerts needs a cleanup - // TODO: second page of screenTexts when needed async drawCanvas() { super.drawCanvas(); - this.context.drawImage(await this.backgroundImage, 0, 0); - draw.horizontalGradientSingle(this.context, 0, 30, 500, 90, draw.topColor1, draw.topColor2); - draw.triangle(this.context, 'rgb(28, 10, 87)', 500, 30, 450, 90, 500, 90); - draw.horizontalGradientSingle(this.context, 0, 90, 52, 399, draw.sideColor1, draw.sideColor2); - draw.horizontalGradientSingle(this.context, 584, 90, 640, 399, draw.sideColor1, draw.sideColor2); + const top = -this.screenIndex * this.pageHeight; + this.elem.querySelector('.forecasts').style.top = `${top}px`; - draw.titleText(this.context, 'Local ', 'Forecast'); - - // clear existing text - draw.box(this.context, 'rgb(33, 40, 90)', 65, 105, 505, 280); - // Draw the text. - this.screenTexts[this.screenIndex].split('\n').forEach((text, index) => { - draw.text(this.context, 'Star4000', '24pt', '#FFFFFF', 75, 140 + 40 * index, text, 2); - }); this.finishDraw(); } diff --git a/server/scripts/modules/navigation.js b/server/scripts/modules/navigation.js index 77e5b51..a6a72f4 100644 --- a/server/scripts/modules/navigation.js +++ b/server/scripts/modules/navigation.js @@ -101,7 +101,7 @@ const navigation = (() => { new Hourly(2, 'hourly'), new TravelForecast(3, 'travelForecast', false), // not active by default new RegionalForecast(4, 'regionalForecast'), - new LocalForecast(5, 'localForecast'), + new LocalForecast(5, 'local-forecast'), new ExtendedForecast(6, 'extendedForecast'), almanac, new Radar(8, 'radar'), diff --git a/server/scripts/modules/weatherdisplay.js b/server/scripts/modules/weatherdisplay.js index 4713cc7..74a4d76 100644 --- a/server/scripts/modules/weatherdisplay.js +++ b/server/scripts/modules/weatherdisplay.js @@ -284,7 +284,7 @@ class WeatherDisplay { isActive() { if (!this.isHtml) return document.getElementById(`${this.elemId}Canvas`).offsetParent !== null; - return this.elem.offsetParent !== null; + return this.elem.offsetHeight !== 0; } isEnabled() { diff --git a/server/styles/compiled.css b/server/styles/compiled.css index 8887988..0fb599e 100644 --- a/server/styles/compiled.css +++ b/server/styles/compiled.css @@ -4,10 +4,11 @@ overflow: hidden; position: relative; background-image: url(../images/BackGround1_1.png); - display: none; + /* this method is required to hide blocks so they can be measured while off screen */ + height: 0px; } .weather-display.show { - display: block; + height: 480px; } .weather-display .template { display: none; @@ -94,22 +95,22 @@ margin-top: 10px; } -#hourly-html.weather-display .main { +.weather-display .hourly .main { overflow-y: hidden; } -#hourly-html.weather-display .main .column-headers { +.weather-display .hourly .main .column-headers { background-color: rgb(32, 0, 87); height: 20px; position: absolute; width: 100%; } -#hourly-html.weather-display .main .column-headers { +.weather-display .hourly .main .column-headers { position: -webkit-sticky; position: sticky; top: 0px; z-index: 5; } -#hourly-html.weather-display .main .column-headers div { +.weather-display .hourly .main .column-headers div { display: inline-block; font-family: "Star4000 Small"; font-size: 24pt; @@ -122,21 +123,21 @@ /* paint-order: stroke fill; */ text-shadow: 3px 3px 0 black, -1.5px -1.5px 0 black, 0 -1.5px 0 black, 1.5px -1.5px 0 black, 1.5px 0 0 black, 1.5px 1.5px 0 black, 0 1.5px 0 black, -1.5px 1.5px 0 black, -1.5px 0 0 black; } -#hourly-html.weather-display .main .column-headers .temp { +.weather-display .hourly .main .column-headers .temp { left: 370px; } -#hourly-html.weather-display .main .column-headers .like { +.weather-display .hourly .main .column-headers .like { left: 450px; } -#hourly-html.weather-display .main .column-headers .wind { +.weather-display .hourly .main .column-headers .wind { left: 560px; } -#hourly-html.weather-display .main .hourly-lines { +.weather-display .hourly .main .hourly-lines { min-height: 338px; padding-top: 10px; background: repeating-linear-gradient(0deg, #001040 0px, #102080 136px, #102080 202px, #001040 338px); } -#hourly-html.weather-display .main .hourly-lines .hourly-row { +.weather-display .hourly .main .hourly-lines .hourly-row { font-family: "Star4000 Large"; font-size: 24pt; height: 72px; @@ -147,33 +148,33 @@ text-shadow: 3px 3px 0 black, -1.5px -1.5px 0 black, 0 -1.5px 0 black, 1.5px -1.5px 0 black, 1.5px 0 0 black, 1.5px 1.5px 0 black, 0 1.5px 0 black, -1.5px 1.5px 0 black, -1.5px 0 0 black; position: relative; } -#hourly-html.weather-display .main .hourly-lines .hourly-row > div { +.weather-display .hourly .main .hourly-lines .hourly-row > div { position: absolute; white-space: pre; top: 8px; } -#hourly-html.weather-display .main .hourly-lines .hourly-row .hour { +.weather-display .hourly .main .hourly-lines .hourly-row .hour { left: 50px; } -#hourly-html.weather-display .main .hourly-lines .hourly-row .icon { +.weather-display .hourly .main .hourly-lines .hourly-row .icon { left: 280px; width: 70px; text-align: center; top: unset; } -#hourly-html.weather-display .main .hourly-lines .hourly-row .temp { +.weather-display .hourly .main .hourly-lines .hourly-row .temp { left: 370px; } -#hourly-html.weather-display .main .hourly-lines .hourly-row .like { +.weather-display .hourly .main .hourly-lines .hourly-row .like { left: 450px; } -#hourly-html.weather-display .main .hourly-lines .hourly-row .wind { +.weather-display .hourly .main .hourly-lines .hourly-row .wind { left: 530px; width: 100px; text-align: right; } -#current-weather-html.weather-display .main .col { +.weather-display .current-weather .main .col { height: 50px; width: 255px; display: inline-block; @@ -184,61 +185,84 @@ /* paint-order: stroke fill; */ text-shadow: 3px 3px 0 black, -1.5px -1.5px 0 black, 0 -1.5px 0 black, 1.5px -1.5px 0 black, 1.5px 0 0 black, 1.5px 1.5px 0 black, 0 1.5px 0 black, -1.5px 1.5px 0 black, -1.5px 0 0 black; } -#current-weather-html.weather-display .main .col.left { +.weather-display .current-weather .main .col.left { font-family: "Star4000 Extended"; font-size: 24pt; } -#current-weather-html.weather-display .main .col.right { +.weather-display .current-weather .main .col.right { right: 0px; font-family: "Star4000 Large"; font-size: 20px; font-weight: bold; } -#current-weather-html.weather-display .main .col.right .row { +.weather-display .current-weather .main .col.right .row { margin-bottom: 12px; } -#current-weather-html.weather-display .main .col.right .row .label, -#current-weather-html.weather-display .main .col.right .row .value { +.weather-display .current-weather .main .col.right .row .label, +.weather-display .current-weather .main .col.right .row .value { display: inline-block; } -#current-weather-html.weather-display .main .col.right .row .label { +.weather-display .current-weather .main .col.right .row .label { margin-left: 20px; } -#current-weather-html.weather-display .main .col.right .row .value { +.weather-display .current-weather .main .col.right .row .value { float: right; margin-right: 10px; } -#current-weather-html.weather-display .main .center { +.weather-display .current-weather .main .center { text-align: center; } -#current-weather-html.weather-display .main .temp { +.weather-display .current-weather .main .temp { font-family: "Star4000 Large"; font-size: 24pt; } -#current-weather-html.weather-display .main .icon { +.weather-display .current-weather .main .icon { height: 100px; } -#current-weather-html.weather-display .main .icon img { +.weather-display .current-weather .main .icon img { max-width: 126px; } -#current-weather-html.weather-display .main .wind-container { +.weather-display .current-weather .main .wind-container { margin-bottom: 10px; } -#current-weather-html.weather-display .main .wind-container > div { +.weather-display .current-weather .main .wind-container > div { width: 45%; display: inline-block; margin: 0px; } -#current-weather-html.weather-display .main .wind-container .wind-label { +.weather-display .current-weather .main .wind-container .wind-label { margin-left: 5px; } -#current-weather-html.weather-display .main .wind-container .wind { +.weather-display .current-weather .main .wind-container .wind { text-align: right; } -#current-weather-html.weather-display .main .wind-gusts { +.weather-display .current-weather .main .wind-gusts { margin-left: 5px; } -#current-weather-html.weather-display .main .location { +.weather-display .current-weather .main .location { color: yellow; margin-bottom: 10px; +} + +.weather-display .local-forecast .container { + position: relative; + top: 15px; + margin: 0px 10px; + box-sizing: border-box; + height: 280px; + overflow: hidden; +} +.weather-display .local-forecast .forecasts { + position: relative; +} +.weather-display .local-forecast .forecast { + font-family: "Star4000"; + font-size: 24pt; + text-transform: uppercase; + /* eventually, when chrome supports paint-order for html elements */ + /* -webkit-text-stroke: 2px black; */ + /* paint-order: stroke fill; */ + text-shadow: 3px 3px 0 black, -1.5px -1.5px 0 black, 0 -1.5px 0 black, 1.5px -1.5px 0 black, 1.5px 0 0 black, 1.5px 1.5px 0 black, 0 1.5px 0 black, -1.5px 1.5px 0 black, -1.5px 0 0 black; + min-height: 280px; + line-height: 40px; }/*# sourceMappingURL=compiled.css.map */ \ No newline at end of file diff --git a/server/styles/compiled.css.map b/server/styles/compiled.css.map index facf221..d6e2455 100644 --- a/server/styles/compiled.css.map +++ b/server/styles/compiled.css.map @@ -1 +1 @@ -{"version":3,"sources":["scss/_weatherdisplay.scss","compiled.css","scss/_colors.scss","scss/_utils.scss","scss/_hourly.scss","scss/_current-weather.scss"],"names":[],"mappings":"AAGA;EACC,YAAA;EACA,aAAA;EACA,gBAAA;EACA,kBAAA;EACA,kDAAA;EACA,aAAA;ACFD;ADIC;EACC,cAAA;ACFF;ADKC;EACC,aAAA;ACHF;ADMC;EACC,YAAA;EACA,YAAA;EACA,iBAAA;ACJF;ADME;EACC,aEzBW;ECGb,mEAAA;EACA,oCAAA;EACA,8BAAA;EACA,0LACC;EHoBC,uBAAA;EACA,eAAA;EACA,kBAAA;ACDH;ADGG;EACC,WAAA;EACA,SAAA;ACDJ;ADIG;EACC,WAAA;ACFJ;ADII;EACC,kBAAA;ACFL;ADKI;EACC,SAAA;ACHL;ADMI;EACC,SAAA;ACJL;ADUE;EACC,SAAA;EACA,UAAA;EACA,kBAAA;EACA,WAAA;ACRH;ADWE;EACC,kBAAA;EACA,SAAA;EACA,WAAA;ACTH;ADYE;EACC,SAAA;ACVH;ADaE;EACC,gBAAA;EACA,YExES;EFyET,6BAAA;EACA,eAAA;EGxEF,mEAAA;EACA,oCAAA;EACA,8BAAA;EACA,0LACC;EHsEC,WAAA;EACA,YAAA;EACA,iBAAA;EACA,kBAAA;ACRH;ADUG;EACC,iBAAA;ACRJ;ADaC;EACC,kBAAA;ACXF;ADaE;EACC,YAAA;EACA,aAAA;EACA,gBAAA;ACXH;ADcE;EACC,iBAAA;EACA,kBAAA;EACA,yBAAA;ACZH;ADiBC;EACC,YAAA;EACA,YAAA;EACA,gBAAA;EACA,gBAAA;ACfF;;AG1FC;EACC,kBAAA;AH6FF;AG3FE;EACC,gCFJa;EEKb,YAAA;EACA,kBAAA;EACA,WAAA;AH6FH;AG1FE;EACC,wBAAA;EAAA,gBAAA;EACA,QAAA;EACA,UAAA;AH4FH;AG1FG;EACC,qBAAA;EACA,6BAAA;EACA,eAAA;EACA,a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X,mBAAA;AJsJH","file":"compiled.css"} \ No newline at end of file +{"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"],"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,kBAAA;EACA,SAAA;EACA,WAAA;ACVH;ADaE;EACC,SAAA;ACXH;ADcE;EACC,gBAAA;EACA,YE1ES;EF2ET,6BAAA;EACA,eAAA;EG1EF,mEAAA;EACA,oCAAA;EACA,8BAAA;EACA,0LACC;EHwEC,WAAA;EACA,YAAA;EACA,iBAAA;EACA,kBAAA;ACTH;ADWG;EACC,iBAAA;ACTJ;ADcC;EACC,kBAAA;ACZF;ADcE;EACC,YAAA;EACA,aAAA;EACA,gBAAA;ACZH;ADeE;EACC,iBAAA;EACA,kBAAA;EACA,yBAAA;ACbH;ADkBC;EACC,YAAA;EACA,YAAA;EACA,gBAAA;EACA,gBAAA;AChBF;;AG3FC;EACC,kBAAA;AH8FF;AG5FE;EACC,gCFJa;EEKb,YAAA;EACA,kBAAA;EACA,WAAA;AH8FH;AG3FE;EACC,wBAAA;EAAA,gBAAA;EACA,QAAA;EACA,UAAA;AH6FH;AG3FG;EACC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ACC,gBAAA;AJwJH;AIrJE;EACC,aH3FW;EG4FX,mBAAA;AJuJH;;AK/OC;EACC,kBAAA;EACA,SAAA;EACA,gBAAA;EACA,sBAAA;EACA,aAAA;EACA,gBAAA;ALkPF;AK/OC;EACC,kBAAA;ALiPF;AK9OC;EACC,uBAAA;EACA,eAAA;EACA,yBAAA;EHjBD,mEAAA;EACA,oCAAA;EACA,8BAAA;EACA,0LACC;EGeA,iBAAA;EACA,iBAAA;ALmPF","file":"compiled.css"} \ No newline at end of file diff --git a/server/styles/scss/_current-weather.scss b/server/styles/scss/_current-weather.scss index 326d45f..058774f 100644 --- a/server/styles/scss/_current-weather.scss +++ b/server/styles/scss/_current-weather.scss @@ -1,7 +1,7 @@ @use 'colors'as c; @use 'utils'as u; -#current-weather-html.weather-display { +.weather-display .current-weather { .main { .col { diff --git a/server/styles/scss/_hourly.scss b/server/styles/scss/_hourly.scss index 30f707b..eb209a3 100644 --- a/server/styles/scss/_hourly.scss +++ b/server/styles/scss/_hourly.scss @@ -1,7 +1,7 @@ @use 'colors'as c; @use 'utils'as u; -#hourly-html.weather-display { +.weather-display .hourly { .main { overflow-y: hidden; diff --git a/server/styles/scss/_local-forecast.scss b/server/styles/scss/_local-forecast.scss new file mode 100644 index 0000000..76ecb14 --- /dev/null +++ b/server/styles/scss/_local-forecast.scss @@ -0,0 +1,26 @@ +@use 'colors'as c; +@use 'utils'as u; + +.weather-display .local-forecast { + .container { + position: relative; + top: 15px; + margin: 0px 10px; + box-sizing: border-box; + height: 280px; + overflow: hidden; + } + + .forecasts { + position: relative; + } + + .forecast { + font-family: 'Star4000'; + font-size: 24pt; + text-transform: uppercase; + @include u.text-shadow(); + min-height: 280px; + line-height: 40px; + } +} \ No newline at end of file diff --git a/server/styles/scss/_weatherdisplay.scss b/server/styles/scss/_weatherdisplay.scss index cbb9d7f..1bf9a61 100644 --- a/server/styles/scss/_weatherdisplay.scss +++ b/server/styles/scss/_weatherdisplay.scss @@ -7,10 +7,12 @@ overflow: hidden; position: relative; background-image: url(../images/BackGround1_1.png); - display: none; + + /* this method is required to hide blocks so they can be measured while off screen */ + height: 0px; &.show { - display: block; + height: 480px; } .template { diff --git a/server/styles/scss/compiled.scss b/server/styles/scss/compiled.scss index 0bd2463..116aa87 100644 --- a/server/styles/scss/compiled.scss +++ b/server/styles/scss/compiled.scss @@ -1,3 +1,4 @@ @use '_weatherdisplay'; @use '_hourly'; -@use '_current-weather'; \ No newline at end of file +@use '_current-weather'; +@use '_local-forecast'; \ No newline at end of file diff --git a/views/index.ejs b/views/index.ejs index a5a7792..0d6b93f 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -4,13 +4,6 @@ - - - - - - - WeatherStar 4000+ @@ -103,6 +96,9 @@
<%- include('partials/current-weather.ejs') %>
+
+ <%- include('partials/local-forecast.ejs') %> +
diff --git a/views/partials/local-forecast.ejs b/views/partials/local-forecast.ejs new file mode 100644 index 0000000..a773d7f --- /dev/null +++ b/views/partials/local-forecast.ejs @@ -0,0 +1,12 @@ +<%- include('header.ejs', {titleDual:{ top: 'Local' , bottom: 'Forecast' }, hasTime: true, noaaLogo: true}) %> +
+
+
+
+
+
+
+
+
+
+ <%- include('scroll.ejs') %> \ No newline at end of file