Auto commit: 2026-02-18T22:14:43.485Z
This commit is contained in:
parent
efc24289da
commit
69c8c87fc6
10
index.php
10
index.php
@ -2102,6 +2102,7 @@ $twitter_link = "https://twitter.com/";
|
||||
|
||||
<audio id="radio-audio" src="https://listen.radioking.com/radio/828046/stream/897251" preload="auto" crossorigin="anonymous"></audio>
|
||||
<audio id="welcome-sound" src="https://assets.mixkit.co/active_storage/sfx/2013/2013-preview.mp3" preload="auto"></audio>
|
||||
<audio id="pop-sound" src="https://assets.mixkit.co/active_storage/sfx/2354/2354-preview.mp3" preload="auto"></audio>
|
||||
|
||||
<script>
|
||||
const audio = document.getElementById('radio-audio');
|
||||
@ -2552,6 +2553,15 @@ $twitter_link = "https://twitter.com/";
|
||||
|
||||
if (messages.length === lastMessageCount) return;
|
||||
|
||||
// Play pop sound for new messages (not on initial load)
|
||||
if (messages.length > lastMessageCount && lastMessageCount > 0) {
|
||||
const popSound = document.getElementById('pop-sound');
|
||||
if (popSound) {
|
||||
popSound.currentTime = 0;
|
||||
popSound.play().catch(e => console.log('Pop sound blocked:', e));
|
||||
}
|
||||
}
|
||||
|
||||
const currentUserName = document.getElementById('user-name').value.trim() || 'Anónimo';
|
||||
chatMessages.innerHTML = '';
|
||||
messages.forEach((msg, index) => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user