diff --git a/server/scripts/modules/currentweatherscroll.js b/server/scripts/modules/currentweatherscroll.js index 7e6efe5..cffe993 100644 --- a/server/scripts/modules/currentweatherscroll.js +++ b/server/scripts/modules/currentweatherscroll.js @@ -1,4 +1,4 @@ -/* globals draw, navigation */ +/* globals draw, navigation, utils */ // eslint-disable-next-line no-unused-vars const currentWeatherScroll = (() => { @@ -14,10 +14,8 @@ const currentWeatherScroll = (() => { // start drawing conditions // reset starts from the first item in the text scroll list const start = (_context) => { - // see if there is a context available - if (!_context) return; // store see if the context is new - if (_context !== context) { + if (context && _context !== context) { // clean the outgoing context cleanLastContext(); // store the new blank context @@ -42,6 +40,7 @@ const currentWeatherScroll = (() => { }; const cleanLastContext = () => { + if (!context) return; if (blankDrawArea) context.putImageData(blankDrawArea, 0, 405); blankDrawArea = undefined; context = undefined; @@ -62,7 +61,7 @@ const currentWeatherScroll = (() => { if (!data) return; // clean up any old text - context.putImageData(blankDrawArea, 0, 405); + if (context) context.putImageData(blankDrawArea, 0, 405); drawCondition(screens[screenIndex](data)); }; @@ -70,7 +69,7 @@ const currentWeatherScroll = (() => { // the "screens" are stored in an array for easy addition and removal const screens = [ // station name - (data) => `Conditions at ${data.station.properties.name.substr(0, 20)}`, + (data) => `Conditions at ${utils.string.locationCleanup(data.station.properties.name).substr(0, 20)}`, // temperature (data) => { @@ -109,7 +108,14 @@ const currentWeatherScroll = (() => { // internal draw function with preset parameters const drawCondition = (text) => { - draw.text(context, 'Star4000', '24pt', '#ffffff', 70, 430, text, 2); + if (context) { + draw.text(context, 'Star4000', '24pt', '#ffffff', 70, 430, text, 2); + } + + // update all html scroll elements + utils.elem.forEach('.weather-display .scroll .fixed', (elem) => { + elem.innerHTML = text; + }); }; // return the api diff --git a/server/scripts/modules/weatherdisplay.js b/server/scripts/modules/weatherdisplay.js index 74a4d76..23daba1 100644 --- a/server/scripts/modules/weatherdisplay.js +++ b/server/scripts/modules/weatherdisplay.js @@ -169,7 +169,6 @@ class WeatherDisplay { // if (_ScrollText !== '') OkToDrawCustomScrollText = true; if (this.elemId === 'almanac') OkToDrawNoaaImage = false; if (this.elemId === 'travelForecast') OkToDrawNoaaImage = false; - if (this.elemId === 'hourly') OkToDrawNoaaImage = false; if (this.elemId === 'regionalForecast') OkToDrawNoaaImage = false; if (this.elemId === 'progress') { OkToDrawCurrentConditions = false; diff --git a/server/styles/compiled.css b/server/styles/compiled.css index 30ee37e..e82959d 100644 --- a/server/styles/compiled.css +++ b/server/styles/compiled.css @@ -89,11 +89,20 @@ width: calc(100% - 128px); } .weather-display .scroll { + /* 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; width: 640px; height: 80px; overflow: hidden; margin-top: 10px; } +.weather-display .scroll .fixed { + font-family: "Star4000"; + font-size: 24pt; + margin-left: 55px; +} .weather-display .main.hourly.main { overflow-y: hidden; diff --git a/server/styles/compiled.css.map b/server/styles/compiled.css.map index 66555a6..b1b14e6 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","scss/_local-forecast.scss","scss/_latest-observations.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,kBA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AAA;EACA,UAAA;EJnBH,mEAAA;EACA,oCAAA;EACA,8BAAA;EACA,0LACC;AF0RF;AMvQG;EAEC,aAAA;ANwQJ;AMtQI;EACC,qBAAA;ANwQL;AMnQE;EACC,WAAA;ANqQH;AMlQE;EACC,WAAA;ANoQH;AMjQE;EACC,WAAA;ANmQH;AMhQE;EACC,iBAAA;EACA,iBAAA;ANkQH;AMhQG;EACC,uBAAA;EACA,eAAA;EJnDH,mEAAA;EACA,oCAAA;EACA,8BAAA;EACA,0LACC;EIiDE,kBAAA;EACA,YAAA;ANqQJ;AMnQI;EACC,kBAAA;EACA,QAAA;ANqQL;AMlQI;EACC,gBAAA;EACA,iBAAA;ANoQL","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","scss/_latest-observations.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;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;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","file":"compiled.css"} \ No newline at end of file diff --git a/server/styles/scss/_weatherdisplay.scss b/server/styles/scss/_weatherdisplay.scss index d2bce7b..22256e1 100644 --- a/server/styles/scss/_weatherdisplay.scss +++ b/server/styles/scss/_weatherdisplay.scss @@ -107,9 +107,16 @@ .scroll { + @include u.text-shadow(3px, 1.5px); width: 640px; height: 80px; overflow: hidden; margin-top: 10px; + + .fixed { + font-family: 'Star4000'; + font-size: 24pt; + margin-left: 55px; + } } } \ No newline at end of file diff --git a/views/index.ejs b/views/index.ejs index 93611a3..5fc4597 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -93,7 +93,7 @@
<%- include('partials/hourly.ejs') %>
-
+
<%- include('partials/current-weather.ejs') %>
diff --git a/views/partials/scroll.ejs b/views/partials/scroll.ejs index 5d37f43..0fb3cac 100644 --- a/views/partials/scroll.ejs +++ b/views/partials/scroll.ejs @@ -1,3 +1,4 @@
- Scroll +
+
\ No newline at end of file