Temp Mail Script -

/* Header */ .header { background: #2d3748; color: white; padding: 25px 30px; text-align: center; }

// Build list messageListDiv.innerHTML = ''; currentMessages.forEach(msg => { const msgDiv = document.createElement('div'); msgDiv.className = 'message-item'; if (selectedMessageId === msg.id) msgDiv.classList.add('active'); const dateObj = new Date(msg.date); const formattedDate = dateObj.toLocaleTimeString([], {hour:'2-digit', minute:'2-digit'}) + ' ' + dateObj.toLocaleDateString(); msgDiv.innerHTML = ` <div class="message-sender">📧 ${escapeHtml(msg.from)}</div> <div class="message-subject">📌 ${escapeHtml(msg.subject)}</div> <div class="message-date">🕒 ${formattedDate}</div> `; msgDiv.addEventListener('click', (e) => { e.stopPropagation(); selectAndDisplayMessage(msg.id); }); messageListDiv.appendChild(msgDiv); });

@media (max-width: 768px) { .main-content { flex-direction: column; } .inbox-sidebar, .email-detail { width: 100%; } .message-list { max-height: 300px; } .email-bar { flex-direction: column; align-items: stretch; } } </style> </head> <body> temp mail script

// Set a new email (reset inbox) function setNewEmail() { const newEmailAddr = generateNewEmail(); currentEmail = newEmailAddr; selectedMessageId = null; // Ensure we have storage for this email (maybe empty initially) if (!loadMessagesForEmail(currentEmail).length) { saveMessagesForEmail(currentEmail, []); } document.getElementById('emailAddress').innerText = currentEmail; refreshInboxUI(); // Restart auto email generation for new address if (intervalId) clearInterval(intervalId); startAutoGenerateEmails();

.message-sender { font-weight: 600; color: #2d3748; margin-bottom: 5px; } /* Header */

.copy-btn, .refresh-btn { background: #667eea; color: white; border: none; padding: 8px 20px; border-radius: 8px; cursor: pointer; font-weight: 600; transition: all 0.2s; }

// If this is the currently viewed email, refresh UI if (currentEmail === email) { refreshInboxUI(); // Auto-select the newest message if detail view is open? optional } return newMessage; } If this was you, ignore this message

// Simulate random incoming emails (for demo fun) const demoSubjects = [ "Your verification code", "Welcome to Service", "Invoice #INV-2024", "Reset your password", "Special offer just for you", "Meeting reminder", "Your order confirmation", "Newsletter", "Security alert", "Someone liked your post", "Account activation" ]; const demoFromNames = [ "noreply@verify.com", "support@paypal.com", "hello@github.com", "alerts@google.com", "team@spotify.com", "info@amazon.com", "security@facebook.com", "updates@microsoft.com", "welcome@netflix.com" ]; const demoBodies = [ "Thank you for signing up! Click the link to verify your email address.", "We noticed a new login from an unknown device. If this was you, ignore this message.", "Here is your one-time password: 384729. It expires in 10 minutes.", "Your invoice is attached. Total amount: $49.99. Due date: 2025-01-15.", "Don't miss out on our holiday sale! Up to 50% off.", "Meeting scheduled for tomorrow at 10 AM. Join via Zoom.", "Your package has been shipped and will arrive in 2-3 business days." ];

.message-subject { font-size: 0.85rem; color: #4a5568; margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.inbox-header { padding: 15px 20px; background: #edf2f7; border-bottom: 1px solid #e2e8f0; font-weight: bold; display: flex; justify-content: space-between; }

Discover more from The Escape Roomer

Subscribe now to keep reading and get access to the full archive.

Continue reading