Grid Reveal Effects with Anime.js

Recently, a new version of anime.js was released. One of the great new features is its staggering system that makes complex follow through and overlapping animations really simple. We wanted to give it a try and experiment with this new feature on an image grid with many thumbnails. We’ve created four demos, each with a different staggering effect that hides and shows small images to reveal some content underneath.

Attention: Note that this is highly experimental and that we use modern CSS properties that might not be supported in older browsers.

If you want to learn more about staggering in anime, you can check out the great documentation: Staggering in anime.js

In the first demo, we make the thumbnails disappear from the point where we clicked and then reverse this animation when closing the full view.

GridRevealEffects_00

GridRevealEffects_01

In the second demo, we fade and scale the thumbnails down. Not from the center though but from the edges. We also make the thumbnails appear again in the same way when closing the full view.

GridRevealEffects_02

The third demo shows how to make the items disappear towards the bottom right corner.

GridRevealEffects_06

The last demo is a more playful example: here we let the thumbnails “fall down”. When closing the view, we make them show again by moving them upwards.

GridRevealEffects_04

We hope you like these effects and find them useful!

References and Credits

Grid Reveal Effects with Anime.js was written by Mary Lou and published on Codrops.

Text Distortion Effects using Blotter.js

Distortion effects have become quite popular over the past two years and now many extraordinary website designs have some unique form of this intriguing trend. Today we’d like to share two demos with you that show how to use Blotter, a three.js and Underscore.js powered API for drawing artsy text effects. We used it to distort text on scroll and on mouse move.

The inspiration for this experiment comes from the project page of Bounce where you can see decorative letters being distorted on scroll.

If you enjoy this little experiment, you might also like Yannis’ Liquid Distortion Effects or Robin’s WebGL Distortion Hover Effects or Lucas’ Animated Heat Distortion Effects with WebGL.

Attention: Note that this is experimental and that we use modern CSS properties that might not be supported in older browsers.

TextDistortionEffects01

Blotter gives us an easy to use interface for creating text effects that utilize GLSL shaders. You can use one of the many configurable effects (materials) or, if you are familiar with GLSL, implement completely new ones. Read the basics to understand how to use it and play with one of the materials to see it in action.

TextDistortionEffects04

The main idea in our demos is to change the value of the material’s uniform as we scroll the page. The faster the scrolling the more the value changes. Here’s a simplified example on how to achieve this:

<span data-blotter>text here</span>
const MathUtils = {
  // Equation of a line.
  lineEq: (y2, y1, x2, x1, currentVal) => {
    var m = (y2 - y1) / (x2 - x1), b = y1 - m * x1;
    return m * currentVal + b;
  },
  // Linear Interpolation function.
  lerp: (a, b, n) =>  (1 - n) * a + n * b
};

// Create the blotter material. 
const material = new Blotter.LiquidDistortMaterial();
// Set the default material uniform values.
material.uniforms.uSpeed.value = .5;
material.uniforms.uVolatility.value = 0;
material.uniforms.uSeed.value = 0.4;
// Create the Blotter instance.
const blotter = new Blotter(material);
// Initialize the Blotter Text on all HTML elements with data-blotter.
const blotterElems = [...document.querySelectorAll('[data-blotter]')];
blotterElems.forEach((el) => {
  const text = new Blotter.Text(el.innerHTML);
  blotter.addText(text);
  // Now delete the html content.
  el.innerHTML = '';
  // The created canvas.
  const scope = blotter.forText(text);
  // Append it to the main element.
  scope.appendTo(el);
});

// Now, change one (or more) uniform value as we scroll. 
// The faster the scrolling the more the value changes.
let currentScroll = window.pageYOffset;
// The volatility is the uniform that will change.  
let volatility = 0;
// It will go from 0 (not scrolling) to 0.9 (scrolling at a speed of maxscroll).
const maxscroll = 10;
const uniformValuesRange = [0,0.9];
// Using requestAnimationFrame + linear interpolation for the effect.
const render = () => {
  // Current scroll position
  const newScroll = window.pageYOffset;
  // How much was scrolled from the last repaint.
  const scrolled = Math.abs(newScroll - currentScroll);
  // Get the new value of volatility.
  volatility =  MathUtils.lerp(volatility, Math.min(MathUtils.lineEq(uniformValuesRange[1], uniformValuesRange[0], maxscroll, 0, scrolled), 0.9), 0.05);
  // Set the volatility.
  material.uniforms.uVolatility.value = volatility;
  // Update the current scroll.
  currentScroll = newScroll;
  // Repeat.
  requestAnimationFrame(render);
}
requestAnimationFrame(render);

