FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
jQuery.Keyframes/jquery.keyframes.min.js at ie1011fix · Keyframes/jQuery.Keyframes · GitHub
Keyframes
/
jQuery.Keyframes
Public
Notifications
You must be signed in to change notification settings
Fork
83
Star
294
Code
Issues
2
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
jQuery.Keyframes
/
jquery.keyframes.min.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
10 lines (7 loc) · 9.21 KB
Breadcrumbs
jQuery.Keyframes
/
jquery.keyframes.min.js
Copy path
File metadata and controls
10 lines (7 loc) · 9.21 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
/**
* StyleFix 1.0.3 & PrefixFree 1.0.7
*
@author
Lea Verou
* MIT license
*/
(
function
(
)
{
function
t
(
e
,
t
)
{
return
[
]
.
slice
.
call
(
(
t
||
document
)
.
querySelectorAll
(
e
)
)
}
if
(
!
window
.
addEventListener
)
return
;
var
e
=
window
.
StyleFix
=
{
link
:
function
(
t
)
{
try
{
if
(
t
.
rel
!==
"stylesheet"
||
t
.
hasAttribute
(
"data-noprefix"
)
)
return
}
catch
(
n
)
{
return
}
var
r
=
t
.
href
||
t
.
getAttribute
(
"data-href"
)
,
i
=
r
.
replace
(
/
[
^
\/
]
+
$
/
,
""
)
,
s
=
(
/
^
[
a
-
z
]
{
3
,
10
}
:
/
.
exec
(
i
)
||
[
""
]
)
[
0
]
,
o
=
(
/
^
[
a
-
z
]
{
3
,
10
}
:
\/
\/
[
^
\/
]
+
/
.
exec
(
i
)
||
[
""
]
)
[
0
]
,
u
=
/
^
(
[
^
?
]
*
)
\?
?
/
.
exec
(
r
)
[
1
]
,
a
=
t
.
parentNode
,
f
=
new
XMLHttpRequest
,
l
;
f
.
onreadystatechange
=
function
(
)
{
f
.
readyState
===
4
&&
l
(
)
}
;
l
=
function
(
)
{
var
n
=
f
.
responseText
;
if
(
n
&&
t
.
parentNode
&&
(
!
f
.
status
||
f
.
status
<
400
||
f
.
status
>
600
)
)
{
n
=
e
.
fix
(
n
,
!
0
,
t
)
;
if
(
i
)
{
n
=
n
.
replace
(
/
u
r
l
\(
\s
*
?
(
(?:
"
|
'
)
?
)
(
.
+
?
)
\1
\s
*
?
\)
/
gi
,
function
(
e
,
t
,
n
)
{
return
/
^
(
[
a
-
z
]
{
3
,
10
}
:
|
#
)
/
i
.
test
(
n
)
?
e
:
/
^
\/
\/
/
.
test
(
n
)
?
'url("'
+
s
+
n
+
'")'
:
/
^
\/
/
.
test
(
n
)
?
'url("'
+
o
+
n
+
'")'
:
/
^
\?
/
.
test
(
n
)
?
'url("'
+
u
+
n
+
'")'
:
'url("'
+
i
+
n
+
'")'
}
)
;
var
r
=
i
.
replace
(
/
(
[
\\
\^
\$
*
+
[
\]
?
{
}
.
=
!
:
(
|
)
]
)
/
g
,
"\\$1"
)
;
n
=
n
.
replace
(
RegExp
(
"\\b(behavior:\\s*?url\\('?\"?)"
+
r
,
"gi"
)
,
"$1"
)
}
var
l
=
document
.
createElement
(
"style"
)
;
l
.
textContent
=
n
;
l
.
media
=
t
.
media
;
l
.
disabled
=
t
.
disabled
;
l
.
setAttribute
(
"data-href"
,
t
.
getAttribute
(
"href"
)
)
;
a
.
insertBefore
(
l
,
t
)
;
a
.
removeChild
(
t
)
;
l
.
media
=
t
.
media
}
}
;
try
{
f
.
open
(
"GET"
,
r
)
;
f
.
send
(
null
)
}
catch
(
n
)
{
if
(
typeof
XDomainRequest
!=
"undefined"
)
{
f
=
new
XDomainRequest
;
f
.
onerror
=
f
.
onprogress
=
function
(
)
{
}
;
f
.
onload
=
l
;
f
.
open
(
"GET"
,
r
)
;
f
.
send
(
null
)
}
}
t
.
setAttribute
(
"data-inprogress"
,
""
)
}
,
styleElement
:
function
(
t
)
{
if
(
t
.
hasAttribute
(
"data-noprefix"
)
)
return
;
var
n
=
t
.
disabled
;
t
.
textContent
=
e
.
fix
(
t
.
textContent
,
!
0
,
t
)
;
t
.
disabled
=
n
}
,
styleAttribute
:
function
(
t
)
{
var
n
=
t
.
getAttribute
(
"style"
)
;
n
=
e
.
fix
(
n
,
!
1
,
t
)
;
t
.
setAttribute
(
"style"
,
n
)
}
,
process
:
function
(
)
{
t
(
'link[rel="stylesheet"]:not([data-inprogress])'
)
.
forEach
(
StyleFix
.
link
)
;
t
(
"style"
)
.
forEach
(
StyleFix
.
styleElement
)
;
t
(
"[style]"
)
.
forEach
(
StyleFix
.
styleAttribute
)
}
,
register
:
function
(
t
,
n
)
{
(
e
.
fixers
=
e
.
fixers
||
[
]
)
.
splice
(
n
===
undefined
?
e
.
fixers
.
length
:
n
,
0
,
t
)
}
,
fix
:
function
(
t
,
n
,
r
)
{
for
(
var
i
=
0
;
i
<
e
.
fixers
.
length
;
i
++
)
t
=
e
.
fixers
[
i
]
(
t
,
n
,
r
)
||
t
;
return
t
}
,
camelCase
:
function
(
e
)
{
return
e
.
replace
(
/
-
(
[
a
-
z
]
)
/
g
,
function
(
e
,
t
)
{
return
t
.
toUpperCase
(
)
}
)
.
replace
(
"-"
,
""
)
}
,
deCamelCase
:
function
(
e
)
{
return
e
.
replace
(
/
[
A
-
Z
]
/
g
,
function
(
e
)
{
return
"-"
+
e
.
toLowerCase
(
)
}
)
}
}
;
(
function
(
)
{
setTimeout
(
function
(
)
{
t
(
'link[rel="stylesheet"]'
)
.
forEach
(
StyleFix
.
link
)
}
,
10
)
;
document
.
addEventListener
(
"DOMContentLoaded"
,
StyleFix
.
process
,
!
1
)
}
)
(
)
}
)
(
)
;
(
function
(
e
)
{
function
t
(
e,t,r,i,s){e=n[e];if(e.length){var o=RegExp(t+"("+e.join("|")+")"+r,"gi");s=s.replace(o,i)}return s}if(!window.StyleFix||!window.getComputedStyle)return;var n=window.PrefixFree={prefixCSS:function(e,r,i){var s=n.prefix;n.functions.indexOf("linear-gradient")>-1&&(e=e.replace(/(\s|:|,)(repeating-)?linear-gradient\(\s*(-?\d*\.?\d*)deg/ig,function(e,t,n,r){return t+(n||"")+"linear-gradient("+(90-r)+"deg"}));e=t("functions","(\\s|:|,)","\\s*\\(","$1"+s+"$2(",e);e=t("keywords","(\\s|:)","(\\s|;|\\}|$)","$1"+s+"$2$3",e);e=t("properties","(^|\\{|\\s|;)","\\s*:","$1"+s+"$2:",e);if(n.properties.length){var o=RegExp("\\b("+n.properties.join("|")+")(?!:)","gi");e=t("valueProperties","\\b",":(.+?);",function(e){return e.replace(o,s+"$1")},e)}if(r){e=t("selectors","","\\b",n.prefixSelector,e);e=t("atrules","@","\\b","@"+s+"$1",e)}e=e.replace(RegExp("-"+s,"g"),"-");e=e.replace(/-\*-(?=[a-z]+)/gi,n.prefix);return e},property:function(e){return(n.properties.indexOf(e)>=0?n.prefix:"")+e},value:function(e,r){e=t("functions","(^|\\s|,)","\\s*\\(","$1"+n.prefix+"$2(",e);e=t("keywords","(^|\\s)","(\\s|$)","$1"+n.prefix+"$2$3",e);n.valueProperties.indexOf(r)>=0&&(e=t("properties","(^|\\s|,)","($|\\s|,)","$1"+n.prefix+"$2$3",e));return e},prefixSelector:function(e){return e.replace(/^:{1,2}/,function(e){return e+n.prefix})},prefixProperty:function(e,t){var r=n.prefix+e;return t?StyleFix.camelCase(r):r}};(function(){var e={},t=[],r={},i=getComputedStyle(document.documentElement,null),s=document.createElement("div").style,o=function(n){if(n.charAt(0)==="-"){t.push(n);var r=n.split("-"),i=r[1];e[i]=++e[i]||1;while(r.length>3){r.pop();var s=r.join("-");u(s)&&t.indexOf(s)===-1&&t.push(s)}}},u=function(e){return StyleFix.camelCase(e)in s};if(i.length>0)for(var a=0;a<i.length;a++)o(i[a]);else for(var f in i)o(StyleFix.deCamelCase(f));var l={uses:0};for(var c in e){var h=e[c];l.uses<h&&(l={prefix:c,uses:h})}n.prefix="-"+l.prefix+"-";n.Prefix=StyleFix.camelCase(n.prefix);n.properties=[];for(var a=0;a<t.length;a++){var f=t[a];if(f.indexOf(n.prefix)===0){var p=f.slice(n.prefix.length);u(p)||n.properties.push(p)}}n.Prefix=="Ms"&&!("transform"in s)&&!("MsTransform"in s)&&"msTransform"in s&&n.properties.push("transform","transform-origin");n.properties.sort()})();(function(){function i(e,t){r[t]="";r[t]=e;return!!r[t]}var e={"linear-gradient":{property:"backgroundImage",params:"red, teal"},calc:{property:"width",params:"1px + 5%"},element:{property:"backgroundImage",params:"#foo"},"cross-fade":{property:"backgroundImage",params:"url(a.png), url(b.png), 50%"}};e["repeating-linear-gradient"]=e["repeating-radial-gradient"]=e["radial-gradient"]=e["linear-gradient"];var t={initial:"color","zoom-in":"cursor","zoom-out":"cursor",box:"display",flexbox:"display","inline-flexbox":"display",flex:"display","inline-flex":"display",grid:"display","inline-grid":"display","min-content":"width"};n.functions=[];n.keywords=[];var r=document.createElement("div").style;for(var s in e){var o=e[s],u=o.property,a=s+"("+o.params+")";!i(a,u)&&i(n.prefix+a,u)&&n.functions.push(s)}for(var f in t){var u=t[f];!i(f,u)&&i(n.prefix+f,u)&&n.keywords.push(f)}})();(function(){function s(e){i.textContent=e+"{}";return!!i.sheet.cssRules.length}var t={":read-only":null,":read-write":null,":any-link":null,"::selection":null},r={keyframes:"name",viewport:null,document:'regexp(".")'};n.selectors=[];n.atrules=[];var i=e.appendChild(document.createElement("style"));for(var o in t){var u=o+(t[o]?"("+t[o]+")":"");!s(u)&&s(n.prefixSelector(u))&&n.selectors.push(o)}for(var a in r){var u=a+" "+(r[a]||"");!s("@"+u)&&s("@"+n.prefix+u)&&n.atrules.push(a)}e.removeChild(i)})();n.valueProperties=["transition","transition-property"];e.className+=" "+n.prefix;StyleFix.register(n.prefixCSS)})(document.documentElement);
!
function
(
e
,
t
,
a
)
{
var
n
=
!
1
,
i
=
"animation"
,
o
=
prefix
=
""
,
r
=
[
"Webkit"
,
"Moz"
,
"O"
,
"ms"
,
"Khtml"
]
,
s
=
e
.
matchMedia
&&
e
.
matchMedia
(
"all and (-ms-high-contrast: none), (-ms-high-contrast: active)"
)
.
matches
,
f
=
a
(
e
)
,
m
=
t
.
getElementsByTagName
(
"head"
)
[
0
]
;
f
.
on
(
"load"
,
function
(
)
{
var
e
=
t
.
body
.
style
;
if
(
void
0
!==
e
.
animationName
&&
(
n
=
!
0
)
,
n
===
!
1
)
for
(
var
a
=
0
;
a
<
r
.
length
;
a
++
)
if
(
void
0
!==
e
[
r
[
a
]
+
"AnimationName"
]
)
{
prefix
=
r
[
a
]
,
i
=
prefix
+
"Animation"
,
o
=
"-"
+
prefix
.
toLowerCase
(
)
+
"-"
,
n
=
!
0
;
break
}
}
)
;
var
l
,
d
=
function
(
)
{
a
.
each
(
a
(
"[data-media]"
)
,
function
(
t
,
n
)
{
$el
=
a
(
n
)
,
e
.
matchMedia
(
$el
.
attr
(
"data-media"
)
)
.
matches
?
$el
.
html
(
$el
.
data
(
"keyframedata"
)
)
:
(
$el
.
data
(
"keyframedata"
,
$el
.
html
(
)
)
,
$el
.
html
(
""
)
)
}
)
}
,
c
=
function
(
)
{
e
.
clearTimeout
(
l
)
,
l
=
e
.
setTimeout
(
d
,
34
)
}
,
u
=
function
(
t
,
n
,
i
)
{
if
(
a
.
keyframe
.
debug
&&
e
.
console
.
log
(
t
+
" "
+
n
)
,
s
&&
i
)
{
var
o
=
a
(
"<style></style>"
)
.
attr
(
{
"class"
:
"keyframe-style"
,
id
:
t
,
type
:
"text/css"
,
"data-media"
:
i
}
)
;
return
e
.
matchMedia
(
i
)
.
matches
?
o
.
html
(
n
)
:
o
.
data
(
"keyframedata"
,
n
)
,
f
.
on
(
"resize"
,
c
)
.
on
(
"orientationchange"
,
c
)
,
o
.
appendTo
(
m
)
}
return
a
(
"<style>"
+
n
+
"</style>"
)
.
attr
(
{
"class"
:
"keyframe-style"
,
id
:
t
,
type
:
"text/css"
}
)
.
appendTo
(
m
)
}
;
a
.
keyframe
=
{
debug
:
!
1
,
getVendorPrefix
:
function
(
)
{
return
o
}
,
isSupported
:
function
(
)
{
return
n
}
,
generate
:
function
(
t
)
{
var
n
=
t
.
name
||
""
,
r
=
"@"
+
o
+
"keyframes "
+
n
+
" {"
;
for
(
var
f
in
t
)
if
(
"name"
!==
f
&&
"media"
!==
f
&&
"complete"
!==
f
)
{
r
+=
f
+
" {"
;
for
(
var
m
in
t
[
f
]
)
r
+=
m
+
":"
+
t
[
f
]
[
m
]
+
";"
;
r
+=
"}"
}
e
.
PrefixFree
?
r
=
e
.
PrefixFree
.
prefixCSS
(
r
+
"}"
)
:
r
+=
"}"
,
t
.
media
&&
!
s
&&
(
r
=
"@media "
+
t
.
media
+
"{"
+
r
+
"}"
)
;
var
l
=
a
(
"style#"
+
t
.
name
)
;
if
(
l
.
length
>
0
)
{
l
.
html
(
r
)
;
var
d
=
a
(
"*"
)
.
filter
(
function
(
)
{
return
this
.
style
[
i
+
"Name"
]
===
n
}
)
;
d
.
each
(
function
(
)
{
var
e
=
a
(
this
)
,
t
=
e
.
data
(
"keyframeOptions"
)
;
e
.
resetKeyframe
(
function
(
)
{
e
.
playKeyframe
(
t
)
}
)
}
)
}
else
s
&&
t
.
media
?
u
(
n
,
r
,
t
.
media
)
:
u
(
n
,
r
)
}
,
define
:
function
(
e
)
{
if
(
e
.
length
)
for
(
var
t
=
0
;
t
<
e
.
length
;
t
++
)
{
var
a
=
e
[
t
]
;
this
.
generate
(
a
)
}
else
this
.
generate
(
e
)
}
}
;
var
y
=
"animation-play-state"
,
h
=
"running"
;
a
.
fn
.
resetKeyframe
=
function
(
t
)
{
a
(
this
)
.
css
(
o
+
y
,
h
)
.
css
(
o
+
"animation"
,
"none"
)
;
t
&&
e
.
setTimeout
(
t
,
1
)
}
,
a
.
fn
.
pauseKeyframe
=
function
(
)
{
a
(
this
)
.
css
(
o
+
y
,
"paused"
)
}
,
a
.
fn
.
resumeKeyframe
=
function
(
)
{
a
(
this
)
.
css
(
o
+
y
,
h
)
}
,
a
.
fn
.
playKeyframe
=
function
(
e
,
t
)
{
var
n
=
function
(
e
)
{
return
e
=
a
.
extend
(
{
duration
:
"0s"
,
timingFunction
:
"ease"
,
delay
:
"0s"
,
iterationCount
:
1
,
direction
:
"normal"
,
fillMode
:
"forwards"
}
,
e
)
,
[
e
.
name
,
e
.
duration
,
e
.
timingFunction
,
e
.
delay
,
e
.
iterationCount
,
e
.
direction
,
e
.
fillMode
]
.
join
(
" "
)
}
,
i
=
""
;
if
(
a
.
isArray
(
e
)
)
{
for
(
var
r
=
[
]
,
s
=
0
;
s
<
e
.
length
;
s
++
)
"string"
==
typeof
e
[
s
]
?
r
.
push
(
e
[
s
]
):r.push(n(e[s]));i=r.join(", ")}else i="string"==typeof e?e:n(e);var f=o+"animation",m=["webkit","moz","MS","o",""];!t&&e.complete&&(t=e.complete);var l=function(e,t,a){for(var n=0;n<m.length;n++){m[n]||(t=t.toLowerCase());var i=m[n]+t;e.off(i).on(i,a)}};return this.each(function(){var n=a(this).addClass("boostKeyframe").css(o+y,h).css(f,i).data("keyframeOptions",e);if(a.keyframe.debug){console.group(),o&&console.log("Vendor Prefix: "+o),console.log("Style Applied: "+i);var r=n.css(f);console.log("Rendered Style: "+(r?r:n[0].style.animation)),console.groupEnd()}t&&(l(n,"AnimationIteration",t),l(n,"AnimationEnd",t))}),this},u("boost-keyframe"," .boostKeyframe{"+o+"transform:scale3d(1,1,1);}")}(window,document,jQuery);
Back
|
FazBrowse Home
|
New Git URL