Skip to content

Commit

Permalink
v1.0.0-dev.5
Browse files Browse the repository at this point in the history
  • Loading branch information
clementroche committed Jan 21, 2023
1 parent 86e4b89 commit 2aa7bc3
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 11 deletions.
15 changes: 11 additions & 4 deletions bundled/lenis.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
}
});

var version = "1.0.0-dev.4";
var version = "1.0.0-dev.5";

function clamp(min, input, max) {
return Math.max(min, Math.min(input, max));
Expand Down Expand Up @@ -522,14 +522,19 @@
return;
}
_classPrivateFieldLooseBase(_this, _isSmooth2)[_isSmooth2] = _classPrivateFieldLooseBase(_this, _options)[_options].smoothTouch && type === 'touch' || _classPrivateFieldLooseBase(_this, _options)[_options].smoothWheel && type === 'wheel';
if (!_this.isSmooth) return;
if (!_this.isSmooth) {
_classPrivateFieldLooseBase(_this, _isScrolling2)[_isScrolling2] = false;
_classPrivateFieldLooseBase(_this, _animate)[_animate].stop();
return;
}
event.preventDefault();
var delta = deltaY;
if (_classPrivateFieldLooseBase(_this, _options)[_options].gestureOrientation === 'both') {
delta = deltaX + deltaY;
} else if (_classPrivateFieldLooseBase(_this, _options)[_options].gestureOrientation === 'horizontal') {
delta = deltaX;
}
console.log('scrollTo', _classPrivateFieldLooseBase(_this, _targetScroll)[_targetScroll] + delta);
_this.scrollTo(_classPrivateFieldLooseBase(_this, _targetScroll)[_targetScroll] + delta, {}, false);
}
});
Expand Down Expand Up @@ -618,6 +623,7 @@
};
_proto.stop = function stop() {
_classPrivateFieldLooseBase(this, _isStopped2)[_isStopped2] = true;
_classPrivateFieldLooseBase(this, _animate)[_animate].stop();
};
_proto.raf = function raf(time) {
var deltaTime = time - (_classPrivateFieldLooseBase(this, _time)[_time] || time);
Expand Down Expand Up @@ -735,7 +741,7 @@
}, {
key: "limit",
get: function get() {
return this.isHorizontal ? _classPrivateFieldLooseBase(this, _content)[_content].width - _classPrivateFieldLooseBase(this, _wrapper)[_wrapper].width : _classPrivateFieldLooseBase(this, _content)[_content].height - _classPrivateFieldLooseBase(this, _wrapper)[_wrapper].height;
return Math.round(this.isHorizontal ? _classPrivateFieldLooseBase(this, _content)[_content].width - _classPrivateFieldLooseBase(this, _wrapper)[_wrapper].width : _classPrivateFieldLooseBase(this, _content)[_content].height - _classPrivateFieldLooseBase(this, _wrapper)[_wrapper].height);
}
}, {
key: "isHorizontal",
Expand All @@ -745,7 +751,7 @@
}, {
key: "scroll",
get: function get() {
return clampedModulo(_classPrivateFieldLooseBase(this, _animatedScroll)[_animatedScroll], this.limit);
return _classPrivateFieldLooseBase(this, _options)[_options].infinite ? clampedModulo(_classPrivateFieldLooseBase(this, _animatedScroll)[_animatedScroll], this.limit) : _classPrivateFieldLooseBase(this, _animatedScroll)[_animatedScroll];
}
}, {
key: "progress",
Expand Down Expand Up @@ -782,6 +788,7 @@
}();
function _setScroll2(scroll) {
if (_classPrivateFieldLooseBase(this, _options)[_options].infinite) {
// modulo scroll value
scroll = this.scroll;
}

Expand Down
4 changes: 2 additions & 2 deletions bundled/lenis.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/lenis.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/lenis.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/lenis.modern.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/lenis.umd.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@studio-freight/lenis",
"version": "1.0.0-dev.4",
"version": "1.0.0-dev.5",
"description": "Lenis is a smooth scroll library to normalize the scrolling experience across devices",
"files": [
"dist"
Expand Down

2 comments on commit 2aa7bc3

@vercel
Copy link

@vercel vercel bot commented on 2aa7bc3 Jan 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"⚡️ Lighthouse report for the changes in this commit:

🔴 Performance: 15
🟠 Accessibility: 89
🟢 Best practices: 100
🟠 SEO: 67
🔴 PWA: 0

Lighthouse ran on https://greensock.com/requires-membership/?plugin=SplitText&source=trial"

Please sign in to comment.