Skip to content

Instantly share code, notes, and snippets.

@stamat
Created May 29, 2021 20:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stamat/793d90d8fbec94279af6346ed986a18b to your computer and use it in GitHub Desktop.
Save stamat/793d90d8fbec94279af6346ed986a18b to your computer and use it in GitHub Desktop.
Cubic Bezier in SCSS... Anyone? I have no idea where I was going with it...
@function cubic-bezier($t,$x1,$y1,$x2,$y2) {
$diff: 1 - $t;
$x: $diff * ( $diff * ($t * $x1) + $t * ($diff * $x1 + $t * $x2)) + $t * ($diff * ( $diff * $x1 + $t * $x2) + $t * ($diff * $x2 + $t));
$y: $diff * ( $diff * ($t * $y1) + $t * ($diff * $y1 + $t * $y2)) + $t * ($diff * ( $diff * $y1 + $t * $y2) + $t * ($diff * $y2 + $t));
@return ($x, $y);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment