This repository has been archived by the owner on Aug 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 111
/
index.html
282 lines (217 loc) 路 19.6 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
<!DOCTYPE html>
<!--[if lt IE 8]>
<html class="no-js lt-ie8 lt-ie9" lang="en">
<![endif]-->
<!--[if IE 8]>
<html class="no-js lt-ie9 ie8" lang="en">
<![endif]-->
<!--[if IE 9 ]>
<html class="no-js ie9" lang="en">
<![endif]-->
<!--[if !(IE)]><!-->
<html class="no-js" lang="en">
<!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Test: animate</title>
<script type="text/javascript">
var $html=document.documentElement;if($html.classList)$html.classList.remove("no-js"),$html.classList.add("js");else{var className="no-js";$html.className=$html.className.replace(new RegExp("(^|\\b)"+className.split(" ").join("|")+"(\\b|$)","gi")," "),$html.className+=" js"}
</script>
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,700" rel="stylesheet">
<link rel="stylesheet" href="style.css">
<!--[if lt IE 9]>
<script>
/* https://github.com/aFarkas/html5shiv HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed */
!function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.3",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b),"object"==typeof module&&module.exports&&(module.exports=t)}("undefined"!=typeof window?window:this,document);
</script>
<script>
/* https://github.com/scottjehl/Respond Respond.js v1.4.2: min/max-width media query polyfill * Copyright 2013 Scott Jehl Licensed under https://github.com/scottjehl/Respond/blob/master/LICENSE-MIT */
!function(a){"use strict";a.matchMedia=a.matchMedia||function(a){var b,c=a.documentElement,d=c.firstElementChild||c.firstChild,e=a.createElement("body"),f=a.createElement("div");return f.id="mq-test-1",f.style.cssText="position:absolute;top:-100em",e.style.background="none",e.appendChild(f),function(a){return f.innerHTML='­<style media="'+a+'"> #mq-test-1 { width: 42px; }</style>',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(a.document)}(this),function(a){"use strict";function b(){u(!0)}var c={};a.respond=c,c.update=function(){};var d=[],e=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}(),f=function(a,b){var c=e();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))};if(c.ajax=f,c.queue=d,c.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,maxw:/\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/},c.mediaQueriesSupported=a.matchMedia&&null!==a.matchMedia("only all")&&a.matchMedia("only all").matches,!c.mediaQueriesSupported){var g,h,i,j=a.document,k=j.documentElement,l=[],m=[],n=[],o={},p=30,q=j.getElementsByTagName("head")[0]||k,r=j.getElementsByTagName("base")[0],s=q.getElementsByTagName("link"),t=function(){var a,b=j.createElement("div"),c=j.body,d=k.style.fontSize,e=c&&c.style.fontSize,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",c||(c=f=j.createElement("body"),c.style.background="none"),k.style.fontSize="100%",c.style.fontSize="100%",c.appendChild(b),f&&k.insertBefore(c,k.firstChild),a=b.offsetWidth,f?k.removeChild(c):c.removeChild(b),k.style.fontSize=d,e&&(c.style.fontSize=e),a=i=parseFloat(a)},u=function(b){var c="clientWidth",d=k[c],e="CSS1Compat"===j.compatMode&&d||j.body[c]||d,f={},o=s[s.length-1],r=(new Date).getTime();if(b&&g&&p>r-g)return a.clearTimeout(h),h=a.setTimeout(u,p),void 0;g=r;for(var v in l)if(l.hasOwnProperty(v)){var w=l[v],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?i||t():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?i||t():1)),w.hasquery&&(z&&A||!(z||e>=x)||!(A||y>=e))||(f[w.media]||(f[w.media]=[]),f[w.media].push(m[w.rules]))}for(var C in n)n.hasOwnProperty(C)&&n[C]&&n[C].parentNode===q&&q.removeChild(n[C]);n.length=0;for(var D in f)if(f.hasOwnProperty(D)){var E=j.createElement("style"),F=f[D].join("\n");E.type="text/css",E.media=D,q.insertBefore(E,o.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(j.createTextNode(F)),n.push(E)}},v=function(a,b,d){var e=a.replace(c.regex.keyframes,"").match(c.regex.media),f=e&&e.length||0;b=b.substring(0,b.lastIndexOf("/"));var g=function(a){return a.replace(c.regex.urls,"$1"+b+"$2$3")},h=!f&&d;b.length&&(b+="/"),h&&(f=1);for(var i=0;f>i;i++){var j,k,n,o;h?(j=d,m.push(g(a))):(j=e[i].match(c.regex.findStyles)&&RegExp.$1,m.push(RegExp.$2&&g(RegExp.$2))),n=j.split(","),o=n.length;for(var p=0;o>p;p++)k=n[p],l.push({media:k.split("(")[0].match(c.regex.only)&&RegExp.$2||"all",rules:m.length-1,hasquery:k.indexOf("(")>-1,minw:k.match(c.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:k.match(c.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},w=function(){if(d.length){var b=d.shift();f(b.href,function(c){v(c,b.href,b.media),o[b.href]=!0,a.setTimeout(function(){w()},0)})}},x=function(){for(var b=0;b<s.length;b++){var c=s[b],e=c.href,f=c.media,g=c.rel&&"stylesheet"===c.rel.toLowerCase();e&&g&&!o[e]&&(c.styleSheet&&c.styleSheet.rawCssText?(v(c.styleSheet.rawCssText,e,f),o[e]=!0):(!/^([a-zA-Z:]*\/\/)/.test(e)&&!r||e.replace(RegExp.$1,"").split("/")[0]===a.location.host)&&("//"===e.substring(0,2)&&(e=a.location.protocol+e),d.push({href:e,media:f})))}w()};x(),c.update=x,c.getEmValue=t,a.addEventListener?a.addEventListener("resize",b,!1):a.attachEvent&&a.attachEvent("onresize",b)}}(this);
</script>
<![endif]-->
</head>
<body class="uikit-grid">
<noscript>
<p role="alert">This website needs JavaScript to work properly.</p>
</noscript>
<script>
if( !window.console ) { //removing console.log from IE8
console = {
log: function( text ) { alert( text ) },
};
}
</script>
<a class="test-link" href="../../../../">← back to the module index</a>
<div class="container">
<h1>Test: animate</h1>
<div class="row">
<div class="grids col-sm-6">
<h2>Open, close and toggle between 0 and auto</h2>
<div>
<button aria-controls="close" onclick="UIKIT.animate.Run({ element: document.getElementById('dropdown-1'), property: 'height', endSize: 0, speed: 1000, callback: function() { console.log('end2!!'); } })">Close</button>
<button aria-controls="open" onclick="UIKIT.animate.Run({ element: document.getElementById('dropdown-1'), property: 'height', endSize: 'auto', speed: 1000, callback: function() { console.log('end1!!'); } })">Open</button>
<button aria-controls="toggle" onclick="UIKIT.animate.Toggle({ element: document.getElementById('dropdown-1'), property: 'height', speed: 2000, callback: function() { console.log('end2!!'); } })">Toggle</button>
<button aria-controls="toggle" onclick="UIKIT.animate.Stop( document.getElementById('dropdown-1') )">Stop</button>
</div>
<div style="background-color:rebeccapurple;" class="uikit-dropdown-example" id="dropdown-1">
<br><br><br>
</div>
</div>
<div class="grids col-sm-6">
<h2>Open, close and toggle between 0 and auto</h2>
<div>
<button aria-controls="close" onclick="UIKIT.animate.Run({ element: document.getElementById('dropdown-2'), property: 'width', endSize: 0, callback: function() { console.log('end3!!'); } })">Close</button>
<button aria-controls="open" onclick="UIKIT.animate.Run({ element: document.getElementById('dropdown-2'), property: 'width', endSize: 'auto', callback: function() { console.log('end3!!'); } })">Open</button>
<button aria-controls="toggle" onclick="UIKIT.animate.Toggle({ element: document.getElementById('dropdown-2'), property: 'width', callback: function() { console.log('end3!!'); } })">Toggle</button>
<button aria-controls="toggle" onclick="UIKIT.animate.Stop( document.getElementById('dropdown-2') )">Stop</button>
</div>
<div style="background-color:rebeccapurple;" class="uikit-dropdown-example" id="dropdown-2">
<br><br><br>
</div>
</div>
</div>
<hr>
<div class="row">
<div class="grids col-sm-6">
<h2>Animate padding-bottom</h2>
<div>
<button aria-controls="close" onclick="UIKIT.animate.Run({ element: document.getElementById('dropdown-padding1'), property: 'paddingBottom', endSize: 0, callback: function() { console.log('end4!!'); } })">Close</button>
<button aria-controls="open" onclick="UIKIT.animate.Run({ element: document.getElementById('dropdown-padding1'), property: 'paddingBottom', endSize: 20, callback: function() { console.log('end3!!'); } })">Open</button>
<button aria-controls="toggle" onclick="UIKIT.animate.Stop( document.getElementById('dropdown-padding1') )">Stop</button>
</div>
<div style="background-color:rebeccapurple;padding-bottom:20px;" class="uikit-dropdown-example" id="dropdown-padding1">
<br><br><br>
</div>
</div>
<div class="grids col-sm-6">
<h2>Animate margin-bottom</h2>
<div>
<button aria-controls="close" onclick="UIKIT.animate.Run({ element: document.getElementById('dropdown-margin1'), property: 'marginBottom', endSize: 0, callback: function() { console.log('end4!!'); } })">Close</button>
<button aria-controls="open" onclick="UIKIT.animate.Run({ element: document.getElementById('dropdown-margin1'), property: 'marginBottom', endSize: 20, callback: function() { console.log('end3!!'); } })">Open</button>
<button aria-controls="toggle" onclick="UIKIT.animate.Stop( document.getElementById('dropdown-margin1') )">Stop</button>
</div>
<div style="background-color:rebeccapurple;margin-bottom:20px;" class="uikit-dropdown-example" id="dropdown-margin1">
<br><br><br>
</div>
I'm pushed down by the bottom margin
</div>
</div>
<div class="row">
<div class="grids col-sm-6">
<h2>Animate position</h2>
<div>
<button aria-controls="back" onclick="UIKIT.animate.Run({ element: document.getElementById('dropdown-position1'), property: 'left', endSize: 0, speed: 1000, callback: function() { console.log('end4!!'); } })">Back</button>
<button aria-controls="forward" onclick="UIKIT.animate.Run({ element: document.getElementById('dropdown-position1'), property: 'left', endSize: 100, speed: 1000, callback: function() { console.log('end3!!'); } })">Forward</button>
<button aria-controls="toggle" onclick="UIKIT.animate.Stop( document.getElementById('dropdown-position1') )">Stop</button>
</div>
<div class="position-container" style="position:relative;">
<div style="background-color:rebeccapurple;height:20px;width:20px;border-radius:50%;position:absolute;top:0;left:0;" class="uikit-dropdown-example" id="dropdown-position1">
</div>
</div>
</div>
</div>
<hr>
<div class="row">
<div class="grids col-sm-6">
<h2>Open, close height between specified values</h2>
<div>
<button aria-controls="open" onclick="UIKIT.animate.Run({ element: document.getElementById('dropdown-3'), property: 'height', endSize: 200, speed: 1000, callback: function() { console.log('end4!!'); } })">Open</button>
<button aria-controls="close" onclick="UIKIT.animate.Run({ element: document.getElementById('dropdown-3'), property: 'height', endSize: 50, speed: 1000, callback: function() { console.log('end4!!'); } })">Close</button>
<button aria-controls="toggle" onclick="UIKIT.animate.Toggle({ element: document.getElementById('dropdown-3'), property: 'height', openSize: 200, closeSize: 50, callback: function() { console.log('end4!!'); } })">Toggle</button>
<button aria-controls="toggle" onclick="UIKIT.animate.Stop( document.getElementById('dropdown-3') )">Stop</button>
</div>
<div style="background-color:rebeccapurple;height:50px;" class="uikit-dropdown-example" id="dropdown-3">
</div>
</div>
<div class="grids col-sm-6">
<h2>Open, close width between specified values</h2>
<div>
<button aria-controls="open" onclick="UIKIT.animate.Run({ element: document.getElementById('dropdown-4'), property: 'width', endSize: 200, speed: 1000, callback: function() { console.log('end4!!'); } })">Open</button>
<button aria-controls="close" onclick="UIKIT.animate.Run({ element: document.getElementById('dropdown-4'), property: 'width', endSize: 100, speed: 1000, callback: function() { console.log('end4!!'); } })">Close</button>
<button aria-controls="toggle" onclick="UIKIT.animate.Toggle({ element: document.getElementById('dropdown-4'), property: 'width', openSize: 200, closeSize: 100, callback: function() { console.log('end4!!'); } })">Toggle</button>
<button aria-controls="toggle" onclick="UIKIT.animate.Stop( document.getElementById('dropdown-4') )">Stop</button>
</div>
<div style="height:50px;width:50px;" class="uikit-dropdown-example" id="dropdown-4">
</div>
</div>
</div>
<hr>
<div class="row">
<div class="col-sm-12">
<h2>Open, close and toggle multiple items</h2>
</div>
<div class="grids col-sm-6">
<div>
<div>
<button aria-controls="open" onclick="UIKIT.animate.Run({ element: document.querySelectorAll('.js-vertical-dropdown-group'), property: 'height', endSize: 'auto', speed: 1000, callback: function() { console.log('end8!!'); } })">Open all</button>
<button aria-controls="close" onclick="UIKIT.animate.Run({ element: document.querySelectorAll('.js-vertical-dropdown-group'), property: 'height', endSize: 0, speed: 1000, callback: function() { console.log('end9!!'); } })">Close all</button>
<button aria-controls="toggle" onclick="UIKIT.animate.Toggle({ element: document.querySelectorAll('.js-vertical-dropdown-group'), property: 'height', callback: function() { console.log('toggle end10!!'); } })">Toggle all</button>
</div>
</div>
<div class="uikit-dropdown-example js-vertical-dropdown-group elment1" id="dropdown-5">
<br><br><br><br><br><br>
</div>
<div class=" uikit-dropdown-example js-vertical-dropdown-group elment2" style="height:0;">
<br><br><br>
</div>
<div class="uikit-dropdown-example js-vertical-dropdown-group elment3">
<br><br><br><br>
</div>
</div>
<div class="grids col-sm-6">
<div>
<div>
<button aria-controls="open" onclick="UIKIT.animate.Run({ element: document.querySelectorAll('.js-horizontal-dropdown-group'), property: 'width', endSize: 'auto', speed: 1000, callback: function() { console.log('end8!!'); } })">Open all</button>
<button aria-controls="close" onclick="UIKIT.animate.Run({ element: document.querySelectorAll('.js-horizontal-dropdown-group'), property: 'width', endSize: 0, speed: 1000, callback: function() { console.log('end8!!'); } })">Close all</button>
<button aria-controls="toggle" onclick="UIKIT.animate.Toggle({ element: document.querySelectorAll('.js-horizontal-dropdown-group'), property: 'width', callback: function() { console.log('toggle end9-!!'); } })">Toggle all</button>
</div>
</div>
<div class="uikit-dropdown-example js-horizontal-dropdown-group elment4" id="dropdown-6">
<br><br><br>
</div>
<div class="uikit-dropdown-example js-horizontal-dropdown-group elment5" style="width:0;">
<br><br><br>
</div>
<div class="uikit-dropdown-example js-horizontal-dropdown-group elment6">
<br><br><br>
</div>
</div>
</div>
<hr>
<div class="row">
<div class="col-sm-12">
<h2>Edge cases</h2>
</div>
<div class="grids col-sm-6">
<h2>less pixel than steps</h2>
<div>
<div>
<button aria-controls="open" onclick="UIKIT.animate.Run({ element: document.getElementById('edgecase1'), property: 'height', endSize: 3, speed: 4, callback: function() { console.log('end edgecase1!!'); } })">Open</button>
<button aria-controls="close" onclick="UIKIT.animate.Run({ element: document.getElementById('edgecase1'), property: 'height', endSize: 0, speed: 4, callback: function() { console.log('end edgecase2!!'); } })">Close</button>
<button aria-controls="toggle" onclick="UIKIT.animate.Toggle({ element: document.getElementById('edgecase1'), property: 'height', openSize: 3, closeSize: 0, speed: 4, callback: function() { console.log('end edgecase2!!'); } })">Toggle</button>
</div>
</div>
<div class="uikit-dropdown-example" id="edgecase1"></div>
</div>
<div class="grids col-sm-6">
<h2>Half pixel step size</h2>
<div>
<div>
<button aria-controls="open" onclick="UIKIT.animate.Run({ element: document.getElementById('edgecase2'), property: 'height', endSize: 200, speed: 473, callback: function() { console.log('end edgecase2!!'); } })">Open</button>
<button aria-controls="close" onclick="UIKIT.animate.Run({ element: document.getElementById('edgecase2'), property: 'height', endSize: 0, speed: 473, callback: function() { console.log('end edgecase2!!'); } })">Close</button>
<button aria-controls="toggle" onclick="UIKIT.animate.Toggle({ element: document.getElementById('edgecase2'), property: 'height', openSize: 200, closeSize: 0, speed: 473, callback: function() { console.log('end edgecase2!!'); } })">Toggle</button>
</div>
</div>
<div class="uikit-dropdown-example" id="edgecase2" style="height:0;">
<br><br><br>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="module.js"></script>
</body>
</html>