In the first demo the scroll speed determines the distortion amount:

TextDistortionEffect1.2019-02-05 23_54_17

And in the second demo, the speed of the mouse movement controls the intensity of the effect:

TextDistortionEffect.2019-02-05 23_51_13

We hope you like this experiment and find it useful!

References and Credits

Text Distortion Effects using Blotter.js was written by Mary Lou and published on Codrops.

Layer Motion Slideshow

Today we’d like to share yet another CSS Grid-powered slideshow with you. The idea is to show and hide images with a reveal effect and add a parallax like effect to the main image and the title. For the title we’ve added two copied layers with an outline style which creates an interesting motion effect. For the animations we use TweenMax.

Attention: Note that we use modern CSS properties that might not be supported in older browsers.

The initial view of the slideshow looks as follows:

LayerMotionSlideshow_01

For each slide we have a custom grid layout with one main image that spans the full height of the page. When we go next, the images will be hidden with a sliding motion and the title letters disappear randomly. The new slide will reveal its images and the title in a similar fashion.

When moving the mouse, we move copied layers of the main image and the title to create a trail-like effect.

Once the plus after the excerpt is clicked, we show the content of the slide and change the background color:

LayerMotionSlideshow_02

We hope you like this slideshow and find it useful!

References and Credits

Layer Motion Slideshow was written by Mary Lou and published on Codrops.

A Look Back at 2018: Round-up of Codrops Resources

2018

It has become a little tradition at Codrops to share a summary of all our resources in the end of the year. 2018 was really an exciting year for the web and we are stoked to be part of an ever-changing and inspiring community of creatives who don’t hesitate to push the boundaries, to make bold design statements and use new, experimental technologies. We hope you had a wonderful, creative and fulfilling 2018!

Come and join us for a look at our yearly round-up.

A big big thank you to all our fantastic readers, supporters, contributors and sponsors! Have a wonderful new year full of positivity, health and love! Let’s make good stuff!

With love,
Pedro, Manoela & little Lucas

A Look Back at 2018: Round-up of Codrops Resources was written by Mary Lou and published on Codrops.

Awesome Demos from 2018

Demos2018_featured

Today we’d like to share a collection of our favorite demos and experiments from 2018. This is just a small number compared to all the fantastic stuff that was made and shared in 2018, but we hope you enjoy this little selection of our favorite picks.

Please note that a lot of these demos are experimental and will require a modern browser to work.

Simplex Flower Generator by Jack Rugile

Simplex-Flower-Generator

Jelly by Adam Brooks

jelly

Repellers by Johan Karlsson

Repellers

2018.makemepulse.com by the team of Makemepulse

2018.makemepulse.com

Only CSS: Infinite Steps by Yusuke Nakaya

Only-CSS-Infinite-Steps

This alter world by Gerard Ferrandez

This-alter-world

CSS Space Shooter by Michael Bromley

CSS-Space-Shooter

Psychedelic waves by Karim Maaloul

Psychedelic-waves

Stinkmoji by Stink Studios

Stinkmoji

Song Maker by the Chrome Music Lab

chrome

The Chameleon from Null Island by kittons

The-Chameleon-from-Null-Island

Neural Drum Machine by Tero Parviainen

Neural-Drum-Machine

Toon Shading by Misaki Nakano

Toon-Shading

Wiggly Squiggly by Steve Gardner

Wiggly-Squiggly

Skin and Eye Rendering by David Lenaerts

Skin-and-Eye-Rendering

Perlin Noise by yasaisai

Perlin-Noise

Only CSS: 404 Rolling Box by Yusuke Nakaya

Only-CSS-404-Rolling-Box

Lost Without You by Jack Rugile and Nicolle Witte

Lost-Without-You

VHS Effects (regl) by halvves

VHS-Effects-(regl)

Pure CSS 4 Designers by Julia Muzafarova

Pure-CSS-4-Designers

Pure CSS Francine by Diana Smith

Pure-CSS-Francine

Pin Screen by Johan Karlsson

Pin-Screen

Pure CSS watch animation by Grzegorz Witczak

Pure-CSS-watch-animation

Line Lisa by Nikita Dubko

Line-Lisa

Going Home by 302 chanwoo

Going-Home

Heraclos by students of GOBELINS Paris

Heraclos

Solids by Dave DeSandro

Solids

Thank You by Liam Egan

Thank-You

Tenori-off by Monica Dinculescu

Tenori-off

Ghost Mouse by Liam Egan

Ghost-Mouse

Track by Little Workshop

Track

Isometric eCommerce CSSGrid by Andy Barefoot

Isometric-eCommerce-CSSGrid

