Switch to Ametrine
This commit is contained in:
parent
8d2b031b5a
commit
53353f0a94
76 changed files with 6164 additions and 2645 deletions
|
@ -10,18 +10,27 @@ document.addEventListener("DOMContentLoaded", function () {
|
|||
title.innerHTML = lang;
|
||||
|
||||
// Copy button icon
|
||||
let icon = document.createElement("i");
|
||||
icon.classList.add("icon");
|
||||
let iconCopy = document.createElement("i");
|
||||
iconCopy.classList.add("ph-bold", "ph-copy");
|
||||
|
||||
let iconCheck = document.createElement("i");
|
||||
iconCheck.classList.add("ph-bold", "ph-check-square-offset");
|
||||
|
||||
// Copy button
|
||||
let button = document.createElement("button");
|
||||
let copyCodeText = document.getElementById("copy-code-text").textContent;
|
||||
button.setAttribute("title", copyCodeText)
|
||||
button.appendChild(icon);
|
||||
button.setAttribute("title", copyCodeText);
|
||||
button.appendChild(iconCopy);
|
||||
button.appendChild(iconCheck);
|
||||
|
||||
// Code block header
|
||||
let header = document.createElement("div");
|
||||
header.classList.add("header");
|
||||
|
||||
if (block.classList.contains("z-code")) {
|
||||
header.classList.add("z-code");
|
||||
}
|
||||
|
||||
header.appendChild(title);
|
||||
header.appendChild(button);
|
||||
|
||||
|
@ -35,7 +44,7 @@ document.addEventListener("DOMContentLoaded", function () {
|
|||
container.appendChild(block);
|
||||
|
||||
button.addEventListener("click", async () => {
|
||||
await copyCode(block, header, button); // Pass the button here
|
||||
await copyCode(block, header, button);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue