-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathinsQ.min.js
executable file
·5 lines (4 loc) · 2.09 KB
/
insQ.min.js
1
2
3
4
5
// insertion-query v1.0.5 (2020-09-20)
// license:MIT
// Zbyszek Tenerowicz <[email protected]> (http://naugtur.pl/)
var insertionQ=function(){"use strict";var m=100,t=!1,u="animationName",d="",n="Webkit Moz O ms Khtml".split(" "),e="",i=document.createElement("div"),s={strictlyNew:!0,timeout:20,addImportant:!1};if(i.style.animationName&&(t=!0),!1===t)for(var o=0;o<n.length;o++)if(void 0!==i.style[n[o]+"AnimationName"]){e=n[o],u=e+"AnimationName",d="-"+e.toLowerCase()+"-",t=!0;break}function c(t){return s.strictlyNew&&!0===t.QinsQ}function r(t,n){function e(t){t.animationName!==o&&t[u]!==o||c(t.target)||n(t.target)}var i,o="insQ_"+m++,r=s.addImportant?" !important":"";(i=document.createElement("style")).innerHTML="@"+d+"keyframes "+o+" { from { outline: 1px solid transparent } to { outline: 0px solid transparent } }\n"+t+" { animation-duration: 0.001s"+r+"; animation-name: "+o+r+"; "+d+"animation-duration: 0.001s"+r+"; "+d+"animation-name: "+o+r+"; } ",document.head.appendChild(i);var a=setTimeout(function(){document.addEventListener("animationstart",e,!1),document.addEventListener("MSAnimationStart",e,!1),document.addEventListener("webkitAnimationStart",e,!1)},s.timeout);return{destroy:function(){clearTimeout(a),i&&(document.head.removeChild(i),i=null),document.removeEventListener("animationstart",e),document.removeEventListener("MSAnimationStart",e),document.removeEventListener("webkitAnimationStart",e)}}}function a(t){t.QinsQ=!0}function f(t){if(t)for(a(t),t=t.firstChild;t;t=t.nextSibling)void 0!==t&&1===t.nodeType&&f(t)}function l(t,n){var e,i=[],o=function(){clearTimeout(e),e=setTimeout(function(){i.forEach(f),n(i),i=[]},10)};return r(t,function(t){if(!c(t)){a(t);var n=function t(n){return c(n.parentNode)||"BODY"===n.nodeName?n:t(n.parentNode)}(t);i.indexOf(n)<0&&i.push(n),o()}})}function v(n){return!(!t||!n.match(/[^{}]/))&&(s.strictlyNew&&f(document.body),{every:function(t){return r(n,t)},summary:function(t){return l(n,t)}})}return v.config=function(t){for(var n in t)t.hasOwnProperty(n)&&(s[n]=t[n])},v}();"undefined"!=typeof module&&void 0!==module.exports&&(module.exports=insertionQ);