Skip to content

armgit / anime

Public Imported from GitHub
0

JavaScript animation engine

add color animation examples

Julian Garnier4308c2324236
diff --git a/examples/colors.html b/examples/colors.html
new file mode 100644
index 00000000..229c1df2
--- /dev/null
+++ b/examples/colors.html
@@ -0,0 +1,68 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>anime.js</title>
+ <meta charset="utf-8">
+ <link rel="icon" type="image/png" href="img/favicon.png" />
+ <link rel="apple-touch-icon" href="img/apple-touch-icon.png" />
+</head>
+<style>
+
+ * {
+ margin: 0;
+ padding: 0;
+ }
+
+ body {
+ background-color: black;
+ font-family: monospace;
+ }
+
+ section {
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ display: flex;
+ justify-content: center;
+ }
+
+ div {
+ width: 10vw;
+ height: 10vw;
+ margin: auto;
+ color: white;
+ line-height: 10vw;
+ text-align: center;
+ }
+
+</style>
+</head>
+<body>
+ <section>
+ <div class="hex">hex</div>
+ <div class="rgb">rgb</div>
+ <div class="hsl">hsl</div>
+ </section>
+ <script src="../anime.js"></script>
+ <script>
+ var hex = anime({
+ targets: '.hex',
+ backgroundColor: '#319BFF',
+ duration: 2000,
+ loop: true
+ });
+ var rgb = anime({
+ targets: '.rgb',
+ backgroundColor: 'rgb(49,155,255)',
+ duration: 2000,
+ loop: true
+ });
+ var hsl = anime({
+ targets: '.hsl',
+ backgroundColor: 'hsl(210,100%,60%)',
+ duration: 2000,
+ loop: true
+ });
+ </script>
+</body>
+</html>
diff --git a/examples/svg-path.html b/examples/svg-path.html
index e0a17b2f..aadda0da 100644
--- a/examples/svg-path.html
+++ b/examples/svg-path.html
@@ -39,12 +39,12 @@
</section>
<script src="../anime.js"></script>
<script>
- anime({
- targets: 'svg',
- rotate: 180,
- duration: 2000,
- loop: true
- });
+ anime({
+ targets: 'svg',
+ rotate: 180,
+ duration: 2000,
+ loop: true
+ });
anime({
targets: 'path',
d: 'M72,160 C72,115 16,84 50,50 C84,16 115,72 160,72 C205,72 236,16 270,50 C304,84 248,115 248,160 C248,205 304,236 270,270 C236,304 205,248 160,248 C115,248 84,304 50,270 C16,236 72,205 72,160 Z',