map_howto

This commit is contained in:
Zsolt Ero
2024-01-18 01:46:44 +01:00
parent 2e4b664b25
commit e32079a97f
3 changed files with 19 additions and 19 deletions

View File

@@ -241,6 +241,6 @@ hr {
} }
#support-plans-slider { #support-plans-slider {
max-width: 600px; max-width: 600px;
margin: 50px auto; margin: 50px auto;
} }

View File

@@ -1,22 +1,22 @@
const slider = document.getElementById('support-plans-slider'); const slider = document.getElementById('support-plans-slider')
var arbitraryValuesForSlider = ['128MB', '256MB', '1GB', '8GB', '16GB', '32GB']; var arbitraryValuesForSlider = ['128MB', '256MB', '1GB', '8GB', '16GB', '32GB']
var format = { var format = {
to: function(value) { to: function (value) {
return arbitraryValuesForSlider[Math.round(value)]; return arbitraryValuesForSlider[Math.round(value)]
}, },
from: function (value) { from: function (value) {
return arbitraryValuesForSlider.indexOf(value); return arbitraryValuesForSlider.indexOf(value)
} },
}; }
noUiSlider.create(slider, { noUiSlider.create(slider, {
// start values are parsed by 'format' // start values are parsed by 'format'
start: '1GB', start: '1GB',
range: { min: 0, max: arbitraryValuesForSlider.length - 1 }, range: { min: 0, max: arbitraryValuesForSlider.length - 1 },
step: 1, step: 1,
tooltips: true, tooltips: true,
format: format, format: format,
pips: { mode: 'steps', format: format, density: 50 }, pips: { mode: 'steps', format: format, density: 50 },
}); })