Skip to content

Instantly share code, notes, and snippets.

View egstad's full-sized avatar

Jordan Egstad egstad

View GitHub Profile
@egstad
egstad / animate.js
Created May 20, 2019 18:58
Animation
import dom from "./dom"
import utils from "./utils"
/* ==========================================================================
ANIMATE
==========================================================================
• When ".js-animate" elements are in view, ".is-active" class is added.
• Intersection Observer for modern browsers
• Scroll event fallback for browsers that don't support Intersection Ob.
@egstad
egstad / lazy.js
Created May 20, 2019 22:44
NUXT + Vanilla-lazyload
import LazyLoad from "vanilla-lazyload";
import utils from "./utils";
/* ==========================================================================
LAZYLOAD
==========================================================================
• Once an element enters viewport, load it up!
• Handles lazyloading images, iframes, scripts, etc...
• https://github.com/verlok/lazyload
@egstad
egstad / github-shop-ascii.js
Last active April 2, 2026 20:50
GitHub Shop: ASCII Effect
// __ ___ ___ ____ ____ ___ __ _ _ _ _ __ ___
// /__\ / __)/ __(_ _(_ _) / __) /__\ ( \( ( \/ /__\ / __)
// /(__)\\__ ( (__ _)(_ _)(_ ( (__ /(__)\ ) ( \ /(__)\\__ \
// (__)(__(___/\___(____(____) \___(__)(__(_)\_) \(__)(__(___/
// What you'll need...
// 1. A canvas: <canvas id="asciiCanvas"></canvas>
// 2. An image: <img id="image" src="" alt="">
// Fetch elements