media no longer copied twice

This commit is contained in:
jetstream0
2023-11-06 05:25:47 +00:00
parent 59d2ffe544
commit ae0166b238
10 changed files with 122 additions and 43 deletions

View File

@@ -10,6 +10,13 @@
</head>
<body>
<div id="main">
<label for="show">Show:</label>
<select id="show" onchange="show_change()">
<option value="all" selected>All</option>
<option value="anime">Anime</option>
<option value="manga">Manga</option>
<option value="music">Music</option>
</select>
<div>
<ul>
[[ for:listings:listing ]]
@@ -18,5 +25,40 @@
</ul>
</div>
</div>
<script>
function show_change() {
const show_value = document.getElementById("show").value;
if (show_value === "all") {
document.querySelectorAll(".listing").forEach((l) => {
l.style.display = "list-item";
});
} else if (show_value === "anime") {
document.querySelectorAll(".listing").forEach((l) => {
if (l.classList.contains("anime-listing")) {
l.style.display = "list-item";
} else {
l.style.display = "none";
}
});
} else if (show_value === "manga") {
document.querySelectorAll(".listing").forEach((l) => {
if (l.classList.contains("manga-listing")) {
l.style.display = "list-item";
} else {
l.style.display = "none";
}
});
} else if (show_value === "music") {
document.querySelectorAll(".listing").forEach((l) => {
if (l.classList.contains("music-listing")) {
l.style.display = "list-item";
} else {
l.style.display = "none";
}
});
}
}
show_change();
</script>
</body>
</html>