Skip to content

Instantly share code, notes, and snippets.

@codenoid
Created April 29, 2017 05:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codenoid/20dec59ec4197a562b33ce1b284b129c to your computer and use it in GitHub Desktop.
Save codenoid/20dec59ec4197a562b33ce1b284b129c to your computer and use it in GitHub Desktop.
Simple Alarm App With Javascript
<!DOCTYPE html>
<html>
<head>
<title>JAM 2 BANGUNIN RUBI</title>
</head>
<body style="background-color: black;">
<center><br><br><br><br><br><br><br><br>
<h1 style="color: white;">JAM 2 PAGI BANGUNIN RUBI</h1>
<h3 style="color: white;">ALARM AKTIF PADA JAM 2 PAGI</h3>
<h4 style="color: white;" id="uh"></h4>
</center>
<video autoloop id="audio" style="display: none;"><source src="proleter-best-songs.mp4"></video>
<div id="checker">
</div>
<script type="text/javascript">
function check() {
var d = new Date();
document.getElementById('uh').innerHTML = d.getHours()+' : '+d.getMinutes()+' : '+d.getSeconds();
if(d.getHours() == 2)
play();
}
setInterval(function(){
check();
}, 500);
function play() {
if(!document.getElementById('checker').innerHTML) {
document.getElementById('checker').innerHTML = 'BANGUNIN DONG :*';
document.getElementById('audio').play();
}
else
document.getElementById('audio').play();
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment