feat(archive): add retro theme support to archive browser
Implement retro-themed styling and classic pixelated icons for the archive browser when the "retro" theme is active. Changes include: - Adding CSS overrides for `[data-theme="retro"]` to style the archive browser container, tree nodes, and hover states. - Updating the JS preview script to dynamically append retro image icons (e.g., classic shell32/zipfldr icons) alongside SVGs. - Toggling visibility between SVG and retro image icons using CSS based on the active theme.
This commit is contained in:
@@ -707,7 +707,17 @@
|
||||
var element = document.createElement("span");
|
||||
element.className = "archive-file-icon archive-file-icon-" + icon;
|
||||
element.setAttribute("aria-hidden", "true");
|
||||
element.innerHTML = archiveIconSVG(icon);
|
||||
element.innerHTML = '<span class="archive-svg-icon">' + archiveIconSVG(icon) + '</span>';
|
||||
var retroURL = archiveRetroIconURL(icon);
|
||||
if (retroURL) {
|
||||
var retro = document.createElement("img");
|
||||
retro.className = "archive-retro-icon";
|
||||
retro.src = retroURL;
|
||||
retro.alt = "";
|
||||
retro.decoding = "async";
|
||||
retro.loading = "lazy";
|
||||
element.appendChild(retro);
|
||||
}
|
||||
return element;
|
||||
}
|
||||
|
||||
@@ -758,6 +768,21 @@
|
||||
return icons[icon] || icons.file;
|
||||
}
|
||||
|
||||
function archiveRetroIconURL(icon) {
|
||||
var base = "/static/file-icons/retro/";
|
||||
var icons = {
|
||||
folder: "directory_open_file_mydocs-4.png",
|
||||
img: "shimgvw.dll_14_1-2.png",
|
||||
vid: "wmploc.dll_14_504-2.png",
|
||||
aud: "wmploc.dll_14_610-2.png",
|
||||
txt: "shell32.dll_14_151-2.png",
|
||||
code: "mshtml.dll_14_2660-2.png",
|
||||
arc: "zipfldr.dll_14_101-2.png",
|
||||
file: "shell32.dll_14_152-2.png"
|
||||
};
|
||||
return base + (icons[icon] || icons.file);
|
||||
}
|
||||
|
||||
function formatArchiveCount(value, label) {
|
||||
value = Number(value || 0);
|
||||
return value + " " + label + (value === 1 ? "" : "s");
|
||||
|
||||
Reference in New Issue
Block a user