{"id":22367803,"url":"https://github.com/mystroken/cachu-slider","last_synced_at":"2025-09-22T18:23:19.956Z","repository":{"id":55636553,"uuid":"136357232","full_name":"mystroken/cachu-slider","owner":"mystroken","description":":rainbow: :high_brightness: Create animated full screen and content-fit sliders efficiently.","archived":false,"fork":false,"pushed_at":"2024-08-29T09:28:53.000Z","size":338,"stargazers_count":32,"open_issues_count":3,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-21T02:12:05.233Z","etag":null,"topics":["cachu-slider","javascript","scrolling","slide","slider","slideshow","standalone-library","vanilla-javascript"],"latest_commit_sha":null,"homepage":"https://codepen.io/mystroken/pen/bKoebp","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mystroken.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"custom":["https://paypal.me/mystroken"],"patreon":"mystroken"}},"created_at":"2018-06-06T16:35:50.000Z","updated_at":"2023-06-29T20:10:03.000Z","dependencies_parsed_at":"2022-08-15T05:10:15.346Z","dependency_job_id":null,"html_url":"https://github.com/mystroken/cachu-slider","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mystroken%2Fcachu-slider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mystroken%2Fcachu-slider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mystroken%2Fcachu-slider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mystroken%2Fcachu-slider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mystroken","download_url":"https://codeload.github.com/mystroken/cachu-slider/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228165797,"owners_count":17879317,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cachu-slider","javascript","scrolling","slide","slider","slideshow","standalone-library","vanilla-javascript"],"created_at":"2024-12-04T18:21:28.022Z","updated_at":"2025-09-22T18:23:14.906Z","avatar_url":"https://github.com/mystroken.png","language":"JavaScript","funding_links":["https://paypal.me/mystroken","https://patreon.com/mystroken"],"categories":[],"sub_categories":[],"readme":"# cachu-slider\n\n![npm bundle size](https://img.shields.io/bundlephobia/minzip/cachu-slider)\n![npm](https://img.shields.io/npm/dw/cachu-slider)\n![npm](https://img.shields.io/npm/v/cachu-slider)\n![GitHub last commit](https://img.shields.io/github/last-commit/mystroken/cachu-slider)\n[![DUB](https://img.shields.io/dub/l/vibe-d.svg?style=flat)](http://opensource.org/licenses/MIT)\n\nA standalone vanilla javascript library to create animated fullscreen or content-fit sliders on your web pages. It is inspired by the famous library [fullpage.js](https://github.com/alvarotrigo/fullpage.js/) by Alvaro Trigo.\n\n\u003cp\u003e\n    The particularity of \u003ccode\u003ecachu-slider\u003c/code\u003e is that it's essentially based on Promises (ES6 feature), what is ideal for adding individual animations/transitions to each element of each slider section.\n\u003c/p\u003e\n\u003cp\u003e\n    → \u003ca target=\"_blank\" href=\"https://codepen.io/mystroken/pen/bKoebp\"\u003eSimple Demo\u003c/a\u003e\n\u003c/p\u003e\n\n## Usage\n\n#### 1. Including the library\n\nInstall via npm  : ```npm install cachu-slider``` \u003cbr\u003e\nOr include ```dist``` files directly into your HTML document.\n\n```html\n\u003clink rel=\"stylesheet\" type=\"text/css\" href=\"cachu-slider.min.css\"\u003e\n\u003cscript type=\"text/javascript\" src=\"cachu-slider.min.js\"\u003e\u003c/script\u003e\n```\n\nIf you plan to use the library into a webpack project, you must read our [advanced guide](https://github.com/mystroken/cachu-slider/wiki/Include-cachu-slider-to-your-project) for including necessary files.\n\n#### 2. Required HTML Structure\n\n```html\n\u003cdiv class=\"cachu__container\"\u003e\n\n  \u003c!-- All sections are wrapped inside .cachu__sections  --\u003e\n\n  \u003cdiv class=\"cachu__sections\"\u003e\n    \u003csection class=\"cachu__section\"\u003eSome section\u003c/section\u003e\n    \u003csection class=\"cachu__section\"\u003eSome section\u003c/section\u003e\n    \u003csection class=\"cachu__section\"\u003eSome section\u003c/section\u003e\n  \u003c/div\u003e\n\n  \u003c!-- End of section  --\u003e\n  \u003c!-- Navigation will be dynamically added here (via JavaScript) --\u003e\n\u003c/div\u003e\n```\n\nEach section will be defined with an element containing the ```cachu__section``` class. The active section by default will be the first section.\n\nSlider elements should be placed inside a wrapper. The wrapper can not be the body element and it must have the ```cachu__container``` class.\n\nThis structure will generate, by default, a fullpage slider. If you want a content-fit slider rather, you should add to the wrapper ```cachu__container--content-fit``` class too.\n\n```\u003cdiv class=\"cachu__container cachu__container--content-fit\"\u003e```\n\n#### 3. Instantiate the slider\n\nBefore initializing the slider, make sure that the DOM Content is already loaded.\n\n```javascript\n\n// Now let's turn on our slider!\n\n// 1. Set some options.\n// 2. Instantiate the Slider with the DOM Element instance of the wrapper.\n// 3. Run the slider !!\n\nconst options = {};\nlet slider = new Cachu(document.querySelector('.cachu__container'), options);\nslider.run();\n```\n\nA more complete initialization with all options set could look like this:\n\n```javascript\n// Complete options.\n\nconst options = {\n  disableMouseEvents: false, // Disable mousewheel event listening.\n  disableKeyboardEvents: false, // Disable keyboard event listening.\n  disableTouchEvents: false, // Disable event listening on touchable device (Swipe).\n  scrollingSpeed: 1000,  // The speed of the transition.\n  scrollingLoop: true,  // Loop after reaching the end.\n  navigationEnabled: true, // Enable navigation buttons\n  navigationPosition: 'right'  // The Navigation's position\n};\n\nlet slider = new Cachu(document.querySelector('.cachu__container'), options);\nslider.run();\n```\n\n\u003cp\u003e\n\u003cb\u003eNotice\u003c/b\u003e: If you don't plan to use animations or transitions on some of the elements of some of your slides, you must ask yourself if you really need to use this library. ( You could consider using \u003ca href=\"https://github.com/alvarotrigo/fullpage.js/\"\u003efullpage.js\u003c/a\u003e rather ).\n\u003c/p\u003e\n\n## Options\n\n* ```disableMouseEvents```: *boolean* (default ```false```) Disable listening mousewheel events. This feature may be interesting if you only want to scroll through navigation buttons.\n* ```scrollingSpeed```: *int* (default ```1000```) Sets the speed of the transition between sections. This value must be greather than or equal to zero (\u003e= 0).\n* ```scrollingLoop```: *boolean* (default ```true```) Tells the slider if it has to loop the scrolling after reaching the end of sections.\n* ```scrollingDirection```: *string* (default ```vertical```) The scrolling direction. Possible values are:\n  - ```vertical```\n  - ```horizontal```\n* ```fixSectionsHeight```: *boolean* (default ```true```) Tells the slider to set or not a same height to all sections. Only if the scrolling direction is ```horizontal```, else this parameter is ignored.\n* ```navigationEnabled```: *boolean* (default ```true```) Tells the slider to display or not the navigation buttons.\n* ```navigationPosition```: *string* (default ```right```) Sets the position of the navigation (if enabled). Possible values are:\n  - ```top```:    Fix navigation to the top.\n  - ```right```:  Fix navigation to the right.\n    \n    ```\n  - ```bottom```: Fix navigation to the bottom.\n  - ```left```:   Fix navigation to the left.\n\n    ## Methods\n\n    After instantiating the slider (```var slider = new Cachu(...)```), you get access to all these methods:\n\n    ### run()\n\n    You must call this method to run the slide. Else, the content will be hidden.\n\n## Reporting issues\n\nIf you find a bug or have compatibility issues, please open a ticket under issues section for this repository.\n\n## Contributing to cachu-slider\n\n\u003cp\u003e\n    Have any suggestions or feedback?\n    \u003col\u003e\n        \u003cli\u003eLet's use \u003ca target=\"_blank\" href=\"https://trello.com/b/gmsaBRvO/cachu-slider\"\u003eCachu Slider on Trello\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003eReach out \u003ca target=\"_blank\" href=\"https://twitter.com/mystroken/\"\u003e@mystroken\u003c/a\u003e\u003c/li\u003e\n    \u003c/ol\u003e\n\u003c/p\u003e\n\nElse, please see [Contributing to cachu slider](https://github.com/mystroken/cachu-slider/wiki/Contributing-to-cachu-slider).\n\n## License\n\n```cachu-slider``` is an open sourced project using [MIT license](http://opensource.org/licenses/MIT).\n\n**The credit comments in the JavaScript and CSS files should be kept intact (even after combination or minification)**.\n\n(The MIT License)\n\nCopyright (c) 2018 Mystro Ken \u003cmystroken@gmail.com\u003e\n\nPermission 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:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE 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.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmystroken%2Fcachu-slider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmystroken%2Fcachu-slider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmystroken%2Fcachu-slider/lists"}