This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const xMax = 16; | |
const shake = anime({ | |
targets: '#js-login-form', | |
easing: 'easeInOutSine', | |
duration: 550, | |
translateX: [ | |
{ | |
value: xMax * -1, | |
}, | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body, html { | |
padding: 0; | |
margin: 0; | |
height: 100%; | |
} | |
body { | |
font-family: 'arial', sans-serif; | |
} | |
p, h1, h2, h3, h4 { | |
margin: 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const xMax = 16; | |
const shake = anime({ | |
targets: '#js-login-form', | |
easing: 'easeInOutSine', | |
duration: 550, | |
translateX: [ | |
{ | |
value: xMax * -1, | |
}, | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Shake Login Form</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/2.2.0/anime.js"></script> | |
</head> | |
<body> | |
<div class="page"> | |
<div class="login-form" id="js-login-form"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<script src="/anime.js"></script> | |
<title>Shake Form</title> | |
<style> | |
body, html { | |
padding: 0; | |
margin: 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Anime Basics</title> | |
<script src="/anime.js"></script> | |
<style> | |
.box { | |
width: 100px; | |
height: 100px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fibo = (function () { | |
var memo = {}; | |
function fi(n) { | |
if (n < 0) { return -1 } else { | |
var value = (n in memo) ? memo[n] : (!n || n === 1) ? 1 : fi(n - 1) + fi(n - 2); | |
memo[n] = value; | |
return value; | |
} | |
} | |
return fi; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const boxesAnimation = window.anime({ | |
targets: '.js-box', | |
translateY: [150, 50], | |
backgroundColor: { | |
value: (el, i, t) => { | |
const r = 58 + (i * 12); | |
const g = 35 + (i * 12); | |
const b = 220; | |
const color = `rgb(${r}, ${g}, ${b})`; | |
return color; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
anime({ | |
scale: { | |
value: 2, | |
transition: 'linear', | |
duration: 1000, | |
}, | |
opacity: 1, | |
height: [0, 100], | |
transition: 'easeInOutSine', | |
duration: 500, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
anime({ | |
property: { | |
value: ..., | |
transition: ..., | |
duration: ..., | |
/* etc */ | |
} | |
}); |
NewerOlder