GithubHelp home page GithubHelp logo

santaclaas / linear-easing-generator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jakearchibald/linear-easing-generator

0.0 0.0 0.0 257 KB

License: Apache License 2.0

JavaScript 34.44% TypeScript 55.47% CSS 8.03% EJS 2.05%

linear-easing-generator's Introduction

For a long time, easing on the web was limited to cubic-bezier, meaning you couldn't do easings like bounce, spring, or elastic without JavaScript. But now linear() is here! Well, almost here.

linear() works by defining a set of points. And, if you define enough points, you can create things that look and feel like curves.

That's where the linear() easing generator comes in. It can convert JavaScript/SVG easing definitions into linear() format.

Check out the bounce demo. It gives you:

:root {
  --bounce-easing: linear(
    0, 0.004, 0.016, 0.035, 0.063, 0.098, 0.141 13.6%, 0.25, 0.391, 0.563, 0.765,
    1, 0.891 40.9%, 0.848, 0.813, 0.785, 0.766, 0.754, 0.75, 0.754, 0.766, 0.785,
    0.813, 0.848, 0.891 68.2%, 1 72.7%, 0.973, 0.953, 0.941, 0.938, 0.941, 0.953,
    0.973, 1, 0.988, 0.984, 0.988, 1
  );
}

Which you can use in animations and transitions:

.whatever {
  animation-timing-function: var(--bounce-easing);
}

Running locally

npm i
npm run dev

linear-easing-generator's People

Contributors

jakearchibald avatar argyleink avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.