mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-04-23 00:58:40 +02:00
feat: add sounds volume control to user settings
This commit is contained in:
@@ -1,15 +1,19 @@
|
||||
<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()
|
||||
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()
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
{% load i18n %}
|
||||
<i class="fa-solid fa-volume-xmark me-2 fa-fw"></i>{% translate 'Mute sounds' %}
|
||||
{{ user.settings.volume|json_script:"volume" }}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
{% load i18n %}
|
||||
<i class="fa-solid fa-volume-low me-2 fa-fw"></i>{% translate 'Play sounds' %}
|
||||
<span id="settings-mute-sound" class="d-inline tw:invisible"></span>
|
||||
{{ user.settings.volume|json_script:"volume" }}
|
||||
|
||||
Reference in New Issue
Block a user