mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-07-18 02:31:21 +02:00
feat: replace mp3 sounds with cuelume; deprecate volume setting
This commit is contained in:
@@ -140,7 +140,6 @@ class UserSettingsForm(forms.ModelForm):
|
||||
"date_format",
|
||||
"datetime_format",
|
||||
"number_format",
|
||||
"volume",
|
||||
"default_account",
|
||||
]
|
||||
widgets = {
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,20 +1,12 @@
|
||||
<script type="text/hyperscript">
|
||||
on paid if body do not include #settings-mute-sound
|
||||
js
|
||||
volume = JSON.parse(document.getElementById('volume').textContent) / 10
|
||||
paidSound.pause()
|
||||
paidSound.currentTime = 0
|
||||
paidSound.volume = volume
|
||||
paidSound.play()
|
||||
playSound("sparkle")
|
||||
end
|
||||
end
|
||||
on unpaid if body do not include #settings-mute-sound
|
||||
js
|
||||
volume = JSON.parse(document.getElementById('volume').textContent) / 10
|
||||
unpaidSound.pause()
|
||||
unpaidSound.currentTime = 0
|
||||
unpaidSound.volume = volume
|
||||
unpaidSound.play()
|
||||
playSound("bloom")
|
||||
end
|
||||
end
|
||||
</script>
|
||||
|
||||
Generated
+7
@@ -23,6 +23,7 @@
|
||||
"bootstrap": "^5.3.8",
|
||||
"chart.js": "^4.5.1",
|
||||
"chartjs-chart-sankey": "^0.14.3",
|
||||
"cuelume": "^0.1.2",
|
||||
"daisyui": "5.5.20",
|
||||
"htmx.org": "^2.0.10",
|
||||
"hyperscript.org": "^0.9.91",
|
||||
@@ -1287,6 +1288,12 @@
|
||||
"url": "https://github.com/sponsors/rawify"
|
||||
}
|
||||
},
|
||||
"node_modules/cuelume": {
|
||||
"version": "0.1.2",
|
||||
"resolved": "https://registry.npmjs.org/cuelume/-/cuelume-0.1.2.tgz",
|
||||
"integrity": "sha512-VxL0k9l1fyKGot3VKM+wm5Xd2K75fVeBHdNTrR1EHiqKRtD6S5Dxy/vY7hwl9gXp3QT/TIywFXUos77n39YZVQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/daisyui": {
|
||||
"version": "5.5.20",
|
||||
"resolved": "https://registry.npmjs.org/daisyui/-/daisyui-5.5.20.tgz",
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
"bootstrap": "^5.3.8",
|
||||
"chart.js": "^4.5.1",
|
||||
"chartjs-chart-sankey": "^0.14.3",
|
||||
"cuelume": "^0.1.2",
|
||||
"daisyui": "5.5.20",
|
||||
"htmx.org": "^2.0.10",
|
||||
"hyperscript.org": "^0.9.91",
|
||||
@@ -47,4 +48,4 @@
|
||||
"resolutions": {
|
||||
"rollup": "npm:@rollup/wasm-node"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,11 +14,6 @@ Alpine.plugin(mask);
|
||||
Alpine.plugin(collapse);
|
||||
Alpine.start();
|
||||
|
||||
const successAudio = new Audio("/static/sounds/success.mp3");
|
||||
const popAudio = new Audio("/static/sounds/pop.mp3");
|
||||
window.paidSound = successAudio;
|
||||
window.unpaidSound = popAudio;
|
||||
|
||||
/**
|
||||
* Parse a localized number to a float.
|
||||
* @param {string} stringNumber - the localized number
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
import { play } from "cuelume";
|
||||
|
||||
|
||||
window.playSound = play;
|
||||
@@ -3,6 +3,7 @@ import 'vite/modulepreload-polyfill';
|
||||
import './js/bootstrap.js';
|
||||
import './js/datepicker.js';
|
||||
import './js/htmx.js';
|
||||
import './js/sounds.js';
|
||||
import './js/select.js';
|
||||
import './js/charts.js';
|
||||
import './js/autosize.js';
|
||||
|
||||
Reference in New Issue
Block a user