├── .gitignore
├── images
├── github.png
├── tabzilla-static.png
├── tabzilla-static-high-res.png
└── burger.svg
├── tabzilla.css
├── README.md
├── index.html
├── main.js
├── demos
├── lib
│ ├── prism.css
│ ├── prism.js
│ └── Tween.js
├── js-animations-vs-web-animations.html
├── css-vs-animations-code.html
├── accessibility.html
└── style-guide.html
├── gallery.html
├── styles.css
└── LICENSE
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .jshintrc
3 |
--------------------------------------------------------------------------------
/images/github.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mozdevs/Animation-examples/HEAD/images/github.png
--------------------------------------------------------------------------------
/images/tabzilla-static.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mozdevs/Animation-examples/HEAD/images/tabzilla-static.png
--------------------------------------------------------------------------------
/images/tabzilla-static-high-res.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mozdevs/Animation-examples/HEAD/images/tabzilla-static-high-res.png
--------------------------------------------------------------------------------
/images/burger.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/tabzilla.css:
--------------------------------------------------------------------------------
1 | #tabzilla {
2 | float: right;
3 | position: relative;
4 | }
5 |
6 | #tabzilla a {
7 | text-indent: 120%;
8 | white-space: nowrap;
9 | overflow: hidden;
10 | background-image: url('images/tabzilla-static.png');
11 | background-repeat: no-repeat;
12 | display: block;
13 | height: 37px;
14 | position: relative;
15 | width: 147px;
16 | z-index: 2;
17 | box-shadow: none;
18 | }
19 |
20 | @media (-webkit-min-device-pixel-ratio: 1.5), (min--moz-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), (min-resolution: 1.5dppx) {
21 | #tabzilla a {
22 | background-image: url('images/tabzilla-static-high-res.png');
23 | background-size: 147px 37px;
24 | }
25 | }
26 |
27 | #tabzilla:before {
28 | background-color: transparent;
29 | content: '';
30 | display: block;
31 | height: 26px;
32 | left: 28px;
33 | position: absolute;
34 | top: 0;
35 | width: 88px;
36 | z-index: 1;
37 | }
38 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Web Animations API Examples
2 |
3 | This is a collection of [Web Animations](https://developer.mozilla.org/en-US/docs/Web/API/Web_Animations_API) demos. This API allows creation and control of animations through JavaScript.
4 |
5 | - [View demos online](https://mozdevs.github.io/Animation-examples/)
6 | - or [download](https://github.com/mozdevs/Animation-examples/archive/gh-pages.zip) this repository and open `index.html` to browse examples locally.
7 |
8 | ## Requirements
9 |
10 | For the demos to work, you need a browser that supports the Web Animations API. In Firefox, it is available from **version 48**. For other browsers, check out this [support table](http://caniuse.com/#feat=web-animation).
11 |
12 | ## Contribute
13 |
14 | If you would like to submit additional demos featuring more use cases, please create a pull request.
15 |
16 | For bugs and general discussion, use the [issue tracker](https://github.com/mozdevs/Animation-examples/issues).
17 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Web Animations examples
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
20 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/main.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 |
4 | // TODO: we need to display local content instead of the one at Github
5 | const GITHUB_RAW = 'https://raw.githubusercontent.com/mozdevs/Animation-examples/';
6 | function buildRawCodeURL(base) {
7 | let path = base.replace(window.location.href, '');
8 | return `${GITHUB_RAW}gh-pages/${path}`;
9 | }
10 |
11 | window.onload = function () {
12 | let menu = document.querySelector('.sidebar');
13 | let burger = document.querySelector('.burger');
14 | let viewer = document.querySelector('.viewer-wrapper');
15 | let links = Array.from(document.querySelectorAll('a[target=viewer]'));
16 | let viewSourceLink = document.querySelector('.view-source a');
17 | let viewSource = document.querySelector('.view-source');
18 |
19 |
20 | // -------------------------------------------------------------------------
21 | // handle View Source Code button
22 | // -------------------------------------------------------------------------
23 |
24 | links.forEach(function (link) {
25 | link.addEventListener('click', function(event) {
26 | // only update and show the button for demos
27 | if (/demos\//.test(link.href)) {
28 | viewSourceLink.href = buildRawCodeURL(link.href);
29 | viewSource.style.display = 'block';
30 | }
31 | else {
32 | viewSourceLink.href = '#';
33 | viewSource.style.display = 'none';
34 | }
35 | });
36 | });
37 |
38 | // -------------------------------------------------------------------------
39 | // handle responsive menu
40 | // -------------------------------------------------------------------------
41 |
42 | let hideMenu = function () {
43 | viewer.classList.add('mobile-show');
44 | viewer.classList.remove('mobile-hidden');
45 |
46 | menu.classList.add('mobile-hidden');
47 | menu.classList.remove('mobile-show');
48 | };
49 |
50 | let showMenu = function () {
51 | viewer.classList.add('mobile-hidden');
52 | viewer.classList.remove('mobile-show');
53 |
54 | menu.classList.add('mobile-show');
55 | menu.classList.remove('mobile-hidden');
56 |
57 | viewSourceLink.href = '#';
58 | viewSource.style.display = 'none';
59 | };
60 |
61 | links.forEach(function(link) {
62 | link.addEventListener('click', hideMenu);
63 | });
64 |
65 | burger.querySelector('button').addEventListener('click', showMenu);
66 | };
67 |
--------------------------------------------------------------------------------
/demos/lib/prism.css:
--------------------------------------------------------------------------------
1 | /* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript */
2 | /**
3 | * prism.js default theme for JavaScript, CSS and HTML
4 | * Based on dabblet (http://dabblet.com)
5 | * @author Lea Verou
6 | */
7 |
8 | code[class*="language-"],
9 | pre[class*="language-"] {
10 | color: black;
11 | background: none;
12 | text-shadow: 0 1px white;
13 | font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
14 | text-align: left;
15 | white-space: pre;
16 | word-spacing: normal;
17 | word-break: normal;
18 | word-wrap: normal;
19 | line-height: 1.5;
20 |
21 | -moz-tab-size: 4;
22 | -o-tab-size: 4;
23 | tab-size: 4;
24 |
25 | -webkit-hyphens: none;
26 | -moz-hyphens: none;
27 | -ms-hyphens: none;
28 | hyphens: none;
29 | }
30 |
31 | pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
32 | code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
33 | text-shadow: none;
34 | background: #b3d4fc;
35 | }
36 |
37 | pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
38 | code[class*="language-"]::selection, code[class*="language-"] ::selection {
39 | text-shadow: none;
40 | background: #b3d4fc;
41 | }
42 |
43 | @media print {
44 | code[class*="language-"],
45 | pre[class*="language-"] {
46 | text-shadow: none;
47 | }
48 | }
49 |
50 | /* Code blocks */
51 | pre[class*="language-"] {
52 | padding: 1em;
53 | margin: .5em 0;
54 | overflow: auto;
55 | }
56 |
57 | :not(pre) > code[class*="language-"],
58 | pre[class*="language-"] {
59 | background: #f5f2f0;
60 | }
61 |
62 | /* Inline code */
63 | :not(pre) > code[class*="language-"] {
64 | padding: .1em;
65 | border-radius: .3em;
66 | white-space: normal;
67 | }
68 |
69 | .token.comment,
70 | .token.prolog,
71 | .token.doctype,
72 | .token.cdata {
73 | color: slategray;
74 | }
75 |
76 | .token.punctuation {
77 | color: #999;
78 | }
79 |
80 | .namespace {
81 | opacity: .7;
82 | }
83 |
84 | .token.property,
85 | .token.tag,
86 | .token.boolean,
87 | .token.number,
88 | .token.constant,
89 | .token.symbol,
90 | .token.deleted {
91 | color: #905;
92 | }
93 |
94 | .token.selector,
95 | .token.attr-name,
96 | .token.string,
97 | .token.char,
98 | .token.builtin,
99 | .token.inserted {
100 | color: #690;
101 | }
102 |
103 | .token.operator,
104 | .token.entity,
105 | .token.url,
106 | .language-css .token.string,
107 | .style .token.string {
108 | color: #a67f59;
109 | background: hsla(0, 0%, 100%, .5);
110 | }
111 |
112 | .token.atrule,
113 | .token.attr-value,
114 | .token.keyword {
115 | color: #07a;
116 | }
117 |
118 | .token.function {
119 | color: #DD4A68;
120 | }
121 |
122 | .token.regex,
123 | .token.important,
124 | .token.variable {
125 | color: #e90;
126 | }
127 |
128 | .token.important,
129 | .token.bold {
130 | font-weight: bold;
131 | }
132 | .token.italic {
133 | font-style: italic;
134 | }
135 |
136 | .token.entity {
137 | cursor: help;
138 | }
139 |
140 |
--------------------------------------------------------------------------------
/gallery.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Web Animations examples
5 |
6 |
7 |
8 |
9 |
10 |
11 | Web animations examples
12 | Here's a collection of examples using the
13 | Web Animations API . This API allows you to create high-performance animations, and also inspect and manipulate them, as well as those created by CSS that are currently running.
14 |
15 |
19 |
20 | Index
21 |
22 | Style guide
23 | You can give designers the power to fully customise the animations of UX components right in the style guide itself!
24 | Adjustable accessibility settings
25 | Use the Web Animations API so users can customise animations according to their needs or preferences.
26 | Performance comparison
27 | Comparing the performance of JavaScript animations via requestAnimationFrame versus the new Web Animations API.
28 | Source code comparison
29 | Comparing the code of CSS-defined animations versus the Web Animations API.
30 |
31 | Resources
32 |
38 |
39 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/demos/js-animations-vs-web-animations.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | JS Animations vs Web Animations
5 |
6 |
7 |
8 |
9 |
10 | JavaScript Animations vs Web Animations
11 |
12 |
13 |
14 |
15 |
133 |
196 |
197 |
198 |
--------------------------------------------------------------------------------
/demos/css-vs-animations-code.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Web Animations Example - CSS vs Web Animations code comparison
4 |
5 |
6 |
7 |
8 |
45 |
46 |
47 |
48 | Comparing CSS and Web Animations
49 | This is a comparison between CSS code and JavaScript code that use the Web Animations API to achieve the same effects. If you are already familiar with defining CSS animations, you will feel right at home with the Web Animations API.
50 |
51 |
52 |
53 | CSS
54 |
57 |
58 | .rainbow {
59 | animation: rainbow 2s alternate infinite;
60 | }
61 |
62 | @keyframes rainbow {
63 | 0% { background: #ff004d; }
64 | 20% { background: #ff77ab; }
65 | 50% { background: #00e756; }
66 | 80% { background: #29adff; }
67 | 100% { background: #ff77ab;}
68 | }
69 |
70 |
71 |
72 |
73 | Web Animations API
74 |
77 |
78 | let el = document.querySelector('.rainbow');
79 | el.animate([
80 | { background: '#ff004d', offset: 0 },
81 | { background: '#ff77ab', offset: 0.20 },
82 | { background: '#00e756', offset: 0.5 },
83 | { background: '#29adff', offset: 0.80 },
84 | { background: '#ff77ab', offset: 1 }
85 | ], {
86 | duration: 2000,
87 | direction: 'alternate',
88 | iterations: Infinity
89 | });
90 |
91 |
92 |
93 |
94 |
95 |
96 | Linear transform with user events
97 |
98 | CSS
99 |
100 |
101 | Waka
102 | Mouse over the button
103 |
104 |
105 |
106 | button {
107 | transform: scale(1);
108 | transition: all 0.5s;
109 | }
110 |
111 | button:hover {
112 | transform: scale(1.25);
113 | }
114 |
115 |
116 |
117 | Web Animations API
118 |
119 |
120 | Waka
121 | Mouse over the button
122 |
123 |
124 |
125 | let el = document.querySelector('.animated');
126 | el.addEventListener('mouseover', function () {
127 | let anim = el.animate({
128 | transform: ['scale(1)', 'scale(1.25)']
129 | }, 300);
130 | el.style.transform = 'scale(1.25)';
131 | });
132 | el.addEventListener('mouseout', function () {
133 | let anim = el.animate({
134 | transform: ['scale(1.25)', 'scale(1)']
135 | }, 300);
136 | el.style.transform = '';
137 | });
138 |
139 |
140 | NOTE: Once the API implementation allows the use of implicit
141 | from values, we can fully mimick the CSS
142 | behaviour:
143 | el.animate({
144 | transform: ['scale(1.25)']
145 | }, 300);
146 |
147 |
148 |
149 |
150 |
151 |
152 |
189 |
190 |
191 |
--------------------------------------------------------------------------------
/demos/accessibility.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Web Animation examples - Accessibility
4 |
5 |
6 |
7 |
84 |
85 |
86 |
87 | Accessibility settings demo
88 | Tweak the animations according to your needs an preferences. Some examples:
89 |
90 | Make the size variation bigger to see those elements more easily.
91 | Disable the flash animations if you are sensitive to them.
92 | Make the movement animation slower if you have motion sickness.
93 |
94 |
95 |
96 |
101 |
102 | JS
103 | DT
104 | TL
105 |
106 |
107 | Accessibility options
108 |
113 |
114 |
115 |
116 |
117 |
209 |
210 |
--------------------------------------------------------------------------------
/styles.css:
--------------------------------------------------------------------------------
1 | @import url(https://fonts.googleapis.com/css?family=Open+Sans:400,700,400italic);
2 |
3 | :root {
4 | --contrast-color: #0095DD;
5 | --contrast-color-over: #00539F;
6 | --contrast-color-translucid: rgba(0, 149, 221, 0.7);
7 | --contrast-color-over-translucid: rgba(0, 83, 159, 0.7);
8 |
9 | --bg-color: #f6f4ec;
10 | --bg-color-shadow: #d7d3c8;
11 |
12 | --text-color: #000;
13 | --text-color-contrast: #fff;
14 |
15 | --highlight: rgba(255, 255, 255, 0.9);
16 | --highlight-subtle: rgba(255, 255, 255, 0.5);
17 | --shadow: rgba(0, 0, 0, 0.2);
18 | --dark-shadow: rgba(0, 0, 0, 0.6);
19 | }
20 |
21 | body {
22 | font-family: 'Open Sans', sans-serif;
23 | font-size: 14px;
24 | padding: 1em;
25 | margin: 0;
26 | line-height: 1.3em;
27 | background: linear-gradient(to top, var(--bg-color-shadow) 0%, var(--bg-color) 100%) center center repeat;
28 | }
29 |
30 | body, html {
31 | min-height: 100%;
32 | box-sizing: border-box;
33 | }
34 |
35 | code, pre {
36 | font-family: Courier, 'Courier New', monospace;
37 | font-size: 1rem;
38 | }
39 |
40 | code {
41 | color: #666;
42 | }
43 |
44 | a {
45 | color: var(--contrast-color);
46 | text-decoration: none;
47 | }
48 |
49 | a:hover {
50 | color: var(--contrast-color-over);
51 | text-decoration: underline;
52 | }
53 |
54 | a.button {
55 | display: inline-block;
56 | color: var(--text-color-contrast);
57 | text-decoration: none;
58 | line-height: 1.25rem;
59 | box-sizing: border-box;
60 | }
61 |
62 | button, a.button {
63 | border: 0;
64 | background: var(--contrast-color);
65 | font-size: 1rem;
66 | padding: 0.5rem 1rem;
67 | color: #fff;
68 | transition: background 0.2s ease;
69 | }
70 |
71 | button:active, button:hover, a.button:active, a.button:hover {
72 | background: var(--contrast-color-over);
73 | }
74 |
75 | button[disabled] {
76 | background: #ccc;
77 | color: #666;
78 | }
79 |
80 | button[disabled]:hover {
81 | cursor: not-allowed;
82 | }
83 |
84 |
85 | p, li {
86 | margin: 1em 0;
87 | }
88 |
89 | li, dt, dd {
90 | margin: 0.8em 0;
91 | }
92 |
93 | dd {
94 | margin-left: 2em;
95 | }
96 |
97 | input[type=range], input[type=color] {
98 | vertical-align: bottom;
99 | }
100 |
101 | h1, h2, h3 {
102 | font-weight: normal;
103 | text-shadow: 0 1px 0 var(--highlight);
104 | color: #484848;
105 | }
106 |
107 | h1 {
108 | font-size: 2em;
109 | line-height: 1.25em;
110 | }
111 |
112 | iframe {
113 | border: none;
114 | overflow: scroll;
115 | }
116 |
117 | /* ---------------------------------------------------------------------------*/
118 | /* layout */
119 | /* ---------------------------------------------------------------------------*/
120 |
121 | body.index {
122 | padding: 0;
123 | margin: 0;
124 | min-height: 100vh;
125 | overflow: auto;
126 | }
127 |
128 | .page-wrapper {
129 | display: flex;
130 | align-items: stretch;
131 | min-height: 100vh;
132 | }
133 |
134 | .sidebar {
135 | flex: 0 0 auto;
136 | border-right: 4px solid var(--shadow);
137 | width: 280px;
138 | box-sizing: border-box;
139 | padding: 0em 1em 1em 1em;
140 | text-align: center;
141 | }
142 |
143 | .viewer-wrapper {
144 | flex: 1 1 auto;
145 | overflow: hidden;
146 | position: relative;
147 | }
148 |
149 | .viewer {
150 | margin: 0;
151 | padding: 0;
152 | height: 100%;
153 | box-sizing: border-box;
154 | width: 100%;
155 | position: absolute; /* chrome doesn't just like height:100% :( */
156 | }
157 |
158 | /* helpers */
159 | .panel {
160 | border-bottom: 2px solid var(--shadow);
161 | border-right: 2px solid var(--shadow);
162 | border-top: 2px solid var(--highlight);
163 | margin: 2em 0;
164 | padding: 1.5em;
165 | background: var(--bg-color);
166 | }
167 |
168 | .panel > *:first-child, .panel > header > * {
169 | margin-top: 0;
170 | }
171 |
172 | main.constrained {
173 | max-width: 900px;
174 | margin: 0 2em;
175 | }
176 |
177 | .burger {
178 | position: fixed;
179 | top: 0;
180 | left: 0;
181 | display: none;
182 | z-index: 10;
183 | }
184 |
185 | .burger button {
186 | padding: 0.2em;
187 | }
188 |
189 | .burger button, .view-source a {
190 | background: var(--contrast-color-translucid);
191 | }
192 |
193 | .burger button:hover, .view-source a:hover {
194 | background: var(--contrast-color-over-translucid);
195 | }
196 |
197 | .view-source {
198 | position: fixed;
199 | top: 0.5em;
200 | right: 0.5em;
201 | z-index: 10;
202 | display: none;
203 | }
204 |
205 | .view-source a:not(href~=http) {
206 | display: none;
207 | }
208 |
209 | @media (max-width: 900px) {
210 | .mobile-hidden {
211 | display: none;
212 | }
213 |
214 | .mobile-show {
215 | display: block;
216 | }
217 |
218 | .burger {
219 | display: block;
220 | }
221 |
222 | body {
223 | padding-top: 2em;
224 | }
225 | .page-wrapper {
226 | display: block;
227 | min-height: 0;
228 | }
229 | .sidebar {
230 | width: 100%;
231 | border: none;
232 | }
233 | .viewer-wrapper {
234 | height: 100vh;
235 | }
236 | .viewer-wrapper:not(.mobile-show) {
237 | display: none;
238 | }
239 | }
240 |
241 | /* ---------------------------------------------------------------------------*/
242 | /* main menu */
243 | /* ---------------------------------------------------------------------------*/
244 | p.tagline {
245 | margin-top: -1em;
246 | }
247 | .menu {
248 | text-align: left;
249 | background: var(--bg-color);
250 | }
251 |
252 | .menu ul {
253 | padding-left: 0;
254 | }
255 | .menu li {
256 | display: block;
257 | line-height: 1.4em;
258 | border-bottom: 2px solid var(--shadow);
259 | border-top: 2px solid var(--highlight);
260 | margin: 0;
261 | }
262 |
263 | .menu a {
264 | padding: 1em;
265 | display: block;
266 | }
267 |
268 | .menu a:hover {
269 | text-decoration: none;
270 | background: var(--highlight-subtle);
271 | }
272 |
273 | .sidebar .button {
274 | width: 100%;
275 | }
276 |
277 | /* ---------------------------------------------------------------------------*/
278 | /* custom tabzilla */
279 | /* ---------------------------------------------------------------------------*/
280 |
281 | #tabzilla {
282 | float: none;
283 | }
284 |
285 | #tabzilla a {
286 | box-shadow: none;
287 | margin: 0 auto;
288 | }
289 |
290 | #tabzilla a:hover {
291 | background-color: transparent;
292 | }
293 |
294 | #tabzilla:hover:before{
295 | background-color: #C13832;
296 | }
297 |
298 | #tabzilla:before {
299 | background: #4D4E53;
300 | left: 50%;
301 | margin-left: -44px;
302 | }
303 | /* ---------------------------------------------------------------------------*/
304 | /* no browser support warning banner
305 | /* ---------------------------------------------------------------------------*/
306 |
307 | .no-support {
308 | background: var(--bg-color-shadow);
309 | padding: 1em;
310 | }
311 |
312 | /* ---------------------------------------------------------------------------*/
313 | /* custom syntax highlight */
314 | /* ---------------------------------------------------------------------------*/
315 | pre[class*="language-"] {
316 | background: var(--highlight-subtle);
317 | margin: 1em 0;
318 | }
319 |
--------------------------------------------------------------------------------
/demos/lib/prism.js:
--------------------------------------------------------------------------------
1 | /* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript */
2 | var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(){var e=/\blang(?:uage)?-(\w+)\b/i,t=0,n=_self.Prism={util:{encode:function(e){return e instanceof a?new a(e.type,n.util.encode(e.content),e.alias):"Array"===n.util.type(e)?e.map(n.util.encode):e.replace(/&/g,"&").replace(/e.length)break e;if(!(v instanceof a)){u.lastIndex=0;var b=u.exec(v),k=1;if(!b&&h&&m!=r.length-1){if(u.lastIndex=y,b=u.exec(e),!b)break;for(var w=b.index+(g?b[1].length:0),_=b.index+b[0].length,A=m,S=y,P=r.length;P>A&&_>S;++A)S+=(r[A].matchedStr||r[A]).length,w>=S&&(++m,y=S);if(r[m]instanceof a||r[A-1].greedy)continue;k=A-m,v=e.slice(y,S),b.index-=y}if(b){g&&(f=b[1].length);var w=b.index+f,b=b[0].slice(f),_=w+b.length,x=v.slice(0,w),O=v.slice(_),j=[m,k];x&&j.push(x);var N=new a(l,c?n.tokenize(b,c):b,d,b,h);j.push(N),O&&j.push(O),Array.prototype.splice.apply(r,j)}}}}}return r},hooks:{all:{},add:function(e,t){var a=n.hooks.all;a[e]=a[e]||[],a[e].push(t)},run:function(e,t){var a=n.hooks.all[e];if(a&&a.length)for(var r,i=0;r=a[i++];)r(t)}}},a=n.Token=function(e,t,n,a,r){this.type=e,this.content=t,this.alias=n,this.matchedStr=a||null,this.greedy=!!r};if(a.stringify=function(e,t,r){if("string"==typeof e)return e;if("Array"===n.util.type(e))return e.map(function(n){return a.stringify(n,t,e)}).join("");var i={type:e.type,content:a.stringify(e.content,t,r),tag:"span",classes:["token",e.type],attributes:{},language:t,parent:r};if("comment"==i.type&&(i.attributes.spellcheck="true"),e.alias){var l="Array"===n.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(i.classes,l)}n.hooks.run("wrap",i);var o="";for(var s in i.attributes)o+=(o?" ":"")+s+'="'+(i.attributes[s]||"")+'"';return"<"+i.tag+' class="'+i.classes.join(" ")+'"'+(o?" "+o:"")+">"+i.content+""+i.tag+">"},!_self.document)return _self.addEventListener?(_self.addEventListener("message",function(e){var t=JSON.parse(e.data),a=t.language,r=t.code,i=t.immediateClose;_self.postMessage(n.highlight(r,n.languages[a],a)),i&&_self.close()},!1),_self.Prism):_self.Prism;var r=document.currentScript||[].slice.call(document.getElementsByTagName("script")).pop();return r&&(n.filename=r.src,document.addEventListener&&!r.hasAttribute("data-manual")&&("loading"!==document.readyState?window.requestAnimationFrame?window.requestAnimationFrame(n.highlightAll):window.setTimeout(n.highlightAll,16):document.addEventListener("DOMContentLoaded",n.highlightAll))),_self.Prism}();"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism);
3 | Prism.languages.markup={comment://,prolog:/<\?[\w\W]+?\?>/,doctype://,cdata://i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,inside:{punctuation:/[=>"']/}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/?[\da-z]{1,8};/i},Prism.hooks.add("wrap",function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&/,"&"))}),Prism.languages.xml=Prism.languages.markup,Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup;
4 | Prism.languages.css={comment:/\/\*[\w\W]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^\{\}\s][^\{\};]*?(?=\s*\{)/,string:/("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/,property:/(\b|\B)[\w-]+(?=\s*:)/i,important:/\B!important\b/i,"function":/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},Prism.languages.css.atrule.inside.rest=Prism.util.clone(Prism.languages.css),Prism.languages.markup&&(Prism.languages.insertBefore("markup","tag",{style:{pattern:/(
29 |
30 |
174 |
175 |
176 |
177 | Style guide
178 | Tweak each UX component and adjust its animations.
179 |
180 | Expand Element Config
181 | Use to expand an element in order to reveal more content to the user.
182 |
183 |
213 |
214 |
215 | Here is lots of content which can be expanded
216 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur finibus nisi at massa accumsan, et aliquet lacus consequat. Proin ultricies leo augue, dignissim placerat ipsum imperdiet sit amet. Nullam iaculis neque ac eros dapibus, vitae pellentesque eros faucibus. Curabitur dignissim lobortis tortor, in viverra nisi congue sit amet.
217 |
218 |
219 |
220 |
221 | Button Suggest Action Config
222 | Use to suggest a button action to the user by drawing attention to it.
223 |
224 | Action
225 |
226 |
233 |
234 |
235 |
236 | Element Fade In Config
237 | Use to introduce a dynamically loaded piece of content to the user.
238 |
239 |
240 | Dynamically Fetched Content
241 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed lacinia sed sapien vehicula vestibulum.
242 |
243 |
244 |
250 |
251 |
252 |
253 |