Socket
Socket
Sign inDemoInstall

vanilla-back-to-top

Package Overview
Dependencies
0
Maintainers
1
Versions
59
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 7.1.9 to 7.1.10

2

dist/vanilla-back-to-top.min.js

@@ -1,1 +0,1 @@

"use strict";function addBackToTop(){var o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=o.id,e=void 0===t?"back-to-top":t,n=o.showWhenScrollTopIs,i=void 0===n?1:n,d=o.onClickScrollTo,r=void 0===d?0:d,a=o.scrollDuration,c=void 0===a?100:a,s=o.innerHTML,l=void 0===s?'<svg viewBox="0 0 24 24"><path d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"></path></svg>':s,u=o.diameter,m=void 0===u?56:u,p=o.size,b=void 0===p?m:p,h=o.cornerOffset,v=void 0===h?20:h,f=o.backgroundColor,x=void 0===f?"#000":f,w=o.textColor,g=void 0===w?"#fff":w,k=o.zIndex,y=void 0===k?1:k;!function(){var o=Math.round(.43*b),t=Math.round(.29*b),n="#"+e+"{background:"+x+";-webkit-border-radius:50%;-moz-border-radius:50%;border-radius:50%;bottom:"+v+"px;-webkit-box-shadow:0 2px 5px 0 rgba(0,0,0,.26);-moz-box-shadow:0 2px 5px 0 rgba(0,0,0,.26);box-shadow:0 2px 5px 0 rgba(0,0,0,.26);cursor:pointer;display:block;height:"+b+"px;opacity:1;outline:0;position:fixed;right:"+v+"px;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;-webkit-transition:bottom .2s,opacity .2s;-o-transition:bottom .2s,opacity .2s;-moz-transition:bottom .2s,opacity .2s;transition:bottom .2s,opacity .2s;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:"+b+"px;z-index:"+y+"}#"+e+" svg{display:block;fill:"+g+";height:"+o+"px;margin:"+t+"px auto 0;width:"+o+"px}#"+e+".hidden{bottom:-"+b+"px;opacity:0}",i=document.createElement("style");i.appendChild(document.createTextNode(n)),document.head.insertAdjacentElement("afterbegin",i)}();var T=function(){var o=document.createElement("div");return o.id=e,o.className="hidden",o.innerHTML=l,o.addEventListener("click",function(o){o.preventDefault(),function(){var o=window,t=o.performance,e=o.requestAnimationFrame;if(c<=0||void 0===t||void 0===e)return L(r);var n=t.now(),i=M(),d=i-r;e(function o(t){var r=t-n,a=Math.min(r/c,1);L(i-Math.round(a*d)),a<1&&e(o)})}()}),document.body.appendChild(o),o}(),E=!0;window.addEventListener("scroll",z),z();function z(){M()>=i?function(){if(!E)return;T.className="",E=!1}():function(){if(E)return;T.className="hidden",E=!0}()}function M(){return document.body.scrollTop||document.documentElement&&document.documentElement.scrollTop||0}function L(o){document.body.scrollTop=o,document.documentElement&&(document.documentElement.scrollTop=o)}}
"use strict";function addBackToTop(){var o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=o.id,e=void 0===t?"back-to-top":t,n=o.showWhenScrollTopIs,i=void 0===n?1:n,r=o.onClickScrollTo,d=void 0===r?0:r,c=o.scrollDuration,a=void 0===c?100:c,s=o.innerHTML,l=void 0===s?'<svg viewBox="0 0 24 24"><path d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"></path></svg>':s,u=o.diameter,m=void 0===u?56:u,p=o.size,b=void 0===p?m:p,h=o.cornerOffset,v=void 0===h?20:h,f=o.backgroundColor,x=void 0===f?"#000":f,w=o.textColor,g=void 0===w?"#fff":w,k=o.zIndex,y=void 0===k?1:k;!function(){var o=Math.round(.43*b),t=Math.round(.29*b),n="#"+e+"{background:"+x+";-webkit-border-radius:50%;-moz-border-radius:50%;border-radius:50%;bottom:"+v+"px;-webkit-box-shadow:0 2px 5px 0 rgba(0,0,0,.26);-moz-box-shadow:0 2px 5px 0 rgba(0,0,0,.26);box-shadow:0 2px 5px 0 rgba(0,0,0,.26);color:"+g+";cursor:pointer;display:block;height:"+b+"px;opacity:1;outline:0;position:fixed;right:"+v+"px;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;-webkit-transition:bottom .2s,opacity .2s;-o-transition:bottom .2s,opacity .2s;-moz-transition:bottom .2s,opacity .2s;transition:bottom .2s,opacity .2s;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:"+b+"px;z-index:"+y+"}#"+e+" svg{display:block;fill:currentColor;height:"+o+"px;margin:"+t+"px auto 0;width:"+o+"px}#"+e+".hidden{bottom:-"+b+"px;opacity:0}",i=document.createElement("style");i.appendChild(document.createTextNode(n)),document.head.insertAdjacentElement("afterbegin",i)}();var T=function(){var o=document.createElement("div");return o.id=e,o.className="hidden",o.innerHTML=l,o.addEventListener("click",function(o){o.preventDefault(),function(){var o=window,t=o.performance,e=o.requestAnimationFrame;if(a<=0||void 0===t||void 0===e)return C(d);var n=t.now(),i=M(),r=i-d;e(function o(t){var d=t-n,c=Math.min(d/a,1);C(i-Math.round(c*r)),c<1&&e(o)})}()}),document.body.appendChild(o),o}(),E=!0;window.addEventListener("scroll",z),z();function z(){M()>=i?function(){if(!E)return;T.className="",E=!1}():function(){if(E)return;T.className="hidden",E=!0}()}function M(){return document.body.scrollTop||document.documentElement&&document.documentElement.scrollTop||0}function C(o){document.body.scrollTop=o,document.documentElement&&(document.documentElement.scrollTop=o)}}

