From 27b13f9a7cfca223731f60731ae5f33388a9355d Mon Sep 17 00:00:00 2001 From: kovacsv Date: Sun, 10 Oct 2021 10:34:51 +0200 Subject: [PATCH] Custom checkbox and radio button style. --- website/o3dv/css/O3DVIcons/checkmark.svg | 41 ++++++++++++++++++++++ website/o3dv/css/controls.css | 44 ++++++++++++++++++++++++ website/o3dv/css/dialogs.css | 6 ---- website/o3dv/css/website.css | 6 ++++ website/o3dv/js/settingssidebarpanel.js | 4 +-- website/o3dv/js/sharingdialog.js | 7 ++-- 6 files changed, 97 insertions(+), 11 deletions(-) create mode 100644 website/o3dv/css/O3DVIcons/checkmark.svg diff --git a/website/o3dv/css/O3DVIcons/checkmark.svg b/website/o3dv/css/O3DVIcons/checkmark.svg new file mode 100644 index 0000000..a96c5d1 --- /dev/null +++ b/website/o3dv/css/O3DVIcons/checkmark.svg @@ -0,0 +1,41 @@ + + diff --git a/website/o3dv/css/controls.css b/website/o3dv/css/controls.css index 999a5a3..40b5a16 100644 --- a/website/o3dv/css/controls.css +++ b/website/o3dv/css/controls.css @@ -74,14 +74,58 @@ div.ov_tooltip box-shadow: var(--ov_shadow); } +input.ov_dialog_text +{ + color: var(--ov_dialog_foreground_color); + background: var(--ov_dialog_background_color); +} + input.ov_radio_button { margin-right: 10px; } +input.ov_radio_button +{ + position: relative; + top: 2px; + width: 14px; + height: 14px; + margin-right: 10px; + border: 1px solid var(--ov_foreground_color); + border-radius: 50%; + transition: 0.2s all linear; + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; +} + +input.ov_radio_button:checked +{ + border: 5px solid var(--ov_button_color); +} + input.ov_checkbox { + position: relative; + top: 4px; + width: 14px; + height: 14px; margin-right: 10px; + border-radius: 2px; + border: 1px solid var(--ov_foreground_color); + transition: 0.2s all linear; + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; +} + +input.ov_checkbox:checked +{ + background-color: var(--ov_button_color); + background-image: url('O3DVIcons/checkmark.svg'); + background-position: center; + border: 0px; } @media (hover) diff --git a/website/o3dv/css/dialogs.css b/website/o3dv/css/dialogs.css index c72255e..848167a 100644 --- a/website/o3dv/css/dialogs.css +++ b/website/o3dv/css/dialogs.css @@ -13,12 +13,6 @@ div.ov_dialog border-radius: 5px; } -div.ov_dialog input -{ - color: var(--ov_dialog_foreground_color); - background: var(--ov_dialog_background_color); -} - div.ov_dialog textarea { color: var(--ov_dialog_foreground_color); diff --git a/website/o3dv/css/website.css b/website/o3dv/css/website.css index 684f5ae..1c685ab 100644 --- a/website/o3dv/css/website.css +++ b/website/o3dv/css/website.css @@ -257,6 +257,12 @@ div.ov_sidebar_content div.ov_sidebar_settings_row } div.ov_sidebar_content div.ov_sidebar_settings_padded +{ + margin: 10px 0px 0px 40px; + float: left; +} + +div.ov_sidebar_content div.ov_sidebar_settings_comment { color: var(--ov_light_icon_color); margin: 10px 0px 0px 40px; diff --git a/website/o3dv/js/settingssidebarpanel.js b/website/o3dv/js/settingssidebarpanel.js index 9a4a2d2..8d825f5 100644 --- a/website/o3dv/js/settingssidebarpanel.js +++ b/website/o3dv/js/settingssidebarpanel.js @@ -99,10 +99,10 @@ OV.SettingsSidebarPanel = class extends OV.SidebarPanel ); onChange (ovColor); }); - $('
').addClass ('ov_sidebar_settings_padded').html (description).appendTo (contentDiv); + $('
').addClass ('ov_sidebar_settings_comment').html (description).appendTo (contentDiv); let warningDiv = null; if (warningText !== null) { - warningDiv = $('
').addClass ('ov_sidebar_settings_padded').appendTo (contentDiv); + warningDiv = $('
').addClass ('ov_sidebar_settings_comment').appendTo (contentDiv); OV.CreateSvgIcon (warningDiv, 'warning', 'left_inline light'); $('
').addClass ('ov_sidebar_settings_warning').html (warningText).appendTo (warningDiv); } diff --git a/website/o3dv/js/sharingdialog.js b/website/o3dv/js/sharingdialog.js index a83cbe3..4bf926a 100644 --- a/website/o3dv/js/sharingdialog.js +++ b/website/o3dv/js/sharingdialog.js @@ -3,8 +3,9 @@ OV.ShowSharingDialog = function (importer, settings, camera) function AddCheckboxLine (parentDiv, text, id, onChange) { let line = $('
').addClass ('ov_dialog_row').appendTo (parentDiv); - let check = $('').attr ('type', 'checkbox').attr ('checked', 'true').addClass ('ov_checkbox').attr ('id', id).appendTo (line); - $('