Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/orderandch4os/log-slider

JS log scaling slider
https://github.com/orderandch4os/log-slider

html javascript log-slider range-input vanilla-javascript vanilla-js

Last synced: about 15 hours ago
JSON representation

JS log scaling slider

Awesome Lists containing this project

README

        

# log-slider

https://OrderAndCh4oS.github.io/log-slider/

## Setup

### CDN

Include these in your HTML somewhere (update the version number if a new version is available).

*script*
``

*stylesheet*
``

## Examples

### Log scale slider

*js*
```javascript
const handleDemoLogUpdate = (log, value) => {
console.log(log, value);
};

const demoLog = new LogSlider({
id: 'log-scale',
min: 100,
max: 10000,
type: sliderTypes.LOG,
showTab: true,
callback: handleDemoLogUpdate,
});
```
*html*
```html

```

### Linear scale slider

*js*
```javascript
const handleDemoLinearUpdate = (value) => {
console.log(value);
};

const demoLinear = new LogSlider({
id: 'linear-scale',
min: 1,
max: 1000,
showTab: true,
callback: handleDemoLinearUpdate,
});
```
*html*
```html

```

### Linear scale slider with steps

*js*
```javascript
const handleDemoLinearUpdate = (value) => {
console.log(value);
};

const demoLinearStepped = new LogSlider({
id: 'linear-scale',
min: 1,
max: 100,
type: sliderTypes.LINEAR,
steps: [1, 10, 25, 50, 100],
showTab: true,
callback: handleDemoLinearUpdate,
});
```

*html*
```html

```

## Examples Using HTML Attributes

### Linear scale slider with steps
*html*
```html


Linear Scale


```

*js*
```javascript
const demoLinear = new LogSlider({
id: 'linear-scale',
callback: (value) => {console.log(value)},
});
```

### Log scale slider
*html*
```html


Log Scale


```

*js*
```javascript
const demoLog = new LogSlider({
id: 'log-scale',
callback: (log) => {console.log(log)},
});
```