- Clone the repository
git clone <repository-url>
cd slider- Install dependencies (requires Node.js 22+):
npm installThis will automatically:
- Install all dependencies
- Set up Git hooks for testing and commit message validation
-
npm test: Runs the test suite -
npm start: Runs the default gulp task which:- Minifies JS and CSS files
- Watches for changes and automatically rebuilds
- Keeps running until you stop it (Ctrl+C)
-
npm run build: One-time build that:- Minifies JavaScript (dxb-slider.js → dxb-slider.min.js)
- Minifies CSS (dxb-slider.css → dxb-slider.min.css)
The repository is set up with automated checks:
- Pre-commit: Tests run automatically before each commit
- Commit messages: Must follow the Conventional Commits format
- Example:
feat: add RTL support - Example:
fix: resolve slider initialization issue - Example:
docs: update installation instructions
- Example:
To skip checks in emergency situations:
git commit -m "feat: urgent update" --no-verifydxb-slider.js- Main source JavaScript filedxb-slider.css- Main source CSS filedxb-slider.min.js- Minified JavaScript (auto-generated)dxb-slider.min.css- Minified CSS (auto-generated)index.html- Example implementation and test page
- Make changes to source files (
dxb-slider.jsordxb-slider.css) - Run
npm startto automatically rebuild minified files on changes - Open
index.htmlin your browser to test changes - Submit a pull request with your changes
The build process uses Gulp with the following plugins:
- gulp-uglify: JavaScript minification
- gulp-cssnano: CSS minification
- gulp-rename: File renaming
See gulpfile.js for the complete build configuration.
DXB Slider aims to maintain its small footprint (currently <1KB minified). When making changes, please ensure they don't significantly increase the file size.
Before submitting a pull request:
- Test all slider functionality in both LTR and RTL modes
- Verify mobile device compatibility
- Check accessibility features
- Test with different step values (whole numbers and decimals)
If you have questions about contributing, please open an issue in the repository.