Halftone Effect by Misaki Nakano

Halftone-Effect

Zippity Zappity (SVG) by Steve Gardner

Zippity-Zappity-(SVG)

Pure CSS Stack by Ben Szabo

Pure-CSS-Stack

Little Big City by Yi Shen

Little-Big-City

Pure CSS Moustached Nanny by Julia Muzafarova

Pure-CSS-Moustached-Nanny

Dot Menu Animations by Tamino Martinius

Dot-Menu-Animations

Fake 3D effect with depth map by Robin Delaporte

Fake-3D-effect-with-depth-map

CSS Snake & Ladders by Alvaro Montoro

CSS-Snake-&-Ladders

Perlin Noise by Victor Vergara

Perlin-Noise-(2)

Pure CSS The Carlton Dance by Grzegorz Witczak

Pure-CSS-The-Carlton-Dance

Exoplanet Explorer by Thomas Van Glabeke

Exoplanet-Explorer

How Many Steps Does It Take To Get From Me To You? by Jase Smith

steps

Bellwoods by Matt DesLauriers

Bellwoods

HyperMorph 3000™ by Andreas Borgen

HyperMorph-3000™

Interplanetary Postal Service by Sebastian Macke

Interplanetary-Postal-Service

Ripple Mouse (with plasma) by Liam Egan

Ripple-Mouse-(with-plasma)

Lissajous Table – Pannable by Jacob Foster
Lissajous-Table—Pannable

Falling by Yuan Chuan
Falling

Dragon Snake by Thomas Hooper

Dragon-Snake

Color Changing Chameleon by Cassie Evans

Color-Changing-Chameleon

#codevember – 1 – Infinity by Johan Karlsson
#codevember—1—Infinity

Have you ever been lonely? by Gerard Ferrandez and Angelo Plessas

Have-you-ever-been-lonely-

Layerscape by André Mattos

Layerscape

Fashion concept by Jesper Landberg

Fashion-concept

Jellyfish by Rafael Castro Couto

Jellyfish

My journey had lasted seven hours by Gerard Ferrandez

My-journey-had-lasted-seven-hours

#codevember – 15 – Flame by Liam Egan

#codevember—15—Flame

Laser Bag Pipe by Lars Berg

Laser-Bag-Pipe

Flameout by Rye Terrell

flameout

#codevember — bread by Noel Delgado

bread

Canvas Proximity Mask by Ricardo Mendieta

Canvas-Proximity-Mask

Astray 2 by Rye Terrell

Astray-2

Electricity by Vicente Lucendo

Electricity

Dreamsynth by odbol

Dreamsynth

Happy Shopper by Lars Berg

Happy-Shopper

Tiny Explorer by Rachel Richardson

Tiny-Explorer

Pure CSS Pink by Diana Smith

Pure-CSS-Pink

Mikuboard by Daniwell

Mikuboard

Under by Weston C. Beecroft

Under

Choir by David Li

Choir

Retro Pixel by Misaki Nakano

Retro-Pixel

Glimmer by Nicolas Riciotti

Glimmer

Spotify Wrapped Animation using GSAP by Peter Barr

Spotify-Wrapped-Animation-using-GSAP

Sandspiel by Max Bittker

Sandspiel

HyperSpace Jump by Ricardo Mendieta

HyperSpace-Jump

Magic sketchpad by Monica Dinculescu

Magic-sketchpad

Flame in the wind by Blake Bowen
Flame-in-the-wind

Infinite Gift by Jaume Sanchez Elias

InfiniteGift

Awesome Demos from 2018 was written by Mary Lou and published on Codrops.

Motion Transition Effect

Today we’d like to share a little speedy motion effect with you. The idea is based on the Dribbble shot Ping Pong Slow Motion by Gal Shir where you can see a ping pong ball being shot from one racket to the other. The motion in the animation is enhanced by squeezing the ball and making some background stripes’ height pulsate. This is exactly what we want to do in a slideshow transition: we’ll squeeze the image and add some background effect. Additionally, we’ll make the letters of the title fly away consecutively.

The animations are powered by TweenMax.

The grain texture for the background was generated using Grained by Sarath Saleem.

Attention: Note that we use modern CSS properties like CSS Grid and CSS Custom Properties that are not supported in older browsers.

The slideshow shows a image in the center of the page:

MotionTransition_01

When clicking on “next” or “previous”, the image will move away, being squeezed to create the illusion of a fast acceleration. The letters will fly away and the background shapes will start “pulsating”.

MotionTransMain

We hope you enjoy this little effect and find it useful!

References and Credits

Motion Transition Effect was written by Mary Lou and published on Codrops.