feat: add UMass Amherst theme support, implement HTML snippet management system, and update page rendering logic

This commit is contained in:
2026-07-06 23:50:55 +07:00
parent 3dc5a03484
commit e6d98edc45
364 changed files with 9967 additions and 36960 deletions
+26
View File
@@ -0,0 +1,26 @@
(function (el) {
if (!el) {
console.error("Vui lòng chọn thẻ HTML bên tab Elements trước!");
return;
}
const clone = el.cloneNode(true);
function applyStyles(original, cloned) {
const computed = window.getComputedStyle(original);
let styleString = "";
for (let i = 0; i < computed.length; i++) {
const prop = computed[i];
const val = computed.getPropertyValue(prop);
if (val && val !== "none" && val !== "normal" && val !== "auto") {
styleString += `${prop}: ${val}; `;
}
}
cloned.setAttribute("style", styleString);
// Đệ quy quét qua tất cả các con, cháu bên trong để áp dụng CSS
for (let i = 0; i < original.children.length; i++) {
applyStyles(original.children[i], cloned.children[i]);
}
}
applyStyles(el, clone);
copy(clone.outerHTML);
console.log("👉 Đã copy thành công cả THẺ CHA & CÁC THẺ CON kèm CSS!");
})($0);