'use strict'; const ipgeolocation = 'https://freegeoip.app/json/'; const timeouts = []; const mobileAndTabletCheck = () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); $(document).ready(() => { const links = [ { name: 'ghettoshift', link: '76561199137926187', }, { name: 'midnight', link: '76561198328479107', }, ]; for (let i in links) { let link = links[i]; $('#marquee').append(`${link.name}`); link = $('#marquee').children('a').last(); if (i != links.length - 1) $('#marquee').append(' x '); } if (mobileAndTabletCheck()) { $('#background').replaceWith('
'); $('.footer').remove(); app.shouldIgnoreVideo = true; } }); if ($.cookie('videoTime')) { app.videoElement.currentTime = 0 ; } document.addEventListener('contextmenu', (event) => { event.preventDefault(); }); document.body.onkeyup = (event) => { if (event.keyCode == 32 && app.skippedIntro) { if (app.backgroundToggler) { app.videoElement.play(); } else { app.videoElement.pause(); } return (app.backgroundToggler = !app.backgroundToggler); } }; $('.skip').click(() => { skipIntro(); }); $.fn.extend({ animateCss: function (animationName) { const animationEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend'; this.addClass(`animated ${animationName}`).one(animationEnd, () => { $(this).removeClass(`animated ${animationName}`); }); return this; }, }); const writeLine = (text, speed, timeout, callback) => { timeout = typeof timeout === 'number' ? timeout : [0, (callback = timeout)]; const lineNumber = app.id !== 2 ? ++app.id : (app.id += 2); setTimeout(() => { const typed = new Typed(`#line${lineNumber}`, { strings: text, typeSpeed: speed, onComplete: callback, }); }, timeout); }; const skipIntro = () => { if (app.skippedIntro) return; app.skippedIntro = true; timeouts.forEach((timeout) => { clearTimeout(timeout); }); $('.top-right').remove(); $('#main').fadeOut(100, () => { $('#main').remove(); $('#marquee').marquee({ duration: 15000, gap: 420, delayBeforeStart: 1000, direction: 'left', duplicated: true, pauseOnHover: true }); setTimeout(() => { $('.brand-header').animateCss(app.effects[Math.floor(Math.random() * app.effects.length)]); }, 200); function brand() { setTimeout(() => { const typed = new Typed('#brand', { strings: app.brandDescription, typeSpeed: 200, onComplete: () => { clearCursor(); brand(); }, }); }, 1350); } brand(); setTimeout(() => { if (!app.shouldIgnoreVideo) { app.videoElement.play(); } app.videoElement.addEventListener( 'timeupdate', () => { $.cookie('videoTime', app.videoElement.currentTime, { expires: 1 }); }, false ); $('.marquee-container').css('visibility', 'visible').hide().fadeIn(100); $('.marquee-container').animateCss('zoomIn'); $('.container').fadeIn(); $('.background').fadeIn(200, () => { if (!app.shouldIgnoreVideo) $('#background').animate({ volume: app.musicVolume }, app.musicFadeIn); }); $('.kill-feed').css('visibility', 'visible') }, 200); }); }; const clearCursor = () => { return $('span').siblings('.typed-cursor').remove() }; $(document).click(function() { if (app.videoElement.muted) app.videoElement.muted = false; if (!app.skippedIntro) skipIntro(); }) $(document).keydown(function() { if (app.videoElement.muted) app.videoElement.muted = false; }) $(document).on("contextmenu", function(e) { e.preventDefault() }); $(document).on("keydown", (event) => { if(event.ctrlKey && (event.key == "C")) { event.preventDefault(); } if(event.ctrlKey && (event.key == "S" || event.key == "s")) { event.preventDefault(); } if(event.ctrlKey && (event.key == "I" || event.key == "i")) { event.preventDefault(); } if(event.ctrlKey && (event.key == "U" || event.key == "u")) { event.preventDefault(); } });