trying to get timezones to display the time, def broken

This commit is contained in:
Wyatt J. Miller 2018-08-14 15:21:06 -04:00
parent a4882bc7c0
commit c517d13dac
2 changed files with 68 additions and 4 deletions

View File

@ -39,12 +39,13 @@ function whatTimeIsIt(){
print("Geolocation is not supported. Update your shit.");
}
// working on getting user location and setting timezone to said location
function timezoneOffset(zone){
var offset = Math.abs(zone/60);
getHoursOffset = death.getHours + offset;
getMinutesOffset = death.getMinutes + offset;
getSecondsOffset = death.getSeconds + offset;
var getHoursOffset = death.getHours + offset;
var getMinutesOffset = death.getMinutes + offset;
var getSecondsOffset = death.getSeconds + offset;
return getHoursOffset, getMinutesOffset, getSecondsOffset;
}

63
src/video.js Normal file
View File

@ -0,0 +1,63 @@
// custom video player, used when YouTube isn't available
// written by Wyatt J. Miller
var videoContainer = document.getElementsById("video-container");
var videoControls = document.getElementById("video-controls");
var video = document.getElementsById("video");
var supportsVideo = !!document.createElement("video").canPlayType;
if (supportsVideo){
// if supportsVideo is true, setting variables using DOM
var playPause = document.getElementsById("play-pause");
var rewind = document.getElementById("rewind");
var rewindBeginning = document.getElementById("rewind-beginning");
var mute = document.getElementsById("mute");
var volUp = document.getElementsById("vol-up");
var volDown = document.getElementsById("vol-down");
var progress = document.getElementById("progress");
var progressBar = document.getElementById("progress-bar");
}
// hide browser's default controls
video.controls = false;
// displays custom controls
videoControls.style.display = "block";
function changeVolume(x){
var currentVol = Math.floor(video.volume * 10) / 10;
if (x === "+") {
if (currentVol < 1) video.volume += 0.1;
} else if (x === "-") {
if (currentVol > 0) video.volume -= 0.1;
}
}
playPause.addEventListener("click", function(e){
if (video.paused || video.ended) video.play;
else video.pause;
});
mute.addEventListener("click", function(e){
video.muted = !video.muted;
});
volUp.addEventListener("click", function(e){
changeVolume("+");
});
volDown.addEventListener("click", function(e){
changeVolume("-");
});
rewind.addEventListener("click", function(e){
// code goes here
// rewind event is supposed to rewind the video a bit
});
rewindBeginning.addEventListener("click", function(e){
video.pause;
video.currentTime = 0;
progress.value = 0;
video.play;
});