Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo-mod-jslibs-dist.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'alpinejs/packages/intersect/src/index.js')
-rw-r--r--alpinejs/packages/intersect/src/index.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/alpinejs/packages/intersect/src/index.js b/alpinejs/packages/intersect/src/index.js
index bd9b57b..0880258 100644
--- a/alpinejs/packages/intersect/src/index.js
+++ b/alpinejs/packages/intersect/src/index.js
@@ -29,8 +29,14 @@ export default function (Alpine) {
function getThreshhold(modifiers) {
if (modifiers.includes('full')) return 0.99
if (modifiers.includes('half')) return 0.5
+ if (! modifiers.includes('threshold')) return 0
- return 0
+ let threshold = modifiers[modifiers.indexOf('threshold') + 1]
+
+ if (threshold === '100') return 1
+ if (threshold === '0') return 0
+
+ return Number(`.${threshold}`)
}
export function getLengthValue(rawValue) {