Skip to content

Commit

Permalink
Merge pull request #1 from meqativ/rm-gd-2.2
Browse files Browse the repository at this point in the history
feat: remove gd 2.2 stuff
  • Loading branch information
meqativ authored Feb 19, 2024
2 parents 239301d + f69d7ef commit 8271684
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 98 deletions.
15 changes: 3 additions & 12 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!DOCTYPE html>
<html lang="en">
<head>
<script preload type="module" defer src="./script.js"></script>
<link preload href="https://fonts.googleapis.com/css2?family=Noto+Sans&family=Noto+Sans+Mono:wght@300&display=swap" rel="stylesheet">
<link preload href="./assets/favicon.svg" rel="icon" type="image/svg+xml" />
<script preload defer src="./script.js"></script>
<link preload href="https://fonts.googleapis.com/css2?family=Noto+Sans&family=Noto+Sans+Mono:wght@300&display=swap" rel="stylesheet">
<link preload href="./assets/favicon.svg" rel="icon" type="image/svg+xml" />
<link preload href="style.css" rel="stylesheet" type="text/css" />
<meta property="og:title" content="meqativ"/>
<meta itemprop="image" property="og:image" content="https://meqativ.github.io/home/assets/avatar.png" />
Expand Down Expand Up @@ -152,15 +152,6 @@ <h3 translate="no">osu!profile</h3>
<h3 translate="no">geometry dash</h3>
</button>
</a>
<a href="https://mega.nz/file/mP4g0Q4J#VkuR60hxDlfnbaezUKJJc5YdDoKJGZg_GQbULOuH25M">
<button id="fireinthehole" title="Geometry Dash 2.2 android apk file download">
<div class="logo_container">
<img draggable="false" class="round" src="./assets/gd/logo_2.1.png" />
<img draggable="false" src="./assets/meganz.png" />
</div>
<h3 translate="no">gd 2.2 .apk<br/>i Love piracy</h3>
</button>
</a>
<a href="https://nebo.mobi/tower/id/20284549">
<button title="Небоскрёб в игре Небоскрёбы">
<div class="logo_container">
Expand Down
154 changes: 68 additions & 86 deletions script.js
Original file line number Diff line number Diff line change
@@ -1,76 +1,67 @@
function create_enter_handle(element) {
return (e) => {
if ((e.keyCode ? e.keyCode : e.which) == '13' && document.activeElement === element) document.activeElement.click(e);
}
}
function wait(ms) { return new Promise(res => setTimeout(res, ms)); }
const createEnterHandle = (element) => (e) => { if ((e.keyCode ? e.keyCode : e.which) == '13' && document.activeElement === element) document.activeElement.click(e); }
const wait = (ms) => new Promise(res => setTimeout(res, ms));
const scrollIntoView = (el) => el["scrollIntoViewIfNeeded" in el ? "scrollIntoViewIfNeeded" : "scrollIntoView"]({ behavior: "smooth", block: "start" });
const setDisabledOfChildButtonsTo = (parent, state) => { for (const child of parent.children) child.disabled = state };

// https://stackoverflow.com/questions/24969383
function absorbEvent(event) {
var e = event || window.event;
let e = event || window.event;
e.preventDefault && e.preventDefault();
e.cancelBubble = true;
e.returnValue = false;
return false;
}

// if js is enabled in the browser replace all of the <a></a> elements with a button that was inside it
document.querySelectorAll(".buttons > a").forEach(unwrapAnchorButton)

function unwrapAnchorButton(anchor) {
const {
children: [button],
} = anchor;
const link = anchor.getAttribute("href");
if (button.nodeName && button.nodeName.toLowerCase() !== 'button') return;
if (link !== "#") {
button.setAttribute("onclick", `window.open(${JSON.stringify(link)})`);
}
anchor.replaceWith(button);
}

// if JS is enabled in the browser replace all of the <a></a> elements with a button that was inside it
document.querySelectorAll(".buttons > a").forEach((anchor) => {
const button = anchor.children[0];
const link = anchor.getAttribute("href");
if (button.nodeName && button.nodeName.toLowerCase() !== 'button') return;
if (link !== "#") button.setAttribute("onclick", `window.open(${JSON.stringify(link)})`);

anchor.replaceWith(button);
})

const bio_elem = document.querySelector("h3#bio");
const bio_elem = document.querySelector("h3#bio"),
uaflag = document.querySelector("span#ua_flag");

// passing true to element makes it return the age
function updateAge(element) {
const age = ~~((new Date() - new Date("2007-03-13T08:25:00+0200")) / (1000 * 60 * 60 * 24 * 365.25));
if (element === true) return age;
if (element === true) return age; // !!

if (element) return (element.innerText = age);
bio_elem.innerHTML = `a Ukrainian ${document.querySelector("span#ua_flag").outerHTML} <span id="age">${age}</span> y.o.`;
bio_elem.innerHTML = `a Ukrainian ${uaflag.outerHTML} <span id="age">${age}</span> y.o.`;
uaflag.remove()
}
try { updateAge(); } catch (e) {
alert("Failed while updating the age\nError: " + e);
console.error(e);
alert(`Age update error:\n${e?.stack??e}`);
}
const age = document.querySelector("span#age"),
onlyfans_btn = document.querySelector("button#onlyfans"),
btns = document.querySelector(".buttons");

