diff --git a/examples/template-default/packages/app/src/index.css b/examples/template-default/packages/app/src/index.css index f627897c..d21814fe 100644 --- a/examples/template-default/packages/app/src/index.css +++ b/examples/template-default/packages/app/src/index.css @@ -114,6 +114,22 @@ p { margin-bottom: 24px; } +.input-slider-row { + position: relative; + width: 94%; + margin-left: 3%; +} + +.input-slider-tick { + position: absolute; + top: 12px; + width: 4px; + height: 14px; + transform: translate(-2px, 0); + border-radius: 4px; + background: #fafafa; +} + .switch-checkbox { margin-bottom: 8px; } @@ -161,9 +177,8 @@ p { */ .slider.slider-horizontal { - width: 94%; + width: 100%; height: 16px; - margin-left: 3%; margin-top: 4px; margin-bottom: 4px; } @@ -172,6 +187,7 @@ p { height: 8px; top: 4px; /* (slider-handle:height / 2) - (slider-track:height / 2) */ margin-top: 0; + background: #fafafa; } .slider-rangeHighlight { diff --git a/examples/template-default/packages/app/src/index.js b/examples/template-default/packages/app/src/index.js index 231af4a6..0947b069 100644 --- a/examples/template-default/packages/app/src/index.js +++ b/examples/template-default/packages/app/src/index.js @@ -53,9 +53,18 @@ function addSliderItem(sliderInput) { $(`
${str(spec.unitsKey)}
`) ]) + let tickPos = (spec.defaultValue - spec.minValue) / (spec.maxValue - spec.minValue) + if (spec.reversed) { + tickPos = 1 - tickPos + } + const sliderRow = $(`
`).append([ + $(`
`), + $(``) + ]) + const div = $(`
`).append([ titleRow, - $(``), + sliderRow, $(`
${spec.descriptionKey ? str(spec.descriptionKey) : ''}
`) ])