Skip to content

Commit 52f2755

Browse files
VolksRat71claude
andcommitted
Fix audio 404s on GitHub Pages deployment
Use SvelteKit base path for audio src URLs so they work when deployed to subdirectory at /react2shellexploitvisualized/ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent e395790 commit 52f2755

File tree

5 files changed

+10
-5
lines changed

5 files changed

+10
-5
lines changed

src/lib/components/steps/ExploitStep.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import { whisperToCaptions, extractExploitKeyframeTriggers, getAudioDuration, type WhisperOutput } from '$lib/utils/whisper-parser';
88
import whisperData from '$lib/data/exploit-whisper.json';
99
import { onMount, tick } from 'svelte';
10+
import { base } from '$app/paths';
1011
1112
// Parse Whisper data
1213
const whisper = whisperData as WhisperOutput;
@@ -24,7 +25,7 @@
2425
{ time: triggers.whoamiRoot, label: 'RCE!', type: 'danger' }
2526
],
2627
captions,
27-
audioSrc: '/audio/exploit-narration.mp3'
28+
audioSrc: `${base}/audio/exploit-narration.mp3`
2829
};
2930
3031
// Animation state interface

src/lib/components/steps/FixStep.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import { whisperToCaptions, extractFixKeyframeTriggers, getAudioDuration, type WhisperOutput } from '$lib/utils/whisper-parser';
88
import whisperData from '$lib/data/fix-whisper.json';
99
import { onMount, tick } from 'svelte';
10+
import { base } from '$app/paths';
1011
1112
// Parse Whisper data
1213
const whisper = whisperData as WhisperOutput;
@@ -24,7 +25,7 @@
2425
{ time: triggers.patchApplication, label: 'Remediation', type: 'default' }
2526
],
2627
captions,
27-
audioSrc: '/audio/fix-narration.mp3'
28+
audioSrc: `${base}/audio/fix-narration.mp3`
2829
};
2930
3031
// Animation state interface

src/lib/components/steps/LessonsStep.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import { whisperToCaptions, extractLessonsKeyframeTriggers, getAudioDuration, type WhisperOutput } from '$lib/utils/whisper-parser';
77
import whisperData from '$lib/data/lessons-whisper.json';
88
import { onMount, tick } from 'svelte';
9+
import { base } from '$app/paths';
910
1011
// Parse Whisper data
1112
const whisper = whisperData as WhisperOutput;
@@ -25,7 +26,7 @@
2526
{ time: triggers.remember, label: 'Summary', type: 'default' }
2627
],
2728
captions,
28-
audioSrc: '/audio/lessons-narration.mp3'
29+
audioSrc: `${base}/audio/lessons-narration.mp3`
2930
};
3031
3132
// Animation state interface

src/lib/components/steps/RSCStep.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import { whisperToCaptions, extractRSCKeyframeTriggers, getAudioDuration, type WhisperOutput } from '$lib/utils/whisper-parser';
99
import whisperData from '$lib/data/rsc-whisper.json';
1010
import { onMount, tick } from 'svelte';
11+
import { base } from '$app/paths';
1112
1213
// Parse Whisper data
1314
const whisper = whisperData as WhisperOutput;
@@ -25,7 +26,7 @@
2526
{ time: triggers.analyticsArrives, label: 'Analytics' }
2627
],
2728
captions,
28-
audioSrc: '/audio/rsc-narration.mp3'
29+
audioSrc: `${base}/audio/rsc-narration.mp3`
2930
};
3031
3132
// Animation state interface

src/lib/components/steps/SSRStep.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import { whisperToCaptions, extractSSRKeyframeTriggers, getAudioDuration, type WhisperOutput } from '$lib/utils/whisper-parser';
99
import whisperData from '$lib/data/ssr-whisper.json';
1010
import { onMount, tick } from 'svelte';
11+
import { base } from '$app/paths';
1112
1213
// Parse Whisper data
1314
const whisper = whisperData as WhisperOutput;
@@ -25,7 +26,7 @@
2526
{ time: triggers.browserRenders, label: 'Rendered' }
2627
],
2728
captions,
28-
audioSrc: '/audio/ssr-narration.mp3'
29+
audioSrc: `${base}/audio/ssr-narration.mp3`
2930
};
3031
3132
// Animation keyframes - define state at specific times

0 commit comments

Comments
 (0)