Update 1.js
This commit is contained in:
+17
-2
@@ -2,18 +2,33 @@
|
||||
let clickCount = 0;
|
||||
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", () => {
|
||||
clickCount++;
|
||||
|
||||
if (clickCount === 4) {
|
||||
navigator.clipboard.writeText("asdasd").then(() => {
|
||||
showNotification();
|
||||
loadFontAndShowNotification();
|
||||
});
|
||||
|
||||
clickCount = 0;
|
||||
clickCount = 0; // Sayaç sıfırla
|
||||
}
|
||||
});
|
||||
|
||||
// Bildirim fonksiyonu
|
||||
function showNotification() {
|
||||
const notification = document.createElement("div");
|
||||
notification.innerText = "Copied to Clipboard";
|
||||
|
||||
Reference in New Issue
Block a user