Js refactor, added media files in opensource formats

master
meliurwen 7 years ago
parent 5f8d88fb5a
commit 70f67c40a5
  1. BIN
      audio/Clau _M_Nect_-_House_Of_Dreams.ogg
  2. 8
      css/theme.css
  3. BIN
      img/repeat.png
  4. 40
      index.html
  5. BIN
      video/beammm_loop.webm

@ -94,15 +94,11 @@ h1 span a {
} }
#tapeImage { #tapeImage {
opacity: 0; opacity: 0.03;
transition: 1s; transition: 1s;
} }
#dummyTape:hover #tape { #dummyTape:hover #tape, #dummyTape:hover #tapeImage {
opacity: 1;
}
#dummyTape:hover #tapeImage {
opacity: 1; opacity: 1;
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

@ -18,7 +18,12 @@
<!-- Player Audio --> <!-- Player Audio -->
<div style="display:table;position: absolute; right: 0; bottom: 0;margin:10px;" id="dummy"> <div style="display:table;position: absolute; right: 0; bottom: 0;margin:10px;" id="dummy">
<div id="songName" style="display:table-cell;vertical-align:middle">Clau M.& Nect<br />House of Dreams</div> <div id="songName" style="display:table-cell;vertical-align:middle">Clau M.& Nect<br />House of Dreams</div>
<img style="float:right" src="img/play.png" name="Bottom-1" width="30" height="30" border="0" onclick="playSound(this, 'audio/Clau _M_Nect_-_House_Of_Dreams.mp3');diffImage(this);" /> <img id="audioButton" style="float:right" src="img/play.png" name="Bottom-1" width="30" height="30" border="0" />
<audio id="audioSource" preload="none">
<source src="audio/Clau _M_Nect_-_House_Of_Dreams.ogg" type="audio/ogg">
<source src="audio/Clau _M_Nect_-_House_Of_Dreams.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
</div> </div>
<!-- Tape Credits --> <!-- Tape Credits -->
@ -29,27 +34,28 @@
<!-- Video is muted & autoplays --> <!-- Video is muted & autoplays -->
<video autoplay loop id="video-background" muted plays-inline poster="img/beammm_thumbnail.jpg"> <video autoplay loop id="video-background" muted plays-inline poster="img/beammm_thumbnail.jpg">
<source src="video/beammm_loop.mp4"> <source src="video/beammm_loop.webm" type="video/webm">
<source src="video/beammm_loop.mp4" type="video/mp4">
</video> </video>
<script> <script>
function playSound(el, soundfile) { audioButton = document.getElementById("audioButton")
if (el.mp3) { audioSource = document.getElementById("audioSource")
if (el.mp3.paused) el.mp3.play(); audioButton.onclick = function() {audioButtonClick(audioButton, audioSource)};
else el.mp3.pause();
} else { function audioButtonClick(audioButton, audioSource) {
el.mp3 = new Audio(soundfile); if (audioSource.paused) {
el.mp3.play(); audioSource.play();
audioButton.src = "img/pause.png";
}
else {
audioSource.pause();
audioButton.src = "img/play.png";
} }
} }
function diffImage(img) { audioSource.onended = function() {
if (img.src.match(/pause/)) { audioButton.src = "img/repeat.png";
console.log('play');
img.src = "img/play.png";
} else {
console.log('pause');
img.src = "img/pause.png";
}
} }
</script> </script>
</body> </body>

Binary file not shown.
Loading…
Cancel
Save