mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-10-05 01:44:18 +00:00
effects: demo visualising easing functions, tuning
This commit is contained in:
parent
60a0ae46e5
commit
67830bde80
@ -33,6 +33,8 @@
|
|||||||
canvas.height = 135;
|
canvas.height = 135;
|
||||||
var ctx = canvas.getContext("2d");
|
var ctx = canvas.getContext("2d");
|
||||||
ctx.fillStyle = "black";
|
ctx.fillStyle = "black";
|
||||||
|
ctx.strokeStyle = "white";
|
||||||
|
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
ctx.moveTo(10, 0);
|
ctx.moveTo(10, 0);
|
||||||
ctx.quadraticCurveTo(0, 0, 0, 10);
|
ctx.quadraticCurveTo(0, 0, 0, 10);
|
||||||
@ -44,18 +46,15 @@
|
|||||||
ctx.lineTo(10, 0);
|
ctx.lineTo(10, 0);
|
||||||
ctx.fill();
|
ctx.fill();
|
||||||
|
|
||||||
ctx.strokeStyle = "white";
|
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
ctx.moveTo(0, 100.5);
|
ctx.moveTo(0, 100.5);
|
||||||
ctx.lineTo(100, 100.5);
|
ctx.lineTo(100, 100.5);
|
||||||
ctx.stroke();
|
ctx.stroke();
|
||||||
|
|
||||||
var mod = 2;
|
ctx.lineWidth = 1.5;
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
$.each(new Array(100 * mod), function(position) {
|
$.each(new Array(100), function(position) {
|
||||||
var ease = impl(0, position, 0, 1, 100 * mod);
|
ctx.lineTo(position, 100 - position * impl(0, position, 0, 1, 100));
|
||||||
ctx.moveTo(position / mod, 100 - position / mod * ease);
|
|
||||||
ctx.lineTo(position / mod + 1, 99 - position / mod * ease);
|
|
||||||
});
|
});
|
||||||
ctx.stroke();
|
ctx.stroke();
|
||||||
graph.click(function() {
|
graph.click(function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user