Experimental project demonstrating Charkha in CSS3
A Pen by Prashant Sani on CodePen.
Experimental project demonstrating Charkha in CSS3
A Pen by Prashant Sani on CodePen.
Little Experiment for My Blog, SPIDer.
A Pen by Prashant Sani on CodePen.
Have fun tapping on your keyboard.
I exported the franchise characters from After Effects using Bodymovin
Each character is an svg.
Each animated with js.
Adjust colors, tracking, and more on the options panel in the top right.
Don't miss the uppercase version of each char!
These animations were not conceived for real time animation, so some characters are much more performant than others but I wanted to respect the original projects.
The best experience is on Chrome.
//Navigating Pages | |
$(document).on('click','nav a',function(event){ | |
event.preventDefault(); | |
var $this = $(this), | |
toPage = $this.attr('href'); | |
//Adds loading gif as a background to <html> tag | |
$('html').addClass('loading'); | |
//This is usually a class from 'animate.css' | |
$('body').addClass('fadeOut'); |
//Ideally all the code below should be inside a self executing anonymous function | |
var controller = new ScrollMagic.Controller(); | |
function setSMAnim(tweenArray,triggerElement,triggerHook,dur,funcOnStart){ | |
var tweenQuote = new TimelineMax(); | |
tweenQuote.add(tweenArray); | |
new ScrollMagic.Scene({ | |
triggerElement: triggerElement, |
function parseVideo(url) { | |
// - Supported YouTube URL formats: | |
// - http://www.youtube.com/watch?v=My2FRPA3Gf8 | |
// - http://youtu.be/My2FRPA3Gf8 | |
// - https://youtube.googleapis.com/v/My2FRPA3Gf8 | |
// - Supported Vimeo URL formats: | |
// - http://vimeo.com/25451551 | |
// - http://player.vimeo.com/video/25451551 | |
// - Also supports relative URLs: | |
// - //player.vimeo.com/video/25451551 |
A list of some of my favorite JS libraries
// View Comment section for explanation | |
function _$(elem){ return d.querySelectorAll(elem) } | |
function observer(trigger, func_vis, func_hidden, threshold){ | |
var t = threshold ? threshold : 1, | |
observable_var; | |
const supportsNativeSmoothScroll = 'scrollBehavior' in document.documentElement.style; | |
function scrollToView(elem) { | |
if(supportsNativeSmoothScroll){ | |
// https://caniuse.com/#feat=mdn-api_window_scrollto | |
// As of publish date of this gist, | |
// this is only supported in 52% browsers, | |
// So, the next section (`else{`) is a fallback | |
window.scrollTo({ | |
behavior: 'smooth', |
// Write some code, that will flatten an array of arbitrarily nested arrays of integers into a flat array of integers. | |
// e.g. [[1,2,[3]],4] -> [1,2,3,4]. | |
function flatten(arr){ | |
let newArray = []; | |
for(let i=0; i< arr.length; i++){ | |
if(Array.isArray(arr[i])){ | |
newArray = newArray.concat(flatten(arr[i])) | |
}else{ | |
newArray.push(arr[i]) |