@@ -84,3 +84,3 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

var svgTop = Math.round(0.29 * size);
var styles = '#' + id + '{background:' + backgroundColor + ';-webkit-border-radius:50%;-moz-border-radius:50%;border-radius:50%;bottom:' + cornerOffset + 'px;-webkit-box-shadow:0 2px 5px 0 rgba(0,0,0,.26);-moz-box-shadow:0 2px 5px 0 rgba(0,0,0,.26);box-shadow:0 2px 5px 0 rgba(0,0,0,.26);cursor:pointer;display:block;height:' + size + 'px;opacity:1;outline:0;position:fixed;right:' + cornerOffset + 'px;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;-webkit-transition:bottom .2s,opacity .2s;-o-transition:bottom .2s,opacity .2s;-moz-transition:bottom .2s,opacity .2s;transition:bottom .2s,opacity .2s;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:' + size + 'px;z-index:' + zIndex + '}#' + id + ' svg{display:block;fill:' + textColor + ';height:' + svgSize + 'px;margin:' + svgTop + 'px auto 0;width:' + svgSize + 'px}#' + id + '.hidden{bottom:-' + size + 'px;opacity:0}';
var styles = '#' + id + '{background:' + backgroundColor + ';-webkit-border-radius:50%;-moz-border-radius:50%;border-radius:50%;bottom:' + cornerOffset + 'px;-webkit-box-shadow:0 2px 5px 0 rgba(0,0,0,.26);-moz-box-shadow:0 2px 5px 0 rgba(0,0,0,.26);box-shadow:0 2px 5px 0 rgba(0,0,0,.26);color:' + textColor + ';cursor:pointer;display:block;height:' + size + 'px;opacity:1;outline:0;position:fixed;right:' + cornerOffset + 'px;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;-webkit-transition:bottom .2s,opacity .2s;-o-transition:bottom .2s,opacity .2s;-moz-transition:bottom .2s,opacity .2s;transition:bottom .2s,opacity .2s;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:' + size + 'px;z-index:' + zIndex + '}#' + id + ' svg{display:block;fill:currentColor;height:' + svgSize + 'px;margin:' + svgTop + 'px auto 0;width:' + svgSize + 'px}#' + id + '.hidden{bottom:-' + size + 'px;opacity:0}';
var styleEl = document.createElement('style');

@@ -87,0 +87,0 @@ styleEl.appendChild(document.createTextNode(styles));

