Compare commits
No commits in common. "longitude-digital" and "master" have entirely different histories.
longitude-
...
master
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,16 +1,11 @@
|
||||
|
||||
@font-face{
|
||||
font-family: courier;
|
||||
src: url('CourierPrimeSansRegular.ttf');
|
||||
}
|
||||
|
||||
@font-face{
|
||||
font-family: fabiolo;
|
||||
src: url('fabiolo-smallcap-regular.ttf')
|
||||
font-family: roboto;
|
||||
src: url('JetBrainsMono-Bold.ttf');
|
||||
}
|
||||
|
||||
.Roboto{
|
||||
font-family: fabiolo;
|
||||
font-family: roboto;
|
||||
}
|
||||
|
||||
html, body {
|
||||
@ -18,7 +13,7 @@ html, body {
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
overflow-y: hidden;
|
||||
font-family: "courier";
|
||||
font-family: "roboto";
|
||||
|
||||
}
|
||||
|
||||
@ -27,7 +22,7 @@ html, body {
|
||||
display: -webkit-flex;
|
||||
-webkit-align-items: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
height: 100%
|
||||
}
|
||||
|
||||
#canvas-layout {
|
||||
@ -50,6 +45,7 @@ hour&minutes
|
||||
*/
|
||||
#digital-body {
|
||||
position: absolute;
|
||||
width: 70%;
|
||||
width: 360px;
|
||||
height: 360px;
|
||||
top: 0px;
|
||||
@ -57,58 +53,37 @@ hour&minutes
|
||||
background-size: 100%;
|
||||
background-repeat: no-repeat;
|
||||
overflow: hidden;
|
||||
|
||||
}
|
||||
|
||||
#str-just-hours {
|
||||
text-transform: full-width;
|
||||
font-size: 600%;
|
||||
font-style: bold;
|
||||
letter-spacing: -2px;
|
||||
float: left;
|
||||
color: white;
|
||||
width: 90px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
#rec-time {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
top: 40%;
|
||||
margin: 0;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
-ms-transform: translate(-50%, -50%);
|
||||
transform: translate(-50%, -50%);
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
#str-hours {
|
||||
font-size: 450%;
|
||||
font-size: 370%;
|
||||
font-style: bold;
|
||||
letter-spacing: -10px;
|
||||
float: left;
|
||||
color: white;
|
||||
width: 80px;
|
||||
text-align: right;
|
||||
transform: translate(-5px, 0);
|
||||
}
|
||||
|
||||
#str-console {
|
||||
font-size: 250%;
|
||||
font-size: 370%;
|
||||
font-style: bold;
|
||||
float: left;
|
||||
color: white;
|
||||
visibility: hidden;
|
||||
transform: translate(-6px, 8px);
|
||||
}
|
||||
|
||||
#str-minutes {
|
||||
font-size: 450%;
|
||||
letter-spacing: -10px;
|
||||
font-size: 370%;
|
||||
font-style: bold;
|
||||
float: left;
|
||||
color: white;
|
||||
width: 70px;
|
||||
text-align: left;
|
||||
transform: translate(-15px, 0);
|
||||
|
||||
}
|
||||
|
||||
#str-ampm {
|
||||
@ -116,24 +91,3 @@ hour&minutes
|
||||
color: white;
|
||||
padding-top: 20%;
|
||||
}
|
||||
|
||||
#str-event {
|
||||
position: absolute;
|
||||
display: inline-block;
|
||||
top:60%;
|
||||
left: 50%;
|
||||
-ms-transform: translate(-50%, -50%);
|
||||
transform: translate(-50%, -50%);
|
||||
font-size: 175%;
|
||||
color: white;
|
||||
text-align: center;
|
||||
z-index: 2;
|
||||
line-height: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2; /* number of lines to show */
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
|
||||
}
|
@ -13,14 +13,11 @@
|
||||
<body>
|
||||
|
||||
<div id="digital-body">
|
||||
<div id="str-just-hours"></div>
|
||||
|
||||
<div id="rec-time">
|
||||
<div id="str-hours"></div>
|
||||
<div id="str-console">:</div>
|
||||
<div id="str-minutes"></div>
|
||||
</div>
|
||||
<div id="str-event"></div>
|
||||
</div>
|
||||
|
||||
<div id="container">
|
||||
|
91
js/app.js
91
js/app.js
@ -20,7 +20,7 @@
|
||||
var STORAGE_SPACE = "downloads";
|
||||
var SHORT_WAIT = 10000;
|
||||
var LONG_WAIT = 30000; // 600000
|
||||
var DESIGN = 2; // 0 - longitude, 1 - mission control, 2 - longitude
|
||||
var DESIGN = 1; // 0 - longitude, 1 - mission control
|
||||
var wait_time = LONG_WAIT;
|
||||
var events = null;
|
||||
var deviceFingerprint = null;
|
||||
@ -240,18 +240,6 @@ var flagDigital = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
function renderLine(context, p1, p2, thickness, color) {
|
||||
context.save();
|
||||
context.beginPath();
|
||||
context.lineCap = "round";
|
||||
context.lineWidth = thickness;
|
||||
context.moveTo(p1.x, p1.y);
|
||||
context.lineTo(p2.x, p2.y);
|
||||
context.strokeStyle = color;
|
||||
context.stroke();
|
||||
context.restore();
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders a circle with specific center, radius, and color
|
||||
* @private
|
||||
@ -437,14 +425,6 @@ var flagDigital = true;
|
||||
renderCircle(ctxContent, polToCart(sunDistance, hourToAngle(hour + minute / 60)), 16, sunColor);
|
||||
}
|
||||
|
||||
function renderSmallSun(date, hour, minute, second) {
|
||||
|
||||
sunColor = "#FFD700";
|
||||
|
||||
sunDistance = document.body.clientWidth / 2 - 40;
|
||||
renderCircle(ctxContent, polToCart(sunDistance, hourToAngle(hour + minute / 60)), 10, sunColor);
|
||||
}
|
||||
|
||||
function renderEarth(date, minute, second) {
|
||||
|
||||
var earthColor = "#0077BE";
|
||||
@ -452,17 +432,6 @@ var flagDigital = true;
|
||||
renderCircle(ctxContent, polToCart(earthDistance, minuteToAngle(minute + second / 60)), 10, earthColor);
|
||||
}
|
||||
|
||||
function renderAnalog(hour, minute, second) {
|
||||
// hour
|
||||
var hourAngle = hourToAngle(hour + minute / 60)*2+180;
|
||||
renderLine(ctxContent, polToCart(document.body.clientWidth / 2 - 120, hourAngle), polToCart(document.body.clientWidth / 2 - 60, hourAngle), 18, '#ffffff');
|
||||
renderLine(ctxContent, polToCart(document.body.clientWidth / 2 - 120, hourAngle), polToCart(document.body.clientWidth / 2 - 60, hourAngle), 12, '#000000');
|
||||
// minute
|
||||
var minuteAngle = minuteToAngle(minute + second / 60);
|
||||
renderLine(ctxContent, polToCart(document.body.clientWidth / 2 - 120, minuteAngle), polToCart(document.body.clientWidth / 2 - 40, minuteAngle), 18, '#ffffff');
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Renders text at a specific center, radius, and color
|
||||
@ -544,10 +513,7 @@ var flagDigital = true;
|
||||
renderSun(date, hour, minute, second);
|
||||
renderEarth(ctxContent, minute, second);
|
||||
} else if(DESIGN === 1) {
|
||||
drawDigitalWatch();
|
||||
} else if(DESIGN === 2) {
|
||||
renderSmallSun(date, hour, minute, second);
|
||||
drawDigitalWatch();
|
||||
drawMissionControl();
|
||||
}
|
||||
|
||||
|
||||
@ -578,13 +544,11 @@ var flagDigital = true;
|
||||
var thickness = 18;
|
||||
} else if(DESIGN === 1) {
|
||||
var thickness = 50;
|
||||
} else if(DESIGN === 2) {
|
||||
var thickness = 18;
|
||||
}
|
||||
|
||||
console.log("switched to long wait");
|
||||
wait_time = LONG_WAIT;
|
||||
|
||||
var wroteEvent = false;
|
||||
|
||||
for(var event in events.events){
|
||||
var startedBeforeToday = false;
|
||||
@ -642,23 +606,9 @@ var flagDigital = true;
|
||||
} else if(DESIGN === 1) {
|
||||
var edge = document.body.clientWidth / 2 - thickness / 2 - 2;
|
||||
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);
|
||||
}
|
||||
|
||||
if(eventNow(e, hour, minute)) {
|
||||
console.log("!!!writing name");
|
||||
wroteEvent = true;
|
||||
drawEventName(e.name);
|
||||
}
|
||||
}
|
||||
|
||||
if(!wroteEvent) {
|
||||
drawEventName("");
|
||||
}
|
||||
|
||||
|
||||
if(DESIGN === 0) {
|
||||
} else if(DESIGN === 1) {
|
||||
var inner = document.body.clientWidth / 2 - thickness;
|
||||
@ -666,45 +616,12 @@ var flagDigital = true;
|
||||
for(var i = 0; i < 24; i++) {
|
||||
renderSimpleArc(ctxContent, center, edge, thickness, "#000000", i*15-0.8, i*15+0.8);
|
||||
}
|
||||
} else if(DESIGN === 2) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
function eventNow(event, hour, minute) {
|
||||
if( ((event.startDateTime.time.hour < hour) ||
|
||||
(event.startDateTime.time.hour <= hour &&
|
||||
event.startDateTime.time.minute <= minute)) ) {
|
||||
console.log("start before");
|
||||
}
|
||||
|
||||
if( ((event.stopDateTime.time.hour > hour) ||
|
||||
(event.stopDateTime.time.hour >= hour &&
|
||||
event.stopDateTime.time.minute >= minute)) ) {
|
||||
console.log("stop after");
|
||||
}
|
||||
|
||||
if( ((event.startDateTime.time.hour < hour) ||
|
||||
(event.startDateTime.time.hour <= hour &&
|
||||
event.startDateTime.time.minute <= minute)) &&
|
||||
((event.stopDateTime.time.hour > hour) ||
|
||||
(event.stopDateTime.time.hour >= hour &&
|
||||
event.stopDateTime.time.minute >= minute)) ){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function drawEventName(name) {
|
||||
var strEvent = document.getElementById("str-event");
|
||||
strEvent.innerHTML = name;
|
||||
}
|
||||
|
||||
function drawDigitalWatch(datetime) {
|
||||
function drawMissionControl(datetime) {
|
||||
var strHours = document.getElementById("str-hours"),
|
||||
strConsole = document.getElementById("str-console"),
|
||||
strMinutes = document.getElementById("str-minutes"),
|
||||
|
Loading…
Reference in New Issue
Block a user