Script | Font Playlist

// Add font function addFont() let newFont = newFontNameInput.value.trim(); if (newFont === "") return alert("Enter a font name"); // simple check: avoid duplicate (case-insensitive) if (playlist.some(f => f.toLowerCase() === newFont.toLowerCase())) alert("Font already in playlist"); return; playlist.push(newFont); renderPlaylistUI(); if (playlist.length === 1) currentIndex = 0; updateDisplay(); newFontNameInput.value = ""; if (isPlaying) stopAutoRotate(); startAutoRotate();

function importPlaylist(file) const reader = new FileReader(); reader.onload = (e) => try const json = JSON.parse(e.target.result); if (json.fonts && Array.isArray(json.fonts) && json.fonts.length) playlist = json.fonts; currentIndex = 0; if (json.savedText !== undefined) userMessageTextarea.value = json.savedText; renderPlaylistUI(); updateTextContent(); updateDisplay(); stopAutoRotate(); else alert("Invalid playlist format. Need fonts: [...] "); catch(err) alert("Error parsing file"); ; reader.readAsText(file); font playlist script

<!-- Playlist editor --> <h3>📋 Font Playlist</h3> <div class="add-font-area"> <input type="text" id="newFontName" placeholder="Font name (e.g., 'Poppins', 'Courier New')"> <button id="addFontBtn">➕ Add</button> </div> <div class="font-list" id="fontListContainer"> <!-- dynamic font list --> </div> <div class="toolbar"> <button id="exportBtn">💾 Export Playlist</button> <button id="importBtn">📂 Import Playlist</button> <input type="file" id="importFile" style="display:none" accept=".json"> </div> <p style="font-size: 0.75rem; margin-top: 20px; opacity:0.6;">💡 Tip: Add any Google Font or system font. Playlist rotates every 3 sec.</p> </div> // Add font function addFont() let newFont =