Kecap
Keyboard-driven Carousel Component Provider
Developed with Typescript and Custom Elements API
Browser Compatibility
Tested in Chrome 75
IE | Edge | FireFox | Chrome | Safari | Opera |
---|---|---|---|---|---|
X | 76~ | 63~ | 54~ | 10.1~ | 41~ |
See more
ChangeLog
See CHANGELOG
Demo
See Demo
Features
- HTML5 Expandable Custom Elements
- Keyboard-driven movable list
- Element prepared listener for lazy loading
Installation
- Install with npm:
npm install kecap --save
- Clone the repo:
git clone https://github.com/project-kahm/kecap.git
Usage
API
<kecap-a>
is implemented for Type A, and <kecap-b>
is implemented for Type B.
Attributes
margin
- the size of the gap between an element's rows and columnspreload
- number of elements to be preloaded(must be at least 1)itemrow
- the grid row sizeitemcol
- the grid column sizeviewportrow
- the viewport row sizeviewportcol
- the viewport column size
Example
Set item size and will-change
attribute.
Type A
1 2 3 ... 8 9 10
Type B
1 2 3 ... 23 24 25
Build Setup
# install dependencies $ npm install # serve with hot reload at localhost:1234 $ npm run dev # build for production $ npm run build # generate example $ npm run generate
License
Copyright (c) 2019 Project Kahm Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.
Kecap is licensed under the MIT License.