JSFiddle - React, Tailwind, and code Playground
HTML
<div id="graphs"></div>
JavaScript
$.easing.almosttinyslider = function(x, t, b, c, d) {
var s = 1.70158;
if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
}
$.easing.tinyslider = function(x, t, b, c, d) {
ts=(t/=d)*t;
tc=ts*t;
return b+c*(-8.1525*tc*ts + 28.5075*ts*ts + -35.105*tc + 16*ts + -0.25*t);
}
// from http://jqueryui.com/demos/effect/easing.html
if (!$("<canvas/>")[0].getContext) {
$("<div/>").text("Your browser doesn't support canvas, which is required for this demo. " + "Give Firefox 3 a try!").appendTo("#graphs");
return;
}
var i = 0,
width = 100,
height = 100;
$.each($.easing, function(name, impl) {
// skip linear/jswing and any non functioning implementation
if (! /tinyslider/.test(name)) {
return;
}
var graph = $("<div/>").addClass("graph").appendTo("#graphs"),
text = $("<div/>").text(++i + ". " + name).appendTo(graph),
wrap = $("<div/>").appendTo(graph).css('overflow', 'hidden'),
canvas = $("<canvas/>").appendTo(wrap)[0];
canvas.width = width;
canvas.height = height;
var drawHeight = height * 0.8,
cradius = 10;
ctx = canvas.getContext("2d");
ctx.fillStyle = "black";
ctx.beginPath();
ctx.moveTo(cradius, 0);
ctx.quadraticCurveTo(0, 0, 0, cradius);
ctx.lineTo(0, height - cradius);
ctx.quadraticCurveTo(0, height, cradius, height);
ctx.lineTo(width - cradius, height);
ctx.quadraticCurveTo(width, height, width, height - cradius);
ctx.lineTo(width, 0);
ctx.lineTo(cradius, 0);
ctx.fill();
ctx.strokeStyle = "#555";
ctx.beginPath();
ctx.moveTo(width * 0.1, drawHeight + .5);
ctx.lineTo(width * 0.9, drawHeight + .5);
ctx.stroke();
ctx.strokeStyle = "#555";
ctx.beginPath();
ctx.moveTo(width * 0.1, drawHeight * .3 - .5);
ctx.lineTo(width * 0.9, drawHeight * .3 - .5);
ctx.stroke();
ctx.strokeStyle = "white";
...