Skip to content

Instantly share code, notes, and snippets.

Shan Robertson invisibled

Block or report user

Report or block invisibled

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@invisibled
invisibled / reveal.js
Last active Aug 24, 2018
Watches a set of elements and reveals them as they scroll into view.
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()
}
@invisibled
invisibled / slider.js
Created Jun 22, 2016
Creates a simple slideshow with basic options
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>
@invisibled
invisibled / scrollto.js
Last active Aug 7, 2018
Animates the scroll to a specific pixel value with a given duration
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
You can’t perform that action at this time.