diff --git a/assets/css/default.css b/assets/css/default.css index 793295d9..a76ecd48 100644 --- a/assets/css/default.css +++ b/assets/css/default.css @@ -495,7 +495,8 @@ video.video-js { */ .light-theme a:hover, -.light-theme a:active { +.light-theme a:active, +.light-theme summary:hover { color: #075A9E !important; } @@ -521,7 +522,8 @@ video.video-js { @media (prefers-color-scheme: light) { .no-theme a:hover, - .no-theme a:active { + .no-theme a:active, + .no-theme summary:hover { color: #075A9E !important; } @@ -551,7 +553,8 @@ video.video-js { */ .dark-theme a:hover, -.dark-theme a:active { +.dark-theme a:active, +.dark-theme summary:hover { color: rgb(0, 182, 240); } @@ -629,5 +632,25 @@ body.dark-theme { } #filters { - display: none; -} \ No newline at end of file + display: inline; + margin-top: 15px; +} + +#filters > div { + display: inline-block; +} + +#filters > summary { + display: inline-block; + margin-bottom: 15px; +} + +#filters > summary::before { + content: "[ + ]"; + font-size: 1.5em; +} + +#filters[open] > summary::before { + content: "[ - ]"; + font-size: 1.5em; +} diff --git a/assets/js/search.js b/assets/js/search.js deleted file mode 100644 index 36edd053..00000000 --- a/assets/js/search.js +++ /dev/null @@ -1,13 +0,0 @@ -function toggle_comments(event) { - var target = event.target; - var body = document.getElementById('filters'); - if (body.style.display === 'flex') { - target.innerHTML = '[ + ]'; - body.style.display = 'none'; - } else { - target.innerHTML = '[ - ]'; - body.style.display = 'flex'; - } -} - -document.getElementById('togglefilters').onclick = toggle_comments; \ No newline at end of file diff --git a/src/invidious/views/search.ecr b/src/invidious/views/search.ecr index 3fa9242b..fefc9fbb 100644 --- a/src/invidious/views/search.ecr +++ b/src/invidious/views/search.ecr @@ -2,99 +2,92 @@ <%= search_query.not_nil!.size > 30 ? HTML.escape(query.not_nil![0,30].rstrip(".") + "...") : HTML.escape(query.not_nil!) %> - Invidious <% end %> -

- [ + ] - <%= translate(locale, "filter") %> -

- - -
-
- <%= translate(locale, "date") %> -
- <% ["hour", "today", "week", "month", "year"].each do |date| %> -
- <% if operator_hash.fetch("date", "all") == date %> - <%= translate(locale, date) %> - <% else %> - &page=<%= page %>"> - <%= translate(locale, date) %> - - <% end %> -
- <% end %> +
+ +

<%= translate(locale, "filter") %>

+
+
+
+ <%= translate(locale, "date") %> +
+ <% ["hour", "today", "week", "month", "year"].each do |date| %> +
+ <% if operator_hash.fetch("date", "all") == date %> + <%= translate(locale, date) %> + <% else %> + &page=<%= page %>"> + <%= translate(locale, date) %> + + <% end %> +
+ <% end %> +
+
+ <%= translate(locale, "content_type") %> +
+ <% ["video", "channel", "playlist", "movie", "show"].each do |content_type| %> +
+ <% if operator_hash.fetch("content_type", "all") == content_type %> + <%= translate(locale, content_type) %> + <% else %> + &page=<%= page %>"> + <%= translate(locale, content_type) %> + + <% end %> +
+ <% end %> +
+
+ <%= translate(locale, "duration") %> +
+ <% ["short", "long"].each do |duration| %> +
+ <% if operator_hash.fetch("duration", "all") == duration %> + <%= translate(locale, duration) %> + <% else %> + &page=<%= page %>"> + <%= translate(locale, duration) %> + + <% end %> +
+ <% end %> +
+
+ <%= translate(locale, "features") %> +
+ <% ["hd", "subtitles", "creative_commons", "3d", "live", "purchased", "4k", "360", "location", "hdr"].each do |feature| %> +
+ <% if operator_hash.fetch("features", "all").includes?(feature) %> + <%= translate(locale, feature) %> + <% elsif operator_hash.has_key?("features") %> + &page=<%= page %>"> + <%= translate(locale, feature) %> + + <% else %> + &page=<%= page %>"> + <%= translate(locale, feature) %> + + <% end %> +
+ <% end %> +
+
+ <%= translate(locale, "sort") %> +
+ <% ["relevance", "rating", "date", "views"].each do |sort| %> +
+ <% if operator_hash.fetch("sort", "relevance") == sort %> + <%= translate(locale, sort) %> + <% else %> + &page=<%= page %>"> + <%= translate(locale, sort) %> + + <% end %> +
+ <% end %> +
-
- <%= translate(locale, "content_type") %> -
- <% ["video", "channel", "playlist", "movie", "show"].each do |content_type| %> -
- <% if operator_hash.fetch("content_type", "all") == content_type %> - <%= translate(locale, content_type) %> - <% else %> - &page=<%= page %>"> - <%= translate(locale, content_type) %> - - <% end %> -
- <% end %> -
-
- <%= translate(locale, "duration") %> -
- <% ["short", "long"].each do |duration| %> -
- <% if operator_hash.fetch("duration", "all") == duration %> - <%= translate(locale, duration) %> - <% else %> - &page=<%= page %>"> - <%= translate(locale, duration) %> - - <% end %> -
- <% end %> -
-
- <%= translate(locale, "features") %> -
- <% ["hd", "subtitles", "creative_commons", "3d", "live", "purchased", "4k", "360", "location", "hdr"].each do |feature| %> -
- <% if operator_hash.fetch("features", "all").includes?(feature) %> - <%= translate(locale, feature) %> - <% elsif operator_hash.has_key?("features") %> - &page=<%= page %>"> - <%= translate(locale, feature) %> - - <% else %> - &page=<%= page %>"> - <%= translate(locale, feature) %> - - <% end %> -
- <% end %> -
-
- <%= translate(locale, "sort") %> -
- <% ["relevance", "rating", "date", "views"].each do |sort| %> -
- <% if operator_hash.fetch("sort", "relevance") == sort %> - <%= translate(locale, sort) %> - <% else %> - &page=<%= page %>"> - <%= translate(locale, sort) %> - - <% end %> -
- <% end %> -
-
+
@@ -141,4 +134,3 @@ <% end %>
- \ No newline at end of file