Skip to content

Instantly share code, notes, and snippets.

View ajmeyghani's full-sized avatar
😀
Hello!

AJ Meyghani ajmeyghani

😀
Hello!
View GitHub Profile
const xMax = 16;
const shake = anime({
targets: '#js-login-form',
easing: 'easeInOutSine',
duration: 550,
translateX: [
{
value: xMax * -1,
},
{
body, html {
padding: 0;
margin: 0;
height: 100%;
}
body {
font-family: 'arial', sans-serif;
}
p, h1, h2, h3, h4 {
margin: 0;
const xMax = 16;
const shake = anime({
targets: '#js-login-form',
easing: 'easeInOutSine',
duration: 550,
translateX: [
{
value: xMax * -1,
},
{
<!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">
<!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;
@ajmeyghani
ajmeyghani / animejs-basics.html
Created August 28, 2018 23:02
Animejs Basics
<!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;
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;
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;
anime({
scale: {
value: 2,
transition: 'linear',
duration: 1000,
},
opacity: 1,
height: [0, 100],
transition: 'easeInOutSine',
duration: 500,
anime({
property: {
value: ...,
transition: ...,
duration: ...,
/* etc */
}
});