clickable navigation
This commit is contained in:
parent
0e5d831f4a
commit
6a2317d283
2
dist/index.html
vendored
2
dist/index.html
vendored
File diff suppressed because one or more lines are too long
2
dist/resources/ws.min.js
vendored
2
dist/resources/ws.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/twc3.html
vendored
2
dist/twc3.html
vendored
|
@ -1 +1 @@
|
|||
<!DOCTYPE html><html lang="en" xmlns="http://www.w3.org/1999/xhtml"><head><meta charset="utf-8"><link rel="preload" href="fonts/Star4000.woff" as="font" crossorigin="anonymous"><link rel="preload" href="fonts/Star 4 Radar.woff" as="font" crossorigin="anonymous"><link rel="preload" href="fonts/Star4000 Extended.woff" as="font" crossorigin="anonymous"><link rel="preload" href="fonts/Star4000 Large Compressed.woff" as="font" crossorigin="anonymous"><link rel="preload" href="fonts/Star4000 Large.woff" as="font" crossorigin="anonymous"><link rel="preload" href="fonts/Star4000 Small.woff" as="font" crossorigin="anonymous"><link rel="stylesheet" type="text/css" href="resources/twc3.min.css?_=2.3.0"><script type="text/javascript" src="resources/data.min.js"></script><script type="text/javascript" src="resources/ws.min.js?_=2.3.0"></script></head><body><div id="version" style="display:none">2.3.0</div><div id="container"></div></body></html>
|
||||
<!DOCTYPE html><html lang="en" xmlns="http://www.w3.org/1999/xhtml"><head><meta charset="utf-8"><link rel="preload" href="fonts/Star4000.woff" as="font" crossorigin="anonymous"><link rel="preload" href="fonts/Star 4 Radar.woff" as="font" crossorigin="anonymous"><link rel="preload" href="fonts/Star4000 Extended.woff" as="font" crossorigin="anonymous"><link rel="preload" href="fonts/Star4000 Large Compressed.woff" as="font" crossorigin="anonymous"><link rel="preload" href="fonts/Star4000 Large.woff" as="font" crossorigin="anonymous"><link rel="preload" href="fonts/Star4000 Small.woff" as="font" crossorigin="anonymous"><link rel="stylesheet" type="text/css" href="resources/twc3.min.css?_=2.3.1"><script type="text/javascript" src="resources/data.min.js"></script><script type="text/javascript" src="resources/ws.min.js?_=2.3.1"></script></head><body><div id="version" style="display:none">2.3.1</div><div id="container"></div></body></html>
|
|
@ -251,6 +251,9 @@ const navigation = (() => {
|
|||
}
|
||||
};
|
||||
|
||||
// return the specificed display
|
||||
const getDisplay = (index) => displays[index];
|
||||
|
||||
return {
|
||||
init,
|
||||
updateStatus,
|
||||
|
@ -258,5 +261,6 @@ const navigation = (() => {
|
|||
isPlaying,
|
||||
displayNavMessage,
|
||||
msg,
|
||||
getDisplay,
|
||||
};
|
||||
})();
|
|
@ -1,6 +1,6 @@
|
|||
// regional forecast and observations
|
||||
|
||||
/* globals WeatherDisplay, utils, STATUS, draw */
|
||||
/* globals WeatherDisplay, utils, STATUS, draw, navigation */
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
class Progress extends WeatherDisplay {
|
||||
|
@ -93,6 +93,20 @@ class Progress extends WeatherDisplay {
|
|||
}
|
||||
|
||||
canvasClick(e) {
|
||||
console.log(e);
|
||||
const x = e.offsetX;
|
||||
const y = e.offsetY;
|
||||
console.log(x,y);
|
||||
// eliminate off canvas and outside area clicks
|
||||
if (!this.isActive()) return;
|
||||
if (y < 100 || y > 410) return;
|
||||
if (x < 440 || x > 570) return;
|
||||
|
||||
// use the y value to determine an index
|
||||
const index = Math.floor((y-100)/29);
|
||||
const display = navigation.getDisplay(index);
|
||||
if (display && display.status === STATUS.loaded) {
|
||||
display.showCanvas(navigation.msg.command.firstFrame);
|
||||
this.hideCanvas();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1 +1 @@
|
|||
module.exports = '2.3.0';
|
||||
module.exports = '2.3.1';
|
Loading…
Reference in a new issue