網域徙竇 lió!
為著提供還較穩定个服務,客源翠个網址既經徙竇吔。
請撳下面个撳鈕,同你个進度、設定款起來,共下運過去。
function handleDomainMigration() { if (window.location.hostname !== 'aiuanyu.github.io' && window.location.hostname !== 'fix-migration-dark-theme.hakspring.pages.dev' && window.location.hostname !== 'feat-dark-theme-loading-over.hakspring.pages.dev') { return false; } // Create the overlay const overlay = document.createElement('div'); overlay.id = 'migration-overlay'; // Add ID for styling overlay.style.position = 'fixed'; overlay.style.top = '0'; overlay.style.left = '0'; overlay.style.width = '100vw'; overlay.style.height = '100vh'; overlay.style.zIndex = '999999'; overlay.style.display = 'flex'; overlay.style.justifyContent = 'center'; overlay.style.alignItems = 'center'; overlay.style.padding = '1.5em'; overlay.style.boxSizing = 'border-box'; const newHost = 'https://hakspring.pages.dev'; const originalPath = window.location.pathname; let newPath = originalPath.replace(/^\/HakSpring/, '').replace(/^\/index\.html/, ''); if (newPath === '') newPath = '/'; const newBaseUrl = newHost + newPath; // Define the HTML content for the overlay overlay.innerHTML = `
為著提供還較穩定个服務,客源翠个網址既經徙竇吔。
請撳下面个撳鈕,同你个進度、設定款起來,共下運過去。
華語詞義: ${(reading.mandarinMeaning || '無資料').replace(/"/g, '')}
`; itemDiv.appendChild(headerBtn); itemDiv.appendChild(panelDiv); accordionContainer.appendChild(itemDiv); const playButton = headerBtn.querySelector('.popup-audio-play-btn'); if (playButton) { playButton.addEventListener('click', (e) => { e.stopPropagation(); const header = playButton.closest('.accordion-header'); const panel = header ? header.nextElementSibling : null; if (header && panel && !header.classList.contains('active')) { header.classList.add('active'); const indicator = header.querySelector('.indicator'); panel.style.maxHeight = panel.scrollHeight + "px"; if (indicator) indicator.textContent = '−'; } const audioSrc = playButton.dataset.audioSrc; if (audioSrc) { if (window.currentPopupAudio && typeof window.currentPopupAudio.pause === 'function') { window.currentPopupAudio.pause(); window.currentPopupAudio.currentTime = 0; } window.currentPopupAudio = new Audio(audioSrc); const iconElement = playButton.querySelector('i'); const originalIconClasses = iconElement ? iconElement.className : ''; if (iconElement) iconElement.className = 'fas fa-spinner fa-spin'; window.currentPopupAudio.play().catch(err => { console.error("播放 popup 音檔失敗:", err); if (iconElement) iconElement.className = originalIconClasses; }); window.currentPopupAudio.onended = () => { if (iconElement) iconElement.className = originalIconClasses; window.currentPopupAudio = null; }; window.currentPopupAudio.onerror = () => { if (iconElement) iconElement.className = originalIconClasses; window.currentPopupAudio = null; }; } }); } const substituteBtn = headerBtn.querySelector('.popup-substitute-btn'); if (substituteBtn) { substituteBtn.addEventListener('click', (e) => { e.stopPropagation(); if (typeof callbackOnSelect === 'function') { const selectedPhonetic = reading.pronunciation; callbackOnSelect(anchorElementOrRect, selectedPhonetic); hidePronunciationPopup(popupEl, backdropEl); } }); } headerBtn.addEventListener('click', () => { headerBtn.classList.toggle('active'); const indicator = headerBtn.querySelector('.indicator'); if (panelDiv.style.maxHeight) { panelDiv.style.maxHeight = null; if (indicator) indicator.textContent = '+'; } else { panelDiv.style.maxHeight = panelDiv.scrollHeight + "px"; if (indicator) indicator.textContent = '−'; } }); }); contentEl.appendChild(accordionContainer); } else { if (readings.length === 0) { contentEl.innerHTML = `在所有腔調中都尋無「${selectedText}」个讀音。
請試看啊重新斷詞,或者縮短尋个字詞。
在「${dialectName}」腔頭尋無讀音。
請試看啊打開「顯示其他腔頭」。