Instantly share code, notes, and snippets.

View reveal.js
export default class Reveal {
constructor ({ elements }) {
this.elements = elements
this.inc = -1
this.nextEl = this.getNextEl()
this.onScroll = this.onScrollEvent.bind(this)
this.setupEvents()
}
View slider.js
/*
Name: Slider
Desc: Creates a simple slideshow with basic options
Usage:
- The slideshow needs a bare minimum of the following Html
<div class="slideshow">
<div class="slides">
<div class="slide show"></div>
</div>
View scrollto.js
const self = {
animate: (to, duration) => {
self.to = to
self.duration = duration
self.start = document.documentElement.scrollTop + document.body.scrollTop
self.change = self.to - self.start
self.fps = 60
self.elapsedTime = 0