Improve styling.
gitea/icedream/dash-wooden-clock/master There was a failure building this commit
Details
gitea/icedream/dash-wooden-clock/master There was a failure building this commit
Details
parent
8dd726c973
commit
862bc0594a
18
src/index.js
18
src/index.js
|
@ -17,6 +17,7 @@ window.addEventListener('load', () => {
|
|||
const playContainer = document.createElement('div');
|
||||
playContainer.classList.add(style.play);
|
||||
const playButton = document.createElement('button');
|
||||
playButton.classList.add(style.playInner);
|
||||
playButton.classList.add('icon');
|
||||
playButton.classList.add('icon-play'); // fontello icon
|
||||
playContainer.appendChild(playButton);
|
||||
|
@ -27,6 +28,11 @@ window.addEventListener('load', () => {
|
|||
statusContent.classList.add(style.statusInner);
|
||||
statusContainer.appendChild(statusContent);
|
||||
|
||||
const playerContainer = document.createElement('video');
|
||||
playerContainer.classList.add(style.video);
|
||||
playerContainer.loop = true;
|
||||
playerContainer.controls = false;
|
||||
|
||||
function showStatus() {
|
||||
if (!(style['status--visible'] in statusContainer.classList)) {
|
||||
statusContainer.classList.add(style['status--visible']);
|
||||
|
@ -51,12 +57,13 @@ window.addEventListener('load', () => {
|
|||
playContainer.classList.remove(style['play--visible']);
|
||||
}
|
||||
|
||||
showStatus('Constructing your clock...');
|
||||
function showPlayer() {
|
||||
if (!(style['video--visible'] in playerContainer.classList)) {
|
||||
playerContainer.classList.add(style['video--visible']);
|
||||
}
|
||||
}
|
||||
|
||||
const playerContainer = document.createElement('video');
|
||||
playerContainer.classList.add(style.video);
|
||||
playerContainer.loop = true;
|
||||
playerContainer.controls = false;
|
||||
showStatus('Constructing your clock...');
|
||||
|
||||
const parsedHash = queryString.parse(window.location.query || window.location.hash);
|
||||
let secondsOfDay;
|
||||
|
@ -114,6 +121,7 @@ window.addEventListener('load', () => {
|
|||
player.on('playbackPlaying', () => {
|
||||
hideStatus();
|
||||
hidePlayButton();
|
||||
showPlayer();
|
||||
|
||||
// resync video position with current time if necessary
|
||||
if (parsedHash.s === undefined && Math.abs(player.time() - getSecondsOfDay()) > 1) {
|
||||
|
|
|
@ -32,7 +32,7 @@ body
|
|||
z-index: 10
|
||||
display: none
|
||||
|
||||
&.status__inner
|
||||
>.status__inner
|
||||
background: rgba(0, 0, 0, .5)
|
||||
|
||||
&.status--visible
|
||||
|
@ -41,7 +41,10 @@ body
|
|||
|
||||
.video
|
||||
fullscreen()
|
||||
animation: fadein .25s linear
|
||||
opacity: 0
|
||||
transition: opacity .25s linear
|
||||
&.video--visible
|
||||
opacity: 1
|
||||
|
||||
.play
|
||||
fullscreen()
|
||||
|
@ -52,10 +55,15 @@ body
|
|||
opacity: 0
|
||||
display: none
|
||||
z-index: 10
|
||||
font-size: 5em
|
||||
|
||||
&.play__inner
|
||||
>.play__inner
|
||||
background: rgba(0, 0, 0, .5)
|
||||
border: #fff 1px solid
|
||||
border-radius: 4px
|
||||
color: #fff
|
||||
font-size: 5em
|
||||
width: 2.5em
|
||||
height: 2.5em
|
||||
|
||||
&.play--visible
|
||||
opacity: 1
|
||||
|
|
Loading…
Reference in New Issue