update guide

This commit is contained in:
Luke Pulverenti 2016-06-06 14:05:22 -04:00
parent 9f4127adca
commit 8b5889ea3c
2 changed files with 39 additions and 49 deletions

View file

@ -4,25 +4,6 @@
align-items: initial; align-items: initial;
} }
.tvguide ::-webkit-scrollbar {
width: 10px;
height: 10px;
}
.tvguide ::-webkit-scrollbar-button:start:decrement,
.tvguide ::-webkit-scrollbar-button:end:increment {
display: none;
}
.tvguide ::-webkit-scrollbar-track-piece {
background-color: #3b3b3b;
}
.tvguide ::-webkit-scrollbar-thumb:vertical, .tvguide ::-webkit-scrollbar-thumb:horizontal {
-webkit-border-radius: 2px;
background: #888 no-repeat center;
}
.tvGuideHeader { .tvGuideHeader {
white-space: nowrap; white-space: nowrap;
width: 100%; width: 100%;
@ -128,38 +109,40 @@
position: relative; position: relative;
} }
.currentTimeIndicator { .currentTimeIndicatorBar {
position: absolute; position: absolute;
bottom: .05em; bottom: .05em;
left: 0; left: 0;
width: 100%; width: 100%;
height: 2px; height: 2px;
display: flex; display: flex;
align-items: flex-end; margin-left: .65vh;
transition: all 500ms ease-out;
}
.layout-tv .currentTimeIndicator {
/* Need to account for the scrollbar not being there */
margin-left: 4px;
}
.currentTimeIndicatorBar {
background-color: #52B54B; background-color: #52B54B;
height: 2px; height: 2px;
flex-grow: 1; transform-origin: left;
width: 100%; transition: transform 500ms ease-out;
margin-left: .65vh;
} }
.currentTimeIndicator iron-icon { .currentTimeIndicatorArrowContainer {
position: absolute;
bottom: -1.35vh;
width: 100%;
color: #52B54B;
margin-left: .65vh;
transform-origin: left;
transition: transform 500ms ease-out;
}
.layout-tv .currentTimeIndicatorBar, .layout-tv .currentTimeIndicatorArrowContainer {
/* Need to account for the scrollbar not being there */
left: 4px;
}
.currentTimeIndicatorArrow {
width: 4vh; width: 4vh;
height: 4vh; height: 4vh;
color: #52B54B; color: #52B54B;
flex-shrink: 0;
position: relative;
margin-left: -2vh; margin-left: -2vh;
top: 1.45vh;
} }
.channelPrograms, .timeslotHeadersInner { .channelPrograms, .timeslotHeadersInner {

View file

@ -59,7 +59,8 @@
} }
var currentTimeUpdateInterval; var currentTimeUpdateInterval;
var currentTimeIndicatorElement; var currentTimeIndicatorBar;
var currentTimeIndicatorArrow;
function startCurrentTimeUpdateInterval() { function startCurrentTimeUpdateInterval() {
clearCurrentTimeUpdateInterval(); clearCurrentTimeUpdateInterval();
@ -74,13 +75,17 @@
clearInterval(interval); clearInterval(interval);
} }
currentTimeUpdateInterval = null; currentTimeUpdateInterval = null;
currentTimeIndicatorElement = null; currentTimeIndicatorBar = null;
currentTimeIndicatorArrow = null;
} }
function updateCurrentTimeIndicator() { function updateCurrentTimeIndicator() {
if (!currentTimeIndicatorElement) { if (!currentTimeIndicatorBar) {
currentTimeIndicatorElement = options.element.querySelector('.currentTimeIndicator'); currentTimeIndicatorBar = options.element.querySelector('.currentTimeIndicatorBar');
}
if (!currentTimeIndicatorArrow) {
currentTimeIndicatorArrow = options.element.querySelector('.currentTimeIndicatorArrowContainer');
} }
var dateDifference = new Date().getTime() - currentDate.getTime(); var dateDifference = new Date().getTime() - currentDate.getTime();
@ -88,13 +93,17 @@
pct = Math.min(pct, 1); pct = Math.min(pct, 1);
if (pct <= 0 || pct >= 1) { if (pct <= 0 || pct >= 1) {
currentTimeIndicatorElement.classList.add('hide'); currentTimeIndicatorBar.classList.add('hide');
currentTimeIndicatorArrow.classList.add('hide');
} else { } else {
currentTimeIndicatorElement.classList.remove('hide'); currentTimeIndicatorBar.classList.remove('hide');
currentTimeIndicatorArrow.classList.remove('hide');
//pct *= 100; //pct *= 100;
//pct = 100 - pct; //pct = 100 - pct;
currentTimeIndicatorElement.style.width = (pct * 100) + '%'; //currentTimeIndicatorElement.style.width = (pct * 100) + '%';
currentTimeIndicatorBar.style.transform = 'scaleX(' + pct + ')';
currentTimeIndicatorArrow.style.transform = 'translateX(' + (pct * 100) + '%)';
} }
} }
@ -202,12 +211,10 @@
startDate.setTime(startDate.getTime() + cellDurationMs); startDate.setTime(startDate.getTime() + cellDurationMs);
} }
html += '<div class="currentTimeIndicator hide">'; html += '<div class="currentTimeIndicatorBar hide">';
html += '<div class="currentTimeIndicatorBar">';
html += '</div>'; html += '</div>';
html += '<iron-icon icon="nav:arrow-drop-down"></iron-icon>'; html += '<div class="currentTimeIndicatorArrowContainer hide">';
html += '</div>'; html += '<iron-icon class="currentTimeIndicatorArrow" icon="nav:arrow-drop-down"></iron-icon>';
html += '</div>'; html += '</div>';
return html; return html;