Skip to content

Commit

Permalink
alive.mid makin a comeback!!!
Browse files Browse the repository at this point in the history
not actually the same midi, but it is the same image.
  • Loading branch information
tophtucker committed Apr 19, 2016
1 parent 1a5295a commit e83cb2f
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 0 deletions.
Binary file added alive.mid
Binary file not shown.
Binary file added alive.mp3
Binary file not shown.
35 changes: 35 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
h1, h2, h3 {
font-weight: normal;
}
img {
margin: 1em 0;
}
@media screen and (min-width: 320px) {
body {
font-size: calc(14px + 8 * ((100vw - 320px) / 960));
Expand Down Expand Up @@ -84,6 +87,38 @@ <h2>Other</h2>
<li>Bowdoin ’13 (Math)</li>
</ul>

<img src="toph-still-sm.gif">
<audio src="alive.mp3"></audio>

</body>

<script>

var image = document.querySelector('img'),
audio = document.querySelector('audio');

image.addEventListener('mouseenter', play);

image.addEventListener('mouseleave', pause);

image.addEventListener('touchstart', function() {
if(audio.paused || !audio.currentTime) {
play();
} else {
pause();
}
});

function play() {
image.setAttribute('src', 'toph-animated-sm.gif');
audio.play();
}

function pause() {
image.setAttribute('src', 'toph-still-sm.gif');
audio.pause();
}

</script>

</html>
Binary file added toph-animated-sm.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added toph-still-sm.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e83cb2f

Please sign in to comment.