Auto commit: 2026-02-18T22:18:18.630Z
This commit is contained in:
parent
69c8c87fc6
commit
b2da37aaa1
39
index.php
39
index.php
@ -1822,9 +1822,14 @@ $twitter_link = "https://twitter.com/";
|
||||
<section class="interaction-center">
|
||||
<!-- Live Web Chat -->
|
||||
<div class="glass-card chat-window" style="height: 500px; display: flex; flex-direction: column;">
|
||||
<h3 style="font-size: 1.2rem; margin-bottom: 1rem; color: var(--primary-color);">
|
||||
<i class="bi bi-chat-dots-fill"></i> CHAT EN VIVO
|
||||
</h3>
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem;">
|
||||
<h3 style="font-size: 1.2rem; margin: 0; color: var(--primary-color);">
|
||||
<i class="bi bi-chat-dots-fill"></i> CHAT EN VIVO
|
||||
</h3>
|
||||
<button id="mute-chat-btn" onclick="toggleChatSound()" style="background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: white; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.3s;" title="Silenciar/Activar sonido del chat">
|
||||
<i class="bi bi-volume-up-fill"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div id="pinned-message" class="pinned-message-container">
|
||||
<div class="pinned-label"><i class="bi bi-pin-angle-fill"></i> MENSAJE FIJADO</div>
|
||||
<div id="pinned-content" style="font-size: 0.85rem; font-weight: 600;"></div>
|
||||
@ -2502,6 +2507,31 @@ $twitter_link = "https://twitter.com/";
|
||||
const chatMsg = document.getElementById('chat-msg');
|
||||
const emojiPicker = document.getElementById('emoji-picker');
|
||||
let lastMessageCount = 0;
|
||||
let chatSoundMuted = localStorage.getItem('chatSoundMuted') === 'true';
|
||||
|
||||
function updateMuteButton() {
|
||||
const btn = document.getElementById('mute-chat-btn');
|
||||
if (!btn) return;
|
||||
const icon = btn.querySelector('i');
|
||||
if (chatSoundMuted) {
|
||||
icon.classList.remove('bi-volume-up-fill');
|
||||
icon.classList.add('bi-volume-mute-fill');
|
||||
btn.style.color = '#ff4444';
|
||||
} else {
|
||||
icon.classList.remove('bi-volume-mute-fill');
|
||||
icon.classList.add('bi-volume-up-fill');
|
||||
btn.style.color = 'white';
|
||||
}
|
||||
}
|
||||
|
||||
function toggleChatSound() {
|
||||
chatSoundMuted = !chatSoundMuted;
|
||||
localStorage.setItem('chatSoundMuted', chatSoundMuted);
|
||||
updateMuteButton();
|
||||
}
|
||||
|
||||
// Initialize button state
|
||||
setTimeout(updateMuteButton, 500);
|
||||
|
||||
function toggleEmojiPicker() {
|
||||
emojiPicker.style.display = emojiPicker.style.display === 'none' ? 'block' : 'none';
|
||||
@ -2554,10 +2584,11 @@ $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) {
|
||||
if (!chatSoundMuted && messages.length > lastMessageCount && lastMessageCount > 0) {
|
||||
const popSound = document.getElementById('pop-sound');
|
||||
if (popSound) {
|
||||
popSound.currentTime = 0;
|
||||
popSound.volume = 0.4; // Soft volume
|
||||
popSound.play().catch(e => console.log('Pop sound blocked:', e));
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user