Skip to content

Commit 9c1c61f

Browse files
Nikhil GiridharanNikhil Giridharan
authored andcommitted
Splash audio: Kevin MacLeod Jazz Brunch, local fallback, max volume
Made-with: Cursor
1 parent fecc669 commit 9c1c61f

2 files changed

Lines changed: 28 additions & 7 deletions

File tree

src/api/static/index.html

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -728,14 +728,16 @@
728728
<div style="position:absolute;bottom:8px;left:24px;width:40px;height:40px;border-bottom:1px solid rgba(0,212,255,0.2);border-left:1px solid rgba(0,212,255,0.2);"></div>
729729
<div style="position:absolute;bottom:8px;right:24px;width:40px;height:40px;border-bottom:1px solid rgba(0,212,255,0.2);border-right:1px solid rgba(0,212,255,0.2);"></div>
730730

731+
<!-- Splash music: Kevin MacLeod — Jazz Brunch (incompetech.com, CC BY 4.0 — incompetech.com/music/royalty-free/music.html). Short Pixabay clip fallback if primary fails to load. -->
731732
<audio id="tp-intro-music" loop preload="auto" playsinline>
732-
<source src="https://assets.mixkit.co/music/preview/mixkit-tech-house-vibes-130.mp3" type="audio/mpeg">
733+
<source src="https://incompetech.com/music/royalty-free/mp3-royaltyfree/Jazz%20Brunch.mp3" type="audio/mpeg">
734+
<source src="/static/splash-intro-fallback.mp3" type="audio/mpeg">
733735
</audio>
734736

735-
<button type="button" id="tp-audio-toggle" aria-pressed="false" aria-label="Turn sound on" title="Sound off — click for ambient music"
737+
<button type="button" id="tp-audio-toggle" aria-pressed="false" aria-label="Turn sound on" title="Sound off — click for retro trading-floor jazz"
736738
style="
737739
position: absolute;
738-
bottom: 22px;
740+
bottom: 46px;
739741
left: 22px;
740742
z-index: 12;
741743
display: inline-flex;
@@ -764,6 +766,21 @@
764766
<span id="tp-audio-toggle-label">Sound off</span>
765767
</button>
766768

769+
<div style="
770+
position: absolute;
771+
bottom: 14px;
772+
left: 22px;
773+
z-index: 12;
774+
font-size: 9px;
775+
color: rgba(148, 163, 184, 0.45);
776+
font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
777+
max-width: 240px;
778+
line-height: 1.35;
779+
pointer-events: none;
780+
">
781+
Music: Kevin MacLeod · Jazz Brunch (CC BY)
782+
</div>
783+
767784
</div>
768785

769786
<style>
@@ -979,7 +996,7 @@
979996
var on = !introMusic.paused;
980997
audioToggleBtn.setAttribute('aria-pressed', on ? 'true' : 'false');
981998
audioToggleBtn.setAttribute('aria-label', on ? 'Turn sound off' : 'Turn sound on');
982-
audioToggleBtn.title = on ? 'Sound on — click to mute' : 'Sound off — click for ambient music';
999+
audioToggleBtn.title = on ? 'Sound on — retro jazz (click to mute)' : 'Sound off — click for retro trading-floor jazz';
9831000
if (audioToggleLabel) audioToggleLabel.textContent = on ? 'Sound on' : 'Sound off';
9841001
if (audioToggleIcon) {
9851002
audioToggleIcon.innerHTML = on
@@ -995,11 +1012,15 @@
9951012
}
9961013

9971014
if (introMusic) {
998-
introMusic.volume = 0.4;
1015+
introMusic.volume = 1;
9991016
introMusic.load();
10001017
introMusic.addEventListener('error', function() {
1001-
audioLoadFailed = true;
1002-
syncIntroAudioButton();
1018+
window.setTimeout(function() {
1019+
if (introMusic.networkState === 3) {
1020+
audioLoadFailed = true;
1021+
syncIntroAudioButton();
1022+
}
1023+
}, 250);
10031024
});
10041025
introMusic.addEventListener('play', syncIntroAudioButton);
10051026
introMusic.addEventListener('pause', syncIntroAudioButton);
65.6 KB
Binary file not shown.

0 commit comments

Comments
 (0)