mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-04-17 17:19:30 -07:00
separate data and css
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
class Almanac extends WeatherDisplay {
|
||||
constructor(navId,elemId,weatherParameters) {
|
||||
super(navId,elemId);
|
||||
super(navId,elemId,'Almanac');
|
||||
|
||||
// pre-load background image (returns promise)
|
||||
this.backgroundImage = utils.image.load('images/BackGround1_1.png');
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
class CurrentWeather extends WeatherDisplay {
|
||||
constructor(navId,elemId,weatherParameters) {
|
||||
super(navId,elemId);
|
||||
super(navId,elemId,'Current Conditions');
|
||||
// pre-load background image (returns promise)
|
||||
this.backgroundImage = utils.image.load('images/BackGround1_1.png');
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
class ExtendedForecast extends WeatherDisplay {
|
||||
constructor(navId,elemId,weatherParameters) {
|
||||
super(navId,elemId);
|
||||
super(navId,elemId,'Extended Forecast');
|
||||
|
||||
// set timings
|
||||
this.timing.totalScreens = 2;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
class LatestObservations extends WeatherDisplay {
|
||||
constructor(navId,elemId, weatherParameters) {
|
||||
super(navId,elemId);
|
||||
super(navId,elemId,'Latest Observations');
|
||||
// pre-load background image (returns promise)
|
||||
this.backgroundImage = utils.image.load('images/BackGround1_1.png');
|
||||
|
||||
|
||||
@@ -176,7 +176,7 @@ const navigation = (() => {
|
||||
},
|
||||
};
|
||||
|
||||
// receive naivgation messages from displays
|
||||
// receive navigation messages from displays
|
||||
const displayNavMessage = (message) => {
|
||||
if (message.type === msg.response.previous) loadDisplay(-1);
|
||||
if (message.type === msg.response.next) loadDisplay(1);
|
||||
@@ -208,8 +208,9 @@ const navigation = (() => {
|
||||
|
||||
// get the current display index or value
|
||||
const currentDisplayIndex = () => {
|
||||
const index = displays.findIndex(display=>display.isActive());
|
||||
if (index === undefined) console.error('No active display');
|
||||
let index = displays.findIndex(display=>display.isActive());
|
||||
// if there is no active display, default to the first one
|
||||
if (index === -1) index = displays.length-1;
|
||||
return index;
|
||||
};
|
||||
const currentDisplay = () => {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
class Radar extends WeatherDisplay {
|
||||
constructor(navId,elemId,weatherParameters) {
|
||||
super(navId,elemId);
|
||||
super(navId,elemId,'Local Radar');
|
||||
|
||||
// set max images
|
||||
this.dopplerRadarImageMax = 6;
|
||||
@@ -134,9 +134,6 @@ class Radar extends WeatherDisplay {
|
||||
workingContext.drawImage(imgBlob, 0, 0, 2550, 1600);
|
||||
}
|
||||
|
||||
// clean the image
|
||||
this.removeDopplerRadarImageNoise(workingContext);
|
||||
|
||||
// get the base map
|
||||
context.drawImage(await this.baseMap, sourceXY.x, sourceXY.y, offsetX*2, offsetY*2, 0, 0, 640, 367);
|
||||
|
||||
@@ -147,6 +144,8 @@ class Radar extends WeatherDisplay {
|
||||
const cropContext = cropCanvas.getContext('2d');
|
||||
cropContext.imageSmoothingEnabled = false;
|
||||
cropContext.drawImage(workingCanvas, radarSourceX, radarSourceY, (radarOffsetX * 2), (radarOffsetY * 2.33), 0, 0, 640, 367);
|
||||
// clean the image
|
||||
this.removeDopplerRadarImageNoise(cropContext);
|
||||
|
||||
// merge the radar and map
|
||||
this.mergeDopplerRadarImage(context, cropContext);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
class RegionalForecast extends WeatherDisplay {
|
||||
constructor(navId,elemId, weatherParameters, period) {
|
||||
super(navId,elemId);
|
||||
super(navId,elemId,'Regional Forecast');
|
||||
// store the period, see above
|
||||
this.period = period;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
class TravelForecast extends WeatherDisplay {
|
||||
constructor(navId, elemId, weatherParameters) {
|
||||
// special height and width for scrolling
|
||||
super(navId, elemId);
|
||||
super(navId, elemId, 'Travel Forecast');
|
||||
// pre-load background image (returns promise)
|
||||
this.backgroundImage = utils.image.load('images/BackGround6_1.png');
|
||||
|
||||
|
||||
@@ -2,38 +2,6 @@
|
||||
{
|
||||
font-family: "Star4000";
|
||||
src: url('../fonts/Star4000.woff') format('woff');
|
||||
/*font-weight: bold;
|
||||
font-style: italic;*/
|
||||
}
|
||||
@font-face
|
||||
{
|
||||
font-family: "Star 4 Radar";
|
||||
src: url('../fonts/Star 4 Radar.woff') format('woff');
|
||||
}
|
||||
@font-face
|
||||
{
|
||||
font-family: 'Star4000 Extended';
|
||||
src: url('../fonts/Star4000 Extended.woff') format('woff');
|
||||
}
|
||||
@font-face
|
||||
{
|
||||
font-family: 'Star4000 Large Compressed Numbers';
|
||||
src: url('../fonts/Star4000 Large Compressed Numbers.woff') format('woff');
|
||||
}
|
||||
@font-face
|
||||
{
|
||||
font-family: 'Star4000 Large Compressed';
|
||||
src: url('../fonts/Star4000 Large Compressed.woff') format('woff');
|
||||
}
|
||||
@font-face
|
||||
{
|
||||
font-family: 'Star4000 Large';
|
||||
src: url('../fonts/Star4000 Large.woff') format('woff');
|
||||
}
|
||||
@font-face
|
||||
{
|
||||
font-family: 'Star4000 Small';
|
||||
src: url('../fonts/Star4000 Small.woff') format('woff');
|
||||
}
|
||||
body
|
||||
{
|
||||
@@ -53,7 +21,6 @@ input, button
|
||||
|
||||
#txtAddress
|
||||
{
|
||||
/*width: 400px;*/
|
||||
width: 490px;
|
||||
font-size: 16pt;
|
||||
}
|
||||
@@ -82,31 +49,8 @@ input, button
|
||||
background-color: #0000ff;
|
||||
color: #ffffff;
|
||||
}
|
||||
.autocomplete-suggestions strong
|
||||
{
|
||||
/*font-weight: normal;*/
|
||||
/*color: lightseagreen*/
|
||||
}
|
||||
.autocomplete-group
|
||||
{
|
||||
/*padding: 2px 5px;*/
|
||||
}
|
||||
.autocomplete-group strong
|
||||
{
|
||||
/*display: block;
|
||||
border-bottom: 1px solid black;*/
|
||||
}
|
||||
|
||||
/*#Star4000LargeCompressedNumbers
|
||||
{
|
||||
visibility: hidden;
|
||||
position: absolute;
|
||||
font-family: 'Star4000 Large Compressed Numbers';
|
||||
}*/
|
||||
|
||||
#divTwc
|
||||
{
|
||||
/*display: none;*/
|
||||
display: block;
|
||||
background-color: #000000;
|
||||
color: #ffffff;
|
||||
@@ -133,8 +77,6 @@ input, button
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
/*position: relative;
|
||||
top: 10%;*/
|
||||
}
|
||||
|
||||
#divTwcRight
|
||||
@@ -152,8 +94,6 @@ input, button
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
/*position: relative;
|
||||
top: 10%;*/
|
||||
}
|
||||
|
||||
#divTwcBottom
|
||||
@@ -242,5 +182,4 @@ input, button
|
||||
#txtScrollText
|
||||
{
|
||||
width: 475px;
|
||||
/*text-transform: uppercase;*/
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user