Update 1.js
This commit is contained in:
+17
-2
@@ -2,18 +2,33 @@
|
|||||||
let clickCount = 0;
|
let clickCount = 0;
|
||||||
const container = document.getElementById("container_4");
|
const container = document.getElementById("container_4");
|
||||||
|
|
||||||
|
// Fontu yükle ve bildirimi göster
|
||||||
|
function loadFontAndShowNotification() {
|
||||||
|
const font = new FontFace('Monomakh', 'url("/FONTS/Monomakh.woff2") format("woff2")');
|
||||||
|
|
||||||
|
font.load().then((loadedFont) => {
|
||||||
|
document.fonts.add(loadedFont);
|
||||||
|
showNotification();
|
||||||
|
}).catch((err) => {
|
||||||
|
console.error("Font yüklenirken hata oluştu:", err);
|
||||||
|
showNotification(); // Font yüklenmese bile bildirim gösterilsin
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tıklama event'i
|
||||||
container.addEventListener("click", () => {
|
container.addEventListener("click", () => {
|
||||||
clickCount++;
|
clickCount++;
|
||||||
|
|
||||||
if (clickCount === 4) {
|
if (clickCount === 4) {
|
||||||
navigator.clipboard.writeText("asdasd").then(() => {
|
navigator.clipboard.writeText("asdasd").then(() => {
|
||||||
showNotification();
|
loadFontAndShowNotification();
|
||||||
});
|
});
|
||||||
|
|
||||||
clickCount = 0;
|
clickCount = 0; // Sayaç sıfırla
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Bildirim fonksiyonu
|
||||||
function showNotification() {
|
function showNotification() {
|
||||||
const notification = document.createElement("div");
|
const notification = document.createElement("div");
|
||||||
notification.innerText = "Panoya Kopyalandı";
|
notification.innerText = "Panoya Kopyalandı";
|
||||||
|
|||||||
Reference in New Issue
Block a user