An open API service indexing awesome lists of open source software.

https://github.com/nichenqin/wall.js

Fullpage Piling, vanilla javascript, no dependency
https://github.com/nichenqin/wall.js

fullpage fullscreen scrolling

Last synced: 11 months ago
JSON representation

Fullpage Piling, vanilla javascript, no dependency

Awesome Lists containing this project

README

          

# wall.js

![wall.js](https://raw.githubusercontent.com/nichenqin1001/wall.js/master/asserts/wall.png)

## Demo And Documentation

[Live Demo & Documentation](http://nichenqin.com/wall.js)

## Installation

```bash
npm install wall.js --save
yarn add wall.js
```

or

```html

```

## Get Start

```html








var wall = new Wall('#wall');

```

## API

```javascript
var wall = new Wall('#wall');

wall.prevSection(); // go to prev section;
wall.nextSection(); // go to next section;
wall.goToSection(1); // go to paticular section, param type is number

wall.prevSlide(); // go to prev slide if slides exists in current section
wall.nextSlide(); // go to next slide if slides exists in current section
```

## Custom Navigation

### Add data-wall-section-nav attribute to your own nav element

wall.js will add event listener and toggle active class of the navs.

```html
< !-- DON'T ADD THE NAV ELEMENT INSIDE THE WRAPPER -- >



First Section
Second Section





```

### style your nav elment in html and css file

Here is an example:

```css
.dot {
position: absolute;
top: 50%;
right: 50px;
transform: translateY(-50%);
}

.dot>li {
width: 16px;
height: 16px;
margin-bottom: 10px;
border: 2px solid #fff;
border-radius: 50%;
background-color: transparent;
box-sizing: border-box;
list-style: none;
cursor: pointer;
}

.dot>li.active,
.dot>li:hover {
background-color: #fff;
}
```

### custom activc class

```javascript
var config = {
sectionNavItemActiveClass: 'my-active-class'
}

var wall = new Wall('#wall',config);
```

## Slides

### Add data-wall-slide attribute to your HTMLElement

```html









```

### add data-wall-slide-arrow attribute to your arrows

```html




```

Your should create and style the arrow yourself, wall.js helps arraw show above the slides

## lazyload

wall.js support lazy load images.

Just set the true image source to `data-wall-origin` attribute of the `` tag.

```javascript

awesome

```

The picture will be replaced with the true picture.

## Custom Animation Duration

### Add data-wall-animate-duration attribute to section

You can change animation duration to all secitons like this:

```javascript
var config = {
sectionAnimateDuration: 3 // every section now move 3 seconds
}

var wall = new Wall('#wall',config);
```

or just change one of them like this:

```html









```

of cause it works for slides

```html











```

## Class of Current Section/Slide

current section will be added current class

```html

```

animating section will be added animating class

```html

```

You can control animation like this:

```css
h1 {
opacity: 0;
transition: opacity .3s ease;
}

.current h1 {
opacity: 1;
}
```

## Custom Configs

option | default | type | description
------ | ------- | ---- | -----------
wrapperZIndex | 1 | `number` | z-index style of wrapper
sectionAnimateDuration | 1 | `number` | duration of animation
easeFunction | 'easeIn' | `string` or `function` | ease function of animation
loopToBottom | false | `boolean` | whether loop from top to bottom
loopToTop | false | `boolean` | whether loop from bottom to top
sectionNavItemActiveClass | 'active' | `string` | active class of custom nav item
currentClass | 'current' | `string` | class of current section or slide
animatingClass | 'animating' | `string` | class of current section or slide while animating

## LICENSE

MIT License

Copyright (c) 2017 倪晨钦

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.