CLICK TO PLAY FULLSCREEN
`.trim(); // Butona olay dinleyicisi ekle document.addEventListener('DOMContentLoaded', function() { const playButton = document.getElementById('playButton'); const fullscreenButton = document.getElementById('fullscreenButton'); if (playButton) { playButton.addEventListener('click', showContent); } else { console.error('Play butonu bulunamadı.'); } if (fullscreenButton) { fullscreenButton.addEventListener('click', openFullscreen); } else { console.error('Fullscreen butonu bulunamadı.'); } }); function showContent() { try { // Play butonunu gizle document.getElementById('playButton').style.display = 'none'; // Container'ı göster const container = document.getElementById('contentContainer'); container.style.display = 'block'; // Direkt HTML içeriğini container'a yaz container.innerHTML = gameHTML; // Script'leri yeniden çalıştır const scripts = container.getElementsByTagName('script'); for (let script of scripts) { const newScript = document.createElement('script'); newScript.textContent = script.textContent; document.body.appendChild(newScript); } } catch (error) { console.error('Hata oluştu:', error); alert('Oyun yüklenemedi. Tarayıcı konsolunu kontrol edin.'); } } function openFullscreen() { try { // Yeni sekme aç const newWin = window.open("about:blank", "_blank"); if (newWin) { newWin.document.open(); newWin.document.write(gameHTML); newWin.document.close(); // Tam ekran modunu ayarla (isteğe bağlı, tarayıcıya bağlı olarak çalışmayabilir) setTimeout(() => { if (newWin.document.documentElement.requestFullscreen) { newWin.document.documentElement.requestFullscreen(); } else if (newWin.document.documentElement.mozRequestFullScreen) { newWin.document.documentElement.mozRequestFullScreen(); } else if (newWin.document.documentElement.webkitRequestFullscreen) { newWin.document.documentElement.webkitRequestFullscreen(); } else if (newWin.document.documentElement.msRequestFullscreen) { newWin.document.documentElement.msRequestFullscreen(); } }, 500); } else { alert("Yeni sekme açma engellendi. Lütfen tarayıcı ayarlarını kontrol edin."); } } catch (error) { console.error('Fullscreen hata:', error); alert('Tam ekran modu çalışmadı. Tarayıcı konsolunu kontrol edin.'); } }