window.onload = async () => { const fragment = new URLSearchParams(window.location.hash.slice(1)); const [accessToken, tokenType] = [fragment.get('access_token'), fragment.get('token_type')]; if (!accessToken) return window.location.href = '/'; const expirationDate = new Date( Date.now() + (24 * 60 * 60 * 1000));// 24 hours // document.cookie = 'accessToken' + '=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/;'; // document.cookie = 'tokenType' + '=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/;'; const wasEmpty = document.cookie ==''; document.cookie = `accessToken=${accessToken}; expires=${expirationDate.toUTCString()}; path=/`; document.cookie = `tokenType=${tokenType}; expires=${expirationDate.toUTCString()}; path=/`; if(wasEmpty) window.location.reload(); createListeners(); }; function togglePopup(element) { if(element.classList.contains('hidden')) { element.classList.remove('hidden'); return document.addEventListener('click', clickListener); } element.classList.add('hidden'); } let clickListener = function handleClickOutside(event) { if (!document.getElementById('PopUpContainer').contains(event.target) && !event.target.classList.contains('card')) { document.getElementById('PopUpContainer').classList.add('hidden'); document.removeEventListener('click', clickListener); } } function createListeners() { document.getElementById("Guilds").onmousemove = e => { for(var card of document.getElementsByClassName("card")) { const rect = card.getBoundingClientRect(), x = e.clientX - rect.left, y = e.clientY - rect.top; card.style.setProperty("--mouse-x", `${x}px`); card.style.setProperty("--mouse-y", `${y}px`); let interval = null; let target = card.children[0].children[1].children[0].children[0].children[0]; let imgTarget = card.children[0].children[0].children[0] card.addEventListener('mouseenter', ()=> { if(imgTarget.classList.contains('imgfalse')) return const letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; let iteration = 0; interval = setInterval(() => { target.innerText = target.innerText .split("") .map((letter, index) => { if(index < iteration) { return target.dataset.value[index]; } return letters[Math.floor(Math.random() * 26)] }) .join(""); if(iteration >= target.dataset.value.length) { clearInterval(interval); } iteration += 4 ; }, 1) }) card.addEventListener('mouseleave', ()=> { clearInterval(interval); target.innerText = target.dataset.value; }) } } } function addRem() { window.open('https://discord.com/oauth2/authorize?client_id=356104008366030863&permissions=8&scope=bot', '_blank') }