@evermade/overflow-slider 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.editorconfig ADDED
@@ -0,0 +1,22 @@
1
+ # This file is for unifying the coding style for different editors and IDEs
2
+ # editorconfig.org
3
+
4
+ # top-most EditorConfig file
5
+ root = true
6
+
7
+ [*]
8
+ charset = utf-8
9
+ end_of_line = lf
10
+ indent_size = 2
11
+ indent_style = tab
12
+ insert_final_newline = true
13
+
14
+ # Get rid of whitespace to avoid diffs with a bunch of EOL changes
15
+ trim_trailing_whitespace = true
16
+
17
+ [*.md]
18
+ max_line_length = 0
19
+ trim_trailing_whitespace = false
20
+
21
+ [{*.css,*.scss}]
22
+ indent_size = 4
@@ -0,0 +1,33 @@
1
+ # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2
+ # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3
+
4
+ name: Publish to NPM
5
+
6
+ on:
7
+ release:
8
+ types: [created]
9
+
10
+ jobs:
11
+ build:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v3
15
+ - uses: actions/setup-node@v3
16
+ with:
17
+ node-version: 16
18
+ - run: npm ci
19
+ - run: npm test
20
+
21
+ publish-npm:
22
+ needs: build
23
+ runs-on: ubuntu-latest
24
+ steps:
25
+ - uses: actions/checkout@v3
26
+ - uses: actions/setup-node@v3
27
+ with:
28
+ node-version: 16
29
+ registry-url: https://registry.npmjs.org/
30
+ - run: npm ci
31
+ - run: npm publish
32
+ env:
33
+ NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
package/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ v16.16.0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Evermade
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,104 @@
1
+ # Overflow Slider
2
+
3
+ This is slider library that is based on CSS overflow and progressive enhancements via JavaScript. The library is written in TypeScript but it requires no dependencies.
4
+
5
+ This library is heavily inspired by [Keen Slider](https://keen-slider.io/) and provides somewhat similar programming interface but with different engine running under the hood – CSS overflow.
6
+
7
+ Overflow Slider aims to be lightweight, mobile-first and accessible. It is designed to be used in modern web projects and is very customizable and extendable via plugins and CSS.
8
+
9
+ ## Demos
10
+
11
+ * [Example and demos](https://evermade.github.io/overflow-slider/)
12
+
13
+ ### Usage
14
+
15
+ If you’re using a bundler (such as Webpack or Rollup), you can install through npm:
16
+
17
+ ```bash
18
+ npm install @evermade/oveflow-slider
19
+ ```
20
+
21
+ Import the `OverflowSlider` along with plugins you want to use.
22
+
23
+ ```js
24
+ import {
25
+ OverflowSlider,
26
+ DragScrollingPlugin,
27
+ SkipLinksPlugin,
28
+ ArrowsPlugin,
29
+ ScrollIndicatorPlugin,
30
+ DotsPlugin
31
+ } from "@evermade/overflow-slider";
32
+
33
+ // minimal example
34
+ const minimalSlider = new OverflowSlider(
35
+ document.querySelector( '.slider-container-here' ),
36
+ );
37
+
38
+ // example with plugins
39
+ const slider = new OverflowSlider(
40
+ document.querySelector( '.slider-container-here' ),
41
+ {
42
+ // options here
43
+ },
44
+ [
45
+ DragScrollingPlugin(),
46
+ ArrowsPlugin(),
47
+ ScrollIndicatorPlugin(),
48
+ DotsPlugin(),
49
+ SkipLinksPlugin(),
50
+ ]
51
+ );
52
+
53
+ // note that many plugins have their own settings so you can pass them as an object
54
+
55
+ const slider = new OverflowSlider(
56
+ document.querySelector( '.slider-container-here' ),
57
+ {
58
+ // options here
59
+ },
60
+ [
61
+ ArrowsPlugin({
62
+ texts: {
63
+ buttonPrevious: 'Previous',
64
+ buttonNext: 'Next',
65
+ },
66
+ icons: {
67
+ prev: '<svg>...</svg>',
68
+ next: '<svg>...</svg>',
69
+ },
70
+ classNames: {
71
+ navContainer: 'my-nav-container',
72
+ prevButton: 'my-prev-button',
73
+ nextButton: 'my-next-button',
74
+ },
75
+ container: document.querySelector( '.my-nav-container' ),
76
+ }),
77
+ ]
78
+ );
79
+
80
+ ```
81
+
82
+ ### Styles
83
+
84
+ You can import base styles from the library to get started. The base styles include basic styles for the slider and some plugins.
85
+
86
+ ```scss
87
+ @import "@evermade/overflow-slider/dist/overflow-slider.css";
88
+ ```
89
+
90
+ You can use the CSS variables to override some values easily.
91
+
92
+ Note that you can easily write styles from scratch if you want to. See source code from `src/overflow-slider.scss` for reference.
93
+
94
+ ## Development
95
+
96
+ Install tools `npm install` and build `npm run build` or develop with `npm run watch`.
97
+
98
+ Releasing new version:
99
+
100
+ * Update version in `package.json`
101
+ * Commit to master
102
+ * Set tag with version number to git
103
+ * Create new release in GitHub
104
+ * NPM package is automatically published from GitHub
package/changelog.md ADDED
@@ -0,0 +1,5 @@
1
+ # Changelog
2
+
3
+ ## Version 1.0.0
4
+
5
+ - Initial release