Update
This commit is contained in:
27
app.js
27
app.js
@@ -128,9 +128,36 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------
|
||||
* Discord Copy-to-Clipboard Button
|
||||
* ------------------------------------------------------------------ */
|
||||
function initDiscordCopy() {
|
||||
var copyBtn = document.getElementById("copy-discord");
|
||||
var copyText = document.getElementById("copy-text");
|
||||
var discordTag = document.getElementById("discord-tag");
|
||||
|
||||
if (!copyBtn || !discordTag) return;
|
||||
|
||||
copyBtn.addEventListener("click", function () {
|
||||
var textToCopy = discordTag.innerText.trim();
|
||||
navigator.clipboard.writeText(textToCopy).then(function () {
|
||||
copyText.innerText = "Kopiert! ✓";
|
||||
copyBtn.classList.add("copied");
|
||||
setTimeout(function () {
|
||||
copyText.innerText = "Kopieren";
|
||||
copyBtn.classList.remove("copied");
|
||||
}, 2000);
|
||||
}).catch(function () {
|
||||
// Fallback
|
||||
copyText.innerText = "Fehler";
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
loadYouTube();
|
||||
loadTwitch();
|
||||
initNavigation();
|
||||
initDiscordCopy();
|
||||
});
|
||||
})();
|
||||
Reference in New Issue
Block a user