Update 1.js

This commit is contained in:
FURK4NGG
2025-03-01 07:50:27 +03:00
committed by GitHub
parent ca3f8a0438
commit 8c9933b712
+65 -50
View File
@@ -1,53 +1,68 @@
/*LOCATION SAVER*/ /*LOCATION SAVER*/
let clickCount = 0; let clickCount = 0;
const container = document.getElementById("container_4"); const container = document.getElementById("container_4");
container.addEventListener("click", () => { // Fontu yükle ve bildirimi göster
clickCount++; function loadFontAndShowNotification() {
const font = new FontFace('Monomakh', 'url("/FONTS/Monomakh.woff2") format("woff2")');
if (clickCount === 4) {
navigator.clipboard.writeText("asdasd").then(() => { font.load().then((loadedFont) => {
showNotification(); document.fonts.add(loadedFont);
}); showNotification();
}).catch((err) => {
clickCount = 0; console.error("Font yüklenirken hata oluştu:", err);
} showNotification(); // Font yüklenmese bile bildirim gösterilsin
}); });
}
function showNotification() {
const notification = document.createElement("div"); // Tıklama event'i
notification.innerText = "Panoya Kopyalandı"; container.addEventListener("click", () => {
notification.style.position = "fixed"; clickCount++;
notification.style.bottom = "-60px"; // İlk başta aşağıda
notification.style.left = "50%"; if (clickCount === 4) {
notification.style.transform = "translateX(-50%)"; navigator.clipboard.writeText("asdasd").then(() => {
notification.style.background = "#333"; loadFontAndShowNotification();
notification.style.color = "#fff"; });
notification.style.padding = "12px 24px";
notification.style.borderRadius = "20px"; // Kenarları oval clickCount = 0; // Sayaç sıfırla
notification.style.boxShadow = "0 4px 6px rgba(0, 0, 0, 0.1)"; }
notification.style.transition = "bottom 0.4s ease-in-out"; });
notification.style.zIndex = "9999";
notification.style.fontFamily = '"Monomakh", serif'; // Bildirim fonksiyonu
notification.style.fontSize = "1.3rem"; function showNotification() {
const notification = document.createElement("div");
document.body.appendChild(notification); notification.innerText = "Panoya Kopyalandı";
notification.style.position = "fixed";
// Bildirimi yukarı kaydır notification.style.bottom = "-60px"; // İlk başta aşağıda
setTimeout(() => { notification.style.left = "50%";
notification.style.bottom = "20px"; notification.style.transform = "translateX(-50%)";
}, 100); notification.style.background = "#333";
notification.style.color = "#fff";
// 2 saniye sonra aşağı kaydır ve sil notification.style.padding = "12px 24px";
setTimeout(() => { notification.style.borderRadius = "20px"; // Kenarları oval
notification.style.bottom = "-60px"; notification.style.boxShadow = "0 4px 6px rgba(0, 0, 0, 0.1)";
setTimeout(() => { notification.style.transition = "bottom 0.4s ease-in-out";
notification.remove(); notification.style.zIndex = "9999";
}, 500); notification.style.fontFamily = '"Monomakh", serif';
}, 2000); notification.style.fontSize = "1.3rem";
}
document.body.appendChild(notification);
// Bildirimi yukarı kaydır
setTimeout(() => {
notification.style.bottom = "20px";
}, 100);
// 2 saniye sonra aşağı kaydır ve sil
setTimeout(() => {
notification.style.bottom = "-60px";
setTimeout(() => {
notification.remove();
}, 500);
}, 2000);
}
/*CHANGE THEME*/ /*CHANGE THEME*/
const observer = new MutationObserver(() => { const observer = new MutationObserver(() => {
const isDark = document.body.classList.contains("darkmode--activated"); const isDark = document.body.classList.contains("darkmode--activated");