adds scturcture for mixed design

This commit is contained in:
Raphael Maenle 2020-10-03 18:40:20 +02:00
parent c46e0be089
commit 2770c31e6d
2 changed files with 25 additions and 4 deletions

Binary file not shown.

View File

@ -20,7 +20,7 @@
var STORAGE_SPACE = "downloads"; var STORAGE_SPACE = "downloads";
var SHORT_WAIT = 10000; var SHORT_WAIT = 10000;
var LONG_WAIT = 30000; // 600000 var LONG_WAIT = 30000; // 600000
var DESIGN = 1; // 0 - longitude, 1 - mission control var DESIGN = 2; // 0 - longitude, 1 - mission control
var wait_time = LONG_WAIT; var wait_time = LONG_WAIT;
var events = null; var events = null;
var deviceFingerprint = null; var deviceFingerprint = null;
@ -425,6 +425,18 @@ var flagDigital = true;
renderCircle(ctxContent, polToCart(sunDistance, hourToAngle(hour + minute / 60)), 16, sunColor); renderCircle(ctxContent, polToCart(sunDistance, hourToAngle(hour + minute / 60)), 16, sunColor);
} }
function renderSmallSun(date, hour, minute, second) {
if(hour > 6 && hour < 18)
sunColor = "#FFD700";
else {
sunColor = "#C0C0C0"
}
sunDistance = document.body.clientWidth / 2 - 30;
renderCircle(ctxContent, polToCart(sunDistance, hourToAngle(hour + minute / 60)), 10, sunColor);
}
function renderEarth(date, minute, second) { function renderEarth(date, minute, second) {
var earthColor = "#0077BE"; var earthColor = "#0077BE";
@ -513,7 +525,10 @@ var flagDigital = true;
renderSun(date, hour, minute, second); renderSun(date, hour, minute, second);
renderEarth(ctxContent, minute, second); renderEarth(ctxContent, minute, second);
} else if(DESIGN === 1) { } else if(DESIGN === 1) {
drawMissionControl(); drawDigitalWatch();
} else if(DESIGN === 2) {
drawDigitalWatch();
renderSmallSun(date, hour, minute, second);
} }
@ -544,9 +559,10 @@ var flagDigital = true;
var thickness = 18; var thickness = 18;
} else if(DESIGN === 1) { } else if(DESIGN === 1) {
var thickness = 50; var thickness = 50;
} else if(DESIGN === 2) {
var thickness = 18;
} }
console.log("switched to long wait");
wait_time = LONG_WAIT; wait_time = LONG_WAIT;
@ -606,6 +622,9 @@ var flagDigital = true;
} else if(DESIGN === 1) { } else if(DESIGN === 1) {
var edge = document.body.clientWidth / 2 - thickness / 2 - 2; var edge = document.body.clientWidth / 2 - thickness / 2 - 2;
renderArc(ctxContent, center, edge, thickness, e.color, hourToAngle(startTime), hourToAngle(stopTime), true, true); renderArc(ctxContent, center, edge, thickness, e.color, hourToAngle(startTime), hourToAngle(stopTime), true, true);
} else if(DESIGN === 2) {
var edge = document.body.clientWidth / 2 - thickness / 2 - 2;
renderArc(ctxContent, center, edge, thickness, e.color, hourToAngle(startTime), hourToAngle(stopTime), startedBeforeToday, endsAfterToday);
} }
} }
@ -616,12 +635,14 @@ var flagDigital = true;
for(var i = 0; i < 24; i++) { for(var i = 0; i < 24; i++) {
renderSimpleArc(ctxContent, center, edge, thickness, "#000000", i*15-0.8, i*15+0.8); renderSimpleArc(ctxContent, center, edge, thickness, "#000000", i*15-0.8, i*15+0.8);
} }
} else if(DESIGN === 2) {
} }
} }
function drawMissionControl(datetime) { function drawDigitalWatch(datetime) {
var strHours = document.getElementById("str-hours"), var strHours = document.getElementById("str-hours"),
strConsole = document.getElementById("str-console"), strConsole = document.getElementById("str-console"),
strMinutes = document.getElementById("str-minutes"), strMinutes = document.getElementById("str-minutes"),