# Install
If you don't want to rely on [unpkg.com](https://unpkg.com/#/about), save [the file](https://raw.githubusercontent.com/vfeskov/vanilla-back-to-top/v7.1.9/dist/vanilla-back-to-top.min.js) to your project and serve it from your server:
If you don't want to rely on [unpkg.com](https://unpkg.com/#/about), save [the file](https://raw.githubusercontent.com/vfeskov/vanilla-back-to-top/v7.1.10/dist/vanilla-back-to-top.min.js) to your project and serve it from your server:
```html

@@ -5,0 +5,0 @@ <script src="/assets/vanilla-back-to-top.min.js"></script>

{
"name": "vanilla-back-to-top",
"version": "7.1.9",
"version": "7.1.10",
"description": "Simple and smooth Back To Top button with no dependencies",

@@ -5,0 +5,0 @@ "main": "dist/vanilla-back-to-top.umd.js",

# Vanilla Back To Top
[![No Dependencies](http://svgshare.com/i/4rU.svg)](https://github.com/vfeskov/vanilla-back-to-top/blob/v7.1.9/package.json)
[![File Size](https://img.shields.io/github/size/vfeskov/vanilla-back-to-top/dist/vanilla-back-to-top.min.js.gz.svg)](https://github.com/vfeskov/vanilla-back-to-top/blob/v7.1.9/dist/vanilla-back-to-top.min.js.gz)
[![No Dependencies](http://svgshare.com/i/4rU.svg)](https://github.com/vfeskov/vanilla-back-to-top/blob/v7.1.10/package.json)
[![File Size](https://img.shields.io/github/size/vfeskov/vanilla-back-to-top/dist/vanilla-back-to-top.min.js.gz.svg)](https://github.com/vfeskov/vanilla-back-to-top/blob/v7.1.10/dist/vanilla-back-to-top.min.js.gz)
[![Downloads](https://img.shields.io/npm/dm/vanilla-back-to-top.svg)](https://www.npmjs.com/package/vanilla-back-to-top)

@@ -10,3 +10,3 @@

[<img src="https://i.pi.gy/O1Gbz.png" width="67" /><img src="https://i.pi.gy/8Z0Nj.png" width="54"><img src="https://i.pi.gy/0P8Nr.png" width="120"><img src="https://i.pi.gy/Vabg0.png" width="72">](https://github.com/vfeskov/vanilla-back-to-top/blob/v7.1.9/EXAMPLES.md)<br/>
[<img src="https://i.pi.gy/O1Gbz.png" width="67" /><img src="https://i.pi.gy/8Z0Nj.png" width="54"><img src="https://i.pi.gy/0P8Nr.png" width="120"><img src="https://i.pi.gy/Vabg0.png" width="72">](https://github.com/vfeskov/vanilla-back-to-top/blob/v7.1.10/EXAMPLES.md)<br/>

@@ -25,3 +25,3 @@ <img src="https://i.pi.gy/ee5b5.gif" width="320px"/>

- Great for static websites on [Jekyll](https://jekyllrb.com/), [Hexo](https://hexo.io), [Hugo](https://gohugo.io/) etc
- Great with [Vue](https://vuejs.org/), [React](https://reactjs.org/), [Angular](https://angular.io/) etc, see [INSTALL](https://github.com/vfeskov/vanilla-back-to-top/blob/v7.1.9/INSTALL.md#import)
- Great with [Vue](https://vuejs.org/), [React](https://reactjs.org/), [Angular](https://angular.io/) etc, see [INSTALL](https://github.com/vfeskov/vanilla-back-to-top/blob/v7.1.10/INSTALL.md#import)

@@ -32,3 +32,3 @@ ## How to use

```html
<script src="https://unpkg.com/vanilla-back-to-top@7.1.9/dist/vanilla-back-to-top.min.js"></script>
<script src="https://unpkg.com/vanilla-back-to-top@7.1.10/dist/vanilla-back-to-top.min.js"></script>
<script>addBackToTop({

@@ -40,11 +40,11 @@ diameter: 56,

```
For alternative installation see [INSTALL](https://github.com/vfeskov/vanilla-back-to-top/blob/v7.1.9/INSTALL.md)
For alternative installation see [INSTALL](https://github.com/vfeskov/vanilla-back-to-top/blob/v7.1.10/INSTALL.md)
See [EXAMPLES](https://github.com/vfeskov/vanilla-back-to-top/blob/v7.1.9/EXAMPLES.md)
See [EXAMPLES](https://github.com/vfeskov/vanilla-back-to-top/blob/v7.1.10/EXAMPLES.md)
For all options see [OPTIONS](https://github.com/vfeskov/vanilla-back-to-top/blob/v7.1.9/OPTIONS.md)
For all options see [OPTIONS](https://github.com/vfeskov/vanilla-back-to-top/blob/v7.1.10/OPTIONS.md)
## License
MIT, see [LICENSE](https://github.com/vfeskov/vanilla-back-to-top/blob/v7.1.9/LICENSE)
MIT, see [LICENSE](https://github.com/vfeskov/vanilla-back-to-top/blob/v7.1.10/LICENSE)

@@ -51,0 +51,0 @@ Default icon from [Material Design Icons](https://material.io/icons/#ic_keyboard_arrow_up) under [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0), which only restricts re-selling the icon

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc