mirror of
https://github.com/isledecomp/isle.pizza.git
synced 2026-01-11 10:41:15 +00:00
Turn mp4 video into webp and mp3
This commit is contained in:
parent
05b6e93d13
commit
7c4a858767
20
app.js
20
app.js
@ -15,12 +15,11 @@ var Module = {
|
|||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', function () {
|
document.addEventListener('DOMContentLoaded', function () {
|
||||||
// --- Elements ---
|
// --- Elements ---
|
||||||
const video = document.getElementById('install-video');
|
const audio = document.getElementById('install-audio');
|
||||||
const soundToggleEmoji = document.getElementById('sound-toggle-emoji');
|
const soundToggleEmoji = document.getElementById('sound-toggle-emoji');
|
||||||
const mainContainer = document.getElementById('main-container');
|
const mainContainer = document.getElementById('main-container');
|
||||||
const topContent = document.getElementById('top-content');
|
const topContent = document.getElementById('top-content');
|
||||||
const controlsWrapper = document.getElementById('controls-wrapper');
|
const controlsWrapper = document.getElementById('controls-wrapper');
|
||||||
const footer = document.querySelector('.footer-disclaimer');
|
|
||||||
const allPages = document.querySelectorAll('.page-content');
|
const allPages = document.querySelectorAll('.page-content');
|
||||||
const pageButtons = document.querySelectorAll('[data-target]');
|
const pageButtons = document.querySelectorAll('[data-target]');
|
||||||
const backButtons = document.querySelectorAll('.page-back-button');
|
const backButtons = document.querySelectorAll('.page-back-button');
|
||||||
@ -31,17 +30,22 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
|
|
||||||
// --- Sound Toggle ---
|
// --- Sound Toggle ---
|
||||||
function updateSoundEmojiState() {
|
function updateSoundEmojiState() {
|
||||||
soundToggleEmoji.textContent = video.muted ? '🔇' : '🔊';
|
soundToggleEmoji.textContent = audio.muted ? '🔇' : '🔊';
|
||||||
soundToggleEmoji.title = video.muted ? 'Unmute Audio' : 'Mute Audio';
|
soundToggleEmoji.title = audio.muted ? 'Unmute Audio' : 'Mute Audio';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (video && soundToggleEmoji) {
|
if (audio && soundToggleEmoji) {
|
||||||
updateSoundEmojiState();
|
updateSoundEmojiState();
|
||||||
soundToggleEmoji.addEventListener('click', function () {
|
soundToggleEmoji.addEventListener('click', function () {
|
||||||
video.muted = !video.muted;
|
audio.muted = !audio.muted;
|
||||||
|
if (!audio.muted) {
|
||||||
|
audio.currentTime = 0;
|
||||||
|
audio.play();
|
||||||
|
}
|
||||||
|
|
||||||
updateSoundEmojiState();
|
updateSoundEmojiState();
|
||||||
});
|
});
|
||||||
video.addEventListener('volumechange', updateSoundEmojiState);
|
audio.addEventListener('volumechange', updateSoundEmojiState);
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Control Image Hover ---
|
// --- Control Image Hover ---
|
||||||
@ -64,7 +68,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
|
|
||||||
runGameButton.addEventListener('click', function () {
|
runGameButton.addEventListener('click', function () {
|
||||||
if (!Module.running) return;
|
if (!Module.running) return;
|
||||||
video.muted = true;
|
audio.muted = true;
|
||||||
updateSoundEmojiState();
|
updateSoundEmojiState();
|
||||||
this.src = this.dataset.on;
|
this.src = this.dataset.on;
|
||||||
|
|
||||||
|
|||||||
10
index.html
10
index.html
@ -10,6 +10,7 @@
|
|||||||
<link rel="preload" href="app.js" as="script">
|
<link rel="preload" href="app.js" as="script">
|
||||||
<link rel="preload" href="isle.js" as="script">
|
<link rel="preload" href="isle.js" as="script">
|
||||||
<link rel="preload" href="isle.wasm" as="fetch" crossorigin>
|
<link rel="preload" href="isle.wasm" as="fetch" crossorigin>
|
||||||
|
<link rel="preload" href="install.webp" as="image">
|
||||||
<link rel="preload" href="island.webp" as="image">
|
<link rel="preload" href="island.webp" as="image">
|
||||||
|
|
||||||
<meta name="description"
|
<meta name="description"
|
||||||
@ -41,10 +42,11 @@
|
|||||||
<div id="main-container">
|
<div id="main-container">
|
||||||
<div id="top-content">
|
<div id="top-content">
|
||||||
<div class="video-container">
|
<div class="video-container">
|
||||||
<video id="install-video" width="260" height="260" autoplay loop playsinline muted>
|
<img id="install-video" width="260" height="260" src="install.webp" alt="Install Game">
|
||||||
<source src="install.mp4" type="video/mp4">
|
<audio id="install-audio" loop muted preload="none">
|
||||||
Your browser does not support the video tag.
|
<source src="install.mp3" type="audio/mpeg">
|
||||||
</video>
|
Your browser does not support the audio tag.
|
||||||
|
</audio>
|
||||||
<span id="sound-toggle-emoji" title="Unmute Audio">🔇</span>
|
<span id="sound-toggle-emoji" title="Unmute Audio">🔇</span>
|
||||||
</div>
|
</div>
|
||||||
<img id="island-logo-img" width="567" height="198" src="island.webp" alt="Lego Island Logo">
|
<img id="island-logo-img" width="567" height="198" src="island.webp" alt="Lego Island Logo">
|
||||||
|
|||||||
BIN
install.mp3
Normal file
BIN
install.mp3
Normal file
Binary file not shown.
BIN
install.mp4
BIN
install.mp4
Binary file not shown.
BIN
install.webp
Normal file
BIN
install.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 413 KiB |
12
sw.js
12
sw.js
@ -15,7 +15,8 @@ const coreAppFiles = [
|
|||||||
'/free_stuff_off.webp', '/free_stuff_on.webp', '/install_off.webp', '/install_on.webp',
|
'/free_stuff_off.webp', '/free_stuff_on.webp', '/install_off.webp', '/install_on.webp',
|
||||||
'/island.webp', '/isle.js', '/isle.wasm', '/poster.pdf', '/read_me_off.webp',
|
'/island.webp', '/isle.js', '/isle.wasm', '/poster.pdf', '/read_me_off.webp',
|
||||||
'/read_me_on.webp', '/run_game_off.webp', '/run_game_on.webp', '/shark.webp',
|
'/read_me_on.webp', '/run_game_off.webp', '/run_game_on.webp', '/shark.webp',
|
||||||
'/uninstall_off.webp', '/uninstall_on.webp', '/app.js', '/style.css', '/manifest.json'
|
'/uninstall_off.webp', '/uninstall_on.webp', '/app.js', '/style.css', '/manifest.json',
|
||||||
|
'/install.webp', '/install.mp3'
|
||||||
];
|
];
|
||||||
|
|
||||||
const gameFiles = [
|
const gameFiles = [
|
||||||
@ -35,14 +36,7 @@ const STATIC_CACHE_NAME = 'static-assets-v1';
|
|||||||
self.addEventListener('install', (event) => {
|
self.addEventListener('install', (event) => {
|
||||||
event.waitUntil(
|
event.waitUntil(
|
||||||
caches.open(STATIC_CACHE_NAME).then((cache) => {
|
caches.open(STATIC_CACHE_NAME).then((cache) => {
|
||||||
return cache.addAll(coreAppFiles).then(() => {
|
return cache.addAll(coreAppFiles);
|
||||||
return fetch('/install.mp4', { cache: 'reload' }).then((response) => {
|
|
||||||
if (!response.ok) {
|
|
||||||
throw new Error('Video fetch failed!');
|
|
||||||
}
|
|
||||||
return cache.put('/install.mp4', response);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
self.skipWaiting();
|
self.skipWaiting();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user