Bits are basic, configurable web components, made with JavaScript. No external library dependencies.
Yes. The web has plenty of these. This is an exercise in simple, dependency-free, web component development. Modules are initialized on the DOM using a data-mod attribute, and can be passed an optional configuration object.
The data-mod attribute value needs to match the name of your constructor. The data-conf-[constructorname] passes a configuration object. The following snippet initializes a 'slideshow' module.
<section data-mod="slideshow" data-conf-slideshow="{'counter': true, 'navigation': true, 'animate': true}">
...
</section>
bit.slideshow = function (elem, config) {
...
}
The core.js scans the document, and locates all modules with the data-mod attribute. It then instantiates and renders each module, with it's (optional) configuration object.
- npm install
- grunt
- navigate to http://localhost:9001
- Slideshow
- Accordion
- Tabs
- Tooltips
- Animation support for vendor-prefixes