diff --git a/assets/css/default.css b/assets/css/default.css index f8b1c9f7..adde42a1 100644 --- a/assets/css/default.css +++ b/assets/css/default.css @@ -359,103 +359,48 @@ span > select { word-wrap: normal; } -/* - * Light theme - */ - +.dark-theme a:hover, +.dark-theme a:active, +.dark-theme summary:hover, .light-theme a:hover, .light-theme a:active, .light-theme summary:hover { - color: #075A9E !important; -} - -.light-theme a.pure-button-primary:hover { - color: #fff !important; -} - -.light-theme a { - color: #335d7a; - text-decoration: none; -} - -/* All links that do not fit with the default color goes here */ -.light-theme a:not([data-id]) > .icon, -.light-theme .pure-u-lg-1-5 > .h-box > a[href^="/watch?"], -.light-theme .playlist-restricted > ol > li > a { - color: #303030; -} - -.light-theme .pure-menu-heading { - color: #565d64; -} - -@media (prefers-color-scheme: light) { - .no-theme a:hover, - .no-theme a:active, - .no-theme summary:hover { - color: #075A9E !important; - } - - .no-theme a.pure-button-primary:hover { - color: #fff !important; - } - - .no-theme a { - color: #335d7a; - text-decoration: none; - } - - /* All links that do not fit with the default color goes here */ - .no-theme a:not([data-id]) > .icon, - .no-theme .pure-u-lg-1-5 > .h-box > a[href^="/watch?"], - .no-theme .playlist-restricted > ol > li > a { - color: #303030; - } - - .light-theme .pure-menu-heading { - color: #565d64; - } -} - -/* - * Dark theme - */ - -.dark-theme a:hover, -.dark-theme a:active, -.dark-theme summary:hover { color: rgb(0, 182, 240); } -.dark-theme a { +.dark-theme a, .light-theme a { color: #a0a0a0; text-decoration: none; } -body.dark-theme { +body.dark-theme, body.light-theme { background-color: rgba(35, 35, 35, 1); color: #f0f0f0; } -.dark-theme .pure-form legend { +.dark-theme .pure-form legend, .light-theme .pure-form legend { color: #f0f0f0; } -.dark-theme .pure-menu-heading { +.dark-theme .pure-menu-heading, .light-theme .pure-menu-heading { color: #f0f0f0; } .dark-theme input, .dark-theme select, -.dark-theme textarea { +.dark-theme textarea, +.light-theme input, +.light-theme select, +.light-theme textarea { color: rgba(35, 35, 35, 1); } -.dark-theme .pure-form input[type="file"] { +.dark-theme .pure-form input[type="file"], +.light-theme .pure-form input[type="file"] { color: #f0f0f0; } -.dark-theme .searchbar input { +.dark-theme .searchbar input, .searchbar input { background-color: inherit; color: inherit; } diff --git a/assets/css/keromod.css b/assets/css/keromod.css index d6907724..87dd96e0 100644 --- a/assets/css/keromod.css +++ b/assets/css/keromod.css @@ -28,7 +28,7 @@ body { .bgippan { background-color: rgba(0,0,0,.4); } -.dark-theme a { +.dark-theme a, .no-theme a, .light-theme a { color: #e599e5 !important; } #player-container { diff --git a/src/invidious/routes/before_all.cr b/src/invidious/routes/before_all.cr index 8e2a253f..0270ad9f 100644 --- a/src/invidious/routes/before_all.cr +++ b/src/invidious/routes/before_all.cr @@ -126,12 +126,10 @@ module Invidious::Routes::BeforeAll end end - dark_mode = convert_theme(env.params.query["dark_mode"]?) || preferences.dark_mode.to_s thin_mode = env.params.query["thin_mode"]? || preferences.thin_mode.to_s thin_mode = thin_mode == "true" locale = env.params.query["hl"]? || preferences.locale - preferences.dark_mode = dark_mode preferences.thin_mode = thin_mode preferences.locale = locale env.set "preferences", preferences diff --git a/src/invidious/routes/preferences.cr b/src/invidious/routes/preferences.cr index 570cba69..7d7ac6ce 100644 --- a/src/invidious/routes/preferences.cr +++ b/src/invidious/routes/preferences.cr @@ -225,46 +225,6 @@ module Invidious::Routes::PreferencesRoute env.redirect referer end - def self.toggle_theme(env) - locale = env.get("preferences").as(Preferences).locale - referer = get_referer(env, unroll: false) - - redirect = env.params.query["redirect"]? - redirect ||= "true" - redirect = redirect == "true" - - if user = env.get? "user" - user = user.as(User) - - case user.preferences.dark_mode - when "dark" - user.preferences.dark_mode = "light" - else - user.preferences.dark_mode = "dark" - end - - Invidious::Database::Users.update_preferences(user) - else - preferences = env.get("preferences").as(Preferences) - - case preferences.dark_mode - when "dark" - preferences.dark_mode = "light" - else - preferences.dark_mode = "dark" - end - - env.response.cookies["PREFS"] = Invidious::User::Cookies.prefs(CONFIG.domain, preferences) - end - - if redirect - env.redirect referer - else - env.response.content_type = "application/json" - "{}" - end - end - def self.data_control(env) locale = env.get("preferences").as(Preferences).locale diff --git a/src/invidious/routing.cr b/src/invidious/routing.cr index 9e2ade3d..867cdb5d 100644 --- a/src/invidious/routing.cr +++ b/src/invidious/routing.cr @@ -62,7 +62,6 @@ module Invidious::Routing # User preferences get "/preferences", Routes::PreferencesRoute, :show post "/preferences", Routes::PreferencesRoute, :update - get "/toggle_theme", Routes::PreferencesRoute, :toggle_theme get "/data_control", Routes::PreferencesRoute, :data_control post "/data_control", Routes::PreferencesRoute, :update_data_control diff --git a/src/invidious/user/converters.cr b/src/invidious/user/converters.cr index dcbf8c53..53427bd5 100644 --- a/src/invidious/user/converters.cr +++ b/src/invidious/user/converters.cr @@ -3,7 +3,7 @@ def convert_theme(theme) when "true" "dark" when "false" - "light" + "dark" when "", nil nil else diff --git a/src/invidious/user/preferences.cr b/src/invidious/user/preferences.cr index b3059403..0766bef6 100644 --- a/src/invidious/user/preferences.cr +++ b/src/invidious/user/preferences.cr @@ -74,7 +74,7 @@ struct Preferences if value.read_bool "dark" else - "light" + "dark" end end end @@ -92,7 +92,7 @@ struct Preferences when "true" "dark" when "false" - "light" + "dark" when "" CONFIG.default_user_preferences.dark_mode else diff --git a/src/invidious/views/add_playlist_items.ecr b/src/invidious/views/add_playlist_items.ecr index bcba74cf..afc7a1a3 100644 --- a/src/invidious/views/add_playlist_items.ecr +++ b/src/invidious/views/add_playlist_items.ecr @@ -1,5 +1,5 @@ <% content_for "header" do %> -<%= playlist.title %> - Invidious +<%= playlist.title %> - オワコンYouTube <% end %> diff --git a/src/invidious/views/channel.ecr b/src/invidious/views/channel.ecr index 6e62a471..bf00038a 100644 --- a/src/invidious/views/channel.ecr +++ b/src/invidious/views/channel.ecr @@ -20,7 +20,7 @@ <% content_for "header" do %> <%- if selected_tab.videos? -%> - + @@ -34,7 +34,7 @@ <%- end -%> -<%= author %> - Invidious +<%= author %> - オワコンYouTube <% end %> <%= rendered "components/channel_info" %> diff --git a/src/invidious/views/community.ecr b/src/invidious/views/community.ecr index 9e11d562..fb731e84 100644 --- a/src/invidious/views/community.ecr +++ b/src/invidious/views/community.ecr @@ -12,7 +12,7 @@ <% content_for "header" do %> -<%= author %> - Invidious +<%= author %> - オワコンYouTube <% end %> <%= rendered "components/channel_info" %> diff --git a/src/invidious/views/create_playlist.ecr b/src/invidious/views/create_playlist.ecr index 807244e6..ff6296ce 100644 --- a/src/invidious/views/create_playlist.ecr +++ b/src/invidious/views/create_playlist.ecr @@ -1,5 +1,5 @@ <% content_for "header" do %> -<%= translate(locale, "Create playlist") %> - Invidious +<%= translate(locale, "Create playlist") %> - オワコンYouTube <% end %>
diff --git a/src/invidious/views/delete_playlist.ecr b/src/invidious/views/delete_playlist.ecr index cd66b963..03c9c0e0 100644 --- a/src/invidious/views/delete_playlist.ecr +++ b/src/invidious/views/delete_playlist.ecr @@ -1,5 +1,5 @@ <% content_for "header" do %> -<%= translate(locale, "Delete playlist") %> - Invidious +<%= translate(locale, "Delete playlist") %> - オワコンYouTube <% end %>
diff --git a/src/invidious/views/edit_playlist.ecr b/src/invidious/views/edit_playlist.ecr index 548104c8..128ed44e 100644 --- a/src/invidious/views/edit_playlist.ecr +++ b/src/invidious/views/edit_playlist.ecr @@ -1,7 +1,7 @@ <% title = HTML.escape(playlist.title) %> <% content_for "header" do %> -<%= title %> - Invidious +<%= title %> - オワコンYouTube <% end %> diff --git a/src/invidious/views/embed.ecr b/src/invidious/views/embed.ecr index 1bf5cc3e..192a8090 100644 --- a/src/invidious/views/embed.ecr +++ b/src/invidious/views/embed.ecr @@ -10,7 +10,7 @@ - <%= HTML.escape(video.title) %> - Invidious + <%= HTML.escape(video.title) %> - オワコンYouTube diff --git a/src/invidious/views/error.ecr b/src/invidious/views/error.ecr index 04eb74d5..1559d53e 100644 --- a/src/invidious/views/error.ecr +++ b/src/invidious/views/error.ecr @@ -1,5 +1,5 @@ <% content_for "header" do %> -<%= "Error" %> - Invidious +<%= "Error" %> - オワコンYouTube <% end %>
diff --git a/src/invidious/views/feeds/history.ecr b/src/invidious/views/feeds/history.ecr index 471d21db..bac444d3 100644 --- a/src/invidious/views/feeds/history.ecr +++ b/src/invidious/views/feeds/history.ecr @@ -1,5 +1,5 @@ <% content_for "header" do %> -<%= translate(locale, "History") %> - Invidious +<%= translate(locale, "History") %> - オワコンYouTube <% end %>
diff --git a/src/invidious/views/feeds/playlists.ecr b/src/invidious/views/feeds/playlists.ecr index e52a7707..a10f7473 100644 --- a/src/invidious/views/feeds/playlists.ecr +++ b/src/invidious/views/feeds/playlists.ecr @@ -1,5 +1,5 @@ <% content_for "header" do %> -<%= translate(locale, "Playlists") %> - Invidious +<%= translate(locale, "Playlists") %> - オワコンYouTube <% end %> <%= rendered "components/feed_menu" %> diff --git a/src/invidious/views/feeds/popular.ecr b/src/invidious/views/feeds/popular.ecr index 5fbe539c..7a5d4c33 100644 --- a/src/invidious/views/feeds/popular.ecr +++ b/src/invidious/views/feeds/popular.ecr @@ -2,9 +2,9 @@ "> <% if env.get("preferences").as(Preferences).default_home != "Popular" %> - <%= translate(locale, "Popular") %> - Invidious + <%= translate(locale, "Popular") %> - オワコンYouTube <% else %> - Invidious + オワコンYouTube <% end %> <% end %> diff --git a/src/invidious/views/feeds/subscriptions.ecr b/src/invidious/views/feeds/subscriptions.ecr index 9c69c5b0..be8f0061 100644 --- a/src/invidious/views/feeds/subscriptions.ecr +++ b/src/invidious/views/feeds/subscriptions.ecr @@ -1,5 +1,5 @@ <% content_for "header" do %> -<%= translate(locale, "Subscriptions") %> - Invidious +<%= translate(locale, "Subscriptions") %> - オワコンYouTube <% end %> diff --git a/src/invidious/views/feeds/trending.ecr b/src/invidious/views/feeds/trending.ecr index 7dc416c6..0df361e8 100644 --- a/src/invidious/views/feeds/trending.ecr +++ b/src/invidious/views/feeds/trending.ecr @@ -2,9 +2,9 @@ "> <% if env.get("preferences").as(Preferences).default_home != "Trending" %> - <%= translate(locale, "Trending") %> - Invidious + <%= translate(locale, "Trending") %> - オワコンYouTube <% else %> - Invidious + オワコンYouTube <% end %> <% end %> diff --git a/src/invidious/views/hashtag.ecr b/src/invidious/views/hashtag.ecr index 3351c21c..f3c1f669 100644 --- a/src/invidious/views/hashtag.ecr +++ b/src/invidious/views/hashtag.ecr @@ -1,5 +1,5 @@ <% content_for "header" do %> -<%= HTML.escape(hashtag) %> - Invidious +<%= HTML.escape(hashtag) %> - オワコンYouTube <% end %>
diff --git a/src/invidious/views/message.ecr b/src/invidious/views/message.ecr index 8c7bf611..e4e82742 100644 --- a/src/invidious/views/message.ecr +++ b/src/invidious/views/message.ecr @@ -1,7 +1,7 @@ <% content_for "header" do %> "> - Invidious + オワコンYouTube <% end %> diff --git a/src/invidious/views/mix.ecr b/src/invidious/views/mix.ecr index e55b00f8..1062180b 100644 --- a/src/invidious/views/mix.ecr +++ b/src/invidious/views/mix.ecr @@ -1,5 +1,5 @@ <% content_for "header" do %> -<%= HTML.escape(mix.title) %> - Invidious +<%= HTML.escape(mix.title) %> - オワコンYouTube <% end %>
diff --git a/src/invidious/views/playlist.ecr b/src/invidious/views/playlist.ecr index a04acf4c..028136a2 100644 --- a/src/invidious/views/playlist.ecr +++ b/src/invidious/views/playlist.ecr @@ -2,7 +2,7 @@ <% author = HTML.escape(playlist.author) %> <% content_for "header" do %> -<%= title %> - Invidious +<%= title %> - オワコンYouTube <% end %> diff --git a/src/invidious/views/privacy.ecr b/src/invidious/views/privacy.ecr index 0bb02ba5..182b40b4 100644 --- a/src/invidious/views/privacy.ecr +++ b/src/invidious/views/privacy.ecr @@ -1,5 +1,5 @@ <% content_for "header" do %> -Privacy Policy - Invidious +Privacy Policy - オワコンYouTube <% end %>
diff --git a/src/invidious/views/search.ecr b/src/invidious/views/search.ecr index a7469e36..55e79d08 100644 --- a/src/invidious/views/search.ecr +++ b/src/invidious/views/search.ecr @@ -1,5 +1,5 @@ <% content_for "header" do %> -<%= query.text.size > 30 ? HTML.escape(query.text[0,30].rstrip(".")) + "…" : HTML.escape(query.text) %> - Invidious +<%= query.text.size > 30 ? HTML.escape(query.text[0,30].rstrip(".")) + "…" : HTML.escape(query.text) %> - オワコンYouTube <% end %> diff --git a/src/invidious/views/search_homepage.ecr b/src/invidious/views/search_homepage.ecr index 2424a1cf..f7358b0f 100644 --- a/src/invidious/views/search_homepage.ecr +++ b/src/invidious/views/search_homepage.ecr @@ -1,7 +1,7 @@ <% content_for "header" do %> "> - Invidious - <%= translate(locale, "search") %> + オワコンYouTube - <%= translate(locale, "search") %> <% end %> @@ -10,7 +10,7 @@