Auto commit: 2026-02-15T18:26:45.400Z
This commit is contained in:
parent
6f66b76f14
commit
27c2edbc0f
@ -714,7 +714,7 @@ $facebook_link = "https://www.facebook.com/profile.php?id=61587890927489";
|
||||
<div style="opacity: 0.5; font-size: 0.9rem; text-align: center; margin-top: 2rem;">Cargando mensajes...</div>
|
||||
</div>
|
||||
<div class="chat-input-area" style="display: flex; gap: 0.5rem;">
|
||||
<input type="text" id="chat-user" placeholder="Nombre" style="width: 80px; font-size: 0.8rem; padding: 0.5rem; border-radius: 8px; border: none; background: rgba(255,255,255,0.1); color: white;">
|
||||
<input type="hidden" id="chat-user">
|
||||
<input type="text" id="chat-msg" placeholder="Escribe un mensaje..." style="flex: 1; font-size: 0.8rem; padding: 0.5rem; border-radius: 8px; border: none; background: rgba(255,255,255,0.1); color: white;">
|
||||
<button onclick="sendChatMessage()" style="background: var(--primary-color); border: none; border-radius: 8px; color: white; padding: 0 1rem; cursor: pointer;">
|
||||
<i class="bi bi-send-fill"></i>
|
||||
@ -896,13 +896,14 @@ $facebook_link = "https://www.facebook.com/profile.php?id=61587890927489";
|
||||
const messages = await response.json();
|
||||
|
||||
if (messages.length !== lastMessageCount) {
|
||||
const currentUserName = document.getElementById('user-name').value.trim() || 'Anónimo';
|
||||
chatMessages.innerHTML = '';
|
||||
messages.forEach(msg => {
|
||||
const div = document.createElement('div');
|
||||
div.style.background = 'rgba(255,255,255,0.05)';
|
||||
div.style.padding = '0.8rem';
|
||||
div.style.borderRadius = '12px';
|
||||
div.style.borderLeft = `4px solid ${msg.username === chatUser.value ? 'var(--primary-color)' : 'rgba(255,255,255,0.2)'}`;
|
||||
div.style.borderLeft = `4px solid ${msg.username === currentUserName ? 'var(--primary-color)' : 'rgba(255,255,255,0.2)'}`;
|
||||
|
||||
div.innerHTML = `
|
||||
<div style="font-size: 0.7rem; font-weight: bold; color: var(--primary-color); margin-bottom: 2px;">${msg.username}</div>
|
||||
@ -920,7 +921,8 @@ $facebook_link = "https://www.facebook.com/profile.php?id=61587890927489";
|
||||
}
|
||||
|
||||
async function sendChatMessage() {
|
||||
const user = chatUser.value.trim() || 'Anónimo';
|
||||
const userNameInput = document.getElementById('user-name');
|
||||
const user = userNameInput.value.trim() || 'Anónimo';
|
||||
const message = chatMsg.value.trim();
|
||||
if (!message) return;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user