add button sfx

This commit is contained in:
aqua 2025-05-12 13:25:49 -04:00
parent 2abc48572c
commit 39cf79222e
2 changed files with 28 additions and 1 deletions

View file

@ -6,4 +6,22 @@ module ApplicationHelper
def markdown_to_html(markdown)
Kramdown::Document.new(markdown).to_html
end
def link_to(name = nil, options = nil, html_options = nil, &block)
# warning might be jank. it's overriding the default link_to method lol.
if block
options ||= {}
new_options = options
else
html_options ||= {}
new_options = html_options
end
new_options[:class] ||= []
if new_options[:class].is_a? Array
new_options[:class] << "btn"
else
new_options[:class] << " btn"
end
super(name, options, html_options, &block)
end
end

View file

@ -12,4 +12,13 @@ function toggleMute() {
// Update the button icon
var audioToggle = document.getElementById('audio-toggle');
audioToggle.textContent = myAudio.muted ? '🔇' : '🔊';
}
}
const audio = new Audio('https://hc-cdn.hel1.your-objectstorage.com/s/v3/98df9f1054b50821b1d2208a7d3386a2408134be_d3bd3f0972d62d58cdfce91bc042d32ee643aa94_ui_button_confirm_audio__mp3cut.net__audio.mp4');
audio.volume = 0.75
document.addEventListener('click', (event) => {
let el = event.target.closest('a.btn');
if (el) {
audio.play();
}
});