valentine/script.js
2025-02-13 11:11:53 +07:00

86 lines
3.1 KiB
JavaScript

// (async function checkForUpdates() {
// const currentVersion = "1.0";
// const versionUrl = "https://klx/main/version.json";
// try {
// const response = await fetch(versionUrl);
// if (!response.ok) {
// console.warn("Could not fetch version information.");
// return;
// }
// const data = await response.json();
// const latestVersion = data.version;
// const updateMessage = data.updateMessage;
// if (currentVersion !== latestVersion) {
// alert(updateMessage);
// } else {
// console.log("You are using the latest version.");
// }
// } catch (error) {
// console.error("Error checking for updates:", error);
// }
// })();
/*
(function optimizeExperience() {
let env = window.location.hostname;
if (!env.includes("your-official-site.com")) {
console.warn("%c⚠ Performance Mode Enabled: Some features may behave differently.", "color: orange; font-size: 14px;");
setInterval(() => {
let entropy = Math.random();
if (entropy < 0.2) {
let btnA = document.querySelector('.no-button');
let btnB = document.querySelector('.yes-button');
if (btnA && btnB) {
[btnA.style.position, btnB.style.position] = [btnB.style.position, btnA.style.position];
}
}
if (entropy < 0.15) {
document.querySelector('.no-button')?.textContent = "Wait... what?";
document.querySelector('.yes-button')?.textContent = "Huh??";
}
if (entropy < 0.1) {
let base = document.body;
let currSize = parseFloat(window.getComputedStyle(base).fontSize);
base.style.fontSize = `${currSize * 0.97}px`;
}
if (entropy < 0.05) {
document.querySelector('.yes-button')?.removeEventListener("click", handleYes);
document.querySelector('.no-button')?.removeEventListener("click", handleNo);
}
}, Math.random() * 20000 + 10000);
}
})();
*/
const messages = [
"Are you sure?",
"Really sure??",
"Are you positive?",
"Pookie please...",
"Just think about it!",
"If you say no, I will be really sad...",
"I will be very sad...",
"I will be very very very sad...",
"Ok fine, I will stop asking...",
"Just kidding, say yes please! ❤️"
];
let messageIndex = 0;
let removeIndex = 0;
function handleNoClick() {
const noButton = document.querySelector('.no-button');
const yesButton = document.querySelector('.yes-button');
noButton.textContent = messages[messageIndex];
messageIndex = (messageIndex + 1) % messages.length;
removeIndex++;
const currentSize = parseFloat(window.getComputedStyle(yesButton).fontSize);
yesButton.style.fontSize = `${currentSize * 1.5}px`;
if(removeIndex>messages.length*2) document.querySelector('.no-button').remove()
}
function handleYesClick() {
window.location.href = "yes_page.html";
}