Skip to content

Commit

Permalink
Play an otter sound when the logo is clicked
Browse files Browse the repository at this point in the history
  • Loading branch information
Adamouization committed Apr 14, 2024
1 parent 0c77193 commit a746679
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
19 changes: 17 additions & 2 deletions themes/bootstrap386/layout/index.ejs
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
<div class="page-header logo">
<div class="page-header logo" onclick="playAudio()">
<h1><% if (config.subtitle){ %><%= config.subtitle%><% } else { %><%= config.title%><% }%><span class="blink-fast">∎</span></h1>
</div>

<%- partial('_partial/index', {index: true}) %>
<%- partial('_partial/index', {index: true}) %>

<audio id="audio" src="../otter_whistle_snarl.mp3"></audio>

<script>
/*
Function that plays the audio file inside the audio element.
*/
function playAudio() {
var audio = document.getElementById("audio");
if(audio) {
audio.volume = 0.5; // Lowering the volume to 50%
audio.play();
}
}
</script>
1 change: 1 addition & 0 deletions themes/bootstrap386/source/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ hr {
.logo {
background: url("../favicon.png") no-repeat left top;
background-size: 5em;
cursor: pointer;
}
.logo > h1 {
padding-left: 2.4em;
Expand Down
Binary file not shown.

0 comments on commit a746679

Please sign in to comment.