Skip to content

armgit / anime

Public Imported from GitHub
0

JavaScript animation engine

Update docs

Julian Garniercde7c55400ec
diff --git a/documentation/assets/css/anime.css b/documentation/assets/css/anime.css
index 6429033b..ec092654 100644
--- a/documentation/assets/css/anime.css
+++ b/documentation/assets/css/anime.css
@@ -7,7 +7,7 @@ html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abb
html,
body,
header {
- background-color: #16161c; /* Black */
+ background-color: #16161c; /* Black */
}
body {
@@ -20,15 +20,15 @@ body {
overflow-x: hidden;
}
-.color-targets { color: #FF1461; } /* Red */
-.color-properties { color: #FF7C72; } /* Orange */
-.color-prop-params { color: #FBF38C; } /* Yellow */
-.color-anim-params { color: #A6FF8F; } /* Citrus */
-.color-values { color: #18FF92; } /* Green */
-.color-tl { color: #1CE2B2; } /* Darkgreen */
-.color-controls { color: #5EF3FB; } /* Turquoise */
-.color-states { color: #61C3FF; } /* Lightblue */
-.color-callbacks { color: #5A87FF; } /* Blue */
-.color-svg { color: #8453E3; } /* Purple */
-.color-easings { color: #C26EFF; } /* Lavender */
-.color-misc { color: #FB89FB; } /* Pink */
+.color-01 { color: #FF1461; } /* Red */
+.color-02 { color: #FF7C72; } /* Orange */
+.color-03 { color: #FBF38C; } /* Yellow */
+.color-04 { color: #A6FF8F; } /* Citrus */
+.color-05 { color: #18FF92; } /* Green */
+.color-06 { color: #1CE2B2; } /* Darkgreen */
+.color-07 { color: #5EF3FB; } /* Turquoise */
+.color-08 { color: #61C3FF; } /* Lightblue */
+.color-09 { color: #5A87FF; } /* Blue */
+.color-10 { color: #8453E3; } /* Purple */
+.color-11 { color: #C26EFF; } /* Lavender */
+.color-12 { color: #FB89FB; } /* Pink */
diff --git a/documentation/assets/css/documentation.css b/documentation/assets/css/documentation.css
index 851030fa..5fa36321 100644
--- a/documentation/assets/css/documentation.css
+++ b/documentation/assets/css/documentation.css
@@ -1,3 +1,39 @@
+html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{border:0;font-size:100%;font:inherit;vertical-align:baseline;margin:0;padding:0}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:none}
+
+* {
+ box-sizing: border-box;
+}
+
+html,
+body,
+header {
+ background-color: #16161c; /* Black */
+}
+
+body {
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ color: white;
+ font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
+ -webkit-font-smoothing: antialiased;
+ overflow-x: hidden;
+}
+
+.color-targets { color: #FF1461; } /* Red */
+.color-properties { color: #FF7C72; } /* Orange */
+.color-prop-params { color: #FBF38C; } /* Yellow */
+.color-anim-params { color: #A6FF8F; } /* Citrus */
+.color-values { color: #18FF92; } /* Green */
+.color-tl { color: #1CE2B2; } /* Darkgreen */
+.color-controls { color: #5EF3FB; } /* Turquoise */
+.color-states { color: #61C3FF; } /* Lightblue */
+.color-callbacks { color: #5A87FF; } /* Blue */
+.color-svg { color: #8453E3; } /* Purple */
+.color-easings { color: #C26EFF; } /* Lavender */
+.color-misc { color: #FB89FB; } /* Pink */
+
+
.content {
overflow: hidden;
opacity: 0;
@@ -8,7 +44,7 @@
transition: opacity 1s ease;
}
-body.ready .content {
+.ready .content {
opacity: 1;
}
diff --git a/documentation/examples/anime-tests-2.html b/documentation/examples/anime-convert-units.html
similarity index 57%
rename from documentation/examples/anime-tests-2.html
rename to documentation/examples/anime-convert-units.html
index f9933cea..2f4bc84d 100644
--- a/documentation/examples/anime-tests-2.html
+++ b/documentation/examples/anime-convert-units.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
- <title>Tests | anime.js</title>
+ <title>Convert units | anime.js</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta property="og:title" content="anime.js">
@@ -28,50 +28,36 @@
min-height: 100vh;
}
.item {
- width: 100px;
- height: 100px;
- border-radius: 15%;
background-color: currentColor;
margin: 10px;
}
+ .color-01 {
+ width: 5vw;
+ height: 40px;
+ }
+ .color-02 {
+ width: 10%;
+ height: 4rem;
+ }
</style>
</head>
<body>
- <div class="item color-01" style="transform: translateX(45px) translateY(200px);"></div>
+ <div class="item color-01"></div>
<div class="item color-02"></div>
- <div class="item color-03" style="transform: translateX(85px) translateY(300px);"></div>
+ <div class="item color-03"></div>
<script>
- // function mouseenter() {
- // var animation = anime({
- // targets: this,
- // scale: 2
- // });
- // console.log(animation.animations[0].tweens[0].from);
- // }
- // function mouseleave() {
- // var animation = anime({
- // targets: this,
- // scale: 1
- // });
- // console.log(animation.animations[0].tweens[0].from);
- // }
-
- anime.timeline({
- targets: '.color-02',
- direction: 'alternate'
- }).add({
- translateX: 300
- }).add({
- translateY: 300
- }).add({
- rotate: 360
- }).add({
- scale: 0
+ var obj = {
+ data: '30px'
+ }
+ anime({
+ targets: '.color-01',
+ width: ['100vw', '2rem'],
+ easing: 'linear'
+ })
+ anime({
+ targets: obj,
+ data: '2rem'
})
-
- // var el01 = document.querySelector('.color-01');
- // el01.addEventListener('mouseenter', mouseenter, false);
- // el01.addEventListener('mouseleave', mouseleave, false);
</script>
</body>
</html>
\ No newline at end of file
diff --git a/documentation/examples/anime-speed-test.html b/documentation/examples/anime-speed-test.html
index 7672f168..9f27530b 100644
--- a/documentation/examples/anime-speed-test.html
+++ b/documentation/examples/anime-speed-test.html
@@ -18,7 +18,7 @@
<link href="../assets/css/anime.css" rel="stylesheet">
<script src="../../anime.js"></script>
<!-- <script src="../assets/js/anime.3.0.0-alpha.js"></script> -->
- <!-- <script src="../assets/js/anime.2.2.0.js"></script> -->
+ <!-- <script src="../assets/js/anime/anime.2.2.0.js"></script> -->
<!-- <script src="../assets/js/anime.2.0.1.js"></script> -->
<!-- <script src="../assets/js/anime.1.3.js"></script> -->
<style>
@@ -49,7 +49,7 @@
<body>
<script>
- var numberOfEls = 200;
+ var numberOfEls = 500;
var duration = 4000;
var midScreenX = window.innerWidth / 2;
var midScreenY = window.innerHeight / 2;
@@ -61,21 +61,35 @@
var el = document.createElement('div');
el.classList.add('particule');
el.style.backgroundColor = 'hsl(' + hue + ', 100%, 50%)';
+ el.style.transform = 'rotate(' + i * 1 + 'deg) translateX(1000vw)';
+
+ document.body.appendChild(el);
anime({
targets: el,
- rotate: [i * 1, '+=360'],
- loop: true,
+ //rotate: '+=2turn',
+ translateX: '10vw',
+ // scaleY: [
+ // {value: [1, .1]},
+ // {value: 1}
+ // ],
+ // height: [
+ // {value: ['10rem', '1rem']},
+ // {value: '1rem'}
+ // ],
+ // height: [
+ // {value: '10px'},
+ // {value: anime.getValue(el, 'height', 'px')}
+ // ],
easing: 'linear',
- duration: duration
+ //direction: 'alternate',
+ duration: duration,
+ loop: true
});
- fragment.appendChild(el);
}
- document.body.appendChild(fragment);
-
</script>
- <script src="../assets/js/stats.js"></script>
+ <script src="../assets/js/vendors/stats.min.js"></script>
</body>
</html>
diff --git a/documentation/index.html b/documentation/index.html
index 8475b927..24cfedb8 100644
--- a/documentation/index.html
+++ b/documentation/index.html
@@ -17,7 +17,6 @@
<link rel="icon" type="image/png" href="assets/img/icons/favicon.png" >
<link href="//cloud.typenetwork.com/projects/2160/fontface.css/" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Space+Mono" rel="stylesheet">
- <link href="assets/css/anime.css" rel="stylesheet">
<link href="assets/css/anime-theme.css" rel="stylesheet">
<link href="assets/css/documentation.css" rel="stylesheet">
<script src="../anime.js"></script>