vanilla-back-to-top
Advanced tools
Comparing version 3.2.0 to 3.2.1
@@ -1,1 +0,1 @@ | ||
function addBackToTop(t){var e=t.id,o=void 0===e?"back-to-top":e,n=t.scrollContainer,c=void 0===n?document.documentElement:n,i=t.showWhenScrollTopIs,a=void 0===i?300:i,d=t.onClickScrollTo,r=void 0===d?0:d,l=t.innerElement,s=void 0===l?document.createTextNode("Up"):l,p=t.size,m=void 0===p?50:p,u=t.fontSize,b=void 0===u?14:u,x=t.cornerOffset,f=void 0===x?20:x,v=t.backgroundColor,k=void 0===v?"#000":v,y=t.textColor,h=void 0===y?"#fff":y,w=t.zIndex,g=void 0===w?1:w;!function(){var t="#".concat(o,"{bottom:").concat(f,"px;opacity:1;position:fixed;right:").concat(f,"px;-webkit-transition:bottom .2s,opacity .2s;-moz-transition:bottom .2s,opacity .2s;transition:bottom .2s,opacity .2s;z-index:").concat(g,";}#").concat(o,".hidden{bottom:-").concat(m,"px;opacity:0;}#").concat(o," a{-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;background:").concat(k,";-webkit-border-radius:").concat(m,"px;-moz-border-radius:").concat(m,"px;border-radius:").concat(m,"px;color:").concat(h,";cursor:pointer;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;font-size:").concat(b,"px;height:").concat(m,"px;-webkit-box-pack:center;-webkit-justify-content:center;-moz-box-pack:center;-ms-flex-pack:center;justify-content:center;text-decoration:none;width:").concat(m,"px;}"),e=document.createElement("style");e.appendChild(document.createTextNode(t)),document.head.insertAdjacentElement("afterbegin",e)}();var z,E=function(){var t=document.createElement("div");t.id=o;var e=document.createElement("a");return e.addEventListener("click",function(t){t.preventDefault(),c.scrollTop=r}),e.appendChild(s),t.appendChild(e),document.body.appendChild(t),t}();C(),(c===document.documentElement?window:c).addEventListener("scroll",C);function C(){c.scrollTop>=a?function(){if(!z)return;E.className="",z=!1}():function(){if(z)return;E.className="hidden",z=!0}()}} | ||
function addBackToTop(e){var t=e.id,o=void 0===t?"back-to-top":t,n=e.scrollContainer,c=void 0===n?document.documentElement:n,i=e.showWhenScrollTopIs,a=void 0===i?300:i,d=e.onClickScrollTo,r=void 0===d?0:d,l=e.innerElement,s=void 0===l?document.createTextNode("Up"):l,p=e.size,m=void 0===p?50:p,u=e.fontSize,b=void 0===u?14:u,x=e.cornerOffset,f=void 0===x?20:x,v=e.backgroundColor,k=void 0===v?"#000":v,h=e.textColor,y=void 0===h?"#fff":h,w=e.zIndex,g=void 0===w?1:w;!function(){var e="#".concat(o,"{bottom:").concat(f,"px;opacity:1;position:fixed;right:").concat(f,"px;-webkit-transition:bottom .2s,opacity .2s;-moz-transition:bottom .2s,opacity .2s;transition:bottom .2s,opacity .2s;z-index:").concat(g,";}#").concat(o,".hidden{bottom:-").concat(m,"px;opacity:0;}#").concat(o," a{-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;background:").concat(k,";-webkit-border-radius:").concat(m,"px;-moz-border-radius:").concat(m,"px;border-radius:").concat(m,"px;color:").concat(y,";cursor:pointer;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;font-size:").concat(b,"px;height:").concat(m,"px;-webkit-box-pack:center;-webkit-justify-content:center;-moz-box-pack:center;-ms-flex-pack:center;justify-content:center;text-decoration:none;width:").concat(m,"px;}"),t=document.createElement("style");t.appendChild(document.createTextNode(e)),document.head.insertAdjacentElement("afterbegin",t)}();var z=function(){var e=document.createElement("div");e.id=o,e.className="hidden";var t=document.createElement("a");return t.addEventListener("click",function(e){e.preventDefault(),c.scrollTop=r}),t.appendChild(s),e.appendChild(t),document.body.appendChild(e),e}(),E=!0;(c===document.documentElement?window:c).addEventListener("scroll",C),C();function C(){c.scrollTop>=a?function(){if(!E)return;z.className="",E=!1}():function(){if(E)return;z.className="hidden",E=!0}()}} |
{ | ||
"name": "vanilla-back-to-top", | ||
"version": "3.2.0", | ||
"version": "3.2.1", | ||
"description": "Configurable zero dependency Back To Top button", | ||
@@ -5,0 +5,0 @@ "main": "dist/vanilla-back-to-top.min.js", |
@@ -13,3 +13,3 @@ # Vanilla Back To Top | ||
``` | ||
<script src="https://unpkg.com/vanilla-back-to-top@3.2.0/dist/vanilla-back-to-top.min.js"></script> | ||
<script src="https://unpkg.com/vanilla-back-to-top@3.2.1/dist/vanilla-back-to-top.min.js"></script> | ||
<script>addBackToTop({})</script> | ||
@@ -16,0 +16,0 @@ ``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6692