Skip to content

armgit / my-yt

Public Imported from GitHub
0

A clean and minimal youtube frontend, without all the ads and whistles

JavaScript

fix: filter videos

Christian Feideb486a701ba
diff --git a/client/components/video-filters.js b/client/components/video-filters.js
index d9d6e3e..e4a787e 100644
--- a/client/components/video-filters.js
+++ b/client/components/video-filters.js
@@ -29,25 +29,16 @@ class VideoFilters extends HTMLElement {
`
}
handleDownloadedVideos(event) {
- this.reset()
event.target.classList.toggle('active')
document.body.classList.toggle('show-downloaded-videos')
}
handleSummarizedVideos(event) {
- this.reset()
event.target.classList.toggle('active')
document.body.classList.toggle('show-summarized-videos')
}
handleIgnoredVideos(event) {
- this.reset()
event.target.classList.toggle('active')
document.body.classList.toggle('show-ignored-videos')
}
- reset() {
- this.querySelectorAll('button').forEach(button => button.classList.remove('active'))
- document.body.classList.remove('show-downloaded-videos')
- document.body.classList.remove('show-summarized-videos')
- document.body.classList.remove('show-ignored-videos')
- }
}
customElements.define('video-filters', VideoFilters)
diff --git a/client/main.css b/client/main.css
index ae6f16e..338f3ed 100644
--- a/client/main.css
+++ b/client/main.css
@@ -409,7 +409,12 @@ body.searching [data-ignored="true"] {
display: block;
}
-
+.show-downloaded-videos.show-summarized-videos [data-downloaded="true"][data-summarized="true"] {
+ display: block !important;
+}
+.show-downloaded-videos.show-summarized-videos [data-downloaded="false"][data-summarized="false"] {
+ display: none !important;
+}