Interactive interface for browsing global, full-resolution satellite imagery
Simplified radio buttons for palette selection. No longer uses a <span> tag to create blue 'checked' radio button. Now uses CSS to fill in radio button. Created new radio.scss file.
Jason Hurley11f6c30621aa
diff --git a/web/js/components/layer/settings/palette.js b/web/js/components/layer/settings/palette.jsindex e9e45eb9a..090dab86d 100644--- a/web/js/components/layer/settings/palette.js+++ b/web/js/components/layer/settings/palette.js@@ -47,7 +47,7 @@ function PaletteSelect (props) {const color = palette.classes? palette.classes.colors[0]: palette.colors[0];- const caseDefaultClassName = 'wv-palette-selector-row wv-checkbox wv-checkbox-round gray ';+ const caseDefaultClassName = 'wv-palette-selector-row wv-radio';const checkedClassName = isSelected ? 'checked' : '';const isInvisible = color === '00000000';@@ -83,7 +83,7 @@ function PaletteSelect (props) {* @param {Boolean} isSelected | is this colormap active*/const renderSelectorItemScale = (palette, id, legend, isSelected) => {- const caseDefaultClassName = 'wv-palette-selector-row wv-checkbox wv-checkbox-round gray ';+ const caseDefaultClassName = 'wv-palette-selector-row wv-radio ';const checkedClassName = isSelected ? 'checked' : '';const ctx = canvas.getContext('2d');drawPaletteOnCanvas(@@ -102,9 +102,6 @@ function PaletteSelect (props) {name="wv-palette-radio"onClick={() => onChangePalette(id)}/>- {isSelected && (- <span className="dot" />- )}<label htmlFor={`wv-palette-radio-${id}-${index}`}><img src={dataURL} /><span className="wv-palette-label">{legend.name || 'Default'}</span>diff --git a/web/scss/components/radio.scss b/web/scss/components/radio.scssnew file mode 100644index 000000000..c14bc0cc1--- /dev/null+++ b/web/scss/components/radio.scss@@ -0,0 +1,41 @@+.wv-radio {+ & input[type="radio"] {+ margin: 3px 1px;+ vertical-align: middle;+ }++ input {+ appearance: none !important;+ width: 16px;+ height: 16px;+ border: 1px solid #eee;+ border-radius: 50%;+ background: none;+ position: relative;+ }+++ label {+ color: #fff;+ cursor: pointer;++ span {+ line-height: 22px;+ }+ }+}++.wv-radio.checked input {+ appearance: none !important;+ width: 16px;+ height: 16px;+ border: 2px solid #eee;+ border-radius: 50%;+ background: #1d67e3;+ box-shadow: 0 0 0 1px #1d67e3;+ position: relative;+}++.wv-radio.gray label {+ color: #666;+}\ No newline at end of filediff --git a/web/scss/features/palettes.scss b/web/scss/features/palettes.scssindex a6db68c90..efa7efa1d 100644--- a/web/scss/features/palettes.scss+++ b/web/scss/features/palettes.scss@@ -18,7 +18,7 @@}.wv-palette-selector-row label {- margin-left: 7px;+ margin-left: 12px;color: #b5b5b7 !important;}diff --git a/web/scss/index.scss b/web/scss/index.scssindex 501330d83..ba188f9a1 100644--- a/web/scss/index.scss+++ b/web/scss/index.scss@@ -15,6 +15,7 @@@use 'components/list';@use 'components/modal';@use 'components/notifications';+@use 'components/radio';@use 'components/switch';@use 'components/tooltip';@use 'components/range';