From eaab18028842237c53d01c441a6c877522b40d71 Mon Sep 17 00:00:00 2001 From: Marat Fayzullin Date: Fri, 27 Oct 2023 20:35:28 -0400 Subject: [PATCH] Improving themes. --- htdocs/css/themes.css | 18 ++++++------------ htdocs/openwebrx.js | 8 +++++++- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/htdocs/css/themes.css b/htdocs/css/themes.css index 2000ce6f..18127a6d 100644 --- a/htdocs/css/themes.css +++ b/htdocs/css/themes.css @@ -29,8 +29,7 @@ .openwebrx-button-brown { background-color: #270700; - background: -webkit-gradient( linear, left top, left bottom, color-stop(0.0, #270700), color-stop(1, #3F1F00) ); - background: -moz-linear-gradient( center top, #270700 0%, #3F1F00 100% ); + background: linear-gradient(to bottom, #270700 0%, #3F1F00 100%); } .openwebrx-panel-red @@ -41,8 +40,7 @@ .openwebrx-button-red { background-color: #270000; - background: -webkit-gradient( linear, left top, left bottom, color-stop(0.0, #270000), color-stop(1, #3F0000) ); - background: -moz-linear-gradient( center top, #270000 0%, #3F0000 100% ); + background: linear-gradient(to bottom, #270000 0%, #3F0000 100%); } .openwebrx-panel-green @@ -53,8 +51,7 @@ .openwebrx-button-green { background-color: #001700; - background: -webkit-gradient( linear, left top, left bottom, color-stop(0.0, #001700), color-stop(1, #002F00) ); - background: -moz-linear-gradient( center top, #001700 0%, #002F00 100% ); + background: linear-gradient(to bottom, #001700 0%, #002F00 100%); } .openwebrx-panel-khaki @@ -65,8 +62,7 @@ .openwebrx-button-khaki { background-color: #171F07; - background: -webkit-gradient( linear, left top, left bottom, color-stop(0.0, #171F07), color-stop(1, #272F17) ); - background: -moz-linear-gradient( center top, #171F07 0%, #272F17 100% ); + background: linear-gradient(to bottom, #171F07 0%, #272F17 100%); } .openwebrx-panel-blue @@ -77,8 +73,7 @@ .openwebrx-button-blue { background-color: #000027; - background: -webkit-gradient( linear, left top, left bottom, color-stop(0.0, #000027), color-stop(1, #00003F) ); - background: -moz-linear-gradient( center top, #000027 0%, #00003F 100% ); + background: linear-gradient(to bottom, #000027 0%, #00003F 100%); } .openwebrx-panel-navy @@ -89,6 +84,5 @@ .openwebrx-button-navy { background-color: #001727; - background: -webkit-gradient( linear, left top, left bottom, color-stop(0.0, #001727), color-stop(1, #002F3F) ); - background: -moz-linear-gradient( center top, #001727 0%, #002F3F 100% ); + background: linear-gradient(to bottom, #001727 0%, #002F3F 100%); } diff --git a/htdocs/openwebrx.js b/htdocs/openwebrx.js index fd320d88..5e4ff498 100644 --- a/htdocs/openwebrx.js +++ b/htdocs/openwebrx.js @@ -37,6 +37,7 @@ var tuning_step = 1; var nr_enabled = false; var nr_threshold = 0; var swap_wheel = false; +var ui_theme = "default"; function updateVolume() { audioEngine.setVolume(parseFloat($("#openwebrx-panel-volume").val()) / 100); @@ -1142,7 +1143,8 @@ function on_ws_recv(evt) { } if ('ui_scheme' in config) { - set_ui_scheme(config['ui_scheme']); + ui_scheme = config['ui_scheme']; + set_ui_scheme(ui_scheme); } break; @@ -1241,6 +1243,7 @@ function on_ws_recv(evt) { break; case 'modes': Modes.setModes(json['value']); + set_ui_scheme(ui_scheme); break; default: console.warn('received message of unknown type: ' + json['type']); @@ -2028,14 +2031,17 @@ function set_ui_scheme(theme) { const themes = ['brown', 'red', 'green', 'khaki', 'blue', 'navy']; var $panels = $('.openwebrx-panel'); var $buttons = $('.openwebrx-button'); + var $lists = $('.openwebrx-panel select'); themes.forEach(function(theme) { $panels.removeClass('openwebrx-panel-' + theme); $buttons.removeClass('openwebrx-button-' + theme); + $lists.removeClass('openwebrx-button-' + theme); }); if (theme && (theme != '') && (theme != 'default')) { $panels.addClass('openwebrx-panel-' + theme); $buttons.addClass('openwebrx-button-' + theme); + $lists.addClass('openwebrx-button-' + theme); } }