Add ads system, diversify callers, update website descriptions

- Add ads playback system with backend endpoints and frontend UI
- Diversify AI callers: randomize voices per session, expand jobs/problems/interests/quirks/locations
- Update website tagline and descriptions to "biologically questionable organisms"

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-06 20:38:25 -07:00
parent eafcf27beb
commit e30d4c8856
5 changed files with 311 additions and 58 deletions

View File

@@ -38,6 +38,7 @@ document.addEventListener('DOMContentLoaded', async () => {
await loadAudioDevices();
await loadCallers();
await loadMusic();
await loadAds();
await loadSounds();
await loadSettings();
initEventListeners();
@@ -119,6 +120,10 @@ function initEventListeners() {
document.getElementById('stop-btn')?.addEventListener('click', stopMusic);
document.getElementById('volume')?.addEventListener('input', setMusicVolume);
// Ads
document.getElementById('ad-play-btn')?.addEventListener('click', playAd);
document.getElementById('ad-stop-btn')?.addEventListener('click', stopMusic);
// Settings
document.getElementById('settings-btn')?.addEventListener('click', async () => {
document.getElementById('settings-modal')?.classList.remove('hidden');
@@ -629,6 +634,50 @@ async function setMusicVolume(e) {
}
async function loadAds() {
try {
const res = await fetch('/api/ads');
const data = await res.json();
const ads = data.ads || [];
const select = document.getElementById('ad-select');
if (!select) return;
const previousValue = select.value;
select.innerHTML = '';
ads.forEach(ad => {
const option = document.createElement('option');
option.value = ad.file;
option.textContent = ad.name;
select.appendChild(option);
});
if (previousValue && [...select.options].some(o => o.value === previousValue)) {
select.value = previousValue;
}
console.log('Loaded', ads.length, 'ads');
} catch (err) {
console.error('loadAds error:', err);
}
}
async function playAd() {
await loadAds();
const select = document.getElementById('ad-select');
const track = select?.value;
if (!track) return;
await fetch('/api/ads/play', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ track, action: 'play' })
});
}
// --- Sound Effects (Server-Side) ---
async function loadSounds() {
try {