// Loud warning const LOUD = document.getElementById("loud"); LOUD.addEventListener("click", function () { alert("LOUD WARNING! Turn down your volume for this one."); }); // Hide button on iOS if (navigator.userAgent.match(/iPhone|iPad|iPod|Macintosh/i)) { FULL_SCREEN_BUTTON.style.display = "none"; } window.RufflePlayer = window.RufflePlayer || {}; window.addEventListener("load", (event) => { const ruffle = window.RufflePlayer.newest(); let player = ruffle.createPlayer(); player.id = "embeddedMedia"; player.ruffle().config = { // Options affecting the whole page publicPath: undefined, polyfills: true, // Options affecting files only allowScriptAccess: false, // Polyfill elements have a different default value, see the allowScriptAccess section autoplay: "auto", unmuteOverlay: "visible", backgroundColor: "black", wmode: "window", letterbox: "on", warnOnUnsupportedContent: true, contextMenu: "on", showSwfDownload: false, upgradeToHttps: window.location.protocol === "https:", maxExecutionDuration: 15, logLevel: "error", base: null, menu: true, salign: "", forceAlign: false, scale: "showAll", forceScale: false, frameRate: null, quality: "high", splashScreen: true, preferredRenderer: null, openUrlMode: "allow", allowNetworking: "all", favorFlash: true, socketProxy: [], fontSources: [], defaultFonts: {}, credentialAllowList: [], playerRuntime: "flashPlayer", allowFullscreen: true, }; const container = document.getElementById("playerDiv"); container.appendChild(player); const DEFAULT_MEDIA = "/flash/troubled_windows.swf"; const DEFAULT_TITLE = "Troubled Windows"; const DEFAULT_DESCRIPTION = 'Troubled Windows (Toraburu Windouzu) is the most notable OS-tan multimedia presentation created through the net. It features interactivity and is accompanied by the song "Sakuranbo Kissu" by KOTOKO, which became the unofficial OS-tan theme song.'; const DEFAULT_CONTROLS = "Point and Click"; const DEFAULT_DATE = "2004"; const DEFAULT_DOWNLOAD = "https://frutigeraeroarchive.org/flash/troubled_windows.swf"; document.getElementById("mediaTitle").innerHTML = DEFAULT_TITLE; document.getElementById("mediaDescription").innerHTML = DEFAULT_DESCRIPTION; document.getElementById("mediaControls").innerHTML = DEFAULT_CONTROLS; document.getElementById("mediaDate").innerHTML = DEFAULT_DATE; document.getElementById("mediaDownload").href = DEFAULT_DOWNLOAD; player.load(DEFAULT_MEDIA); player.play(); let sound_effect = new Audio("/sounds/samsung_navigating.wav"); const MEDIA_LINKS = document.querySelectorAll(".media-link"); MEDIA_LINKS.forEach((link) => { link.addEventListener("click", function (event) { event.preventDefault(); const FILE = link.getAttribute("data-media"); const TITLE = link.getAttribute("data-title"); const DESCRIPTION = link.getAttribute("data-description"); const CONTROLS = link.getAttribute("data-controls"); const DATE = link.getAttribute("data-date"); const DOWNLOAD = link.getAttribute("data-download"); document.getElementById("mediaTitle").innerHTML = TITLE; document.getElementById("mediaDescription").innerHTML = DESCRIPTION; document.getElementById("mediaControls").innerHTML = CONTROLS; document.getElementById("mediaDate").innerHTML = DATE; document.getElementById("mediaDownload").href = DOWNLOAD; if (sounds) { sound_effect.play(); } const playerDiv = document.getElementById("playerDiv"); playerDiv.innerHTML = ""; player = ruffle.createPlayer(); player.id = "embeddedMedia"; playerDiv.appendChild(player); player.ruffle().config = { // Options affecting the whole page publicPath: undefined, polyfills: true, // Options affecting files only allowScriptAccess: false, // Polyfill elements have a different default value, see the allowScriptAccess section autoplay: "auto", unmuteOverlay: "visible", backgroundColor: "black", wmode: "window", letterbox: "on", warnOnUnsupportedContent: true, contextMenu: "on", showSwfDownload: false, upgradeToHttps: window.location.protocol === "https:", maxExecutionDuration: 15, logLevel: "error", base: null, menu: true, salign: "", forceAlign: false, scale: "showAll", forceScale: false, frameRate: null, quality: "high", splashScreen: true, preferredRenderer: null, openUrlMode: "allow", allowNetworking: "all", favorFlash: true, socketProxy: [], fontSources: [], defaultFonts: {}, credentialAllowList: [], playerRuntime: "flashPlayer", allowFullscreen: true, }; player.load(FILE); player.play(); setTimeout(() => { document.getElementById("mainContent").scrollTo({ top: 0, behavior: "smooth", }); window.scrollTo({ top: 0, behavior: "smooth", }); }, 200); }); }); }); // Check if sound is enabled let sounds = localStorage.getItem("globalSound") === "true"; document .getElementById("navSoundToggle") .addEventListener("click", function () { sounds = !sounds; localStorage.setItem("globalSound", sounds); });