Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ykob/fullscreen-slider
This asset controls sections in a page. It resizes sections to fullscreen resolution and moves these individually by wheel/touch events.
https://github.com/ykob/fullscreen-slider
Last synced: about 2 months ago
JSON representation
This asset controls sections in a page. It resizes sections to fullscreen resolution and moves these individually by wheel/touch events.
- Host: GitHub
- URL: https://github.com/ykob/fullscreen-slider
- Owner: ykob
- Created: 2019-04-13T14:38:31.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-05-16T06:15:53.000Z (over 5 years ago)
- Last Synced: 2024-10-12T22:17:09.471Z (2 months ago)
- Language: CSS
- Homepage: https://ykob.github.io/fullscreen-slider/
- Size: 9.95 MB
- Stars: 220
- Watchers: 8
- Forks: 29
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- jimsghstars - ykob/fullscreen-slider - This asset controls sections in a page. It resizes sections to fullscreen resolution and moves these individually by wheel/touch events. (CSS)
README
# fullscreen-slider
![screenshot](screenshot.gif)
This asset controls sections in a page.
It resizes sections to fullscreen resolution and moves these individually by wheel/touch events.
https://ykob.github.io/fullscreen-slider/## Usage
1. You must install the necessary npm modules.
This class depends on below modules.
https://www.npmjs.com/package/normalize-wheel```
npm i normalize-wheel --save
```2. Import FullscreenSlider class.
https://github.com/ykob/fullscreen-slider/blob/master/src/js/modules/fullscreen_slider/index.js
Like as below.```
import FullscreenSlider from '../modules/fullscreen_slider/';
```3. Create an instance and set wrapper element (ex: document) and 2D resolution object to arguments as below.
```
const fsSlider = new FullscreenSlider(
document,
{
x: window.innerWidth,
y: window.innerHeight
}
);
```4. Bind the `resize` event. You should run the `reset` method before running the `resize` method to set the resolution to the section elements correctly. Also, you should set an object that has window resolution to an argument of the "resize" method to resize the sections to full-screen size.
```
window.addEventListener('resize', () => {
fsSlider.reset();
fsSlider.resize(
{
x: window.innerWidth,
y: window.innerHeight
}
);
});
```5. Run the `start` method when you want to start the animation.
```
fsSlider.start();
```