Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/stagas/x-knob

Web Component Knobs
https://github.com/stagas/x-knob

audio custom-element knob ui web-component

Last synced: 13 days ago
JSON representation

Web Component Knobs

Awesome Lists containing this project

README

        


x-knob

Web Component Knobs



npm i x-knob

pnpm add x-knob

yarn add x-knob

## Examples

# web


    Try it live

    # view source example/web.tsx

    ```tsx
    /** @jsxImportSource minimal-view */

    import { render } from 'minimal-view'

    import { Knob } from 'x-knob'

    render(







    , document.body)

    // customElements.define('x-knob', KnobElement)

    // document.body.innerHTML = /*html*/ `
    //
    // html,
    // body {
    // width: 100%;
    // height: 100%;
    // background: #383838;
    // }
    // x-knob {
    // width: 150px;
    // height: 150px;
    // }
    //
    //


    //
    //
    //
    //
    //
    //
    //
    //
    //
    //

    //

    //

    // `

    // // const knobs = document.querySelectorAll('x-knob') as NodeListOf
    // // let i = 0
    // // const ivl = setInterval(() => {
    // // const knob = knobs[i++ % knobs.length]
    // // knob.targetValue! += (knob.normal > 0.5 ? -1 : knob.normal === 0.5 ? (Math.random() - 0.5) * 2 : 1) * Math.random()
    // // * knob.scale
    // // * 0.95
    // // if (i >= knobs.length) clearInterval(ivl)
    // // }, 60)
    ```

## API

# themes  =  ...


    any

# Knob(props)

    # props


      props


    Knob(props)  =>


      VKid

## Credits
- [everyday-utils](https://npmjs.org/package/everyday-utils) by [stagas](https://github.com/stagas) – Everyday utilities
- [memoize-pure](https://npmjs.org/package/memoize-pure) by [stagas](https://github.com/stagas) – low footprint memoize for just pure sync functions with scalar arguments
- [minimal-view](https://npmjs.org/package/minimal-view) by [stagas](https://github.com/stagas) – Minimal reactive component view library.
- [relative-mouse](https://npmjs.org/package/relative-mouse) by [stagas](https://github.com/stagas) – Get mouse position relative to a DOM element.
- [sigl](https://npmjs.org/package/sigl) by [stagas](https://github.com/stagas) – Web framework

## Contributing

[Fork](https://github.com/stagas/x-knob/fork) or [edit](https://github.dev/stagas/x-knob) and submit a PR.

All contributions are welcome!

## License

MIT © 2023 [stagas](https://github.com/stagas)