let last,
font_size = 2;
onlyfans_btn.style.display = ""; // show the button if js enabled
let last, font_size = 2;
onlyfans_btn.style.display = "";// show if js enabled
onlyfans_btn.addEventListener("click", () => {
if (last) clearTimeout(last);
if (age) updateAge(age);
if (!age || age.innerText > 18) return window.open("https://media.tenor.com/iHAv4WoNo2kAAAAC/gotcha-bitch.gif");
age["scrollIntoViewIfNeeded" in age ? "scrollIntoViewIfNeeded" : "scrollIntoView"]
({ behavior: "smooth", block: "start" })
scrollIntoView(age);
if (font_size < 8) return (age.style = `font-size: ${(font_size *= 4)}rem;`);
age.style.animation = "look 2s";
age.addEventListener(
"animationend",
() => {
age.style.animation = "";
},
age.style.animation = ""
},
{ once: true }
);

// revert to normal font size
last = setTimeout(() => {
font_size = 1;
age.style = ``;
age.style = "";
last = undefined;
}, 10 * 1000);
});
Expand All @@ -82,39 +73,36 @@ const tg_btn = document.querySelector("button#tg"),
button_height = "4rem";

tg_btn.onclick = "";
tg_btn_arrow.style.display = ""; // show it for js users
tg_btns.style.display = ""; // show them for js users
tg_btn_arrow.style.display = ""; // show if js enabled
tg_btns.style.display = ""; // show if js enabled


function setDisabledOfChildButtonsTo(parent, state) {
for (const child of parent.children) child.disabled = state;
}

tg_btn.addEventListener("click", (e) => {
if (!tg_btn_arrow.matches(":hover, :focus")) return window.open(`https://t.me/paketmeqa`);
absorbEvent(e);
if /* close the fold */ (tg_btns.getAttribute("closed") === "false") {
tg_btn_arrow.style.transform = "rotate(0turn)";
tg_btns.setAttribute("closed", "true");
setDisabledOfChildButtonsTo(tg_btns, true);
tg_text_2.style = "width: 0px; opacity: 0; text-align: center; font-size: 0px";
tg_text_1.style = "width: 100%; opacity: 1;";
return
tg_btn_arrow.style.transform = "rotate(0turn)";
tg_btns.setAttribute("closed", "true");
setDisabledOfChildButtonsTo(tg_btns, true);
tg_text_2.style = "width: 0px; opacity: 0; text-align: center; font-size: 0px";
tg_text_1.style = "width: 100%; opacity: 1;";
return
}
/* open the fold */
tg_btn_arrow.style.transform = "rotate(-.25turn)";
tg_btns.setAttribute("closed", "false");
setDisabledOfChildButtonsTo(tg_btns, false);
tg_text_1.style = "width: 0px; opacity: 0; font-size: 0px;";
tg_text_2.style = "width: 100%; opacity: 1; text-align: center;";
setTimeout(() => tg_btns["scrollIntoViewIfNeeded" in tg_btns ? "scrollIntoViewIfNeeded" : "scrollIntoView"]
({ behavior: "smooth", block: "end" }), 300);
setTimeout(() => scrollIntoView(tg_btns), 300);
});

const x_btn = document.querySelector("button#x"),
close_btn = document.querySelector("button#x div:last-child"),
close_btn = document.querySelector("button#x div:last-child"),
btn_title = document.querySelector("button#x h3");

close_btn.style.display = "";
close_btn.style.display = ""; // show if js enabled
x_btn.appendChild(close_btn);
x_btn.onclick = "";
btn_title.innerHTML = btn_title.innerHTML.slice(0, -2);
Expand All @@ -128,41 +116,35 @@ x_btn.addEventListener("click", async () => {
});

const lib_text = document.getElementById("lib_text"),
src_btn = document.getElementById("src_btn");
let lib_text_enter_handle = create_enter_handle(lib_text)
src_btn = document.getElementById("src_btn");
let lib_text_enter_handle = createEnterHandle(lib_text)
function showSourceCodeButton(e) {
absorbEvent(e);
src_btn.style.opacity = "";
src_btn.style.position = "";
src_btn.style.height = "";
src_btn.setAttribute("tabindex", "0");
src_btn.focus();

lib_text.innerText = "made with no libraries";
lib_text.classList.remove("pointer");
lib_text.removeEventListener("click", showSourceCodeButton);
document.removeEventListener("keyup", lib_text_enter_handle);
lib_text.setAttribute("tabindex", "");
absorbEvent(e);
with (src_btn) {
style.opacity = "";
style.position = "";
style.height = "";
setAttribute("tabindex", "0");
focus();
}
with (lib_text) {
innerText = "made with no libraries";
classList.remove("pointer");
removeEventListener("click", showSourceCodeButton);
document.removeEventListener("keyup", lib_text_enter_handle);
setAttribute("tabindex", "");
}
};
src_btn.style.opacity = "0";
src_btn.style.position = "absolute";
src_btn.style.height = "0px";
src_btn.setAttribute("tabindex", "-1");
lib_text.setAttribute("tabindex", "0");
lib_text.classList.add("pointer");
lib_text.innerHTML = lib_text.innerHTML + "<br/>press me"
lib_text.addEventListener("click", showSourceCodeButton);
document.addEventListener("keyup", lib_text_enter_handle);

// FIRE IN THE HOLE !!!!!!!!!!!!!!!!!!!!
window.loadedSound = new Audio("./assets/sfx/Fire_in_the_hole_(ID4451).ogg");
loadedSound.load()

document.querySelectorAll("button#fireinthehole")
.forEach(button => button.addEventListener("click", async () => {
window.loadedSound.play()

window.loadedSound = window.loadedSound.cloneNode();
window.loadedSound.load()
})
);
with (src_btn) {
style.opacity = "0";
style.position = "absolute";
style.height = "0px";
setAttribute("tabindex", "-1");
}
with (lib_text) {
setAttribute("tabindex", "0");
classList.add("pointer");
innerHTML += "<br/>press me"
addEventListener("click", showSourceCodeButton);
document.addEventListener("keyup", lib_text_enter_handle);
}

0 comments on commit 8271684

Please sign in to comment.