Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

alpinejs-scroll-amount

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alpinejs-scroll-amount - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

dist/scroll-amount.esm.js

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

function t(n){n.magic("scrollAmount",()=>{let o=Math.round(window.scrollY/(document.body.offsetHeight-window.innerHeight)*100);return{px:window.scrollY,percent:o,start:o==0,end:o==100}})}var l=t;export{l as default};
function t(r){r.magic("scrollAmount",()=>{let o=Math.round(window.scrollY/(document.body.offsetHeight-window.innerHeight)*100);return{scrollPx:window.scrollY,scrollPercent:o,atStart:o==0,atEnd:o==100}})}var e=t;export{e as default};

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

(()=>{function o(t){t.magic("scrollAmount",()=>{let n=Math.round(window.scrollY/(document.body.offsetHeight-window.innerHeight)*100);return{px:window.scrollY,percent:n,start:n==0,end:n==100}})}document.addEventListener("alpine:init",()=>{window.Alpine.plugin(o)});})();
(()=>{function o(t){t.magic("scrollAmount",()=>{let n=Math.round(window.scrollY/(document.body.offsetHeight-window.innerHeight)*100);return{scrollPx:window.scrollY,scrollPercent:n,atStart:n==0,atEnd:n==100}})}document.addEventListener("alpine:init",()=>{window.Alpine.plugin(o)});})();
{
"name": "alpinejs-scroll-amount",
"version": "1.0.0",
"version": "1.0.1",
"description": "Track the users scroll position and their progress on the page 🤿",

@@ -5,0 +5,0 @@ "keywords": [

@@ -45,4 +45,4 @@ # Alpine JS Scroll Amount

class="h-px bg-green-500"
:class="{ 'bg-green-600': scrollPos.end }"
:style="{ width: `${scrollPos.percent}%` }"
:class="{ 'bg-green-600': scrollPos.atEnd }"
:style="{ width: `${scrollPos.scrollPercent}%` }"
>

@@ -61,6 +61,6 @@ </span>

return {
px: 0,
percent: 0,
start: true / false,
end: true / false,
scrollPx: 0,
scrollPercent: 0,
atStart: true / false,
atEnd: true / false,
}

@@ -67,0 +67,0 @@ ```

@@ -8,8 +8,8 @@ export default function (Alpine) {

return {
px: window.scrollY,
percent: scrollPercent,
start: scrollPercent == 0,
end: scrollPercent == 100,
scrollPx: window.scrollY,
scrollPercent: scrollPercent,
atStart: scrollPercent == 0,
atEnd: scrollPercent == 100,
}
})
}
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc