Keyboard-driven Carousel Component Provider
Developed with Typescript and Custom Elements API
Tested in Chrome 75
IE | Edge | FireFox | Chrome | Safari | Opera |
---|---|---|---|---|---|
X | 76~ | 63~ | 54~ | 10.1~ | 41~ |
See more
See CHANGELOG
See Demo
- HTML5 Expandable Custom Elements
- Keyboard-driven movable list
- Element prepared listener for lazy loading
- Install with npm:
npm install kecap --save
- Clone the repo:
git clone https://github.com/project-kahm/kecap.git
<kecap-a>
is implemented for Type A, and <kecap-b>
is implemented for Type B.
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
Set item size and will-change
attribute.
.item {
width: 100px;
height: 100px;
will-change: transform;
}
<kecap-a itemrow="1" itemcol="10" viewportrow="1" viewportcol="5">
<div class="item">1</div>
<div class="item">2</div>
<div class="item">3</div>
...
<div class="item">8</div>
<div class="item">9</div>
<div class="item">10</div>
</kecap-a>
<kecap-b itemrow="5" itemcol="5" viewportrow="3" viewportcol="3">
<div class="item">1</div>
<div class="item">2</div>
<div class="item">3</div>
...
<div class="item">23</div>
<div class="item">24</div>
<div class="item">25</div>
</kecap-b>
# 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
Copyright (c) 2019 Project Kahm
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, 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 THE
SOFTWARE.
Kecap is licensed under the MIT License.