Skip to content

armgit / anime

Public Imported from GitHub
0

JavaScript animation engine

Remove old examples

Julian Garnier27fd6d9fbd61
diff --git a/documentation/assets/css/anime-theme.css b/documentation/assets/css/anime-theme.css
deleted file mode 100644
index 0b27856b..00000000
--- a/documentation/assets/css/anime-theme.css
+++ /dev/null
@@ -1,72 +0,0 @@
-.hljs {
- display: block;
- color: #C5C2CB;
-}
-
-.hljs-comment,
-.hljs-quote {
- color: #5c6370;
- font-style: italic;
-}
-
-.hljs-doctag,
-.hljs-keyword,
-.hljs-formula {
- color: #C987FE;
-}
-
-.hljs-section,
-.hljs-name,
-.hljs-selector-tag,
-.hljs-deletion,
-.hljs-subst {
- color: #e06c75;
-}
-
-.hljs-literal {
- color: #56b6c2;
-}
-
-.hljs-string,
-.hljs-regexp,
-.hljs-addition,
-.hljs-attribute,
-.hljs-meta-string {
- color: #8AFBB1;
-}
-
-.hljs-built_in,
-.hljs-class .hljs-title {
- color: #FBF88F;
-}
-
-.hljs-variable,
-.hljs-template-variable,
-.hljs-type,
-.hljs-selector-class,
-.hljs-selector-attr,
-.hljs-selector-pseudo,
-.hljs-number {
- color: #FEA388;
-}
-
-.hljs-symbol,
-.hljs-bullet,
-.hljs-link,
-.hljs-meta,
-.hljs-selector-id,
-.hljs-title {
- color: #61aeee;
-}
-
-.hljs-emphasis {
- font-style: italic;
-}
-
-.hljs-strong {
- font-weight: bold;
-}
-
-.hljs-link {
- text-decoration: underline;
-}
diff --git a/documentation/assets/css/styles.css b/documentation/assets/css/styles.css
deleted file mode 100644
index 839e5cb0..00000000
--- a/documentation/assets/css/styles.css
+++ /dev/null
@@ -1,413 +0,0 @@
-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}table{border-collapse:collapse;border-spacing:0}
-
-* {
- margin: 0;
- padding: 0;
- box-sizing: border-box;
-}
-
-html,
-body,
-header {
- background-color: #17151C;
-}
-
-body {
- position: absolute;
- width: 100%;
- height: 100%;
- color: white;
- font-family: sans-serif;
- -webkit-font-smoothing: antialiased;
- overflow-x: hidden;
-}
-
-.content {
- display: flex;
- flex-direction: row;
- width: 100%;
- height: 100%;
-}
-
-/* Header */
-
-header {
- position: -webkit-sticky;
- position: -moz-sticky;
- position: -o-sticky;
- position: -ms-sticky;
- position: sticky;
- top: 0;
- z-index: 2;
- display: flex;
- align-items: center;
- justify-content: space-between;
- width: 100%;
- height: 60px;
- padding-left: 20px;
- padding-right: 20px;
- border-bottom: 1px solid #09090B;
-}
-
-h1, h2 {
- opacity: .6;
- font-size: 22px;
- letter-spacing: 2px;
- text-transform: uppercase;
- font-weight: 200;
-}
-
-h1:hover {
- opacity: 1;
-}
-
-/* Panes */
-
-.pane {
- position: relative;
- display: flex;
- flex-direction: row;
- flex-wrap: wrap;
- height: 100%;
-}
-
-/* Sidebar */
-
-.sidebar {
- width: 240px;
- padding-top: 60px;
- border-right: 1px solid #09090B;
-}
-
-.sidebar-header {
- position: absolute;
- z-index: 1;
- top: 0;
- width: 100%;
- padding: 0;
-}
-
-.logo {
- display: flex;
- align-items: center;
- width: 240px;
- height: 60px;
- padding: 10px 0 10px 55px;
- color: white;
- text-decoration: none;
- background-image: url(../img/anime-js-v2-logo-white.png);
- background-size: 32px;
- background-position: 10px;
- background-repeat: no-repeat;
-}
-
-.navigation {
- overflow-y: scroll;
- width: 100%;
- height: 100%;
- padding: 10px 0 20px 20px;
-}
-
-.navigation ul {
- height: 30px;
- overflow-y: hidden;
- transition: opacity .4s ease;
-}
-
-.navigation a {
- display: block;
- padding-left: 15px;
- color: #FFF;
- text-decoration: none;
- font-size: 12px;
- line-height: 20px;
- text-transform: uppercase;
- background-image: linear-gradient(90deg, currentColor 0px, transparent 1px);
- background-repeat: no-repeat;
- background-size: 1px 12px;
- background-position: 0 4px;
-}
-
-.navigation ul li:first-child a {
- padding-left: 0;
- padding-top: 10px;
- padding-bottom: 10px;
- background-image: none;
-}
-
-.navigation ul a {
- opacity: .4;
- transition: opacity .4s ease, color .4s ease;
-}
-
-.navigation ul.active a {
- opacity: .7;
-}
-
-.navigation ul a:hover {
- transition: none;
- opacity: 1;
-}
-
-.navigation ul a.active {
- opacity: 1;
- color: currentColor;
-}
-
-.navigation ul.active li:first-child a,
-.navigation ul.active li:first-child a:hover {
- color: currentColor;
-}
-
-/* Code */
-
-.code-examples {
- width: 50%;
- flex-direction: column;
- border-left: 1px solid #09090B;
-}
-
-.code-pane {
- position: relative;
- border-bottom: 1px solid #09090B;
-}
-
-.code-pane-js {
- height: 66%;
-}
-
-.code-pane-html {
- height: 34%;
-}
-
-.code-header {
- position: absolute;
- top: 0;
-}
-
-pre {
- overflow: auto;
- font-family: 'Space Mono', monospace;
- line-height: 22px;
-}
-
-.code-output {
- width: 100%;
- height: 100%;
- padding: 80px 20px 20px 20px;
-}
-
-/* Demos */
-
-.demos {
- overflow-y: scroll;
- width: calc(50% - 240px);
- min-width: 330px;
-}
-
-article {
- width: 100%;
- display: flex;
- flex-direction: row;
- flex-wrap: wrap;
- align-items: flex-start;
- justify-content: flex-start;
-}
-
-.demos-title {
- opacity: 1;
-}
-
-.demo {
- position: relative;
- z-index: 1;
- display: flex;
- align-items: center;
- justify-content: center;
- width: 100%;
- min-height: 200px;
- padding-top: 35px;
- border-bottom: 1px solid #09090B;
- cursor: pointer;
-}
-
-.demo.active.controls {
- cursor: default;
-}
-
-.demo:before {
- content: "";
- position: absolute;
- z-index: 0;
- top: 0;
- left: 0;
- opacity: 0;
- display: block;
- width: 100%;
- height: 100%;
- background-color: currentColor;
-}
-
-.demo.active:before {
- opacity: .05;
-}
-
-.demo-content {
- position: relative;
- display: flex;
- flex-direction: column;
- justify-content: center;
- text-align: center;
- width: 290px;
- height: 100%;
-}
-
-#penner .demo-content {
- padding: 25px 0;
-}
-
-#timeline .demo-content,
-#motionpath .demo-content {
- padding: 40px 0;
-}
-
-.demo-title {
- position: absolute;
- top: 0;
- left: 20px;
- width: calc(100% - 40px);
- padding: 23px 0;
- font-size: 12px;
- letter-spacing: 2px;
- text-transform: uppercase;
- color: #FFF;
- opacity: .7;
-}
-
-.active .demo-title {
- color: currentColor;
- opacity: 1;
-}
-
-.demo-title:before {
- position: absolute;
- content: ""
- top: 0;
- left: 20px;
- display: block;
- width: calc(100% - 40px);
- height: 1px;
- background-color: currentColor;
-}
-
-.line {
- width: 100%;
- padding: 1px 0px;
-}
-
-.player {
- padding-top: 40px;
-}
-
-.player button {
- padding: 5px 2px;;
-}
-
-.player input {
- margin-left: 10px;
-}
-
-.text-output {
- padding-top: 10px;
- padding-bottom: 10px;
- font-size: 16px;
- color: currentColor;
- text-align: center;
- background-color: transparent;
- border: 1px solid currentColor;
-}
-
-.log {
- width: 100%;
- height: 22px;
- background: transparent;
- color: currentColor;
- border: none;
- font-size: 16px;
- text-align: center;
-}
-
-.logs {
- pointer-events: none;
- display: flex;
- flex-direction: column;
- align-items: center;
- position: absolute;
- width: 100%;
- height: 100%;
-}
-
-.log:focus {
- outline: none;
-}
-
-input.progress {
- cursor: ew-resize;
-}
-
-.square {
- pointer-events: none;
- position: relative;
- width: 28px;
- height: 28px;
- margin: 1px;
- background-color: currentColor;
- font-size: 12px;
-}
-
-.small {
- width: 18px;
- height: 18px;
-}
-
-.large {
- width: 48px;
- height: 48px;
-}
-
-.stretched {
- height: 2px;
-}
-
-.shadow {
- position: absolute;
- opacity: .2;
-}
-
-.motion-path {
- position: relative;
- margin: auto;
-}
-
-.follow-path {
- position: absolute;
- top: -9px;
- left: -9px;
-}
-
-.align-center {
- align-items: center;
-}
-
-.color-01 { color: #FF3478; }
-.color-02 { color: #F96F82; }
-.color-03 { color: #FEA388; }
-.color-04 { color: #FED28B; }
-.color-05 { color: #FBF88F; }
-.color-06 { color: #D1FA9E; }
-.color-07 { color: #8AFBB1; }
-.color-08 { color: #7BE6D6; }
-.color-09 { color: #67AAFB; }
-.color-10 { color: #4E7EFC; }
-.color-11 { color: #957FFD; }
-.color-12 { color: #C987FE; }
diff --git a/documentation/assets/fonts/Circular-Bold.woff b/documentation/assets/fonts/Circular-Bold.woff
deleted file mode 100755
index a14fb39a..00000000
Binary files a/documentation/assets/fonts/Circular-Bold.woff and /dev/null differ
diff --git a/documentation/assets/fonts/Circular-Book.woff b/documentation/assets/fonts/Circular-Book.woff
deleted file mode 100755
index 569a8228..00000000
Binary files a/documentation/assets/fonts/Circular-Book.woff and /dev/null differ
diff --git a/documentation/assets/img/anime-js-v2-logo-white.png b/documentation/assets/img/anime-js-v2-logo-white.png
deleted file mode 100644
index ae5025a0..00000000
Binary files a/documentation/assets/img/anime-js-v2-logo-white.png and /dev/null differ
diff --git a/documentation/assets/img/apple-touch-icon.png b/documentation/assets/img/apple-touch-icon.png
deleted file mode 100644
index ccbf06d3..00000000
Binary files a/documentation/assets/img/apple-touch-icon.png and /dev/null differ
diff --git a/documentation/assets/img/documentation/anime-js-v2-logo-white.png b/documentation/assets/img/documentation/anime-js-v2-logo-white.png
deleted file mode 100644
index 1a579728..00000000
Binary files a/documentation/assets/img/documentation/anime-js-v2-logo-white.png and /dev/null differ
diff --git a/documentation/assets/img/documentation/basic-anim.gif b/documentation/assets/img/documentation/basic-anim.gif
deleted file mode 100644
index d1cdaa71..00000000
Binary files a/documentation/assets/img/documentation/basic-anim.gif and /dev/null differ
diff --git a/documentation/assets/img/documentation/follow-path.gif b/documentation/assets/img/documentation/follow-path.gif
deleted file mode 100644
index 69355890..00000000
Binary files a/documentation/assets/img/documentation/follow-path.gif and /dev/null differ
diff --git a/documentation/assets/img/documentation/multi-timings.gif b/documentation/assets/img/documentation/multi-timings.gif
deleted file mode 100644
index 0706e69c..00000000
Binary files a/documentation/assets/img/documentation/multi-timings.gif and /dev/null differ
diff --git a/documentation/assets/img/documentation/playback-controls.gif b/documentation/assets/img/documentation/playback-controls.gif
deleted file mode 100644
index 8115f7f0..00000000
Binary files a/documentation/assets/img/documentation/playback-controls.gif and /dev/null differ
diff --git a/documentation/assets/img/documentation/random-values.gif b/documentation/assets/img/documentation/random-values.gif
deleted file mode 100644
index fc8d5fe2..00000000
Binary files a/documentation/assets/img/documentation/random-values.gif and /dev/null differ
diff --git a/documentation/assets/img/documentation/specific-parameters.gif b/documentation/assets/img/documentation/specific-parameters.gif
deleted file mode 100644
index 9760c707..00000000
Binary files a/documentation/assets/img/documentation/specific-parameters.gif and /dev/null differ
diff --git a/documentation/assets/img/documentation/specific-values.gif b/documentation/assets/img/documentation/specific-values.gif
deleted file mode 100644
index 95df54f6..00000000
Binary files a/documentation/assets/img/documentation/specific-values.gif and /dev/null differ
diff --git a/documentation/assets/img/favicon.png b/documentation/assets/img/favicon.png
deleted file mode 100644
index 0e4fd228..00000000
Binary files a/documentation/assets/img/favicon.png and /dev/null differ
diff --git a/documentation/assets/img/og-image.png b/documentation/assets/img/og-image.png
deleted file mode 100644
index 625a596c..00000000
Binary files a/documentation/assets/img/og-image.png and /dev/null differ
diff --git a/documentation/assets/js/beautify-html.js b/documentation/assets/js/beautify-html.js
deleted file mode 100644
index c814ccc5..00000000
--- a/documentation/assets/js/beautify-html.js
+++ /dev/null
@@ -1,1125 +0,0 @@
-/*jshint curly:true, eqeqeq:true, laxbreak:true, noempty:false */
-/*
-
- The MIT License (MIT)
-
- Copyright (c) 2007-2017 Einar Lielmanis, Liam Newman, and contributors.
-
- Permission is hereby granted, free of charge, to any person
- obtaining a copy of this software and associated documentation files
- (the "Software"), to deal in the Software without restriction,
- including without limitation the rights to use, copy, modify, merge,
- publish, distribute, sublicense, and/or sell copies of the Software,
- and to permit persons to whom the Software is furnished to do so,
- subject to the following conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
-
-
- Style HTML
----------------
-
- Written by Nochum Sossonko, ([email protected])
-
- Based on code initially developed by: Einar Lielmanis, <[email protected]>
- http://jsbeautifier.org/
-
- Usage:
- style_html(html_source);
-
- style_html(html_source, options);
-
- The options are:
- indent_inner_html (default false) — indent <head> and <body> sections,
- indent_size (default 4) — indentation size,
- indent_char (default space) — character to indent with,
- wrap_line_length (default 250) - maximum amount of characters per line (0 = disable)
- brace_style (default "collapse") - "collapse" | "expand" | "end-expand" | "none"
- put braces on the same line as control statements (default), or put braces on own line (Allman / ANSI style), or just put end braces on own line, or attempt to keep them where they are.
- unformatted (defaults to inline tags) - list of tags, that shouldn't be reformatted
- content_unformatted (defaults to pre tag) - list of tags, that its content shouldn't be reformatted
- indent_scripts (default normal) - "keep"|"separate"|"normal"
- preserve_newlines (default true) - whether existing line breaks before elements should be preserved
- Only works before elements, not inside tags or for text.
- max_preserve_newlines (default unlimited) - maximum number of line breaks to be preserved in one chunk
- indent_handlebars (default false) - format and indent {{#foo}} and {{/foo}}
- end_with_newline (false) - end with a newline
- extra_liners (default [head,body,/html]) -List of tags that should have an extra newline before them.
-
- e.g.
-
- style_html(html_source, {
- 'indent_inner_html': false,
- 'indent_size': 2,
- 'indent_char': ' ',
- 'wrap_line_length': 78,
- 'brace_style': 'expand',
- 'preserve_newlines': true,
- 'max_preserve_newlines': 5,
- 'indent_handlebars': false,
- 'extra_liners': ['/html']
- });
-*/
-
-(function() {
-
- // function trim(s) {
- // return s.replace(/^\s+|\s+$/g, '');
- // }
-
- function ltrim(s) {
- return s.replace(/^\s+/g, '');
- }
-
- function rtrim(s) {
- return s.replace(/\s+$/g, '');
- }
-
- function mergeOpts(allOptions, targetType) {
- var finalOpts = {};
- var name;
-
- for (name in allOptions) {
- if (name !== targetType) {
- finalOpts[name] = allOptions[name];
- }
- }
-
- //merge in the per type settings for the targetType
- if (targetType in allOptions) {
- for (name in allOptions[targetType]) {
- finalOpts[name] = allOptions[targetType][name];
- }
- }
- return finalOpts;
- }
-
- var lineBreak = /\r\n|[\n\r\u2028\u2029]/;
- var allLineBreaks = new RegExp(lineBreak.source, 'g');
-
- function style_html(html_source, options, js_beautify, css_beautify) {
- //Wrapper function to invoke all the necessary constructors and deal with the output.
-
- var multi_parser,
- indent_inner_html,
- indent_body_inner_html,
- indent_head_inner_html,
- indent_size,
- indent_character,
- wrap_line_length,
- brace_style,
- unformatted,
- content_unformatted,
- preserve_newlines,
- max_preserve_newlines,
- indent_handlebars,
- wrap_attributes,
- wrap_attributes_indent_size,
- is_wrap_attributes_force,
- is_wrap_attributes_force_expand_multiline,
- is_wrap_attributes_force_aligned,
- end_with_newline,
- extra_liners,
- eol;
-
- options = options || {};
-
- // Allow the setting of language/file-type specific options
- // with inheritance of overall settings
- options = mergeOpts(options, 'html');
-
- // backwards compatibility to 1.3.4
- if ((options.wrap_line_length === undefined || parseInt(options.wrap_line_length, 10) === 0) &&
- (options.max_char !== undefined && parseInt(options.max_char, 10) !== 0)) {
- options.wrap_line_length = options.max_char;
- }
-
- indent_inner_html = (options.indent_inner_html === undefined) ? false : options.indent_inner_html;
- indent_body_inner_html = (options.indent_body_inner_html === undefined) ? true : options.indent_body_inner_html;
- indent_head_inner_html = (options.indent_head_inner_html === undefined) ? true : options.indent_head_inner_html;
- indent_size = (options.indent_size === undefined) ? 4 : parseInt(options.indent_size, 10);
- indent_character = (options.indent_char === undefined) ? ' ' : options.indent_char;
- brace_style = (options.brace_style === undefined) ? 'collapse' : options.brace_style;
- wrap_line_length = parseInt(options.wrap_line_length, 10) === 0 ? 32786 : parseInt(options.wrap_line_length || 250, 10);
- unformatted = options.unformatted || [
- // https://www.w3.org/TR/html5/dom.html#phrasing-content
- 'a', 'abbr', 'area', 'audio', 'b', 'bdi', 'bdo', 'br', 'button', 'canvas', 'cite',
- 'code', 'data', 'datalist', 'del', 'dfn', 'em', 'embed', 'i', 'iframe', 'img',
- 'input', 'ins', 'kbd', 'keygen', 'label', 'map', 'mark', 'math', 'meter', 'noscript',
- 'object', 'output', 'progress', 'q', 'ruby', 's', 'samp', /* 'script', */ 'select', 'small',
- 'span', 'strong', 'sub', 'sup', 'svg', 'template', 'textarea', 'time', 'u', 'var',
- 'video', 'wbr', 'text',
- // prexisting - not sure of full effect of removing, leaving in
- 'acronym', 'address', 'big', 'dt', 'ins', 'strike', 'tt',
- ];
- content_unformatted = options.content_unformatted || [
- 'pre',
- ];
- preserve_newlines = (options.preserve_newlines === undefined) ? true : options.preserve_newlines;
- max_preserve_newlines = preserve_newlines ?
- (isNaN(parseInt(options.max_preserve_newlines, 10)) ? 32786 : parseInt(options.max_preserve_newlines, 10)) :
- 0;
- indent_handlebars = (options.indent_handlebars === undefined) ? false : options.indent_handlebars;
- wrap_attributes = (options.wrap_attributes === undefined) ? 'auto' : options.wrap_attributes;
- wrap_attributes_indent_size = (isNaN(parseInt(options.wrap_attributes_indent_size, 10))) ? indent_size : parseInt(options.wrap_attributes_indent_size, 10);
- is_wrap_attributes_force = wrap_attributes.substr(0, 'force'.length) === 'force';
- is_wrap_attributes_force_expand_multiline = (wrap_attributes === 'force-expand-multiline');
- is_wrap_attributes_force_aligned = (wrap_attributes === 'force-aligned');
- end_with_newline = (options.end_with_newline === undefined) ? false : options.end_with_newline;
- extra_liners = (typeof options.extra_liners === 'object') && options.extra_liners ?
- options.extra_liners.concat() : (typeof options.extra_liners === 'string') ?
- options.extra_liners.split(',') : 'head,body,/html'.split(',');
- eol = options.eol ? options.eol : 'auto';
-
- if (options.indent_with_tabs) {
- indent_character = '\t';
- indent_size = 1;
- }
-
- if (eol === 'auto') {
- eol = '\n';
- if (html_source && lineBreak.test(html_source || '')) {
- eol = html_source.match(lineBreak)[0];
- }
- }
-
- eol = eol.replace(/\\r/, '\r').replace(/\\n/, '\n');
-
- // HACK: newline parsing inconsistent. This brute force normalizes the input.
- html_source = html_source.replace(allLineBreaks, '\n');
-
- function Parser() {
-
- this.pos = 0; //Parser position
- this.token = '';
- this.current_mode = 'CONTENT'; //reflects the current Parser mode: TAG/CONTENT
- this.tags = { //An object to hold tags, their position, and their parent-tags, initiated with default values
- parent: 'parent1',
- parentcount: 1,
- parent1: ''
- };
- this.tag_type = '';
- this.token_text = this.last_token = this.last_text = this.token_type = '';
- this.newlines = 0;
- this.indent_content = indent_inner_html;
- this.indent_body_inner_html = indent_body_inner_html;
- this.indent_head_inner_html = indent_head_inner_html;
-
- this.Utils = { //Uilities made available to the various functions
- whitespace: "\n\r\t ".split(''),
-
- single_token: [
- // HTLM void elements - aka self-closing tags - aka singletons
- // https://www.w3.org/html/wg/drafts/html/master/syntax.html#void-elements
- 'area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'keygen',
- 'link', 'menuitem', 'meta', 'param', 'source', 'track', 'wbr',
- // NOTE: Optional tags - are not understood.
- // https://www.w3.org/TR/html5/syntax.html#optional-tags
- // The rules for optional tags are too complex for a simple list
- // Also, the content of these tags should still be indented in many cases.
- // 'li' is a good exmple.
-
- // Doctype and xml elements
- '!doctype', '?xml',
- // ?php tag
- '?php',
- // other tags that were in this list, keeping just in case
- 'basefont', 'isindex'
- ],
- extra_liners: extra_liners, //for tags that need a line of whitespace before them
- in_array: function(what, arr) {
- for (var i = 0; i < arr.length; i++) {
- if (what === arr[i]) {
- return true;
- }
- }
- return false;
- }
- };
-
- // Return true if the given text is composed entirely of whitespace.
- this.is_whitespace = function(text) {
- for (var n = 0; n < text.length; n++) {
- if (!this.Utils.in_array(text.charAt(n), this.Utils.whitespace)) {
- return false;
- }
- }
- return true;
- };
-
- this.traverse_whitespace = function() {
- var input_char = '';
-
- input_char = this.input.charAt(this.pos);
- if (this.Utils.in_array(input_char, this.Utils.whitespace)) {
- this.newlines = 0;
- while (this.Utils.in_array(input_char, this.Utils.whitespace)) {
- if (preserve_newlines && input_char === '\n' && this.newlines <= max_preserve_newlines) {
- this.newlines += 1;
- }
-
- this.pos++;
- input_char = this.input.charAt(this.pos);
- }
- return true;
- }
- return false;
- };
-
- // Append a space to the given content (string array) or, if we are
- // at the wrap_line_length, append a newline/indentation.
- // return true if a newline was added, false if a space was added
- this.space_or_wrap = function(content) {
- if (this.line_char_count >= this.wrap_line_length) { //insert a line when the wrap_line_length is reached
- this.print_newline(false, content);
- this.print_indentation(content);
- return true;
- } else {
- this.line_char_count++;
- content.push(' ');
- return false;
- }
- };
-
- this.get_content = function() { //function to capture regular content between tags
- var input_char = '',
- content = [],
- handlebarsStarted = 0;
-
- while (this.input.charAt(this.pos) !== '<' || handlebarsStarted === 2) {
- if (this.pos >= this.input.length) {
- return content.length ? content.join('') : ['', 'TK_EOF'];
- }
-
- if (this.traverse_whitespace()) {
- this.space_or_wrap(content);
- continue;
- }
-
- input_char = this.input.charAt(this.pos);
-
- if (indent_handlebars) {
- if (input_char === '{') {
- handlebarsStarted += 1;
- } else if (handlebarsStarted < 2) {
- handlebarsStarted = 0;
- }
-
- if (input_char === '}' && handlebarsStarted > 0) {
- if (handlebarsStarted-- === 0) {
- break;
- }
- }
- // Handlebars parsing is complicated.
- // {{#foo}} and {{/foo}} are formatted tags.
- // {{something}} should get treated as content, except:
- // {{else}} specifically behaves like {{#if}} and {{/if}}
- var peek3 = this.input.substr(this.pos, 3);
- if (peek3 === '{{#' || peek3 === '{{/') {
- // These are tags and not content.
- break;
- } else if (peek3 === '{{!') {
- return [this.get_tag(), 'TK_TAG_HANDLEBARS_COMMENT'];
- } else if (this.input.substr(this.pos, 2) === '{{') {
- if (this.get_tag(true) === '{{else}}') {
- break;
- }
- }
- }
-
- this.pos++;
- this.line_char_count++;
- content.push(input_char); //letter at-a-time (or string) inserted to an array
- }
- return content.length ? content.join('') : '';
- };
-
- this.get_contents_to = function(name) { //get the full content of a script or style to pass to js_beautify
- if (this.pos === this.input.length) {
- return ['', 'TK_EOF'];
- }
- var content = '';
- var reg_match = new RegExp('</' + name + '\\s*>', 'igm');
- reg_match.lastIndex = this.pos;
- var reg_array = reg_match.exec(this.input);
- var end_script = reg_array ? reg_array.index : this.input.length; //absolute end of script
- if (this.pos < end_script) { //get everything in between the script tags
- content = this.input.substring(this.pos, end_script);
- this.pos = end_script;
- }
- return content;
- };
-
- this.record_tag = function(tag) { //function to record a tag and its parent in this.tags Object
- if (this.tags[tag + 'count']) { //check for the existence of this tag type
- this.tags[tag + 'count']++;
- this.tags[tag + this.tags[tag + 'count']] = this.indent_level; //and record the present indent level
- } else { //otherwise initialize this tag type
- this.tags[tag + 'count'] = 1;
- this.tags[tag + this.tags[tag + 'count']] = this.indent_level; //and record the present indent level
- }
- this.tags[tag + this.tags[tag + 'count'] + 'parent'] = this.tags.parent; //set the parent (i.e. in the case of a div this.tags.div1parent)
- this.tags.parent = tag + this.tags[tag + 'count']; //and make this the current parent (i.e. in the case of a div 'div1')
- };
-
- this.retrieve_tag = function(tag) { //function to retrieve the opening tag to the corresponding closer
- if (this.tags[tag + 'count']) { //if the openener is not in the Object we ignore it
- var temp_parent = this.tags.parent; //check to see if it's a closable tag.
- while (temp_parent) { //till we reach '' (the initial value);
- if (tag + this.tags[tag + 'count'] === temp_parent) { //if this is it use it
- break;
- }
- temp_parent = this.tags[temp_parent + 'parent']; //otherwise keep on climbing up the DOM Tree
- }
- if (temp_parent) { //if we caught something
- this.indent_level = this.tags[tag + this.tags[tag + 'count']]; //set the indent_level accordingly
- this.tags.parent = this.tags[temp_parent + 'parent']; //and set the current parent
- }
- delete this.tags[tag + this.tags[tag + 'count'] + 'parent']; //delete the closed tags parent reference...
- delete this.tags[tag + this.tags[tag + 'count']]; //...and the tag itself
- if (this.tags[tag + 'count'] === 1) {
- delete this.tags[tag + 'count'];
- } else {
- this.tags[tag + 'count']--;
- }
- }
- };
-
- this.indent_to_tag = function(tag) {
- // Match the indentation level to the last use of this tag, but don't remove it.
- if (!this.tags[tag + 'count']) {
- return;
- }
- var temp_parent = this.tags.parent;
- while (temp_parent) {
- if (tag + this.tags[tag + 'count'] === temp_parent) {
- break;
- }
- temp_parent = this.tags[temp_parent + 'parent'];
- }
- if (temp_parent) {
- this.indent_level = this.tags[tag + this.tags[tag + 'count']];
- }
- };
-
- this.get_tag = function(peek) { //function to get a full tag and parse its type
- var input_char = '',
- content = [],
- comment = '',
- space = false,
- first_attr = true,
- has_wrapped_attrs = false,
- tag_start, tag_end,
- tag_start_char,
- orig_pos = this.pos,
- orig_line_char_count = this.line_char_count,
- is_tag_closed = false,
- tail;
-
- peek = peek !== undefined ? peek : false;
-
- do {
- if (this.pos >= this.input.length) {
- if (peek) {
- this.pos = orig_pos;
- this.line_char_count = orig_line_char_count;
- }
- return content.length ? content.join('') : ['', 'TK_EOF'];
- }
-
- input_char = this.input.charAt(this.pos);
- this.pos++;
-
- if (this.Utils.in_array(input_char, this.Utils.whitespace)) { //don't want to insert unnecessary space
- space = true;
- continue;
- }
-
- if (input_char === "'" || input_char === '"') {
- input_char += this.get_unformatted(input_char);
- space = true;
- }
-
- if (input_char === '=') { //no space before =
- space = false;
- }
- tail = this.input.substr(this.pos - 1);
- if (is_wrap_attributes_force_expand_multiline && has_wrapped_attrs && !is_tag_closed && (input_char === '>' || input_char === '/')) {
- if (tail.match(/^\/?\s*>/)) {
- space = false;
- is_tag_closed = true;
- this.print_newline(false, content);
- this.print_indentation(content);
- }
- }
- if (content.length && content[content.length - 1] !== '=' && input_char !== '>' && space) {
- //no space after = or before >
- var wrapped = this.space_or_wrap(content);
- var indentAttrs = wrapped && input_char !== '/' && !is_wrap_attributes_force;
- space = false;
-
- if (is_wrap_attributes_force && input_char !== '/') {
- var force_first_attr_wrap = false;
- if (is_wrap_attributes_force_expand_multiline && first_attr) {
- var is_only_attribute = tail.match(/^\S*(="([^"]|\\")*")?\s*\/?\s*>/) !== null;
- force_first_attr_wrap = !is_only_attribute;
- }
- if (!first_attr || force_first_attr_wrap) {
- this.print_newline(false, content);
- this.print_indentation(content);
- indentAttrs = true;
- }
- }
- if (indentAttrs) {
- has_wrapped_attrs = true;
-
- //indent attributes an auto, forced, or forced-align line-wrap
- var alignment_size = wrap_attributes_indent_size;
- if (is_wrap_attributes_force_aligned) {
- alignment_size = content.indexOf(' ') + 1;
- }
-
- for (var count = 0; count < alignment_size; count++) {
- content.push(indent_character);
- }
- }
- if (first_attr) {
- for (var i = 0; i < content.length; i++) {
- if (content[i] === ' ') {
- first_attr = false;
- break;
- }
- }
- }
- }
-
- if (indent_handlebars && tag_start_char === '<') {
- // When inside an angle-bracket tag, put spaces around
- // handlebars not inside of strings.
- if ((input_char + this.input.charAt(this.pos)) === '{{') {
- input_char += this.get_unformatted('}}');
- if (content.length && content[content.length - 1] !== ' ' && content[content.length - 1] !== '<') {
- input_char = ' ' + input_char;
- }
- space = true;
- }
- }
-
- if (input_char === '<' && !tag_start_char) {
- tag_start = this.pos - 1;
- tag_start_char = '<';
- }
-
- if (indent_handlebars && !tag_start_char) {
- if (content.length >= 2 && content[content.length - 1] === '{' && content[content.length - 2] === '{') {
- if (input_char === '#' || input_char === '/' || input_char === '!') {
- tag_start = this.pos - 3;
- } else {
- tag_start = this.pos - 2;
- }
- tag_start_char = '{';
- }
- }
-
- this.line_char_count++;
- content.push(input_char); //inserts character at-a-time (or string)
-
- if (content[1] && (content[1] === '!' || content[1] === '?' || content[1] === '%')) { //if we're in a comment, do something special
- // We treat all comments as literals, even more than preformatted tags
- // we just look for the appropriate close tag
- content = [this.get_comment(tag_start)];
- break;
- }
-
- if (indent_handlebars && content[1] && content[1] === '{' && content[2] && content[2] === '!') { //if we're in a comment, do something special
- // We treat all comments as literals, even more than preformatted tags
- // we just look for the appropriate close tag
- content = [this.get_comment(tag_start)];
- break;
- }
-
- if (indent_handlebars && tag_start_char === '{' && content.length > 2 && content[content.length - 2] === '}' && content[content.length - 1] === '}') {
- break;
- }
- } while (input_char !== '>');
-
- var tag_complete = content.join('');
- var tag_index;
- var tag_offset;
-
- if (tag_complete.indexOf('\n') !== -1) { //if there's a line break, thats where the tag name ends
- tag_index = tag_complete.indexOf('\n');
- } else if (tag_complete.indexOf(' ') !== -1) { //if there's whitespace, thats where the tag name ends
- tag_index = tag_complete.indexOf(' ');
- } else if (tag_complete.charAt(0) === '{') {
- tag_index = tag_complete.indexOf('}');
- } else { //otherwise go with the tag ending
- tag_index = tag_complete.indexOf('>');
- }
- if (tag_complete.charAt(0) === '<' || !indent_handlebars) {
- tag_offset = 1;
- } else {
- tag_offset = tag_complete.charAt(2) === '#' ? 3 : 2;
- }
- var tag_check = tag_complete.substring(tag_offset, tag_index).toLowerCase();
- if (tag_complete.charAt(tag_complete.length - 2) === '/' ||
- this.Utils.in_array(tag_check, this.Utils.single_token)) { //if this tag name is a single tag type (either in the list or has a closing /)
- if (!peek) {
- this.tag_type = 'SINGLE';
- }
- } else if (indent_handlebars && tag_complete.charAt(0) === '{' && tag_check === 'else') {
- if (!peek) {
- this.indent_to_tag('if');
- this.tag_type = 'HANDLEBARS_ELSE';
- this.indent_content = true;
- this.traverse_whitespace();
- }
- } else if (this.is_unformatted(tag_check, unformatted) ||
- this.is_unformatted(tag_check, content_unformatted)) {
- // do not reformat the "unformatted" or "content_unformatted" tags
- comment = this.get_unformatted('</' + tag_check + '>', tag_complete); //...delegate to get_unformatted function
- content.push(comment);
- tag_end = this.pos - 1;
- this.tag_type = 'SINGLE';
- } else if (tag_check === 'script' &&
- (tag_complete.search('type') === -1 ||
- (tag_complete.search('type') > -1 &&
- tag_complete.search(/\b(text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect)/) > -1))) {
- if (!peek) {
- this.record_tag(tag_check);
- this.tag_type = 'SCRIPT';
- }
- } else if (tag_check === 'style' &&
- (tag_complete.search('type') === -1 ||
- (tag_complete.search('type') > -1 && tag_complete.search('text/css') > -1))) {
- if (!peek) {
- this.record_tag(tag_check);
- this.tag_type = 'STYLE';
- }
- } else if (tag_check.charAt(0) === '!') { //peek for <! comment
- // for comments content is already correct.
- if (!peek) {
- this.tag_type = 'SINGLE';
- this.traverse_whitespace();
- }
- } else if (!peek) {
- if (tag_check.charAt(0) === '/') { //this tag is a double tag so check for tag-ending
- this.retrieve_tag(tag_check.substring(1)); //remove it and all ancestors
- this.tag_type = 'END';
- } else { //otherwise it's a start-tag
- this.record_tag(tag_check); //push it on the tag stack
- if (tag_check.toLowerCase() !== 'html') {
- this.indent_content = true;
- }
- this.tag_type = 'START';
- }
-
- // Allow preserving of newlines after a start or end tag
- if (this.traverse_whitespace()) {
- this.space_or_wrap(content);
- }
-
- if (this.Utils.in_array(tag_check, this.Utils.extra_liners)) { //check if this double needs an extra line
- this.print_newline(false, this.output);
- if (this.output.length && this.output[this.output.length - 2] !== '\n') {
- this.print_newline(true, this.output);
- }
- }
- }
-
- if (peek) {
- this.pos = orig_pos;
- this.line_char_count = orig_line_char_count;
- }
-
- return content.join(''); //returns fully formatted tag
- };
-
- this.get_comment = function(start_pos) { //function to return comment content in its entirety
- // this is will have very poor perf, but will work for now.
- var comment = '',
- delimiter = '>',
- matched = false;
-
- this.pos = start_pos;
- var input_char = this.input.charAt(this.pos);
- this.pos++;
-
- while (this.pos <= this.input.length) {
- comment += input_char;
-
- // only need to check for the delimiter if the last chars match
- if (comment.charAt(comment.length - 1) === delimiter.charAt(delimiter.length - 1) &&
- comment.indexOf(delimiter) !== -1) {
- break;
- }
-
- // only need to search for custom delimiter for the first few characters
- if (!matched && comment.length < 10) {
- if (comment.indexOf('<![if') === 0) { //peek for <![if conditional comment
- delimiter = '<![endif]>';
- matched = true;
- } else if (comment.indexOf('<![cdata[') === 0) { //if it's a <[cdata[ comment...
- delimiter = ']]>';
- matched = true;
- } else if (comment.indexOf('<![') === 0) { // some other ![ comment? ...
- delimiter = ']>';
- matched = true;
- } else if (comment.indexOf('<!--') === 0) { // <!-- comment ...
- delimiter = '-->';
- matched = true;
- } else if (comment.indexOf('{{!--') === 0) { // {{!-- handlebars comment
- delimiter = '--}}';
- matched = true;
- } else if (comment.indexOf('{{!') === 0) { // {{! handlebars comment
- if (comment.length === 5 && comment.indexOf('{{!--') === -1) {
- delimiter = '}}';
- matched = true;
- }
- } else if (comment.indexOf('<?') === 0) { // {{! handlebars comment
- delimiter = '?>';
- matched = true;
- } else if (comment.indexOf('<%') === 0) { // {{! handlebars comment
- delimiter = '%>';
- matched = true;
- }
- }
-
- input_char = this.input.charAt(this.pos);
- this.pos++;
- }
-
- return comment;
- };
-
- function tokenMatcher(delimiter) {
- var token = '';
-
- var add = function(str) {
- var newToken = token + str.toLowerCase();
- token = newToken.length <= delimiter.length ? newToken : newToken.substr(newToken.length - delimiter.length, delimiter.length);
- };
-
- var doesNotMatch = function() {
- return token.indexOf(delimiter) === -1;
- };
-
- return {
- add: add,
- doesNotMatch: doesNotMatch
- };
- }
-
- this.get_unformatted = function(delimiter, orig_tag) { //function to return unformatted content in its entirety
- if (orig_tag && orig_tag.toLowerCase().indexOf(delimiter) !== -1) {
- return '';
- }
- var input_char = '';
- var content = '';
- var space = true;
-
- var delimiterMatcher = tokenMatcher(delimiter);
-
- do {
-
- if (this.pos >= this.input.length) {
- return content;
- }
-
- input_char = this.input.charAt(this.pos);
- this.pos++;
-
- if (this.Utils.in_array(input_char, this.Utils.whitespace)) {
- if (!space) {
- this.line_char_count--;
- continue;
- }
- if (input_char === '\n' || input_char === '\r') {
- content += '\n';
- /* Don't change tab indention for unformatted blocks. If using code for html editing, this will greatly affect <pre> tags if they are specified in the 'unformatted array'
- for (var i=0; i<this.indent_level; i++) {
- content += this.indent_string;
- }
- space = false; //...and make sure other indentation is erased
- */
- this.line_char_count = 0;
- continue;
- }
- }
- content += input_char;
- delimiterMatcher.add(input_char);
- this.line_char_count++;
- space = true;
-
- if (indent_handlebars && input_char === '{' && content.length && content.charAt(content.length - 2) === '{') {
- // Handlebars expressions in strings should also be unformatted.
- content += this.get_unformatted('}}');
- // Don't consider when stopping for delimiters.
- }
- } while (delimiterMatcher.doesNotMatch());
-
- return content;
- };
-
- this.get_token = function() { //initial handler for token-retrieval
- var token;
-
- if (this.last_token === 'TK_TAG_SCRIPT' || this.last_token === 'TK_TAG_STYLE') { //check if we need to format javascript
- var type = this.last_token.substr(7);
- token = this.get_contents_to(type);
- if (typeof token !== 'string') {
- return token;
- }
- return [token, 'TK_' + type];
- }
- if (this.current_mode === 'CONTENT') {
- token = this.get_content();
- if (typeof token !== 'string') {
- return token;
- } else {
- return [token, 'TK_CONTENT'];
- }
- }
-
- if (this.current_mode === 'TAG') {
- token = this.get_tag();
- if (typeof token !== 'string') {
- return token;
- } else {
- var tag_name_type = 'TK_TAG_' + this.tag_type;
- return [token, tag_name_type];
- }
- }
- };
-
- this.get_full_indent = function(level) {
- level = this.indent_level + level || 0;
- if (level < 1) {
- return '';
- }
-
- return Array(level + 1).join(this.indent_string);
- };
-
- this.is_unformatted = function(tag_check, unformatted) {
- //is this an HTML5 block-level link?
- if (!this.Utils.in_array(tag_check, unformatted)) {
- return false;
- }
-
- if (tag_check.toLowerCase() !== 'a' || !this.Utils.in_array('a', unformatted)) {
- return true;
- }
-
- //at this point we have an tag; is its first child something we want to remain
- //unformatted?
- var next_tag = this.get_tag(true /* peek. */ );
-
- // test next_tag to see if it is just html tag (no external content)
- var tag = (next_tag || "").match(/^\s*<\s*\/?([a-z]*)\s*[^>]*>\s*$/);
-
- // if next_tag comes back but is not an isolated tag, then
- // let's treat the 'a' tag as having content
- // and respect the unformatted option
- if (!tag || this.Utils.in_array(tag, unformatted)) {
- return true;
- } else {
- return false;
- }
- };
-
- this.printer = function(js_source, indent_character, indent_size, wrap_line_length, brace_style) { //handles input/output and some other printing functions
-
- this.input = js_source || ''; //gets the input for the Parser
-
- // HACK: newline parsing inconsistent. This brute force normalizes the input.
- this.input = this.input.replace(/\r\n|[\r\u2028\u2029]/g, '\n');
-
- this.output = [];
- this.indent_character = indent_character;
- this.indent_string = '';
- this.indent_size = indent_size;
- this.brace_style = brace_style;
- this.indent_level = 0;
- this.wrap_line_length = wrap_line_length;
- this.line_char_count = 0; //count to see if wrap_line_length was exceeded
-
- for (var i = 0; i < this.indent_size; i++) {
- this.indent_string += this.indent_character;
- }
-
- this.print_newline = function(force, arr) {
- this.line_char_count = 0;
- if (!arr || !arr.length) {
- return;
- }
- if (force || (arr[arr.length - 1] !== '\n')) { //we might want the extra line
- if ((arr[arr.length - 1] !== '\n')) {
- arr[arr.length - 1] = rtrim(arr[arr.length - 1]);
- }
- arr.push('\n');
- }
- };
-
- this.print_indentation = function(arr) {
- for (var i = 0; i < this.indent_level; i++) {
- arr.push(this.indent_string);
- this.line_char_count += this.indent_string.length;
- }
- };
-
- this.print_token = function(text) {
- // Avoid printing initial whitespace.
- if (this.is_whitespace(text) && !this.output.length) {
- return;
- }
- if (text || text !== '') {
- if (this.output.length && this.output[this.output.length - 1] === '\n') {
- this.print_indentation(this.output);
- text = ltrim(text);
- }
- }
- this.print_token_raw(text);
- };
-
- this.print_token_raw = function(text) {
- // If we are going to print newlines, truncate trailing
- // whitespace, as the newlines will represent the space.
- if (this.newlines > 0) {
- text = rtrim(text);
- }
-
- if (text && text !== '') {
- if (text.length > 1 && text.charAt(text.length - 1) === '\n') {
- // unformatted tags can grab newlines as their last character
- this.output.push(text.slice(0, -1));
- this.print_newline(false, this.output);
- } else {
- this.output.push(text);
- }
- }
-
- for (var n = 0; n < this.newlines; n++) {
- this.print_newline(n > 0, this.output);
- }
- this.newlines = 0;
- };
-
- this.indent = function() {
- this.indent_level++;
- };
-
- this.unindent = function() {
- if (this.indent_level > 0) {
- this.indent_level--;
- }
- };
- };
- return this;
- }
-
- /*_____________________--------------------_____________________*/
-
- multi_parser = new Parser(); //wrapping functions Parser
- multi_parser.printer(html_source, indent_character, indent_size, wrap_line_length, brace_style); //initialize starting values
-
- while (true) {
- var t = multi_parser.get_token();
- multi_parser.token_text = t[0];
- multi_parser.token_type = t[1];
-
- if (multi_parser.token_type === 'TK_EOF') {
- break;
- }
-
- switch (multi_parser.token_type) {
- case 'TK_TAG_START':
- multi_parser.print_newline(false, multi_parser.output);
- multi_parser.print_token(multi_parser.token_text);
- if (multi_parser.indent_content) {
- if ((multi_parser.indent_body_inner_html || !multi_parser.token_text.match(/<body(?:.*)>/)) &&
- (multi_parser.indent_head_inner_html || !multi_parser.token_text.match(/<head(?:.*)>/))) {
-
- multi_parser.indent();
- }
-
- multi_parser.indent_content = false;
- }
- multi_parser.current_mode = 'CONTENT';
- break;
- case 'TK_TAG_STYLE':
- case 'TK_TAG_SCRIPT':
- multi_parser.print_newline(false, multi_parser.output);
- multi_parser.print_token(multi_parser.token_text);
- multi_parser.current_mode = 'CONTENT';
- break;
- case 'TK_TAG_END':
- //Print new line only if the tag has no content and has child
- if (multi_parser.last_token === 'TK_CONTENT' && multi_parser.last_text === '') {
- var tag_name = (multi_parser.token_text.match(/\w+/) || [])[0];
- var tag_extracted_from_last_output = null;
- if (multi_parser.output.length) {
- tag_extracted_from_last_output = multi_parser.output[multi_parser.output.length - 1].match(/(?:<|{{#)\s*(\w+)/);
- }
- if (tag_extracted_from_last_output === null ||
- (tag_extracted_from_last_output[1] !== tag_name && !multi_parser.Utils.in_array(tag_extracted_from_last_output[1], unformatted))) {
- multi_parser.print_newline(false, multi_parser.output);
- }
- }
- multi_parser.print_token(multi_parser.token_text);
- multi_parser.current_mode = 'CONTENT';
- break;
- case 'TK_TAG_SINGLE':
- // Don't add a newline before elements that should remain unformatted.
- var tag_check = multi_parser.token_text.match(/^\s*<([a-z-]+)/i);
- if (!tag_check || !multi_parser.Utils.in_array(tag_check[1], unformatted)) {
- multi_parser.print_newline(false, multi_parser.output);
- }
- multi_parser.print_token(multi_parser.token_text);
- multi_parser.current_mode = 'CONTENT';
- break;
- case 'TK_TAG_HANDLEBARS_ELSE':
- // Don't add a newline if opening {{#if}} tag is on the current line
- var foundIfOnCurrentLine = false;
- for (var lastCheckedOutput = multi_parser.output.length - 1; lastCheckedOutput >= 0; lastCheckedOutput--) {
- if (multi_parser.output[lastCheckedOutput] === '\n') {
- break;
- } else {
- if (multi_parser.output[lastCheckedOutput].match(/{{#if/)) {
- foundIfOnCurrentLine = true;
- break;
- }
- }
- }
- if (!foundIfOnCurrentLine) {
- multi_parser.print_newline(false, multi_parser.output);
- }
- multi_parser.print_token(multi_parser.token_text);
- if (multi_parser.indent_content) {
- multi_parser.indent();
- multi_parser.indent_content = false;
- }
- multi_parser.current_mode = 'CONTENT';
- break;
- case 'TK_TAG_HANDLEBARS_COMMENT':
- multi_parser.print_token(multi_parser.token_text);
- multi_parser.current_mode = 'TAG';
- break;
- case 'TK_CONTENT':
- multi_parser.print_token(multi_parser.token_text);
- multi_parser.current_mode = 'TAG';
- break;
- case 'TK_STYLE':
- case 'TK_SCRIPT':
- if (multi_parser.token_text !== '') {
- multi_parser.print_newline(false, multi_parser.output);
- var text = multi_parser.token_text,
- _beautifier,
- script_indent_level = 1;
- if (multi_parser.token_type === 'TK_SCRIPT') {
- _beautifier = typeof js_beautify === 'function' && js_beautify;
- } else if (multi_parser.token_type === 'TK_STYLE') {
- _beautifier = typeof css_beautify === 'function' && css_beautify;
- }
-
- if (options.indent_scripts === "keep") {
- script_indent_level = 0;
- } else if (options.indent_scripts === "separate") {
- script_indent_level = -multi_parser.indent_level;
- }
-
- var indentation = multi_parser.get_full_indent(script_indent_level);
- if (_beautifier) {
-
- // call the Beautifier if avaliable
- var Child_options = function() {
- this.eol = '\n';
- };
- Child_options.prototype = options;
- var child_options = new Child_options();
- text = _beautifier(text.replace(/^\s*/, indentation), child_options);
- } else {
- // simply indent the string otherwise
- var white = text.match(/^\s*/)[0];
- var _level = white.match(/[^\n\r]*$/)[0].split(multi_parser.indent_string).length - 1;
- var reindent = multi_parser.get_full_indent(script_indent_level - _level);
- text = text.replace(/^\s*/, indentation)
- .replace(/\r\n|\r|\n/g, '\n' + reindent)
- .replace(/\s+$/, '');
- }
- if (text) {
- multi_parser.print_token_raw(text);
- multi_parser.print_newline(true, multi_parser.output);
- }
- }
- multi_parser.current_mode = 'TAG';
- break;
- default:
- // We should not be getting here but we don't want to drop input on the floor
- // Just output the text and move on
- if (multi_parser.token_text !== '') {
- multi_parser.print_token(multi_parser.token_text);
- }
- break;
- }
- multi_parser.last_token = multi_parser.token_type;
- multi_parser.last_text = multi_parser.token_text;
- }
- var sweet_code = multi_parser.output.join('').replace(/[\r\n\t ]+$/, '');
-
- // establish end_with_newline
- if (end_with_newline) {
- sweet_code += '\n';
- }
-
- if (eol !== '\n') {
- sweet_code = sweet_code.replace(/[\n]/g, eol);
- }
-
- return sweet_code;
- }
-
- if (typeof define === "function" && define.amd) {
- // Add support for AMD ( https://github.com/amdjs/amdjs-api/wiki/AMD#defineamd-property- )
- define(["require", "./beautify", "./beautify-css"], function(requireamd) {
- var js_beautify = requireamd("./beautify");
- var css_beautify = requireamd("./beautify-css");
-
- return {
- html_beautify: function(html_source, options) {
- return style_html(html_source, options, js_beautify.js_beautify, css_beautify.css_beautify);
- }
- };
- });
- } else if (typeof exports !== "undefined") {
- // Add support for CommonJS. Just put this file somewhere on your require.paths
- // and you will be able to `var html_beautify = require("beautify").html_beautify`.
- var js_beautify = require('./beautify.js');
- var css_beautify = require('./beautify-css.js');
-
- exports.html_beautify = function(html_source, options) {
- return style_html(html_source, options, js_beautify.js_beautify, css_beautify.css_beautify);
- };
- } else if (typeof window !== "undefined") {
- // If we're running a web page and don't have either of the above, add our one global
- window.html_beautify = function(html_source, options) {
- return style_html(html_source, options, window.js_beautify, window.css_beautify);
- };
- } else if (typeof global !== "undefined") {
- // If we don't even have window, try global.
- global.html_beautify = function(html_source, options) {
- return style_html(html_source, options, global.js_beautify, global.css_beautify);
- };
- }
-
-}());
diff --git a/documentation/assets/js/highlight.pack.js b/documentation/assets/js/highlight.pack.js
deleted file mode 100644
index 11063f6f..00000000
--- a/documentation/assets/js/highlight.pack.js
+++ /dev/null
@@ -1,2 +0,0 @@
-/*! highlight.js v9.9.0 | BSD3 License | git.io/hljslicense */
-!function(e){var n="object"==typeof window&&window||"object"==typeof self&&self;"undefined"!=typeof exports?e(exports):n&&(n.hljs=e({}),"function"==typeof define&&define.amd&&define([],function(){return n.hljs}))}(function(e){function n(e){return e.replace(/[&<>]/gm,function(e){return I[e]})}function t(e){return e.nodeName.toLowerCase()}function r(e,n){var t=e&&e.exec(n);return t&&0===t.index}function i(e){return k.test(e)}function a(e){var n,t,r,a,o=e.className+" ";if(o+=e.parentNode?e.parentNode.className:"",t=B.exec(o))return R(t[1])?t[1]:"no-highlight";for(o=o.split(/\s+/),n=0,r=o.length;r>n;n++)if(a=o[n],i(a)||R(a))return a}function o(e,n){var t,r={};for(t in e)r[t]=e[t];if(n)for(t in n)r[t]=n[t];return r}function u(e){var n=[];return function r(e,i){for(var a=e.firstChild;a;a=a.nextSibling)3===a.nodeType?i+=a.nodeValue.length:1===a.nodeType&&(n.push({event:"start",offset:i,node:a}),i=r(a,i),t(a).match(/br|hr|img|input/)||n.push({event:"stop",offset:i,node:a}));return i}(e,0),n}function c(e,r,i){function a(){return e.length&&r.length?e[0].offset!==r[0].offset?e[0].offset<r[0].offset?e:r:"start"===r[0].event?e:r:e.length?e:r}function o(e){function r(e){return" "+e.nodeName+'="'+n(e.value)+'"'}l+="<"+t(e)+w.map.call(e.attributes,r).join("")+">"}function u(e){l+="</"+t(e)+">"}function c(e){("start"===e.event?o:u)(e.node)}for(var s=0,l="",f=[];e.length||r.length;){var g=a();if(l+=n(i.substring(s,g[0].offset)),s=g[0].offset,g===e){f.reverse().forEach(u);do c(g.splice(0,1)[0]),g=a();while(g===e&&g.length&&g[0].offset===s);f.reverse().forEach(o)}else"start"===g[0].event?f.push(g[0].node):f.pop(),c(g.splice(0,1)[0])}return l+n(i.substr(s))}function s(e){function n(e){return e&&e.source||e}function t(t,r){return new RegExp(n(t),"m"+(e.cI?"i":"")+(r?"g":""))}function r(i,a){if(!i.compiled){if(i.compiled=!0,i.k=i.k||i.bK,i.k){var u={},c=function(n,t){e.cI&&(t=t.toLowerCase()),t.split(" ").forEach(function(e){var t=e.split("|");u[t[0]]=[n,t[1]?Number(t[1]):1]})};"string"==typeof i.k?c("keyword",i.k):E(i.k).forEach(function(e){c(e,i.k[e])}),i.k=u}i.lR=t(i.l||/\w+/,!0),a&&(i.bK&&(i.b="\\b("+i.bK.split(" ").join("|")+")\\b"),i.b||(i.b=/\B|\b/),i.bR=t(i.b),i.e||i.eW||(i.e=/\B|\b/),i.e&&(i.eR=t(i.e)),i.tE=n(i.e)||"",i.eW&&a.tE&&(i.tE+=(i.e?"|":"")+a.tE)),i.i&&(i.iR=t(i.i)),null==i.r&&(i.r=1),i.c||(i.c=[]);var s=[];i.c.forEach(function(e){e.v?e.v.forEach(function(n){s.push(o(e,n))}):s.push("self"===e?i:e)}),i.c=s,i.c.forEach(function(e){r(e,i)}),i.starts&&r(i.starts,a);var l=i.c.map(function(e){return e.bK?"\\.?("+e.b+")\\.?":e.b}).concat([i.tE,i.i]).map(n).filter(Boolean);i.t=l.length?t(l.join("|"),!0):{exec:function(){return null}}}}r(e)}function l(e,t,i,a){function o(e,n){var t,i;for(t=0,i=n.c.length;i>t;t++)if(r(n.c[t].bR,e))return n.c[t]}function u(e,n){if(r(e.eR,n)){for(;e.endsParent&&e.parent;)e=e.parent;return e}return e.eW?u(e.parent,n):void 0}function c(e,n){return!i&&r(n.iR,e)}function g(e,n){var t=N.cI?n[0].toLowerCase():n[0];return e.k.hasOwnProperty(t)&&e.k[t]}function h(e,n,t,r){var i=r?"":y.classPrefix,a='<span class="'+i,o=t?"":C;return a+=e+'">',a+n+o}function p(){var e,t,r,i;if(!E.k)return n(B);for(i="",t=0,E.lR.lastIndex=0,r=E.lR.exec(B);r;)i+=n(B.substring(t,r.index)),e=g(E,r),e?(M+=e[1],i+=h(e[0],n(r[0]))):i+=n(r[0]),t=E.lR.lastIndex,r=E.lR.exec(B);return i+n(B.substr(t))}function d(){var e="string"==typeof E.sL;if(e&&!x[E.sL])return n(B);var t=e?l(E.sL,B,!0,L[E.sL]):f(B,E.sL.length?E.sL:void 0);return E.r>0&&(M+=t.r),e&&(L[E.sL]=t.top),h(t.language,t.value,!1,!0)}function b(){k+=null!=E.sL?d():p(),B=""}function v(e){k+=e.cN?h(e.cN,"",!0):"",E=Object.create(e,{parent:{value:E}})}function m(e,n){if(B+=e,null==n)return b(),0;var t=o(n,E);if(t)return t.skip?B+=n:(t.eB&&(B+=n),b(),t.rB||t.eB||(B=n)),v(t,n),t.rB?0:n.length;var r=u(E,n);if(r){var i=E;i.skip?B+=n:(i.rE||i.eE||(B+=n),b(),i.eE&&(B=n));do E.cN&&(k+=C),E.skip||(M+=E.r),E=E.parent;while(E!==r.parent);return r.starts&&v(r.starts,""),i.rE?0:n.length}if(c(n,E))throw new Error('Illegal lexeme "'+n+'" for mode "'+(E.cN||"<unnamed>")+'"');return B+=n,n.length||1}var N=R(e);if(!N)throw new Error('Unknown language: "'+e+'"');s(N);var w,E=a||N,L={},k="";for(w=E;w!==N;w=w.parent)w.cN&&(k=h(w.cN,"",!0)+k);var B="",M=0;try{for(var I,j,O=0;;){if(E.t.lastIndex=O,I=E.t.exec(t),!I)break;j=m(t.substring(O,I.index),I[0]),O=I.index+j}for(m(t.substr(O)),w=E;w.parent;w=w.parent)w.cN&&(k+=C);return{r:M,value:k,language:e,top:E}}catch(T){if(T.message&&-1!==T.message.indexOf("Illegal"))return{r:0,value:n(t)};throw T}}function f(e,t){t=t||y.languages||E(x);var r={r:0,value:n(e)},i=r;return t.filter(R).forEach(function(n){var t=l(n,e,!1);t.language=n,t.r>i.r&&(i=t),t.r>r.r&&(i=r,r=t)}),i.language&&(r.second_best=i),r}function g(e){return y.tabReplace||y.useBR?e.replace(M,function(e,n){return y.useBR&&"\n"===e?"<br>":y.tabReplace?n.replace(/\t/g,y.tabReplace):void 0}):e}function h(e,n,t){var r=n?L[n]:t,i=[e.trim()];return e.match(/\bhljs\b/)||i.push("hljs"),-1===e.indexOf(r)&&i.push(r),i.join(" ").trim()}function p(e){var n,t,r,o,s,p=a(e);i(p)||(y.useBR?(n=document.createElementNS("http://www.w3.org/1999/xhtml","div"),n.innerHTML=e.innerHTML.replace(/\n/g,"").replace(/<br[ \/]*>/g,"\n")):n=e,s=n.textContent,r=p?l(p,s,!0):f(s),t=u(n),t.length&&(o=document.createElementNS("http://www.w3.org/1999/xhtml","div"),o.innerHTML=r.value,r.value=c(t,u(o),s)),r.value=g(r.value),e.innerHTML=r.value,e.className=h(e.className,p,r.language),e.result={language:r.language,re:r.r},r.second_best&&(e.second_best={language:r.second_best.language,re:r.second_best.r}))}function d(e){y=o(y,e)}function b(){if(!b.called){b.called=!0;var e=document.querySelectorAll("pre code");w.forEach.call(e,p)}}function v(){addEventListener("DOMContentLoaded",b,!1),addEventListener("load",b,!1)}function m(n,t){var r=x[n]=t(e);r.aliases&&r.aliases.forEach(function(e){L[e]=n})}function N(){return E(x)}function R(e){return e=(e||"").toLowerCase(),x[e]||x[L[e]]}var w=[],E=Object.keys,x={},L={},k=/^(no-?highlight|plain|text)$/i,B=/\blang(?:uage)?-([\w-]+)\b/i,M=/((^(<[^>]+>|\t|)+|(?:\n)))/gm,C="</span>",y={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0},I={"&":"&amp;","<":"&lt;",">":"&gt;"};return e.highlight=l,e.highlightAuto=f,e.fixMarkup=g,e.highlightBlock=p,e.configure=d,e.initHighlighting=b,e.initHighlightingOnLoad=v,e.registerLanguage=m,e.listLanguages=N,e.getLanguage=R,e.inherit=o,e.IR="[a-zA-Z]\\w*",e.UIR="[a-zA-Z_]\\w*",e.NR="\\b\\d+(\\.\\d+)?",e.CNR="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",e.BNR="\\b(0b[01]+)",e.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",e.BE={b:"\\\\[\\s\\S]",r:0},e.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[e.BE]},e.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[e.BE]},e.PWM={b:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|like)\b/},e.C=function(n,t,r){var i=e.inherit({cN:"comment",b:n,e:t,c:[]},r||{});return i.c.push(e.PWM),i.c.push({cN:"doctag",b:"(?:TODO|FIXME|NOTE|BUG|XXX):",r:0}),i},e.CLCM=e.C("//","$"),e.CBCM=e.C("/\\*","\\*/"),e.HCM=e.C("#","$"),e.NM={cN:"number",b:e.NR,r:0},e.CNM={cN:"number",b:e.CNR,r:0},e.BNM={cN:"number",b:e.BNR,r:0},e.CSSNM={cN:"number",b:e.NR+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",r:0},e.RM={cN:"regexp",b:/\//,e:/\/[gimuy]*/,i:/\n/,c:[e.BE,{b:/\[/,e:/\]/,r:0,c:[e.BE]}]},e.TM={cN:"title",b:e.IR,r:0},e.UTM={cN:"title",b:e.UIR,r:0},e.METHOD_GUARD={b:"\\.\\s*"+e.UIR,r:0},e});hljs.registerLanguage("xml",function(s){var e="[A-Za-z0-9\\._:-]+",t={eW:!0,i:/</,r:0,c:[{cN:"attr",b:e,r:0},{b:/=\s*/,r:0,c:[{cN:"string",endsParent:!0,v:[{b:/"/,e:/"/},{b:/'/,e:/'/},{b:/[^\s"'=<>`]+/}]}]}]};return{aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist"],cI:!0,c:[{cN:"meta",b:"<!DOCTYPE",e:">",r:10,c:[{b:"\\[",e:"\\]"}]},s.C("<!--","-->",{r:10}),{b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{b:/<\?(php)?/,e:/\?>/,sL:"php",c:[{b:"/\\*",e:"\\*/",skip:!0}]},{cN:"tag",b:"<style(?=\\s|>|$)",e:">",k:{name:"style"},c:[t],starts:{e:"</style>",rE:!0,sL:["css","xml"]}},{cN:"tag",b:"<script(?=\\s|>|$)",e:">",k:{name:"script"},c:[t],starts:{e:"</script>",rE:!0,sL:["actionscript","javascript","handlebars","xml"]}},{cN:"meta",v:[{b:/<\?xml/,e:/\?>/,r:10},{b:/<\?\w+/,e:/\?>/}]},{cN:"tag",b:"</?",e:"/?>",c:[{cN:"name",b:/[^\/><\s]+/,r:0},t]}]}});hljs.registerLanguage("javascript",function(e){var r="[A-Za-z$_][0-9A-Za-z$_]*",t={keyword:"in of if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const export super debugger as async await static import from as",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect Promise"},a={cN:"number",v:[{b:"\\b(0[bB][01]+)"},{b:"\\b(0[oO][0-7]+)"},{b:e.CNR}],r:0},n={cN:"subst",b:"\\$\\{",e:"\\}",k:t,c:[]},c={cN:"string",b:"`",e:"`",c:[e.BE,n]};n.c=[e.ASM,e.QSM,c,a,e.RM];var s=n.c.concat([e.CBCM,e.CLCM]);return{aliases:["js","jsx"],k:t,c:[{cN:"meta",r:10,b:/^\s*['"]use (strict|asm)['"]/},{cN:"meta",b:/^#!/,e:/$/},e.ASM,e.QSM,c,e.CLCM,e.CBCM,a,{b:/[{,]\s*/,r:0,c:[{b:r+"\\s*:",rB:!0,r:0,c:[{cN:"attr",b:r,r:0}]}]},{b:"("+e.RSR+"|\\b(case|return|throw)\\b)\\s*",k:"return throw case",c:[e.CLCM,e.CBCM,e.RM,{cN:"function",b:"(\\(.*?\\)|"+r+")\\s*=>",rB:!0,e:"\\s*=>",c:[{cN:"params",v:[{b:r},{b:/\(\s*\)/},{b:/\(/,e:/\)/,eB:!0,eE:!0,k:t,c:s}]}]},{b:/</,e:/(\/\w+|\w+\/)>/,sL:"xml",c:[{b:/<\w+\s*\/>/,skip:!0},{b:/<\w+/,e:/(\/\w+|\w+\/)>/,skip:!0,c:[{b:/<\w+\s*\/>/,skip:!0},"self"]}]}],r:0},{cN:"function",bK:"function",e:/\{/,eE:!0,c:[e.inherit(e.TM,{b:r}),{cN:"params",b:/\(/,e:/\)/,eB:!0,eE:!0,c:s}],i:/\[|%/},{b:/\$[(.]/},e.METHOD_GUARD,{cN:"class",bK:"class",e:/[{;=]/,eE:!0,i:/[:"\[\]]/,c:[{bK:"extends"},e.UTM]},{bK:"constructor",e:/\{/,eE:!0}],i:/#(?!!)/}});
\ No newline at end of file
diff --git a/documentation/assets/js/scripts.js b/documentation/assets/js/scripts.js
deleted file mode 100644
index 6667920e..00000000
--- a/documentation/assets/js/scripts.js
+++ /dev/null
@@ -1,196 +0,0 @@
-var navigationEl = document.querySelector('.navigation');
-var demosEl = document.querySelector('.demos');
-var articleEls = document.querySelectorAll('article');
-var jsOutputEl = document.querySelector('.js-output');
-var htmlOutputEl = document.querySelector('.html-output');
-var demos = [];
-
-function getScrollTop() {
- return document.body.scrollTop || document.documentElement.scrollTop;
-}
-
-function scrollTo(selector, offset, cb) {
- var offset = offset || 0;
- var el = document.querySelector(selector);
- var scrollAnim = anime({
- targets: {scroll: demosEl.scrollTop},
- scroll: el.offsetTop - offset,
- duration: 500,
- easing: 'easeInOutQuart',
- update: function(a) { demosEl.scrollTop = a.animations[0].currentValue; },
- complete: function() { if (cb) cb(); }
- });
-}
-
-function parseHTML(el, parentId) {
- var parentEl = document.createElement('div');
- var clone = el.cloneNode(true);
- var shadowEls = clone.querySelectorAll('.shadow');
- var els = clone.querySelectorAll('.el');
- for (var i = 0; i < shadowEls.length; i++ ) shadowEls[i].remove();
- for (var i = 0; i < els.length; i++ ) els[i].removeAttribute('style');
- parentEl.id = parentId;
- parentEl.innerHTML = clone.innerHTML;
- return html_beautify(parentEl.outerHTML, {
- preserve_newlines: false,
- indent_size: 2
- });
-}
-
-function outputCode(JScode, HTMLcode) {
- var js = document.createTextNode(JScode);
- var html = document.createTextNode(HTMLcode);
- jsOutputEl.innerHTML = '';
- htmlOutputEl.innerHTML = '';
- jsOutputEl.appendChild(js);
- htmlOutputEl.appendChild(html);
- hljs.highlightBlock(jsOutputEl);
- hljs.highlightBlock(htmlOutputEl);
-}
-
-function toggleSectionLink(ulEl) {
- var ulHeight = 20;
- var ulEls = document.querySelectorAll('.navigation ul');
- for (var i = 0; i < ulEls.length; i++) ulEls[i].classList.remove('active');
- anime({
- targets: '.navigation ul',
- height: ulHeight + 10,
- duration: 400,
- easing: 'easeOutQuart'
- });
- anime.remove(ulEl);
- anime({
- targets: ulEl,
- height: function(el) {
- return el.childNodes.length * ulHeight + 20;
- },
- duration: 600,
- delay: 400,
- easing: 'easeInOutQuart'
- });
- ulEl.classList.add('active');
-}
-
-function resetDemos() {
- demos.forEach(function(demo) {
- demo.anim.pause();
- demo.anim.seek(0);
- });
-}
-
-function createDemo(el) {
- var demo = {};
- var scriptEl = el.querySelector('script');
- var demoContentEl = el.querySelector('.demo-content');
- var title = el.querySelector('h3').innerHTML;
- var id = el.id;
- var demoAnim = window[id];
- var JScode = scriptEl ? scriptEl.innerHTML : '';
- var HTMLcode = demoContentEl ? parseHTML(demoContentEl, id) : '';
- function highlightDemo(e) {
- if (e) e.preventDefault();
- if (!el.classList.contains('active')) {
- resetDemos();
- var linkEls = document.querySelectorAll('.demo-link');
- for (var i = 0; i < demos.length; i++) {
- var d = demos[i];
- d.el.classList.remove('active');
- linkEls[i].classList.remove('active');
- d.anim.pause();
- }
- history.pushState(null, null, '#'+id);
- outputCode(JScode, HTMLcode);
- var linkEl = document.querySelector('a[href="#'+id+'"]');
- var ulEl = linkEl.parentNode.parentNode;
- linkEl.classList.add('active');
- el.classList.add('active');
- scrollTo('#'+id, 60);
- toggleSectionLink(ulEl);
- }
- if (!el.classList.contains('controls')) demoAnim.restart();
- }
- function enterDemo() {
- if (!el.classList.contains('active')) {
- demoAnim.restart();
- }
- }
- function leaveDemo() {
- if (!el.classList.contains('active')) {
- demoAnim.pause();
- demoAnim.seek(0);
- }
- }
- el.addEventListener('click', highlightDemo);
- // el.addEventListener('mouseenter', enterDemo);
- // el.addEventListener('mouseleave', leaveDemo);
- resetDemos();
- return {
- el: el,
- title: title,
- id: id,
- anim: demoAnim,
- highlight: highlightDemo
- }
-}
-
-function getDemoById(id) {
- return demos.filter(function(a) { return a.id === id})[0];
-}
-
-function createLinksSection(articleEl) {
- var articleId = articleEl.id;
- var articleTitle = articleEl.querySelector('h2').innerHTML;
- var colorClass = articleEl.classList[0];
- var ulEl = document.createElement('ul');
- var liEl = document.createElement('li');
- var sectionLinkEl = document.createElement('a');
- sectionLinkEl.setAttribute('href', '#'+articleId);
- sectionLinkEl.innerHTML = articleTitle;
- sectionLinkEl.addEventListener('click', function(e) {
- e.preventDefault();
- var firstDemoId = articleEl.querySelector('.demo').id;
- var firstDemo = getDemoById(firstDemoId);
- firstDemo.highlight();
- });
- liEl.appendChild(sectionLinkEl);
- ulEl.appendChild(liEl);
- ulEl.classList.add(colorClass);
- return ulEl;
-}
-
-function createDemoLink(demo) {
- var liEl = document.createElement('li');
- var demoLinkEl = document.createElement('a');
- demoLinkEl.setAttribute('href', '#'+demo.id);
- demoLinkEl.innerHTML = demo.title;
- demoLinkEl.classList.add('demo-link');
- demoLinkEl.addEventListener('click', demo.highlight);
- liEl.appendChild(demoLinkEl);
- return liEl;
-}
-
-var fragment = document.createDocumentFragment();
-for (var i = 0; i < articleEls.length; i++) {
- var articleEl = articleEls[i];
- var linksSectionEl = createLinksSection(articleEl);
- var demoEls = articleEl.querySelectorAll('.demo');
- for (var d = 0; d < demoEls.length; d++) {
- var demo = createDemo(demoEls[d]);
- var demoLinkEl = createDemoLink(demo);
- linksSectionEl.appendChild(demoLinkEl);
- demos.push(demo);
- }
- fragment.appendChild(linksSectionEl);
-}
-navigationEl.appendChild(fragment);
-
-(function updateDemos() {
- var hash = window.location.hash;
- if (hash) {
- var id = hash.replace('#','');
- var demo = getDemoById(id);
- if (demo) demo.highlight();
- } else {
- demos[0].highlight();
- }
-})();
diff --git a/documentation/assets/js/stats.min.js b/documentation/assets/js/stats.min.js
deleted file mode 100644
index 61757f3c..00000000
--- a/documentation/assets/js/stats.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-// stats.js - http://github.com/mrdoob/stats.js
-(function(f,e){"object"===typeof exports&&"undefined"!==typeof module?module.exports=e():"function"===typeof define&&define.amd?define(e):f.Stats=e()})(this,function(){var f=function(){function e(a){c.appendChild(a.dom);return a}function u(a){for(var d=0;d<c.children.length;d++)c.children[d].style.display=d===a?"block":"none";l=a}var l=0,c=document.createElement("div");c.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000";c.addEventListener("click",function(a){a.preventDefault();
-u(++l%c.children.length)},!1);var k=(performance||Date).now(),g=k,a=0,r=e(new f.Panel("FPS","#0ff","#002")),h=e(new f.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var t=e(new f.Panel("MB","#f08","#201"));u(0);return{REVISION:16,dom:c,addPanel:e,showPanel:u,begin:function(){k=(performance||Date).now()},end:function(){a++;var c=(performance||Date).now();h.update(c-k,200);if(c>g+1E3&&(r.update(1E3*a/(c-g),100),g=c,a=0,t)){var d=performance.memory;t.update(d.usedJSHeapSize/
-1048576,d.jsHeapSizeLimit/1048576)}return c},update:function(){k=this.end()},domElement:c,setMode:u}};f.Panel=function(e,f,l){var c=Infinity,k=0,g=Math.round,a=g(window.devicePixelRatio||1),r=80*a,h=48*a,t=3*a,v=2*a,d=3*a,m=15*a,n=74*a,p=30*a,q=document.createElement("canvas");q.width=r;q.height=h;q.style.cssText="width:80px;height:48px";var b=q.getContext("2d");b.font="bold "+9*a+"px Helvetica,Arial,sans-serif";b.textBaseline="top";b.fillStyle=l;b.fillRect(0,0,r,h);b.fillStyle=f;b.fillText(e,t,v);
-b.fillRect(d,m,n,p);b.fillStyle=l;b.globalAlpha=.9;b.fillRect(d,m,n,p);return{dom:q,update:function(h,w){c=Math.min(c,h);k=Math.max(k,h);b.fillStyle=l;b.globalAlpha=1;b.fillRect(0,0,r,m);b.fillStyle=f;b.fillText(g(h)+" "+e+" ("+g(c)+"-"+g(k)+")",t,v);b.drawImage(q,d+a,m,n-a,p,d,m,n-a,p);b.fillRect(d+n-a,m,a,p);b.fillStyle=l;b.globalAlpha=.9;b.fillRect(d+n-a,m,a,g((1-h/w)*p))}}};return f});
diff --git a/documentation/assets/sounds/Myon-Neutrino.m4a b/documentation/assets/sounds/Myon-Neutrino.m4a
deleted file mode 100644
index 77d848a5..00000000
Binary files a/documentation/assets/sounds/Myon-Neutrino.m4a and /dev/null differ
diff --git a/documentation/examples/testing.html b/documentation/examples/testing.html
deleted file mode 100644
index 078e47d4..00000000
--- a/documentation/examples/testing.html
+++ /dev/null
@@ -1,54 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>Elasticity | anime.js</title>
- <meta charset="utf-8">
- <link href="../assets/css/styles.css" rel="stylesheet">
- <script src="../assets/js/stats.min.js"></script>
- <script src="../../anime.js"></script>
- <style>
-
- .particule {
- position: absolute;
- top: 50%;
- left: 50%;
- width: 4rem;
- height: 4rem;
- margin: -1rem 0 0 -1rem;
- background: red;
- transform: scale(1);
- border-radius: 50%;
- }
-
- </style>
-</head>
-<body>
-<div class="particule" style="transform: translateX(-200px)"></div>
-</body>
-<script>
-
- // var test = anime({
- // targets: '.particule',
- // translateX: '+=400px',
- // duration: 1000,
- // elasticity: function(el, i ) {
- // return 1 + 1000;
- // }
- // });
-
-var myAnimation = anime({
- targets: '.particule',
- translateX: 100,
- autoplay: false
-});
-
-
-function render(time) {
- myAnimation.tick(time);
- requestAnimationFrame(render)
-}
-
-render();
-
- </script>
-</html>
diff --git a/documentation/index.html b/documentation/index.html
deleted file mode 100644
index 107f17bc..00000000
--- a/documentation/index.html
+++ /dev/null
@@ -1,1478 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>Documentation | anime.js</title>
- <meta charset="utf-8">
- <link rel="icon" type="image/png" href="assets/img/favicon.png" />
- <link rel="apple-touch-icon" href="assets/img/apple-touch-icon.png" />
- <link href="https://fonts.googleapis.com/css?family=Space+Mono" rel="stylesheet">
- <link href="assets/css/anime-theme.css" rel="stylesheet">
- <link href="assets/css/styles.css" rel="stylesheet">
- <script src="../anime.js"></script>
-</head>
-<body>
- <div class="content">
-
- <section class="pane sidebar">
- <header class="sidebar-header">
- <h1><a class="logo" href="#">Anime.js</a></h1>
- </header>
- <nav class="navigation"></nav>
- </section>
- <section class="pane demos">
-
-<!-- TARGETS -->
-<article id="targets" class="color-01">
- <header>
- <h2 class="demos-title">Targets</h2>
- </header>
-
-<div id="cssSelector" class="demo">
- <h3 class="demo-title">CSS Selector</h3>
- <div class="demo-content">
- <div class="line">
- <div class="square shadow"></div>
- <div class="square el"></div>
- </div>
- </div>
-<script>var cssSelector = anime({
- targets: '#cssSelector .el',
- translateX: 250
-});
-</script>
-</div>
-
-<div id="domNode" class="demo">
- <h3 class="demo-title">DOM Node</h3>
- <div class="demo-content">
- <div class="large square shadow"></div>
- <div class="large square el"></div>
- </div>
-<script>var el = document.querySelector('#domNode .el');
-
-var domNode = anime({
- targets: el,
- translateX: 250
-});
-</script>
-</div>
-
-<div id="nodeList" class="demo">
- <h3 class="demo-title">Node List</h3>
- <div class="demo-content">
- <div class="line">
- <div class="small square shadow"></div>
- <div class="small square el"></div>
- </div>
- <div class="line">
- <div class="small square shadow"></div>
- <div class="small square el"></div>
- </div>
- <div class="line">
- <div class="small square shadow"></div>
- <div class="small square el"></div>
- </div>
- </div>
-<script>var els = document.querySelectorAll('#nodeList .el');
-
-var nodeList = anime({
- targets: els,
- translateX: 250
-});
-</script>
-</div>
-
-<div id="JSobject" class="demo">
- <h3 class="demo-title">JavaScript Object</h3>
- <div class="demo-content">
- <pre>{"charged":"0"}</pre>
- </div>
-<script>var myObject = { charged: '0%' };
-
-var JSobject = anime({
- targets: myObject,
- charged: '100%',
- round: 1,
- easing: 'linear',
- update: function() {
- var el = document.querySelector('#JSobject pre');
- el.innerHTML = JSON.stringify(myObject);
- }
-});
-</script>
-</div>
-
-<div id="JSarray" class="demo">
- <h3 class="demo-title">JavaScript Array</h3>
- <div class="demo-content">
- <div class="line">
- <div class="square shadow"></div>
- <div class="square el-01"></div>
- </div>
- <div class="line">
- <div class="square shadow"></div>
- <div class="square el-02"></div>
- </div>
- <div class="line">
- <div class="square shadow"></div>
- <div class="square el-03"></div>
- </div>
- </div>
-<script>var el = document.querySelector('#JSarray .el-01');
-
-var JSarray = anime({
- targets: [el, '#JSarray .el-02', '#JSarray .el-03'],
- translateX: 250
-});
-</script>
-</div>
-
-</article>
-<!-- -->
-
-<!-- SETTINGS -->
-<article id="basicSettings" class="color-02">
- <header>
- <h2 class="demos-title">Basic settings</h2>
- </header>
-
-<div id="defaultSettings" class="demo">
- <h3 class="demo-title">Default settings</h3>
- <div class="demo-content">
- <div class="square shadow"></div>
- <div class="square el"></div>
- </div>
-<script>var defaultSettings = anime({
- targets: '#defaultSettings .el',
- translateX: 250
-});
-
-/* Default basic settings are :
-
- duration: 1000,
- delay: 0,
- easing: 'easeOutElastic',
- elasticity: 500,
- loop: 0,
- direction: 'normal',
-
-*/
-
-</script>
-</div>
-
-<div id="duration" class="demo">
- <h3 class="demo-title">Duration</h3>
- <div class="demo-content">
- <div class="square shadow"></div>
- <div class="square el"></div>
- </div>
-<script>var duration = anime({
- targets: '#duration .el',
- translateX: 250,
- duration: 3000
-});
-</script>
-</div>
-
-<div id="delay" class="demo">
- <h3 class="demo-title">Delay</h3>
- <div class="demo-content">
-<div class="square shadow"></div>
-<div class="square el"></div>
- </div>
-<script>var delay = anime({
- targets: '#delay .el',
- translateX: 250,
- delay: 1000
-});
-</script>
-</div>
-
-<div id="alternate" class="demo">
- <h3 class="demo-title">Direction alternate</h3>
- <div class="demo-content">
- <div class="square shadow"></div>
- <div class="square el"></div>
- </div>
-<script>var alternate = anime({
- targets: '#alternate .el',
- translateX: 250,
- direction: 'alternate'
-});
-</script>
-</div>
-
-<div id="reverse" class="demo">
- <h3 class="demo-title">Direction reverse</h3>
- <div class="demo-content">
- <div class="square shadow"></div>
- <div class="square el"></div>
- </div>
-<script>var reverse = anime({
- targets: '#reverse .el',
- translateX: 250,
- direction: 'reverse'
-});
-</script>
-</div>
-
-<div id="loop" class="demo">
- <h3 class="demo-title">Loop (x times)</h3>
- <div class="demo-content">
- <div class="square shadow"></div>
- <div class="square el"></div>
- </div>
-<script>var loop = anime({
- targets: '#loop .el',
- translateX: 250,
- loop: 3
-});
-</script>
-</div>
-
-<div id="loopAlternate" class="demo">
- <h3 class="demo-title">Loop alternate (x times)</h3>
- <div class="demo-content">
- <div class="square shadow"></div>
- <div class="square el"></div>
- </div>
-<script>var loopAlternate = anime({
- targets: '#loopAlternate .el',
- translateX: 250,
- loop: 3,
- direction: 'alternate'
-});
-</script>
-</div>
-
-<div id="loopReverse" class="demo">
- <h3 class="demo-title">Loop reverse (x times)</h3>
- <div class="demo-content">
- <div class="square shadow"></div>
- <div class="square el"></div>
- </div>
-<script>var loopReverse = anime({
- targets: '#loopReverse .el',
- translateX: 250,
- loop: 3,
- direction: 'reverse'
-});
-</script>
-</div>
-
-<div id="infiniteLoop" class="demo">
- <h3 class="demo-title">Infinite loop</h3>
- <div class="demo-content">
- <div class="square shadow"></div>
- <div class="square el"></div>
- </div>
-<script>var infiniteLoop = anime({
- targets: '#infiniteLoop .el',
- translateX: 250,
- loop: true
-});
-</script>
-</div>
-
-</article>
-<!-- -->
-
-<!-- SETTINGS -->
-<article id="easings" class="color-03">
- <header>
- <h2 class="demos-title">Easings</h2>
- </header>
-
-<div id="penner" class="demo">
- <h3 class="demo-title">Penner equations</h3>
- <div class="demo-content">
- <div class="line">
- <div class="small stretched square shadow"></div>
- <div class="small stretched square InQuad"></div>
- </div>
- <div class="line">
- <div class="small stretched square shadow"></div>
- <div class="small stretched square InCubic"></div>
- </div>
- <div class="line">
- <div class="small stretched square shadow"></div>
- <div class="small stretched square InQuart"></div>
- </div>
- <div class="line">
- <div class="small stretched square shadow"></div>
- <div class="small stretched square InQuint"></div>
- </div>
- <div class="line">
- <div class="small stretched square shadow"></div>
- <div class="small stretched square InSine"></div>
- </div>
- <div class="line">
- <div class="small stretched square shadow"></div>
- <div class="small stretched square InExpo"></div>
- </div>
- <div class="line">
- <div class="small stretched square shadow"></div>
- <div class="small stretched square InCirc"></div>
- </div>
- <div class="line">
- <div class="small stretched square shadow"></div>
- <div class="small stretched square InBack"></div>
- </div>
- <div class="line">
- <div class="small stretched square shadow"></div>
- <div class="small stretched square OutQuad"></div>
- </div>
- <div class="line">
- <div class="small stretched square shadow"></div>
- <div class="small stretched square OutCubic"></div>
- </div>
- <div class="line">
- <div class="small stretched square shadow"></div>
- <div class="small stretched square OutQuart"></div>
- </div>
- <div class="line">
- <div class="small stretched square shadow"></div>
- <div class="small stretched square OutQuint"></div>
- </div>
- <div class="line">
- <div class="small stretched square shadow"></div>
- <div class="small stretched square OutSine"></div>
- </div>
- <div class="line">
- <div class="small stretched square shadow"></div>
- <div class="small stretched square OutExpo"></div>
- </div>
- <div class="line">
- <div class="small stretched square shadow"></div>
- <div class="small stretched square OutCirc"></div>
- </div>
- <div class="line">
- <div class="small stretched square shadow"></div>
- <div class="small stretched square OutBack"></div>
- </div>
- <div class="line">
- <div class="small stretched square shadow"></div>
- <div class="small stretched square InOutQuad"></div>
- </div>
- <div class="line">
- <div class="small stretched square shadow"></div>
- <div class="small stretched square InOutCubic"></div>
- </div>
- <div class="line">
- <div class="small stretched square shadow"></div>
- <div class="small stretched square InOutQuart"></div>
- </div>
- <div class="line">
- <div class="small stretched square shadow"></div>
- <div class="small stretched square InOutQuint"></div>
- </div>
- <div class="line">
- <div class="small stretched square shadow"></div>
- <div class="small stretched square InOutSine"></div>
- </div>
- <div class="line">
- <div class="small stretched square shadow"></div>
- <div class="small stretched square InOutExpo"></div>
- </div>
- <div class="line">
- <div class="small stretched square shadow"></div>
- <div class="small stretched square InOutCirc"></div>
- </div>
- <div class="line">
- <div class="small stretched square shadow"></div>
- <div class="small stretched square InOutBack"></div>
- </div>
- </div>
-<script>var InQuad = anime({
- targets: '#penner .InQuad',
- translateX: 250,
- easing: 'easeInQuad'
-});
-var InCubic = anime({
- targets: '#penner .InCubic',
- translateX: 250,
- easing: 'easeInCubic'
-});
-var InQuart = anime({
- targets: '#penner .InQuart',
- translateX: 250,
- easing: 'easeInQuart'
-});
-var InQuint = anime({
- targets: '#penner .InQuint',
- translateX: 250,
- easing: 'easeInQuint'
-});
-var InSine = anime({
- targets: '#penner .InSine',
- translateX: 250,
- easing: 'easeInSine'
-});
-var InExpo = anime({
- targets: '#penner .InExpo',
- translateX: 250,
- easing: 'easeInExpo'
-});
-var InCirc = anime({
- targets: '#penner .InCirc',
- translateX: 250,
- easing: 'easeInCirc'
-});
-var InBack = anime({
- targets: '#penner .InBack',
- translateX: 250,
- easing: 'easeInBack'
-});
-var OutQuad = anime({
- targets: '#penner .OutQuad',
- translateX: 250,
- easing: 'easeOutQuad'
-});
-var OutCubic = anime({
- targets: '#penner .OutCubic',
- translateX: 250,
- easing: 'easeOutCubic'
-});
-var OutQuart = anime({
- targets: '#penner .OutQuart',
- translateX: 250,
- easing: 'easeOutQuart'
-});
-var OutQuint = anime({
- targets: '#penner .OutQuint',
- translateX: 250,
- easing: 'easeOutQuint'
-});
-var OutSine = anime({
- targets: '#penner .OutSine',
- translateX: 250,
- easing: 'easeOutSine'
-});
-var OutExpo = anime({
- targets: '#penner .OutExpo',
- translateX: 250,
- easing: 'easeOutExpo'
-});
-var OutCirc = anime({
- targets: '#penner .OutCirc',
- translateX: 250,
- easing: 'easeOutCirc'
-});
-var OutBack = anime({
- targets: '#penner .OutBack',
- translateX: 250,
- easing: 'easeOutBack'
-});
-var InOutQuad = anime({
- targets: '#penner .InOutQuad',
- translateX: 250,
- easing: 'easeInOutQuad'
-});
-var InOutCubic = anime({
- targets: '#penner .InOutCubic',
- translateX: 250,
- easing: 'easeInOutCubic'
-});
-var InOutQuart = anime({
- targets: '#penner .InOutQuart',
- translateX: 250,
- easing: 'easeInOutQuart'
-});
-var InOutQuint = anime({
- targets: '#penner .InOutQuint',
- translateX: 250,
- easing: 'easeInOutQuint'
-});
-var InOutSine = anime({
- targets: '#penner .InOutSine',
- translateX: 250,
- easing: 'easeInOutSine'
-});
-var InOutExpo = anime({
- targets: '#penner .InOutExpo',
- translateX: 250,
- easing: 'easeInOutExpo'
-});
-var InOutCirc = anime({
- targets: '#penner .InOutCirc',
- translateX: 250,
- easing: 'easeInOutCirc'
-});
-var InOutBack = anime({
- targets: '#penner .InOutBack',
- translateX: 250,
- easing: 'easeInOutBack'
-});
-</script>
-<script>var penner = anime.timeline();
-penner.add([InQuad, InCubic, InQuart, InQuint, InSine, InExpo, InCirc, InBack, OutQuad, OutCubic, OutQuart, OutQuint, OutSine, OutExpo, OutCirc, OutBack, InOutQuad, InOutCubic, InOutQuart, InOutQuint, InOutSine, InOutExpo, InOutCirc, InOutBack]);
-</script>
-</div>
-
-<div id="customBezier" class="demo">
- <h3 class="demo-title">Custom Bézier curves</h3>
- <div class="demo-content">
- <div class="square large shadow"></div>
- <div class="square large el"></div>
- </div>
-<script>var customBezier = anime({
- targets: '#customBezier .el',
- translateX: 250,
- easing: [.91,-0.54,.29,1.56]
-});
-</script>
-</div>
-
-<div id="elastic" class="demo">
- <h3 class="demo-title">Elastic</h3>
- <div class="demo-content">
- <div class="line">
- <div class="square shadow"></div>
- <div class="square in"></div>
- </div>
- <div class="line">
- <div class="square shadow"></div>
- <div class="square out"></div>
- </div>
- <div class="line">
- <div class="square shadow"></div>
- <div class="square inOut"></div>
- </div>
- </div>
-<script>var InElastic = anime({
- targets: '#elastic .in',
- translateX: 250,
- easing: 'easeInElastic'
-});
-
-var OutElastic = anime({
- targets: '#elastic .out',
- translateX: 250,
- easing: 'easeOutElastic'
-});
-
-var InOutElastic = anime({
- targets: '#elastic .inOut',
- translateX: 250,
- easing: 'easeInOutElastic'
-});
-</script>
-<script>var elastic = anime.timeline();
-elastic.add([InElastic, OutElastic, InOutElastic]);
-</script>
-</div>
-
-<div id="elasticity" class="demo">
- <h3 class="demo-title">Elasticity</h3>
- <div class="demo-content">
- <div class="line">
- <div class="stretched square shadow"></div>
- <div class="stretched square elasticity-0"></div>
- </div>
- <div class="line">
- <div class="stretched square shadow"></div>
- <div class="stretched square elasticity-100"></div>
- </div>
- <div class="line">
- <div class="stretched square shadow"></div>
- <div class="stretched square elasticity-200"></div>
- </div>
- <div class="line">
- <div class="stretched square shadow"></div>
- <div class="stretched square elasticity-300"></div>
- </div>
- <div class="line">
- <div class="stretched square shadow"></div>
- <div class="stretched square elasticity-400"></div>
- </div>
- <div class="line">
- <div class="stretched square shadow"></div>
- <div class="stretched square elasticity-500"></div>
- </div>
- <div class="line">
- <div class="stretched square shadow"></div>
- <div class="stretched square elasticity-600"></div>
- </div>
- <div class="line">
- <div class="stretched square shadow"></div>
- <div class="stretched square elasticity-700"></div>
- </div>
- <div class="line">
- <div class="stretched square shadow"></div>
- <div class="stretched square elasticity-800"></div>
- </div>
- <div class="line">
- <div class="stretched square shadow"></div>
- <div class="stretched square elasticity-900"></div>
- </div>
- <div class="line">
- <div class="stretched square shadow"></div>
- <div class="stretched square elasticity-1000"></div>
- </div>
- </div>
-<script>var elasticity0 = anime({
- targets: '#elasticity .elasticity-0',
- translateX: 250,
- elasticity: 0
-});
-var elasticity100 = anime({
- targets: '#elasticity .elasticity-100',
- translateX: 250,
- elasticity: 100
-});
-var elasticity200 = anime({
- targets: '#elasticity .elasticity-200',
- translateX: 250,
- elasticity: 200
-});
-var elasticity300 = anime({
- targets: '#elasticity .elasticity-300',
- translateX: 250,
- elasticity: 300
-});
-var elasticity400 = anime({
- targets: '#elasticity .elasticity-400',
- translateX: 250,
- elasticity: 400
-});
-var elasticity500 = anime({
- targets: '#elasticity .elasticity-500',
- translateX: 250,
- elasticity: 500
-});
-var elasticity600 = anime({
- targets: '#elasticity .elasticity-600',
- translateX: 250,
- elasticity: 600
-});
-var elasticity700 = anime({
- targets: '#elasticity .elasticity-700',
- translateX: 250,
- elasticity: 700
-});
-var elasticity800 = anime({
- targets: '#elasticity .elasticity-800',
- translateX: 250,
- elasticity: 800
-});
-var elasticity900 = anime({
- targets: '#elasticity .elasticity-900',
- translateX: 250,
- elasticity: 900
-});
-var elasticity1000 = anime({
- targets: '#elasticity .elasticity-1000',
- translateX: 250,
- elasticity: 1000
-});
-</script>
-<script>var elasticity = anime.timeline();
-elasticity.add([elasticity0, elasticity100, elasticity200, elasticity300, elasticity400, elasticity500, elasticity600, elasticity700, elasticity800, elasticity900, elasticity1000]);
-</script>
-</div>
-
-</article>
-<!-- -->
-
-<!-- PROPERTIES -->
-<article id="properties" class="color-04">
-<header>
- <h2 class="demos-title">Properties</h2>
-</header>
-
-<div id="cssDemo" class="demo">
- <h3 class="demo-title">CSS</h3>
- <div class="demo-content">
- <div class="square shadow"></div>
- <div class="square el"></div>
- </div>
-<script>var cssDemo = anime({
- targets: '#cssDemo .el',
- left: '85%',
- backgroundColor: '#FFF'
-});
-</script>
-</div>
-
-<div id="transformsDemo" class="demo">
- <h3 class="demo-title">CSS Transforms</h3>
- <div class="demo-content">
- <div class="square shadow"></div>
- <div class="square el"></div>
- </div>
-<script>var transformsDemo = anime({
- targets: '#transformsDemo .el',
- translateX: 250,
- scale: 1.5,
- rotate: 300
-});
-</script>
-</div>
-
-<div id="objectPropDemo" class="demo">
- <h3 class="demo-title">Object properties</h3>
-<div class="demo-content"><pre>{"myProperty":"0"}</pre></div>
-<script>var objectProp = { myProperty: 0 };
-var objectPropDemo = anime({
- targets: objectProp,
- myProperty: 42,
- round: 1,
- easing: 'linear',
- update: function() {
- var el = document.querySelector('#objectPropDemo pre');
- el.innerHTML = JSON.stringify(objectProp);
- }
-});
-</script>
-</div>
-
-<div id="domAttributes" class="demo">
- <h3 class="demo-title">DOM Attributes</h3>
- <div class="demo-content">
- <input class="text-output" value="0"></input>
- </div>
-<script>var domAttributes = anime({
- targets: '#domAttributes input',
- value: 1000,
- round: 1,
- easing: 'easeInOutExpo'
-});
-</script>
-</div>
-
-<div id="svgAttributes" class="demo">
- <h3 class="demo-title">SVG Attributes</h3>
- <div class="demo-content align-center">
-<svg width="128" height="128" viewBox="0 0 128 128">
- <polygon points="64 68.64 8.574 100 63.446 67.68 64 4 64.554 67.68 119.426 100" fill="currentColor"/>
-</svg>
- </div>
-<script>var svgAttributes = anime({
- targets: '#svgAttributes polygon',
- points: '64 128 8.574 96 8.574 32 64 0 119.426 32 119.426 96',
- easing: 'easeInOutExpo'
-});
-</script>
-</div>
-
-</article>
-<!-- -->
-
-<!-- VALUES -->
-<article id="values" class="color-05">
-<header>
- <h2 class="demos-title">Values</h2>
-</header>
-
-<div id="unitlessDemo" class="demo">
- <h3 class="demo-title">Unitless</h3>
- <div class="demo-content">
- <div class="square shadow"></div>
- <div class="square el"></div>
- </div>
-<script>var unitlessDemo = anime({
- targets: '#unitlessDemo .el',
- translateX: 250,
- rotate: 540
-});
-</script>
-</div>
-
-<div id="specificUnitDemo" class="demo">
- <h3 class="demo-title">Specific unit</h3>
- <div class="demo-content">
- <div class="square shadow"></div>
- <div class="square el"></div>
- </div>
-<script>var specificUnitDemo = anime({
- targets: '#specificUnitDemo .el',
- translateX: '20em',
- rotate: '1.5turn'
-});
-</script>
-</div>
-
-<div id="colors" class="demo">
- <h3 class="demo-title">Colors</h3>
- <div class="demo-content">
- <div class="line">
- <div class="square shadow"></div>
- <div class="square hex"></div>
- </div>
- <div class="line">
- <div class="square shadow"></div>
- <div class="square rgb"></div>
- </div>
- <div class="line">
- <div class="square shadow"></div>
- <div class="square hsl"></div>
- </div>
- </div>
-<script>var hex = anime({
- targets: '#colors .hex',
- translateX: 250,
- backgroundColor: '#D1FA9E',
- easing: 'linear',
- duration: 2000
-});
-
-var rgb = anime({
- targets: '#colors .rgb',
- translateX: 250,
- backgroundColor: 'rgb(138, 251, 177)',
- easing: 'linear',
- duration: 2000
-});
-
-var hsl = anime({
- targets: '#colors .hsl',
- translateX: 250,
- backgroundColor: 'hsl(171, 68%, 69%)',
- easing: 'linear',
- duration: 2000
-});
-</script>
-<script>
- var colors = anime.timeline();
- colors.add([hex, rgb, hsl]);
-</script>
-</div>
-
-<div id="relativeValues" class="demo">
- <h3 class="demo-title">Relative</h3>
- <div class="demo-content">
- <div class="square shadow"></div>
- <div class="square el" style="transform: translateX(100px)"></div>
- </div>
-<script>var relativeValues = anime({
- targets: '#relativeValues .el',
- translateX: {
- value: '+=150',
- duration: 1000
- },
- width: {
- value: '-=10',
- duration: 1800,
- easing: 'easeInOutSine'
- },
- height: {
- value: '*=4',
- duration: 1800,
- easing: 'easeInOutSine'
- },
- direction: 'alternate'
-});
-</script>
-</div>
-
-<div id="specificInitialDemo" class="demo">
- <h3 class="demo-title">Specific initial value</h3>
- <div class="demo-content">
- <div class="square shadow"></div>
- <div class="square el"></div>
- </div>
-<script>var specificInitialDemo = anime({
- targets: '#specificInitialDemo .el',
- translateX: [100, 250],
- delay: 500,
- direction: 'alternate',
- loop: true
-});
-</script>
-</div>
-
-<div id="specificTimingsDemo" class="demo">
- <h3 class="demo-title">Specific timings value</h3>
- <div class="demo-content">
- <div class="square shadow"></div>
- <div class="square el"></div>
- </div>
-<script>var specificTimingsDemo = anime({
- targets: '#specificTimingsDemo .el',
- translateX: {
- value: 250,
- duration: 1000
- },
- rotate: {
- value: 360,
- duration: 1800,
- easing: 'easeInOutSine'
- },
- scale: {
- value: 2,
- duration: 2000,
- delay: 1000,
- easing: 'easeInOutQuart'
- },
- delay: 500, // Other values are in
- direction: 'alternate'
-});
-</script>
-</div>
-
-</article>
-<!-- -->
-
-<!-- KEYFRAMES -->
-<article id="keyframes" class="color-06">
-<header>
- <h2 class="demos-title">Keyframes</h2>
-</header>
-
-<div id="keyframesChain" class="demo">
- <h3 class="demo-title">Basic keyframes chain</h3>
- <div class="demo-content">
- <div class="square shadow"></div>
- <div class="square el"></div>
- </div>
-<script>var keyframesChain = anime({
- targets: '#keyframesChain .el',
- translateX: [0, 250, 250, 0, 0],
- translateY: [-45, -45, 45, 45, 0],
- duration: 4000,
- loop: true
-});
-</script>
-</div>
-
-<div id="nonLinearKeyframes" class="demo">
- <h3 class="demo-title">Non-linear keyframes</h3>
- <div class="demo-content">
- <div class="square shadow"></div>
- <div class="square el"></div>
- </div>
-<script>var nonLinearKeyframes = anime({
- targets: '#nonLinearKeyframes .el',
- translateX: [
- [0, 250],
- [0, 250]
- ],
- translateY: [
- [-45, -45],
- [45, 45]
- ],
- loop: true
-});
-</script>
-</div>
-
-<div id="specificKeyframeTimings" class="demo">
- <h3 class="demo-title">Specific keyframes timings</h3>
- <div class="demo-content">
- <div class="square shadow"></div>
- <div class="square el"></div>
- </div>
-<script>var specificKeyframeTimings = anime({
- targets: '#specificKeyframeTimings .el',
- translateX: [
- { value: 100, duration: 600, easing: 'easeInExpo' },
- { value: 250, duration: 1200, easing: 'easeOutExpo' }
- ],
- translateY: [
- { value: -100, duration: 150, delay: 600, easing: 'easeOutSine' },
- { value: 0, duration: 150, easing: 'easeInQuad' },
- ],
- rotate: { value: 180, duration: 400, delay: 600, easing: 'easeOutSine' },
- direction: 'alternate',
- loop: true
-});
-</script>
-</div>
-
-</article>
-<!-- -->
-
-<!-- TIMELINE -->
-<article id="timeline" class="color-07">
-<header>
- <h2 class="demos-title">Timeline</h2>
-</header>
-
-<div id="single" class="demo controls">
- <h3 class="demo-title">Single animation</h3>
- <div class="demo-content">
- <div class="line">
- <div class="small square shadow"></div>
- <div class="small square el"></div>
- </div>
- <div class="line">
- <div class="small square shadow"></div>
- <div class="small square el"></div>
- </div>
- <div class="line">
- <div class="small square shadow"></div>
- <div class="small square el"></div>
- </div>
- <div class="line player align-items">
- <button class="play">Play</button>
- <button class="pause">Pause</button>
- <button class="restart">Restart</button>
- <input class="progress" type="range" min="0" max="100" value="0"></input>
- </div>
- </div>
-<script>var singlePlayButton = document.querySelector('#single .play');
-var singlePauseButton = document.querySelector('#single .pause');
-var singleRestartButton = document.querySelector('#single .restart');
-var singleProgressEl = document.querySelector('#single .progress');
-
-var single = anime({
- targets: '#single .el',
- translateX: 250,
- direction: 'alternate',
- loop: true,
- delay: function(el, i, l) { return i * 100; },
- autoplay: false,
- update: function(anim) {
- singleProgressEl.value = anim.progress;
- }
-});
-
-singlePlayButton.addEventListener('click', function() { single.play(); });
-singlePauseButton.addEventListener('click', function() { single.pause(); });
-singleRestartButton.addEventListener('click', function() { single.restart(); });
-singleProgressEl.addEventListener('input', function() {
- single.seek(single.duration * (singleProgressEl.value / 100));
-});
-</script>
-</div>
-
-<div id="multiple" class="demo controls">
- <h3 class="demo-title">Synchronized animations</h3>
- <div class="demo-content">
- <div class="line">
- <div class="small square shadow"></div>
- <div class="small square el-01"></div>
- </div>
- <div class="line">
- <div class="small square shadow"></div>
- <div class="small square el-02"></div>
- </div>
- <div class="line">
- <div class="small square shadow"></div>
- <div class="small square el-03"></div>
- </div>
- <div class="line player align-items">
- <button class="play">Play</button>
- <button class="pause">Pause</button>
- <button class="restart">Restart</button>
- <input class="progress" type="range" min="0" max="100" value="0"></input>
- </div>
- </div>
-<script>var multiplePlayButton = document.querySelector('#multiple .play');
-var multiplePauseButton = document.querySelector('#multiple .pause');
-var multipleRestartButton = document.querySelector('#multiple .restart');
-var multipleProgressEl = document.querySelector('#multiple .progress');
-
-var multiple = anime.timeline({
- direction: 'alternate',
- update: function(anim) {
- multipleProgressEl.value = anim.progress;
- }
-});
-
-multiple.add([
- anime({
- targets: '#multiple .el-01',
- translateX: 75,
- translateY: [22, 22],
- rotate: 180,
- duration: 400,
- easing: 'easeInQuart'
- }),
- anime({
- targets: '#multiple .el-02',
- translateX: [75+18, 175],
- duration: 400,
- delay: 420,
- easing: 'easeOutQuart'
- }),
- anime({
- targets: '#multiple .el-03',
- translateX: [175+8, 275],
- translateY: [-22, -22],
- duration: 4000,
- delay: 605,
- easing: [.05,.18,.01,.81]
- })
-])
-
-multiplePlayButton.addEventListener('click', function() { multiple.play(); });
-multiplePauseButton.addEventListener('click', function() { multiple.pause(); });
-multipleRestartButton.addEventListener('click', function() { multiple.restart(); });
-multipleProgressEl.addEventListener('input', function() {
- multiple.seek(multiple.duration * (multipleProgressEl.value / 100));
-});
-</script>
-</div>
-
-</article>
-<!-- -->
-
-<!-- FUNCTION BASED VALUES -->
-<article id="keyframes" class="color-08">
-<header>
- <h2 class="demos-title">Function based values</h2>
-</header>
-
-<div id="functionBasedDuration" class="demo">
- <h3 class="demo-title">Duration</h3>
- <div class="demo-content">
- <div class="line">
- <div class="small square shadow"></div>
- <div class="small square el"></div>
- </div>
- <div class="line">
- <div class="small square shadow"></div>
- <div class="small square el"></div>
- </div>
- <div class="line">
- <div class="small square shadow"></div>
- <div class="small square el"></div>
- </div>
- </div>
-<script>var functionBasedDuration = anime({
- targets: '#functionBasedDuration .el',
- translateX: 250,
- direction: 'alternate',
- loop: true,
- duration: function(el, i, l) {
- return 1000 + (i * 1000);
- }
-});
-</script>
-</div>
-
-<div id="functionBasedDelay" class="demo">
- <h3 class="demo-title">Delay</h3>
- <div class="demo-content">
- <div class="line">
- <div class="small square shadow"></div>
- <div class="small square el"></div>
- </div>
- <div class="line">
- <div class="small square shadow"></div>
- <div class="small square el"></div>
- </div>
- <div class="line">
- <div class="small square shadow"></div>
- <div class="small square el"></div>
- </div>
- </div>
-<script>var functionBasedDelay = anime({
- targets: '#functionBasedDelay .el',
- translateX: 250,
- direction: 'alternate',
- loop: true,
- delay: function(el, i, l) {
- return i * 100;
- }
-});
-</script>
-</div>
-
-<div id="functionBasedPropVal" class="demo">
- <h3 class="demo-title">Property values</h3>
- <div class="demo-content">
- <div class="line">
- <div class="small square shadow"></div>
- <div class="small square el"></div>
- </div>
- <div class="line">
- <div class="small square shadow"></div>
- <div class="small square el"></div>
- </div>
- <div class="line">
- <div class="small square shadow"></div>
- <div class="small square el"></div>
- </div>
- </div>
-<script>var functionBasedPropVal = anime({
- targets: '#functionBasedPropVal .el',
- translateX: function(el, i, l) {
- return 100 + ((l - i) * 50);
- },
- direction: 'alternate',
- loop: true
-});
-</script>
-</div>
-
-<div id="functionBasedElasticity" class="demo">
- <h3 class="demo-title">Elasticity</h3>
- <div class="demo-content">
- <div class="line">
- <div class="small square shadow"></div>
- <div class="small square el"></div>
- </div>
- <div class="line">
- <div class="small square shadow"></div>
- <div class="small square el"></div>
- </div>
- <div class="line">
- <div class="small square shadow"></div>
- <div class="small square el"></div>
- </div>
- </div>
-<script>var functionBasedElasticity = anime({
- targets: '#functionBasedElasticity .el',
- translateX: 250,
- direction: 'alternate',
- loop: true,
- elasticity: function(el, i, l) {
- return (200 + i * 400);
- }
-});
-</script>
-</div>
-
-<div id="multiplePropVal" class="demo">
- <h3 class="demo-title">Combined</h3>
- <div class="demo-content">
- <div class="line">
- <div class="small square shadow"></div>
- <div class="small square el"></div>
- </div>
- <div class="line">
- <div class="small square shadow"></div>
- <div class="small square el"></div>
- </div>
- <div class="line">
- <div class="small square shadow"></div>
- <div class="small square el"></div>
- </div>
- </div>
-<script>var multiplePropVal = anime({
- targets: '#multiplePropVal .el',
- translateX: function() {
- return anime.random(50, 250);
- },
- translateY: function(el, i) {
- return anime.random(-40, -20) + (30 * i);
- },
- scale: 1.75,
- rotate: {
- value: function() {
- return anime.random(-360, 360);
- },
- duration: function() {
- return anime.random(1200, 1800);
- }
- },
- direction: 'alternate',
- loop: true,
- duration: function() {
- return anime.random(800, 1600);
- },
- delay: function() {
- return anime.random(0, 1000);
- }
-});
-</script>
-</div>
-
-</article>
-<!-- -->
-
-<!-- CALLBACKS -->
-<article id="callbacks" class="color-09">
-<header>
- <h2 class="demos-title">Callbacks</h2>
-</header>
-
-<div id="update" class="demo">
- <h3 class="demo-title">Update</h3>
- <div class="demo-content">
- <div class="logs">
- <input class="log current-time-log"></input>
- <input class="log progress-log"></input>
- </div>
- <div class="large square shadow"></div>
- <div class="large square el"></div>
- </div>
-<script>var updateLogEl = document.querySelector('#update .current-time-log');
-var progressLogEl = document.querySelector('#update .progress-log');
-
-var update = anime({
- targets: '#callbacks .el',
- translateX: 250,
- delay: 1000,
- update: function(anim) {
- updateLogEl.value = 'current time : ' + Math.round(anim.currentTime) + 'ms';
- progressLogEl.value = 'progress : ' + Math.round(anim.progress) + '%';
- }
-});
-</script>
-</div>
-
-<div id="begin" class="demo">
- <h3 class="demo-title">Begin</h3>
- <div class="demo-content">
- <div class="logs">
- <input class="log began-log" value="began : false"></input>
- </div>
- <div class="square shadow"></div>
- <div class="square el"></div>
- </div>
-<script>var beganLogEl = document.querySelector('#begin .began-log');
-
-var begin = anime({
- targets: '#begin .el',
- translateX: 250,
- delay: 1000,
- begin: function(anim) {
- beganLogEl.value = 'began : ' + anim.began;
- }
-});
-</script>
-<script>
-begin.update = function(anim) {
- if (!anim.began) {
- beganLogEl.value = 'began : ' + anim.began;
- }
-}
-</script>
-</div>
-
-<div id="complete" class="demo">
- <h3 class="demo-title">Complete</h3>
- <div class="demo-content">
- <div class="logs">
- <input class="log completed-log" value="completed : false"></input>
- </div>
- <div class="square shadow"></div>
- <div class="square el"></div>
- </div>
-<script>var completedLogEl = document.querySelector('#complete .completed-log');
-
-var complete = anime({
- targets: '#complete .el',
- translateX: 250,
- complete: function(anim) {
- completedLogEl.value = 'completed : ' + anim.completed;
- }
-});
-</script>
-<script>
-complete.update = function(anim) {
- if (!anim.completed) {
- completedLogEl.value = 'completed : ' + anim.completed;
- }
-}
-</script>
-</div>
-
-
-<div id="outsideCallbacks" class="demo">
- <h3 class="demo-title">Settings object</h3>
- <div class="demo-content">
- <div class="logs">
- <input class="log update-log"></input>
- <input class="log began-log"></input>
- <input class="log completed-log"></input>
- </div>
- <div class="line">
- <div class="small square shadow"></div>
- <div class="small square el"></div>
- </div>
- <div class="line">
- <div class="small square shadow"></div>
- <div class="small square el"></div>
- </div>
- <div class="line">
- <div class="small square shadow"></div>
- <div class="small square el"></div>
- </div>
- <div class="line player align-items"></div>
- </div>
-<script>var updateLogEl2 = document.querySelector('#outsideCallbacks .update-log');
-var beganLogEl2 = document.querySelector('#outsideCallbacks .began-log');
-var completedLogEl2 = document.querySelector('#outsideCallbacks .completed-log');
-
-var outsideCallbacks = anime({
- targets: '#outsideCallbacks .el',
- translateX: 250,
- delay: function(el, i) { return 1000 + (i * 100); },
- duration: function(el, i) { return 500 + (i * 500); }
-});
-
-outsideCallbacks.update = function(anim) {
- if (!anim.began) {
- updateLogEl2.value = 'starts in ' + Math.round(anim.delay - anim.currentTime) + 'ms';
- beganLogEl2.value = '';
- } else {
- updateLogEl2.value = 'starts in 0ms';
- }
- if (!anim.completed) {
- completedLogEl2.value = '';
- }
-}
-outsideCallbacks.begin = function() { beganLogEl2.value = 'began'; };
-outsideCallbacks.complete = function() { completedLogEl2.value = 'completed'; };
-
-</script>
-</div>
-
-</article>
-<!-- -->
-
-<!-- MOTION PATH -->
-<article id="motionpath" class="color-10">
-<header>
- <h2 class="demos-title">Motion path</h2>
-</header>
-
-<div id="motionPath" class="demo">
- <h3 class="demo-title">Basic path animation</h3>
- <div class="demo-content">
- <div class="motion-path">
- <div class="small square shadow follow-path"></div>
- <div class="small square el follow-path"></div>
- <svg width="256" height="112" viewBox="0 0 256 112">
- <path fill="none" stroke="currentColor" d="M8,56 C8,33.90861 25.90861,16 48,16 C70.09139,16 88,33.90861 88,56 C88,78.09139 105.90861,92 128,92 C150.09139,92 160,72 160,56 C160,40 148,24 128,24 C108,24 96,40 96,56 C96,72 105.90861,92 128,92 C154,93 168,78 168,56 C168,33.90861 185.90861,16 208,16 C230.09139,16 248,33.90861 248,56 C248,78.09139 230.09139,96 208,96 L48,96 C25.90861,96 8,78.09139 8,56 Z"/>
- </svg>
- </div>
- </div>
-<script>var path = anime.path('#motionPath path');
-
-var motionPath = anime({
- targets: '#motionPath .el',
- translateX: path('x'),
- translateY: path('y'),
- rotate: path('angle'),
- easing: 'easeOutQuad',
- duration: 2000,
- direction: 'alternate',
- loop: true
-});
-
-</script>
-</div>
-
-</article>
-<!-- -->
-
- </section>
- <section class="pane code-examples">
- <div class="code-pane code-pane-js">
- <header class="code-header">
- <h2>JavaScript</h2>
- </header>
- <pre class="code-output js-output"></pre>
- </div>
- <div class="code-pane code-pane-html">
- <header class="code-header">
- <h2>HTML</h2>
- </header>
- <pre class="code-output html-output"></pre>
- </div>
- </section>
- </div>
- <script src="assets/js/highlight.pack.js"></script>
- <script src="assets/js/beautify-html.js"></script>
- <script src="assets/js/scripts.js"></script>
- <script>
- console.log(anime.active);
- </script>
-</body>
-</html>
diff --git a/examples/3d-transforms.html b/examples/3d-transforms.html
deleted file mode 100644
index a73fc835..00000000
--- a/examples/3d-transforms.html
+++ /dev/null
@@ -1,71 +0,0 @@
-<!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" />
- <link href="css/styles.css" rel="stylesheet">
-</head>
-<style>
-
- .wrapper {
- overflow: hidden;
- position: absolute;
- left: 0;
- top: 0;
- display: flex;
- justify-content: center;
- align-items: center;
- flex-wrap: wrap;
- perspective: 800px;
- transform-style: preserve-3d;
- perspective-origin: 50% 50%;
- width: 100%;
- height: 100%;
- }
-
- div {
- width: 10vw;
- height: 10vh;
- }
-
-</style>
-
-<body>
- <section class="wrapper"></section>
- <script src="../anime.min.js"></script>
- <script>
-
- var wrapperEl = document.querySelector('.wrapper');
- var numberOfThings = 25;
-
- function createEl(className) {
- var el = document.createElement('div');
- el.classList.add(className);
- wrapperEl.appendChild(el);
- }
-
- for (var i = 0; i < numberOfThings; i++) {
- createEl('red');
- createEl('blue');
- createEl('green');
- createEl('yellow');
- }
-
- anime({
- targets: 'div',
- translateZ: 720,
- rotateX: 180,
- rotateY: 180,
- delay: function(el, i) {
- return i * 5;
- },
- loop: true,
- direction: 'alternate',
- easing: 'easeOutQuad',
- });
-
- </script>
-</body>
-</html>
diff --git a/documentation/examples/anime-logo-animation.html b/examples/anime-logo-animation.html
similarity index 96%
rename from documentation/examples/anime-logo-animation.html
rename to examples/anime-logo-animation.html
index abe85925..d81a19a6 100644
--- a/documentation/examples/anime-logo-animation.html
+++ b/examples/anime-logo-animation.html
@@ -45,12 +45,10 @@
color: white;
}
.link.white {
- border: 2px solid rgba(255,255,255,1);
+ border: 1px solid rgba(255,255,255,1);
}
.link.blue {
- /*background-color: #5E89FB;*/
- color: #5E89FB;
- border: 2px solid #5E89FB;
+ background-color: #5E89FB;
}
.logo-animation {
display: flex;
@@ -155,7 +153,7 @@
</div>
<div class="letter letter-i">
<svg viewBox="0 0 82 162">
- <g fill="none" fill-rule="evenodd" stroke="#18F38C">
+ <g fill="none" fill-rule="evenodd" stroke="#B1FF92">
<path class="fill in" stroke-width="40" d="M21 61v20a60 60 0 0 0 60 60"/>
<path class="fill out" stroke-width="40" d="M81 141a60 60 0 0 1-60-60V61"/>
<path class="line out" stroke-width="2" d="M81 121a40 40 0 0 1-40-40V61H1v20a80 80 0 0 0 80 80v-40z"/>
@@ -185,7 +183,7 @@
</div>
<div class="letter letter-e">
<svg viewBox="0 0 162 162">
- <g fill="none" fill-rule="evenodd" stroke="#18F38C">
+ <g fill="none" fill-rule="evenodd" stroke="#B1FF92">
<path class="fill in" stroke-width="40" d="M81 101h60V81c-1-33.14-26.86-60-60-60a60 60 0 1 0 0 120"/>
<path class="fill out" stroke-width="40" d="M81 141a60 60 0 1 1 0-120c33.14 0 59 26.86 60 60v20H81"/>
<path class="line out" stroke-width="2" d="M81 81v40h80V80.7C159.66 36.27 124.8 1 81 1a80 80 0 1 0 0 160v-40a40 40 0 1 1 0-80c21.6 0 39.01 17.42 39.99 40H81z"/>
@@ -198,7 +196,7 @@
<g fill="none" fill-rule="evenodd" stroke-width="2" transform="translate(1 1)">
<path stroke="#FF1554" d="M0 16a80.88 80.88 0 0 1 44 44"/>
<path class="icon-line" stroke="#5E89FB" d="M4 0h54a2 2 0 0 1 2 2.01V58A2 2 0 0 1 58 60H2a2 2 0 0 1-2-2.01V2A2 2 0 0 1 2 0h2z"/>
- <rect width="40" height="40" x="10" y="10" stroke="#18F38C" rx="20"/>
+ <rect width="40" height="40" x="10" y="10" stroke="#B1FF92" rx="20"/>
</g>
</svg>
</div>
@@ -232,8 +230,8 @@
</div>
<div class="info">
<p class="tagline">~10 kB JavasScript animation library</p>
- <a class="link white" href="#">Examples<br>on CodePen</a>
- <a class="link blue" href="#">Documentation<br>on GitHub</a>
+ <a class="link white" href="#">Examples on<br>CodePen</a>
+ <a class="link blue" href="#">Examples on<br>GitHub</a>
<p class="credits"><span class="date"></span> © <a href="juliangarnier.com">Julian Garnier</a></p>
</div>
<div class="player">
diff --git a/examples/anime-logo-v2.html b/examples/anime-logo-v2.html
deleted file mode 100644
index b343a1d0..00000000
--- a/examples/anime-logo-v2.html
+++ /dev/null
@@ -1,203 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>logo animation v2</title>
- <meta charset="utf-8">
- <link href="../documentation/assets/css/styles.css" rel="stylesheet">
-</head>
-<style>
- .logo-animation {
- display: flex;
- align-items: center;
- justify-content: center;
- width: 100%;
- height: 100%;
- }
- .letters {
- position: relative;
- display: flex;
- width: 682px;
- height: 162px;
- }
- .letter {
- position: relative;
- width: 162px;
- height: 162px;
- /*mix-blend-mode: lighten;*/
- }
- .letter:not(:first-child) {
- margin-left: -42px;
- }
- .letter-i {
- z-index: 1;
- width: 82px;
- transform-origin: 100% 50%;
- }
- .dot {
- position: absolute;
- width: 42px;
- height: 42px;
- }
- .dot-i {
- top: 0;
- left: 240px;
- }
- .dot-e {
- bottom: 0;
- left: 0;
- }
- .path-fill {
- opacity: 1;
- }
-</style>
-<body>
- <div class="logo-animation">
- <div class="letters">
- <div class="letter letter-a">
- <svg viewBox="0 0 162 162">
- <g fill="none" fill-rule="evenodd" stroke="#5E89FB">
- <path class="path-line" stroke-width="40" d="M101 141H81a60 60 0 1 1 0-120c33.14 0 59 26.86 60 60v80"/>
- <path class="path-fill" stroke-width="2" d="M121 161V81.33C120.18 58.59 102.7 41 81 41a40 40 0 1 0 0 80h20v40H81A80 80 0 1 1 81 1c43.8 0 78.66 35.27 80 79.7V161h-40z"/>
- </g>
- </svg>
- </div>
- <div class="letter letter-n">
- <svg viewBox="0 0 162 162">
- <g fill="none" fill-rule="evenodd" stroke="#FB155A">
- <path class="path-line" stroke-width="40" d="M21 161V81c1-33.14 26.86-60 60-60a60 60 0 0 1 60 60v80"/>
- <path class="path-fill" stroke-width="2" d="M121 161V81a40 40 0 0 0-40-40c-21.7 0-39.18 17.59-40 40.33V161H1V80.4C2.35 36.27 37.2 1 81 1a80 80 0 0 1 80 80v80h-40z"/>
- </g>
- </svg>
- </div>
- <div class="letter letter-i">
- <svg viewBox="0 0 82 162">
- <g fill="none" fill-rule="evenodd" stroke="#18F38C">
- <path class="path-line" stroke-width="40" d="M21 61v20a60 60 0 0 0 60 60"/>
- <path class="path-fill" stroke-width="2" d="M1 61v20a80 80 0 0 0 80 80v-40a40 40 0 0 1-40-40V61H1z"/>
- </g>
- </svg>
- </div>
- <div class="letter letter-m-1">
- <svg viewBox="0 0 162 162">
- <g fill="none" fill-rule="evenodd" stroke="#5E89FB">
- <path class="path-line" stroke-width="40" d="M21 161V81c1-33.14 26.86-60 60-60a60 60 0 0 1 60 60v80"/>
- <path class="path-fill" stroke-width="2" d="M121 161V81a40 40 0 0 0-40-40c-21.7 0-39.18 17.59-40 40.33V161H1V80.4C2.35 36.27 37.2 1 81 1a80 80 0 0 1 80 80v80h-40z"/>
- </g>
- </svg>
- </div>
- <div class="letter letter-m-2">
- <svg viewBox="0 0 162 162">
- <g fill="none" fill-rule="evenodd" stroke="#FB155A">
- <path class="path-line" stroke-width="40" d="M21 161V81c1-33.14 26.86-60 60-60a60 60 0 0 1 60 60v80"/>
- <path class="path-fill" stroke-width="2" d="M121 161V81a40 40 0 0 0-40-40c-21.7 0-39.18 17.59-40 40.33V161H1V80.4C2.35 36.27 37.2 1 81 1a80 80 0 0 1 80 80v80h-40z"/>
- </g>
- </svg>
- </div>
- <div class="letter letter-e">
- <svg viewBox="0 0 162 162">
- <g fill="none" fill-rule="evenodd">
- <path class="path-line" stroke="#18F38C" stroke-width="40" d="M81 101h60V81c-1-33.14-26.86-60-60-60a60 60 0 1 0 0 120"/>
- <path class="path-fill" stroke="#17F28C" stroke-width="2" d="M81 81v40h80V80.7C159.66 36.27 124.8 1 81 1a80 80 0 1 0 0 160v-40a40 40 0 1 1 0-80c21.6 0 39.01 17.42 39.99 40H81z"/>
- </g>
- </svg>
- </div>
- <div class="dot dot-i">
- <svg viewBox="0 0 42 42">
- <g fill="none" fill-rule="evenodd">
- <circle class="dot-fill" cx="21" cy="21" r="20" fill="#17F28C" stroke-width="2"/>
- <circle class="dot-line" cx="21" cy="21" r="20" stroke="#17F28C" stroke-width="2"/>
- </g>
- </svg>
- </div>
- <div class="dot dot-e">
- <svg viewBox="0 0 42 42">
- <g fill="none" fill-rule="evenodd">
- <circle class="dot-fill" cx="21" cy="21" r="20" fill="#FFFFFF" stroke-width="2"/>
- <circle class="dot-line" cx="21" cy="21" r="20" stroke="#FFFFFF" stroke-width="2"/>
- </g>
- </svg>
- </div>
- </div>
- </div>
- <script src="../anime.js"></script>
- <script>
-
- var setDashoffset = function(el) {
- var l = el.getTotalLength();
- el.setAttribute('stroke-dasharray', l);
- return l;
- }
-
- var logoAnimation = anime.timeline();
-
- logoAnimation.add([
- anime({
- targets: '.dot-e',
- translateX: { value: 640, duration: 800, delay: 600, elasticity: 200 },
- translateY: { value: [-200, 0], duration: 800 },
- }),
- anime({
- targets: '.letter',
- translateY: [150, 0],
- duration: 700,
- elasticity: 400,
- delay: function(el, i) {
- return 100 + i * 100;
- }
- }),
- anime({
- targets: ['.path-line'],
- strokeDashoffset: {
- value: [setDashoffset, 0],
- duration: 700,
- easing: 'easeOutQuad',
- delay: function(el, i) {
- return 200 + (i * 100);
- }
- }
- }),
- anime({
- targets: '.path-fill',
- strokeDashoffset: {
- value: [setDashoffset, 0],
- duration: 700,
- easing: 'easeOutQuad',
- delay: function(el, i) {
- return 100 + (i * 100);
- }
- }
- }),
- anime({
- targets: '.letter-i',
- rotate: -360,
- opacity: {
- value: [0, 1],
- duration: 10
- },
- delay: 650,
- duration: 1400,
- elasticity: 450
- }),
- anime({
- targets: '.dot-i',
- translateY: { value: [-400, 0], duration: 600, elasticity: 300 },
- delay: 1420
- }),
- anime({
- targets: ['.path-line', '.dot-fill'],
- opacity: {
- value: 0,
- duration: 700,
- easing: 'easeOutQuad',
- delay: function(el, i) {
- return 1100 + (i * 50);
- }
- }
- }),
- ]);
-
- anime.speed = 1;
-
- </script>
-</body>
-</html>
diff --git a/examples/callbacks.html b/examples/callbacks.html
deleted file mode 100644
index 7c52f6b4..00000000
--- a/examples/callbacks.html
+++ /dev/null
@@ -1,58 +0,0 @@
-<!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" />
- <link href="css/styles.css" rel="stylesheet">
-</head>
-<body>
- <section>
- <article>
- <div class="blue"></div>
- <div class="red"></div>
- <div class="green"></div>
- </article>
- </section>
- <script src="../anime.min.js"></script>
- <script>
-
- var blueAnimation = anime({
- targets: '.blue',
- translateX: 200,
- direction: 'alternate',
- autoplay: false
- });
-
- var redAnimation = anime({
- targets: '.red',
- translateX: 200,
- direction: 'alternate',
- autoplay: false
- });
-
- var greenAnimation = anime({
- targets: '.green',
- translateX: 200,
- direction: 'alternate',
- autoplay: false
- });
-
- blueAnimation.settings.complete = function() {
- greenAnimation.restart();
- }
-
- redAnimation.settings.complete = function() {
- blueAnimation.restart();
- }
-
- greenAnimation.settings.complete = function() {
- redAnimation.restart();
- }
-
- greenAnimation.play();
-
- </script>
-</body>
-</html>
diff --git a/examples/colors.html b/examples/colors.html
deleted file mode 100644
index e1631db5..00000000
--- a/examples/colors.html
+++ /dev/null
@@ -1,75 +0,0 @@
-<!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;
- background-color: #FF324A;
- }
-
-</style>
-</head>
-<body>
- <section>
- <div class="hex">hex</div>
- <div class="rgb">rgb</div>
- <div class="hsl">hsl</div>
- </section>
- <script src="../anime.min.js"></script>
- <script>
- var hex = anime({
- targets: '.hex',
- backgroundColor: '#319BFF',
- duration: 5000,
- loop: true,
- direction: 'alternate',
- easing: 'easeOutQuad'
- });
- var rgb = anime({
- targets: '.rgb',
- backgroundColor: 'rgb(49,155,255)',
- duration: 5000,
- loop: true,
- direction: 'alternate',
- easing: 'easeOutQuad'
- });
- var hsl = anime({
- targets: '.hsl',
- backgroundColor: 'hsl(210,100%,60%)',
- duration: 5000,
- loop: true,
- direction: 'alternate',
- easing: 'easeOutQuad'
- });
- </script>
-</body>
-</html>
diff --git a/examples/css/styles.css b/examples/css/styles.css
deleted file mode 100644
index 63707996..00000000
--- a/examples/css/styles.css
+++ /dev/null
@@ -1,163 +0,0 @@
-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}table{border-collapse:collapse;border-spacing:0}
-
-* {
- margin: 0;
- padding: 0;
- box-sizing: border-box;
-}
-
-html,
-body {
- background: #17151C;
-}
-
-body {
- position: absolute;
- display: flex;
- width: 100%;
- height: 100%;
- color: white;
- font-family: sans-serif;
- -webkit-font-smoothing: antialiased;
-}
-
-header {
- display: flex;
- align-items: center;
- width: 100%;
- height: 80px;
-}
-
-.page-title {
- display: block;
- padding-left: 20px;
- font-size: 30px;
- font-weight: 200;
- text-transform: uppercase;
-}
-
-.demo-title {
- display: block;
- width: 100%;
- padding: 1rem;
- text-align: center;
- text-transform: uppercase;
-}
-
-.cells {
- position: absolute;
- display: flex;
- align-items: center;
- justify-content: center;
- flex-wrap: wrap;
- width: 100%;
- top: 80px;
- bottom: 0;
- border-top: 1px solid #09090B;
- border-left: 1px solid #09090B;
-}
-
-.cell {
- position: relative;
- display: flex;
- align-items: center;
- justify-content: space-between;
- flex-direction: column;
- flex-wrap: wrap;
- height: auto;
- border-right: 1px solid #09090B;
- border-bottom: 1px solid #09090B;
-}
-
-.demo {
- display: flex;
- align-items: center;
- justify-content: flex-start;
- flex-direction: row;
- flex-wrap: wrap;
- width: 290px;
- max-height: 200px;
- padding: 30px 0;
- flex: 1;
-}
-
-.line {
- width: 100%;
-}
-
-.el {
- width: 40px;
- height: 40px;
-}
-
-.line .el {
- width: 20px;
- height: 20px;
- margin: 1px;
-}
-
-.el.shadow {
- position: absolute;
- opacity: .2;
-}
-
-.object-data {
- width: 100%;
- border: none;
- font-size: 30px;
- font-weight: 200;
- font-family: monospace;
- text-align: left;
- background: transparent;
-}
-
-.w-01 { width: 16.666666667%; }
-.w-02 { width: 33.333333333%; }
-.w-03 { width: 50%; }
-.w-04 { width: 66.666666667%; }
-.w-05 { width: 83.333333333%; }
-.w-06 { width: 100%; }
-
-.h-01 { height: 16.666666667%; }
-.h-02 { height: 33.333333333%; }
-.h-03 { height: 50%; }
-.h-04 { height: 66.666666667%; }
-.h-05 { height: 83.333333333%; }
-.h-06 { height: 100%; }
-
-.color-01,
-.color-01 input { color: #FF3478; }
-.color-01 .el { background-color: #FF3478; }
-.color-02,
-.color-02 input { color: #F96F82; }
-.color-02 .el { background-color: #F96F82; }
-.color-03,
-.color-03 input { color: #FEA388; }
-.color-03 .el { background-color: #FEA388; }
-.color-04,
-.color-04 input { color: #FED28B; }
-.color-04 .el { background-color: #FED28B; }
-.color-05,
-.color-05 input { color: #FBF88F; }
-.color-05 .el { background-color: #FBF88F; }
-.color-06,
-.color-06 input { color: #D1FA9E; }
-.color-06 .el { background-color: #D1FA9E; }
-.color-07,
-.color-07 input { color: #8AFBB1; }
-.color-07 .el { background-color: #8AFBB1; }
-.color-08,
-.color-08 input { color: #7BE6D6; }
-.color-08 .el { background-color: #7BE6D6; }
-.color-09,
-.color-09 input { color: #67AAFB; }
-.color-09 .el { background-color: #67AAFB; }
-.color-10,
-.color-10 input { color: #4E7EFC; }
-.color-10 .el { background-color: #4E7EFC; }
-.color-11,
-.color-11 input { color: #957FFD; }
-.color-11 .el { background-color: #957FFD; }
-.color-12,
-.color-12 input { color: #C987FE; }
-.color-12 .el { background-color: #C987FE; }
diff --git a/documentation/examples/dom-performance-test.html b/examples/dom-performance-test.html
similarity index 96%
rename from documentation/examples/dom-performance-test.html
rename to examples/dom-performance-test.html
index 91eb5fb5..a12aaeb4 100644
--- a/documentation/examples/dom-performance-test.html
+++ b/examples/dom-performance-test.html
@@ -33,7 +33,7 @@
var duration = 3000;
var toAnimate = [];
var w = window.innerWidth > window.innerHeight ? window.innerWidth : window.innerHeight;
- var colors = ['#5E89FB', '#18F38C', '#FB0B5A', '#FBF38C'];
+ var colors = ['#5E89FB', '#B1FF92', '#FB0B5A', '#FFC073'];
var createElements = (function() {
var fragment = document.createDocumentFragment();
diff --git a/examples/dom-stress-test-multiple-animations.html b/examples/dom-stress-test-multiple-animations.html
deleted file mode 100644
index 1f23d653..00000000
--- a/examples/dom-stress-test-multiple-animations.html
+++ /dev/null
@@ -1,70 +0,0 @@
-<!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" />
- <link href="css/styles.css" rel="stylesheet">
-</head>
-<style>
-
- body {
- overflow: hidden;
- }
-
- div {
- position: absolute;
- top: 50%;
- left: 50%;
- width: 2rem;
- height: 2rem;
- margin: -1rem 0 0 -1rem;
- background: #FFF;
- transform: scale(0);
- border-radius: 50%;
- }
-
-</style>
-</head>
-<body>
- <script src="../anime.min.js"></script>
- <script>
-
- var maxElements = 200;
- var duration = 7000;
- var toAnimate = [];
- var w = window.innerWidth > window.innerHeight ? window.innerWidth : window.innerHeight;
- var colors = ['#FF324A', '#31FFA6', '#206EFF', '#FFFF99'];
-
- var createElements = (function() {
- var fragment = document.createDocumentFragment();
- for (var i = 0; i < maxElements; i++) {
- var el = document.createElement('div');
- el.style.background = colors[anime.random(0, 3)];
- el.style.transform = 'rotate('+anime.random(-360, 360)+'deg)';
- toAnimate.push(el);
- fragment.appendChild(el);
- }
- document.body.appendChild(fragment);
- })();
-
- var animate = function(el) {
- anime({
- targets: el,
- rotate: anime.getValue(el,'rotate'),
- translateX: [0, w/2],
- translateY: [0, w/2],
- scale: [0, 2],
- delay: anime.random(0, duration),
- duration: duration,
- easing: "easeInCubic",
- loop: true
- });
- }
-
- toAnimate.forEach(animate);
-
- </script>
-</body>
-</html>
diff --git a/examples/easings.html b/examples/easings.html
deleted file mode 100644
index 46390e87..00000000
--- a/examples/easings.html
+++ /dev/null
@@ -1,68 +0,0 @@
-<!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" />
- <link href="css/styles.css" rel="stylesheet">
- <style>
- section {
- display: flex;
- }
- .easing {
- flex: 1;
- position: relative;
- width: auto;
- height: 100%;
- padding: 20vh 4px 4px 4px;
- }
- .easing div {
- width: 2rem;
- height: 2rem;
- border-radius: 50%;
- }
- .easing p {
- transform: rotate(90deg) translateY(-100%);
- transform-origin: 0 50%;
- position: absolute;
- top: 0;
- left: 0;
- }
- </style>
-</head>
-<body>
- <script src="../anime.min.js"></script>
- <script>
-
- var sectionEl = document.querySelector('section');
- var easingList = Object.keys(anime.easings).sort(function(a, b) {
- return (a < b) ? -1 : (a > b) ? 1 : 0;
- });
-
- function createEaseEl(easeName) {
- var el = document.createElement('div');
- var ballEl = document.createElement('div');
- var textEl = document.createElement('p');
- el.classList.add(easeName);
- el.classList.add('easing');
- ballEl.classList.add('blue');
- textEl.innerHTML = easeName;
- el.appendChild(ballEl);
- el.appendChild(textEl);
- document.body.appendChild(el);
- anime({
- targets: ballEl,
- translateY: '74vh',
- loop: true,
- direction: 'alternate',
- duration: 2000,
- easing: easeName
- });
- }
-
- easingList.forEach(createEaseEl);
-
- </script>
-</body>
-</html>
diff --git a/examples/functions-as-timing-values.html b/examples/functions-as-timing-values.html
deleted file mode 100644
index a2c643bc..00000000
--- a/examples/functions-as-timing-values.html
+++ /dev/null
@@ -1,88 +0,0 @@
-<!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" />
- <link href="css/styles.css" rel="stylesheet">
-</head>
-<style>
-
- section {
- display: flex;
- flex-wrap: wrap;
- justify-content: center;
- align-items: center;
- width: 15rem;
- height: 5rem;
- background-color: #FF324A;
- }
-
- div {
- width: 4rem;
- height: 4rem;
- margin: auto;
- background: #FFF;
- }
-
- .begin {
- background-color: #FFFF99;
- }
-
- .update div {
- background-color: #206EFF;
- }
-
- .complete div {
- background-color: #31FFA6;
- }
-
-</style>
-</head>
-<body>
- <section>
- <div></div>
- <div></div>
- <div></div>
- </section>
- <script src="../anime.min.js"></script>
- <script>
-
- var sectionEl = document.querySelector('section');
-
- function delayFunc() {
- console.log('BEGIN');
- sectionEl.classList.add('begin');
- }
-
- function updateFunc() {
- console.log('UPDATE');
- sectionEl.classList.add('update');
- }
-
- function completeFunc() {
- console.log('COMPLETE');
- sectionEl.classList.add('complete');
- }
-
- anime({
- targets: 'div',
- translateY: 100,
- scale: 1.5,
- rotate: {
- value: 360,
- duration: function(el, i) { return 2000 + (i * 500) },
- delay: function(el, i) { return 2000 + (i * 500) },
- easing: 'easeOutQuad',
- },
- delay: function(el, i) { return 1000 + (i * 500); },
- duration: function(el, i) { return 1000 + (i * 500); },
- begin: delayFunc,
- update: updateFunc,
- complete: completeFunc
- });
-
- </script>
-</body>
-</html>
diff --git a/examples/logo-animation.html b/examples/logo-animation.html
deleted file mode 100644
index 776d77cf..00000000
--- a/examples/logo-animation.html
+++ /dev/null
@@ -1,468 +0,0 @@
-<!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" />
- <link href="css/styles.css" rel="stylesheet">
-</head>
-<style>
-
- :root { font-size: 14px; }
- @media (min-width: 350px) { :root { font-size: 16px; } }
- @media (min-width: 640px) { :root { font-size: 18px; } }
- @media (min-width: 1440px) { :root { font-size: 20px; } }
-
- section {
- position: relative;
- z-index: 1;
- width: 18.5rem;
- }
-
- .description {
- line-height: 1.25rem;
- }
-
- .links {
- line-height: 1.125rem;
- }
-
- .description,
- .links {
- opacity: 0;
- margin-bottom: 1.25rem;
- }
-
- .links {
- display: flex;
- justify-content: space-between;
- width: 100%;
- height: auto;
- }
-
- .link {
- display: flex;
- align-items: center;
- justify-content: center;
- flex-direction: column;
- width: 8.75rem;
- height: 3.5rem;
- border: 1px solid #3A5685;
- border-radius: 2px;
- color: white;
- text-decoration: none;
- text-align: center;
- transition: border-color .100s ease, background-color .100s ease;
- }
-
- .link:hover {
- border-color: #647899;
- background: rgba(255,255,255,.06);
- }
-
- .link.primary {
- border: none;
- background-image: linear-gradient(-180deg, #2796F8 0%, #206EFF 100%);
- }
-
- .link.primary:hover {
- border: none;
- background: linear-gradient(-180deg, #4DA7F7 0%, #3577F3 100%);
- }
-
- .small {
- font-size: .75rem;
- }
-
- /* Logo */
-
- .logo {
- opacity: 0;
- position: relative;
- margin-left: -3.5rem;
- margin-top: -8rem;
- margin-bottom: .75rem;
- font-size: 8px;
- }
-
- body.ready .logo {
- opacity: 1;
- }
-
- body:not(.iOS) #lines * {
- mix-blend-mode: lighten;
- }
-
- #fills * {
- opacity: 0;
- mix-blend-mode: lighten;
- }
-
- #line-i-1 {
- transform-origin: 30em 8em;
- }
-
- .fireworks {
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- cursor: pointer;
- }
-
- footer {
- opacity: 0;
- color: #96A9C3;
- }
-
- footer a {
- color: #96A9C3;
- text-decoration: none;
- }
-
- footer a:hover {
- color: #FFF;
- text-decoration: underline;
- }
-
-</style>
-<body>
- <canvas class="fireworks"></canvas>
- <section>
- <svg class="logo" width="25rem" height="12rem" viewBox="0 0 800 384">
- <defs>
- <radialGradient cx="50%" cy="0%" fx="50%" fy="0%" r="50%" id="radialGradient-1">
- <stop stop-color="#329FFF" offset="0%"></stop>
- <stop stop-color="#206EFF" offset="100%"></stop>
- </radialGradient>
- <radialGradient cx="50%" cy="0%" fx="50%" fy="0%" r="50%" id="radialGradient-2">
- <stop stop-color="#FF7894" offset="0%"></stop>
- <stop stop-color="#FF324A" offset="100%"></stop>
- </radialGradient>
- <radialGradient cx="50%" cy="0%" fx="50%" fy="0%" r="100%" id="radialGradient-3">
- <stop stop-color="#FF7894" offset="0%"></stop>
- <stop stop-color="#FF324A" offset="100%"></stop>
- </radialGradient>
- <radialGradient cx="50%" cy="0%" fx="50%" fy="0%" r="100%" id="radialGradient-4">
- <stop stop-color="#359FFC" offset="0%"></stop>
- <stop stop-color="#206EFF" offset="100%"></stop>
- </radialGradient>
- <radialGradient cx="50%" cy="0%" fx="50%" fy="0%" r="50%" id="radialGradient-5">
- <stop stop-color="#5FFFD2" offset="0%"></stop>
- <stop stop-color="#31FFA6" offset="100%"></stop>
- </radialGradient>
- </defs>
- <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
- <rect id="dot-js" fill="#FFFFFF" x="80" y="352" width="32" height="32" rx="16"></rect>
- <g id="lines" transform="translate(128.000000, 256.000000)">
- <path d="M531.599976,119.042822 C531.872599,121.442657 532.736164,123.612749 534.213875,124.965578 C535.547208,126.186231 537.324986,127 539.587612,127 C542.133067,127 544.032057,126.104854 545.36539,124.680759 C546.739127,123.175287 547.506804,120.978112 547.506804,118.374052 L547.506804,97" id="line-s" stroke="#FDFDFD" stroke-linecap="square"></path>
- <path d="M576.512399,105.204082 C576.353483,103.122449 575.558903,101.612245 574.367034,100.183673 C572.777876,98.2653061 569.758474,97 566.739073,97 C564.116961,97 561.534578,97.8979592 559.786504,99.5306122 C558.356261,100.877551 557.323308,102.591837 557.323308,105 C557.323308,108.410588 560.43582,110.318694 563,110.738061 C566,111.228706 568.5,111.228706 572,112.209996 C574.445972,112.89577 577.108333,115.626631 577.108333,118.632653 C577.108333,121.163265 576.194567,122.836735 574.883511,124.183673 C572.976521,126.102041 570.155764,127 566.897989,127 C563.679942,127 560.898915,125.938776 559.031653,123.897959 C557.641139,122.387755 556.687644,120.346939 556.488999,118.142857" id="line-j" stroke="#FDFDFD"></path>
- <path d="M48,112 C21.490332,112 0,90.509668 0,64 C0,37.490332 21.490332,16 48,16 C74.509668,16 96,37.490332 96,64 L96,128" id="line-a" stroke="#206EFF" stroke-width="32"></path>
- <path d="M96,0 L96,128 L96,64 C96,37.490332 117.490332,16 144,16 C170.509668,16 192,37.490332 192,64 L192,128" id="line-n-1" stroke="#FF324A" stroke-width="32"></path>
- <path d="M224,0 L224,128 L224,64 C224,37.490332 245.490332,16 272,16 C298.509668,16 320,37.490332 320,64 L320,128" id="line-m-1" stroke="#206EFF" stroke-width="32"></path>
- <path d="M320,128 L320,64 C320,37.490332 341.490332,16 368,16 C394.509668,16 416,37.490332 416,64 L416,128" id="line-m-2" stroke="#FF324A" stroke-width="32"></path>
- <path d="M192,48 L192,64 C192,90.509668 213.490332,112 240,112" id="line-i-1" stroke="#31FFA6" stroke-width="32"></path>
- <path d="M464,80 L512,80 L512,64 C512,37.490332 490.509668,16 464,16 C437.490332,16 416,37.490332 416,64 C416,90.509668 437.490332,112 464,112" id="line-e" stroke="#31FFA6" stroke-width="32"></path>
- </g>
- <g id="fills" transform="translate(112.000000, 256.000000)">
- <path d="M64,32 C46.326888,32 32,46.326888 32,64 C32,81.673112 46.326888,96 64,96 L64,128 C28.653776,128 0,99.346224 0,64 C0,28.653776 28.653776,0 64,0 C99.346224,0 128,28.653776 128,64 L128,128 L96,128 L96,64 C96,46.326888 81.673112,32 64,32 Z" id="fill-a" fill="url(#radialGradient-1)"></path>
- <path d="M192,64 C192,46.326888 177.673112,32 160,32 C142.326888,32 128,46.326888 128,64 L128,128 L96,128 L96,64 C96,28.653776 124.653776,0 160,0 C195.346224,0 224,28.653776 224,64 L224,128 L192,128 L192,64" id="fill-n-2" fill="url(#radialGradient-2)"></path>
- <rect id="fill-n-1" fill="url(#radialGradient-3)" x="96" y="0" width="32" height="128"></rect>
- <path d="M256,64 C256,46.326888 270.326888,32 288,32 C305.673112,32 320,46.326888 320,64 L320,128 L352,128 L352,64 C352,28.653776 323.346224,0 288,0 C252.653776,0 224,28.653776 224,64 L256,64 L256,64 Z" id="fill-m-2" fill="url(#radialGradient-1)"></path>
- <rect id="fill-m-1" fill="url(#radialGradient-4)" x="224" y="0" width="32" height="128"></rect>
- <path d="M416,64 C416,46.326888 401.673112,32 384,32 C366.326888,32 352,46.326888 352,64 L352,128 L320,128 L320,64 C320,28.653776 348.653776,0 384,0 C419.346224,0 448,28.653776 448,64 L448,128 L416,128 L416,64" id="fill-m-3" fill="url(#radialGradient-2)"></path>
- <path d="M224,64 C224,81.673112 238.326888,96 256,96 L256,128 C220.653776,128 192,99.346224 192,64 L192,48 L192,48 L224,48 L224,64" id="fill-i-1" fill="url(#radialGradient-5)"></path>
- <circle id="dot-i" fill="url(#radialGradient-5)" cx="208" cy="16" r="16"></circle>
- <path d="M512,64 C512,46.326888 497.673112,32 480,32 L480,32 C462.326888,32 448,46.326888 448,64 C448,81.673112 462.326888,96 480,96 L480,128 C444.653776,128 416,99.346224 416,64 C416,28.653776 444.653776,0 480,0 C515.346224,0 544,28.653776 544,64 L544,96 L512,96 L480,96 L480,64 L512,64" id="fill-e-1" fill="url(#radialGradient-5)"></path>
- </g>
- </g>
- </svg>
- <p class="description">
- Anime (/ˈæn.ə.meɪ/) is a flexible yet lightweight JavaScript animation library.<br>
- It works with CSS, Individual Transforms, SVG, DOM attributes and JS Objects.
- </p>
- <div class="links">
- <a class="link" target="_blank" href="http://codepen.io/collection/XLebem/">
- <span class="small">Examples on</span>
- <span>CodePen</span>
- </a>
- <a class="primary link" target="_blank" href="https://github.com/juliangarnier/anime">
- <span class="small">Documentation on</span>
- <span>GitHub</span>
- </a>
- </div>
- <footer>© 2017 <a href="http://juliangarnier.com" target="_blank">Julian Garnier</a></footer>
- </section>
- <script>
- (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
- (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
- m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
- })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
- ga('create', 'UA-79927007-1', 'auto');
- ga('send', 'pageview');
- </script>
- <script src="../anime.min.js"></script>
- <script>
- var iOS = !!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform);
- var ff = navigator.userAgent.indexOf('Firefox') > 0;
- var tap = ('ontouchstart' in window || navigator.msMaxTouchPoints) ? 'touchstart' : 'mousedown';
- if (iOS) document.body.classList.add('iOS');
-
- var fireworks = (function() {
-
- var getFontSize = function() {
- return parseFloat(getComputedStyle(document.documentElement).fontSize);
- }
-
- var canvas = document.querySelector('.fireworks');
- var ctx = canvas.getContext('2d');
- var numberOfParticules = 24;
- var distance = 200;
- var x = 0;
- var y = 0;
- var animations = [];
-
- var setCanvasSize = function() {
- canvas.width = window.innerWidth;
- canvas.height = window.innerHeight;
- }
-
- var updateCoords = function(e) {
- x = e.clientX || e.touches[0].clientX;
- y = e.clientY || e.touches[0].clientY;
- }
-
- var colors = ['#FF324A', '#31FFA6', '#206EFF', '#FFFF99'];
-
- var createCircle = function(x,y) {
- var p = {};
- p.x = x;
- p.y = y;
- p.color = colors[anime.random(0, colors.length - 1)];
- p.color = '#FFF';
- p.radius = 0;
- p.alpha = 1;
- p.lineWidth = 6;
- p.draw = function() {
- ctx.globalAlpha = p.alpha;
- ctx.beginPath();
- ctx.arc(p.x, p.y, p.radius, 0, 2 * Math.PI, true);
- ctx.lineWidth = p.lineWidth;
- ctx.strokeStyle = p.color;
- ctx.stroke();
- ctx.globalAlpha = 1;
- }
- return p;
- }
-
- var createParticule = function(x,y) {
- var p = {};
- p.x = x;
- p.y = y;
- p.color = colors[anime.random(0, colors.length - 1)];
- p.radius = anime.random(getFontSize(), getFontSize() * 2);
- p.draw = function() {
- ctx.beginPath();
- ctx.arc(p.x, p.y, p.radius, 0, 2 * Math.PI, true);
- ctx.fillStyle = p.color;
- ctx.fill();
- }
- return p;
- }
-
- var createParticles = function(x,y) {
- var particules = [];
- for (var i = 0; i < numberOfParticules; i++) {
- var p = createParticule(x, y);
- particules.push(p);
- }
- return particules;
- }
-
- var removeAnimation = function(animation) {
- var index = animations.indexOf(animation);
- if (index > -1) animations.splice(index, 1);
- }
-
- var animateParticules = function(x, y) {
- setCanvasSize();
- var particules = createParticles(x, y);
- var circle = createCircle(x, y);
- var particulesAnimation = anime({
- targets: particules,
- x: function(p) { return p.x + anime.random(-distance, distance); },
- y: function(p) { return p.y + anime.random(-distance, distance); },
- radius: 0,
- duration: function() { return anime.random(1200, 1800); },
- easing: 'easeOutExpo',
- complete: removeAnimation
- });
- var circleAnimation = anime({
- targets: circle,
- radius: function() { return anime.random(getFontSize() * 8.75, getFontSize() * 11.25); },
- lineWidth: 0,
- alpha: {
- value: 0,
- easing: 'linear',
- duration: function() { return anime.random(400, 600); }
- },
- duration: function() { return anime.random(1200, 1800); },
- easing: 'easeOutExpo',
- complete: removeAnimation
- });
- animations.push(particulesAnimation);
- animations.push(circleAnimation);
- }
-
- var mainLoop = anime({
- duration: Infinity,
- update: function() {
- ctx.clearRect(0, 0, canvas.width, canvas.height);
- animations.forEach(function(anim) {
- anim.animatables.forEach(function(animatable) {
- animatable.target.draw();
- });
- });
- }
- });
-
- document.addEventListener(tap, function(e) {
- updateCoords(e);
- animateParticules(x, y);
- ga('send', 'event', 'Fireworks', 'Click');
- }, false);
-
- window.addEventListener('resize', setCanvasSize, false);
-
- return {
- boom: animateParticules
- }
-
- })();
-
- var logoAnimation = function() {
-
- document.body.classList.add('ready');
-
- var setDashoffset = function(el) {
- var l = el.getTotalLength();
- el.setAttribute('stroke-dasharray', l);
- return [l,0];
- }
-
- var letters = anime({
- targets: '#lines path',
- strokeDashoffset: {
- value: setDashoffset,
- duration: 700,
- easing: 'easeOutQuad'
- },
- transform: ['translate(0 128)', 'translate(0 0)'],
- delay: function(el, i) {
- return 750 + (i * 120)
- },
- duration: 1400
- });
-
- var dotJSRoll = anime({
- targets: '#dot-js',
- transform: ['translate(0 0)', 'translate(544 0)'],
- delay: letters.duration - 800,
- duration: 800,
- elasticity: 300
- });
-
- var dotJSDown = anime({
- targets: '#dot-js',
- transform: ['translate(0 -304)', 'translate(0 0)'],
- duration: 500,
- elasticity: 600,
- autoplay: false
- });
-
- var dotJSUp = anime({
- targets: '#dot-js',
- transform: ['translate(0 0) scale(1 3)', 'translate(0 -352) scale(1 1)'],
- duration: 800,
- easing: 'easeOutCirc',
- complete: dotJSDown.play
- });
-
- var boom = anime({
- duration: 880,
- complete: function(a) {
- var dot = dotJSDown.animatables[0].target.getBoundingClientRect();
- var pos = {x: dot.left + (dot.width / 2), y: dot.top + (dot.height / 2)}
- fireworks.boom(pos.x, pos.y);
- }
- });
-
- var letterI = anime({
- targets: '#line-i-1',
- strokeDashoffset: {
- value: setDashoffset,
- duration: 700,
- easing: 'easeOutQuad'
- },
- transform: function() {
- return ff ? ['rotate(360)', 'rotate(0)'] : ['rotate(360 240 64)', 'rotate(0 240 64)'];
- },
- duration: 2500,
- delay: letters.duration - 780
- });
-
- var dotI = anime({
- targets: '#dot-i',
- transform: ['translate(0 -352) scale(1 3)', 'translate(0 0) scale(1 1)'],
- opacity: {
- value: [0, 1],
- easing: 'linear',
- duration: 100
- },
- delay: letters.duration + 250
- });
-
- var JSletters = anime({
- targets: ['#line-j', '#line-s'],
- strokeDashoffset: setDashoffset,
- duration: 1400,
- delay: function(el, i) { return (letterI.duration - 1400) + (i * 60) },
- easing: 'easeInOutQuart'
- });
-
- var gradients = anime({
- targets: '#fills *:not(#dot-i)',
- opacity: [0, 1],
- delay: letterI.duration - 300,
- delay: function(el, i, l) {
- var mid = l/2;
- var index = (i - mid) > mid ? 0 : i;
- var delay = Math.abs(index - mid);
- return (letterI.duration - 1300) + (delay * 30);
- },
- duration: 500,
- easing: 'linear'
- });
-
- var showDescription = anime({
- targets: ['.logo', '.description', '.links', 'footer'],
- opacity: {
- value: 1,
- easing: 'linear',
- duration: 1000
- },
- translateY: ['1.5rem', '0rem'],
- delay: function(el, i, l) { return ((l - i) * 100) + (letterI.duration - 600); },
- duration: 2250,
- easing: 'easeOutExpo',
- });
-
- }
-
- window.onload = logoAnimation;
-
- </script>
-</body>
-</html>
diff --git a/examples/mgs-logo.html b/examples/mgs-logo.html
deleted file mode 100644
index daf0cb05..00000000
--- a/examples/mgs-logo.html
+++ /dev/null
@@ -1,252 +0,0 @@
-<!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;
- }
-
- section {
- position: absolute;
- width: 100%;
- height: 100%;
- display: flex;
- justify-content: center;
- }
-
- .logo {
- margin: auto;
- }
-
- .vert {
- transform-origin: center bottom;
- }
-
- .hori {
- transform-origin: 0% 50%;
- }
-
- .diag-left {
- transform-origin: 100% 100%;
- }
-
- .diag-right {
- transform-origin: 100% 0%;
- }
-</style>
-</head>
-<body>
- <section>
- <svg class="logo" width="100%" height="448" viewBox="0 0 1024 448">
- <g class="stripes" transform="translate(321.000000, 160.000000)" fill="#F9C100">
- <path d="M8,20 L12,16 L92,16 L88,20 L8,20 L8,20 L8,20 L8,20 Z" class="stripe stripe-left"></path>
- <path d="M4,24 L0,28 L80,28 L84,24 L4,24 L4,24 L4,24 L4,24 Z" class="stripe stripe-left"></path>
- <path d="M16,12 L20,8 L100,8 L96,12 L16,12 L16,12 L16,12 L16,12 Z" class="stripe stripe-left"></path>
- <path d="M24,4 L28,0 L108,7.10542736e-15 L104,4 L24,4 L24,4 L24,4 L24,4 Z" class="stripe stripe-left"></path>
- </g>
- <g class="stripes" transform="translate(592.000000, 160.000000)" fill="#F9C100">
- <path d="M8,20 L12,16 L92,16 L88,20 L8,20 L8,20 L8,20 L8,20 Z" class="stripe stripe-right"></path>
- <path d="M4,24 L0,28 L80,28 L84,24 L4,24 L4,24 L4,24 L4,24 Z" class="stripe stripe-right"></path>
- <path d="M16,12 L20,8 L100,8 L96,12 L16,12 L16,12 L16,12 L16,12 Z" class="stripe stripe-right"></path>
- <path d="M24,4 L28,0 L108,7.10542736e-15 L104,4 L24,4 L24,4 L24,4 L24,4 Z" class="stripe stripe-right"></path>
- </g>
- <g class="katakana" transform="translate(202.000000, 128.000000)" fill="#F9C100">
- <path d="M0,92 L60,32 L140,32 L80,92 L0,92 Z" data-d="M55,33 L56,32 L136,32 L135,33 L55,33 Z"></path>
- <path d="M32,28 L230,28 L202,0 L4,0 L32,28 Z" data-d="M28,28 L29,28 L1,0 L0,0 L28,28 Z"></path>
- <path d="M236,28 L208,0 L388,0 L416,28 L236,28 Z" data-d="M232,28 L204,0 L205,0 L233,28 L232,28 Z"></path>
- <path d="M173,92 L201,64 L381,64 L353,92 L173,92 Z" data-d="M169,92 L197,64 L199,64 L171,92 L169,92 Z"></path>
- <path d="M439,92 L359,92 L387,64 L467,64 L439,92 Z" data-d="M435,92 L355,92 L356,91 L436,91 L435,92 Z"></path>
- <path d="M422,28 L502,28 L474,0 L394,0 L422,28 Z" data-d="M497,28 L498,28 L470,0 L469,0 L497,28 Z"></path>
- <path d="M507,92 L587,92 L559,64 L479,64 L507,92 Z" data-d="M476,65 L556,65 L555,64 L475,64 L476,65 Z"></path>
- <path d="M617,0 L557,60 L477,60 L537,0 L617,0 Z" data-d="M554,59 L553,60 L473,60 L474,59 L554,59 Z"></path>
- </g>
- <g class="text-fills" transform="translate(128.000000, 240.000000)" fill="#F9C100">
- <path d="M0,48 L0,68 L16,84 L96,84 L112,68 L112,16 L96,0 L20,0 L0,20 L92,20 L92,64 L20,64 L20,52 L60,52 L80,32 L16,32 L0,48 Z" id="a"></path>
- <path d="M216,84 L236,84 L236,16 L220,0 L140,0 L124,16 L124,84 L144,84 L144,20 L216,20 L216,84 L216,84 Z" id="n"></path>
- <path d="M248,0 L268,0 L268,84 L248,84 L248,0 Z" id="i"></path>
- <path d="M300,20 L300,84 L280,84 L280,16 L296,0 L408,0 L424,16 L424,84 L404,84 L404,20 L362,20 L362,84 L342,84 L342,20 L300,20 Z" id="m"></path>
- <path d="M548,36 L548,16 L532,2.55795385e-13 L452,2.4158453e-13 L436,16 L436,68 L452,84 L528,84 L548,64 L456,64 L456,20 L528,20 L528,32 L488,32 L468,52 L532,52 L548,36 L548,36 Z" id="e"></path>
- <path d="M562,64 L582,84 L626,84 L642,68 L642,0 L622,0 L622,64 L562,64 Z" id="j"></path>
- <path d="M674,20 L766,20 L746,0 L670,0 L654,16 L654,36 L670,52 L746,52 L746,64 L654,64 L674,84 L750,84 L766,68 L766,48 L750,32 L674,32 L674,20 Z" id="s"></path>
- </g>
- <g stroke="#F9C100" stroke-width="2" fill="none" fill-rule="evenodd">
- <path d="M148,292 L148,304" class="line vert" stroke-linecap="square"></path>
- <path d="M128,288 L128,308" class="line vert" stroke-linecap="square"></path>
- <path d="M148,240 L128,260" class="line diag-right"></path>
- <path d="M128,308 L144,324" class="line diag-left"></path>
- <path d="M144,272 L128,288" class="line diag-right"></path>
- <path d="M148,240 L224,240" class="line hori" stroke-linecap="square"></path>
- <path d="M144,272 L208,272" class="line hori" stroke-linecap="square"></path>
- <path d="M148,292 L188,292" class="line hori" stroke-linecap="square"></path>
- <path d="M148,304 L220,304" class="line hori" stroke-linecap="square"></path>
- <path d="M144,324 L224,324" class="line hori" stroke-linecap="square"></path>
- <path d="M129,260 L220,260" class="line hori" stroke-linecap="square"></path>
- <path d="M208,272 L188,292" class="line diag-right"></path>
- <path d="M220,260 L220,304" class="line vert" stroke-linecap="square"></path>
- <path d="M224,240 L240,256" class="line diag-left"></path>
- <path d="M240,308 L224,324" class="line diag-right"></path>
- <path d="M240,256 L240,308" class="line vert" stroke-linecap="square"></path>
- <path d="M252,256 L252,324" class="line vert" stroke-linecap="square"></path>
- <path d="M268,240 L252,256" class="line diag-right"></path>
- <path d="M252,324 L272,324" class="line hori" stroke-linecap="square"></path>
- <path d="M272,260 L272,324" class="line vert" stroke-linecap="square"></path>
- <path d="M268,240 L348,240" class="line hori" stroke-linecap="square"></path>
- <path d="M272,260 L344,260" class="line hori" stroke-linecap="square"></path>
- <path d="M344,260 L344,324" class="line vert" stroke-linecap="square"></path>
- <path d="M348,240 L364,256" class="line diag-left"></path>
- <path d="M344,324 L364,324" class="line hori" stroke-linecap="square"></path>
- <path d="M364,256 L364,324" class="line vert" stroke-linecap="square"></path>
- <path d="M376,240 L376,324" class="line vert" stroke-linecap="square"></path>
- <path d="M376,324 L396,324" class="line hori" stroke-linecap="square"></path>
- <path d="M376,240 L396,240" class="line hori" stroke-linecap="square"></path>
- <path d="M396,240 L396,324" class="line vert" stroke-linecap="square"></path>
- <path d="M408,256 L408,324" class="line vert" stroke-linecap="square"></path>
- <path d="M424,240 L408,256" class="line diag-right"></path>
- <path d="M408,324 L428,324" class="line hori" stroke-linecap="square"></path>
- <path d="M428,261 L428,323" class="line vert" stroke-linecap="square"></path>
- <path d="M424,240 L536,240" class="line hori" stroke-linecap="square"></path>
- <path d="M428,260 L470,260" class="line hori" stroke-linecap="square"></path>
- <path d="M470,261 L470,323" class="line vert" stroke-linecap="square"></path>
- <path d="M470,324 L490,324" class="line hori" stroke-linecap="square"></path>
- <path d="M490,261 L490,323" class="line vert" stroke-linecap="square"></path>
- <path d="M490,260 L532,260" class="line hori" stroke-linecap="square"></path>
- <path d="M532,261 L532,323" class="line vert" stroke-linecap="square"></path>
- <path d="M536,240 L552,256" class="line diag-left"></path>
- <path d="M532,324 L552,324" class="line hori" stroke-linecap="square"></path>
- <path d="M552,256 L552,324" class="line vert" stroke-linecap="square"></path>
- <path d="M564,256 L564,308" class="line vert" stroke-linecap="square"></path>
- <path d="M564,308 L580,324" class="line diag-left"></path>
- <path d="M580,240 L564,256" class="line diag-right"></path>
- <path d="M584,260 L584,304" class="line vert" stroke-linecap="square"></path>
- <path d="M616,272 L596,292" class="line diag-right"></path>
- <path d="M580,240 L660,240" class="line hori" stroke-linecap="square"></path>
- <path d="M584,260 L656,260" class="line hori" stroke-linecap="square"></path>
- <path d="M580,324 L656,324" class="line hori" stroke-linecap="square"></path>
- <path d="M596,292 L660,292" class="line hori" stroke-linecap="square"></path>
- <path d="M616,272 L656,272" class="line hori" stroke-linecap="square"></path>
- <path d="M656,260 L656,272" class="line vert" stroke-linecap="square"></path>
- <path d="M660,240 L676,256" class="line diag-left"></path>
- <path d="M676,304 L656,324" class="line diag-right"></path>
- <path d="M676,276 L660,292" class="line diag-right"></path>
- <path d="M584,304 L676,304" class="line hori" stroke-linecap="square"></path>
- <path d="M676,256 L676,276" class="line vert" stroke-linecap="square"></path>
- <path d="M690,304 L710,324" class="line diag-left"></path>
- <path d="M690,304 L750,304" class="line hori" stroke-linecap="square"></path>
- <path d="M710,324 L754,324" class="line hori" stroke-linecap="square"></path>
- <path d="M750,240 L750,304" class="line vert" stroke-linecap="square"></path>
- <path d="M770,308 L754,324" class="line diag-right"></path>
- <path d="M750,240 L770,240" class="line hori" stroke-linecap="square"></path>
- <path d="M770,240 L770,308" class="line vert" stroke-linecap="square"></path>
- <path d="M782,256 L782,276" class="line vert" stroke-linecap="square"></path>
- <path d="M782,276 L798,292" class="line diag-left"></path>
- <path d="M782,304 L802,324" class="line diag-left"></path>
- <path d="M798,240 L782,256" class="line diag-right"></path>
- <path d="M802,260 L802,272" class="line vert" stroke-linecap="square"></path>
- <path d="M798,240 L874,240" class="line hori" stroke-linecap="square"></path>
- <path d="M802,272 L878,272" class="line hori" stroke-linecap="square"></path>
- <path d="M802,324 L878,324" class="line hori" stroke-linecap="square"></path>
- <path d="M798,292 L874,292" class="line hori" stroke-linecap="square"></path>
- <path d="M782,304 L874,304" class="line hori" stroke-linecap="square"></path>
- <path d="M874,292 L874,304" class="line vert" stroke-linecap="square"></path>
- <path d="M878,272 L894,288" class="line diag-left"></path>
- <path d="M874,240 L894,260" class="line diag-left"></path>
- <path d="M894,308 L878,324" class="line diag-right"></path>
- <path d="M802,260 L894,260" class="line hori" stroke-linecap="square"></path>
- <path d="M894,288 L894,308" class="line vert" stroke-linecap="square"></path>
- </g>
- </svg>
- </section>
- <script src="../anime.min.js"></script>
- <script>
- var katakanaStripes = anime({
- targets: '.stripes path',
- translateX: function(target) {
- if (target.classList.contains('stripe-right')) return -1000;
- return -1000;
- },
- opacity: {
- value: 0,
- duration: 100
- },
- fill: '#FFF',
- delay: function(t, i) { return 2200 + (i * 75) },
- duration: 400,
- direction: 'reverse',
- easing: 'easeOutExpo'
- });
-
- var katakanaFills = anime({
- targets: '.katakana path',
- d: function(target) { return [target.getAttribute('data-d')] },
- opacity: {
- value: 0,
- duration: 100
- },
- fill: '#FFF',
- delay: function(t, i) { return 2400 + (i * 120) },
- duration: 1200,
- direction: 'reverse',
- easing: 'easeOutExpo'
- });
-
- var textFills = anime({
- targets: '.text-fills path',
- opacity: 0,
- delay: function(t, i) { return 3200 + (anime.random(0, 450)) },
- duration: 200,
- fill: '#FFF',
- direction: 'reverse',
- easing: 'easeOutExpo',
- complete: function() {
- anime({
- targets: '.line',
- opacity: 0,
- duration: 1500
- })
- }
- });
-
- var textpaths = anime({
- targets: '.line',
- translateX: function(target) {
- var x = 1200;
- if (target.classList.contains('hori')) return anime.random(0,1) === 1 ? x : -x;
- if (target.classList.contains('diag-right')) return x / 3;
- if (target.classList.contains('diag-left')) return x / 3;
- },
- translateY: function(target) {
- var y = 1200;
- if (target.classList.contains('vert')) return anime.random(0,1) === 1 ? y : -y;
- if (target.classList.contains('diag-right')) return -y / 3;
- if (target.classList.contains('diag-left')) return y / 3;
- },
- scale: {
- value: 4,
- duration: 500,
- },
- stroke: '#fff',
- opacity: {
- value: [1, 0],
- duration: 100,
- },
- delay: function(t, i) { return 0 + (i * 25) },
- duration: 500,
- easing: 'easeInOutQuad',
- direction: 'reverse',
- speed: 1
- });
-
- </script>
-</body>
-</html>
diff --git a/examples/motion-path.html b/examples/motion-path.html
deleted file mode 100644
index 8d923a05..00000000
--- a/examples/motion-path.html
+++ /dev/null
@@ -1,48 +0,0 @@
-<!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" />
- <link href="css/styles.css" rel="stylesheet">
- <style>
- article {
- position: relative;
- }
- div {
- position: absolute;
- top: -.5rem;
- left: -.5rem;
- width: 1rem;
- height: 1rem;
- }
- </style>
-</head>
-<body>
- <section>
- <article>
- <div class="green"></div>
- <svg width="256" height="112" viewBox="0 0 256 112">
- <path fill="none" stroke="#FFF" d="M8,56 C8,33.90861 25.90861,16 48,16 C70.09139,16 88,33.90861 88,56 C88,78.09139 105.90861,92 128,92 C150.09139,92 160,72 160,56 C160,40 148,24 128,24 C108,24 96,40 96,56 C96,72 105.90861,92 128,92 C154,93 168,78 168,56 C168,33.90861 185.90861,16 208,16 C230.09139,16 248,33.90861 248,56 C248,78.09139 230.09139,96 208,96 L48,96 C25.90861,96 8,78.09139 8,56 Z"/>
- </svg>
- </article>
- </section>
- <script src="../anime.min.js"></script>
- <script>
-
- var path = anime.path('path');
-
- anime({
- targets: 'div',
- translateX: path,
- translateY: path,
- rotate: path,
- duration: 3000,
- loop: true,
- easing: 'linear'
- });
-
- </script>
-</body>
-</html>
diff --git a/examples/playback.html b/examples/playback.html
deleted file mode 100644
index b4d9935e..00000000
--- a/examples/playback.html
+++ /dev/null
@@ -1,78 +0,0 @@
-<!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" />
-<link href="css/styles.css" rel="stylesheet">
-</head>
-<style>
-
- fieldset {
- margin-bottom: 1rem;
- }
-
- .progress {
- width: 82%;
- margin-bottom: 1rem;
- margin-left: auto;
- margin-right: auto;
- }
-
- div {
- width: 2rem;
- height: 2rem;
- margin-top: auto;
- margin-bottom: auto;
- mix-blend-mode: lighten;
- }
-
-</style>
-</head>
-<body>
- <section>
- <article>
- <div class="blue"></div>
- <div class="green"></div>
- <div class="red"></div>
- </article>
- <input class="progress" type="range" value="0" min="0" max="100"></input>
- <fieldset>
- <button class="play">Play</button>
- <button class="pause">Pause</button>
- <button class="restart">Restart</button>
- <input class="percents" type="text"></input>
- </fieldset>
- </section>
- <script src="../anime.min.js"></script>
- <script>
-
- var playButton = document.querySelector('.play');
- var pauseButton = document.querySelector('.pause');
- var restartButton = document.querySelector('.restart');
- var progress = document.querySelector('.progress');
- var percents = document.querySelector('.percents');
-
- var myAnimation = anime({
- targets: 'div',
- translateX: function() { return anime.random(10, 14) + 'rem'; },
- scale: function() { return anime.random(10,20) / 10; },
- rotate: function() { return anime.random(-360,360); },
- duration: function() { return anime.random(800,1400); },
- easing: 'easeOutQuad',
- update: function(animation) {
- progress.value = animation.progress;
- percents.value = Math.round(animation.progress) + '%';
- }
- });
-
- playButton.addEventListener('click', function() { myAnimation.play(); });
- pauseButton.addEventListener('click', function() { myAnimation.pause(); });
- restartButton.addEventListener('click', function() { myAnimation.restart(); });
- progress.addEventListener('input', function() { myAnimation.seek(progress.value); });
-
-
- </script>
-</body>
-</html>
diff --git a/examples/random-multiple-values.html b/examples/random-multiple-values.html
deleted file mode 100644
index c0ace45e..00000000
--- a/examples/random-multiple-values.html
+++ /dev/null
@@ -1,58 +0,0 @@
-<!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" />
- <link href="css/styles.css" rel="stylesheet">
-</head>
-<style>
-
- section {
- display: flex;
- flex-wrap: wrap;
- width: 22rem;
- height: 22rem;
- }
-
- div {
- width: 1.5rem;
- height: 1.5rem;
- background: #FFF;
- }
-
-</style>
-</head>
-<body>
- <script src="../anime.min.js"></script>
- <script>
-
- var maxElements = 210;
- var colors = ['#FF324A', '#31FFA6', '#206EFF', '#FFFF99'];
-
- var createElements = (function() {
- var sectionEl = document.createElement('section');
- for (var i = 0; i < maxElements; i++) {
- var el = document.createElement('div');
- el.style.background = colors[anime.random(0, 3)];
- sectionEl.appendChild(el);
- }
- document.body.appendChild(sectionEl);
- })();
-
- anime({
- targets: 'div',
- translateX: function() { return anime.random(-6, 6) + 'rem'; },
- translateY: function() { return anime.random(-6, 6) + 'rem'; },
- scale: function() { return anime.random(10, 20) / 10; },
- rotate: function() { return anime.random(-360, 360); },
- delay: function() { return 400 + anime.random(0, 500); },
- duration: function() { return anime.random(1000, 2000); },
- direction: 'alternate',
- loop: true
- });
-
- </script>
-</body>
-</html>
diff --git a/examples/remove-elements-from-animations.html b/examples/remove-elements-from-animations.html
deleted file mode 100644
index 1b27161e..00000000
--- a/examples/remove-elements-from-animations.html
+++ /dev/null
@@ -1,61 +0,0 @@
-<!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" />
- <link href="css/styles.css" rel="stylesheet">
-</head>
-<style>
-
- article {
- display: flex;
- flex-direction: row;
- justify-content: center;
- }
-
- div {
- width: 1.5rem;
- height: 1.5rem;
- }
-
- div.disabled {
- background: #FFF;
- }
-
-</style>
-</head>
-<body>
- <section>
- <article>
- <div class="blue"></div>
- <div class="red"></div>
- <div class="green"></div>
- </article>
- </section>
- <script src="../anime.min.js"></script>
- <script>
-
- var animation = anime({
- targets: 'div',
- translateX: function() { return anime.random(-6, 6) + 'rem'; },
- translateY: function() { return anime.random(-6, 6) + 'rem'; },
- scale: function() { return anime.random(10, 20) / 10; },
- rotate: function() { return anime.random(-360, 360); },
- delay: function() { return 400 + anime.random(0, 500); },
- duration: function() { return anime.random(1000, 2000); },
- direction: 'alternate',
- loop: true
- });
-
- document.onmousemove = function(e) {
- if (e.target.matches('div')) {
- anime.remove(e.target);
- e.target.classList.add('disabled');
- }
- }
-
- </script>
-</body>
-</html>
diff --git a/examples/svg-path.html b/examples/svg-path.html
deleted file mode 100644
index 9d019cd8..00000000
--- a/examples/svg-path.html
+++ /dev/null
@@ -1,58 +0,0 @@
-<!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;
- }
-
- section {
- position: absolute;
- width: 100%;
- height: 100%;
- display: flex;
- justify-content: center;
- }
-
- svg {
- margin: auto;
- }
-
-</style>
-</head>
-<body>
- <section>
- <svg width="320px" height="320px" viewBox="0 0 320 320">
- <path fill="rgb(100,200,0)" d="M32,160 C32,115 36,104 70,70 C104,36 115,32 160,32 C205,32 216,36 250,70 C284,104 288,115 288,160 C288,205 284,216 250,250 C216,284 205,288 160,288 C115,288 104,284 70,250 C36,216 32,205 32,160 Z"></path>
- </svg>
- </section>
- <script src="../anime.min.js"></script>
- <script>
- 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',
- fill: ['rgb(100,200,0)', 'rgb(255,0,0)'],
- duration: 2000,
- direction: 'alternate',
- loop: true
- });
- </script>
-</body>
-</html>
diff --git a/examples/timeline.html b/examples/timeline.html
deleted file mode 100644
index 403e76c2..00000000
--- a/examples/timeline.html
+++ /dev/null
@@ -1,122 +0,0 @@
-<!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" />
-<link href="css/styles.css" rel="stylesheet">
-</head>
-<style>
-
- article {
- position: relative;
- }
-
- fieldset {
- margin-bottom: 1rem;
- }
-
- .progress {
- width: 82%;
- margin-bottom: 1rem;
- margin-left: auto;
- margin-right: auto;
- }
-
- div {
- width: 2rem;
- height: 2rem;
- margin-top: auto;
- margin-bottom: auto;
- mix-blend-mode: lighten;
- }
-
- .follow {
- position: absolute;
- top: -.5rem;
- left: -.5rem;
- width: 1rem;
- height: 1rem;
- }
-
-</style>
-</head>
-<body>
- <section>
- <article>
- <div class="follow yellow"></div>
- <svg width="256" height="112" viewBox="0 0 256 112">
- <path fill="none" stroke="#FFF" d="M8,56 C8,33.90861 25.90861,16 48,16 C70.09139,16 88,33.90861 88,56 C88,78.09139 105.90861,92 128,92 C150.09139,92 160,72 160,56 C160,40 148,24 128,24 C108,24 96,40 96,56 C96,72 105.90861,92 128,92 C154,93 168,78 168,56 C168,33.90861 185.90861,16 208,16 C230.09139,16 248,33.90861 248,56 C248,78.09139 230.09139,96 208,96 L48,96 C25.90861,96 8,78.09139 8,56 Z"/>
- </svg>
- <div class="blue">anim 01</div>
- <div class="green">anim 02</div>
- <div class="green">anim 02</div>
- <div class="green">anim 02</div>
- <div class="red">anim 03</div>
- </article>
- <input class="progress" type="range" value="0" min="0" max="100"></input>
- <fieldset>
- <button class="play">Play</button>
- <button class="pause">Pause</button>
- <button class="restart">Restart</button>
- <input class="percents" type="text"></input>
- </fieldset>
- </section>
- <script src="../anime.js"></script>
- <script>
-
- var playButton = document.querySelector('.play');
- var pauseButton = document.querySelector('.pause');
- var restartButton = document.querySelector('.restart');
- var progress = document.querySelector('.progress');
- var percents = document.querySelector('.percents');
-
- var path = anime.path('path');
-
- var timeline = anime.timeline({
- update: function(animation) {
- progress.value = timeline.progress;
- percents.value = Math.round(timeline.progress) + '%';
- }
- });
-
- timeline.add([
- anime({
- targets: '.blue',
- translateX: -200,
- duration: 1000
- }),
- anime({
- targets: '.green',
- translateY: -40,
- translateX: 100,
- duration: function(el, i) {return 1000 + (i * 500) },
- delay: function(el, i) {return 1000 + (i * 500) }
- }),
- anime({
- targets: '.red',
- translateX: 200,
- duration: 4000
- }),
- anime({
- targets: '.follow',
- translateX: path('x'),
- translateY: path('y'),
- rotate: path('angle'),
- duration: 3000,
- easing: 'easeInOutQuart'
- })
- ]);
-
- playButton.addEventListener('click', function() { timeline.play(); });
- pauseButton.addEventListener('click', function() { timeline.pause(); });
- restartButton.addEventListener('click', function() { timeline.restart(); });
- progress.addEventListener('input', function() {
- timeline.seek(timeline.duration * progress.value / 100);
- });
-
-
- </script>
-</body>
-</html>
diff --git a/examples/volume.html b/examples/volume.html
deleted file mode 100644
index daf69556..00000000
--- a/examples/volume.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<!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" />
-<link href="css/styles.css" rel="stylesheet">
-</head>
- <section>
- <audio controls autoplay src="sounds/Myon-Neutrino.m4a"></audio>
- </section>
- <script src="../anime.min.js"></script>
- <script>
-
- var audio = document.querySelector('audio');
-
- var volume = anime({
- targets: audio,
- volume: [1, 0],
- duration: 1920,
- easing: 'linear',
- direction: 'alternate',
- loop: true
- });
-
- </script>
-</body>
-</html>