@aarsteinmedia/dotlottie-player 6.2.0 → 6.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -1
- package/dist/canvas.d.ts +9 -3
- package/dist/canvas.js +17 -10
- package/dist/full.d.ts +9 -3
- package/dist/full.js +17 -10
- package/dist/light.d.ts +9 -3
- package/dist/light.js +17 -10
- package/dist/svg.d.ts +9 -3
- package/dist/svg.js +17 -10
- package/dist/unpkg-canvas.js +17 -17
- package/dist/unpkg-full.js +17 -17
- package/dist/unpkg-light.js +16 -16
- package/dist/unpkg-svg.js +17 -17
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -7,7 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
Changelog was only added since [3.2.3], so it's not exhaustive. [Please report any missing noteable changes to us](https://github.com/aarsteinmedia/dotlottie-player/issues), and we'll add them promptly.
|
|
9
9
|
|
|
10
|
-
## [6.2.
|
|
10
|
+
## [6.2.2] - 11-11-2025
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- Adjusted length of animation on animateOnScroll
|
|
15
|
+
- Added enum to `mouseout` attribute
|
|
16
|
+
|
|
17
|
+
## [6.2.0] - 06-11-2025
|
|
11
18
|
|
|
12
19
|
### Changed
|
|
13
20
|
|
package/dist/canvas.d.ts
CHANGED
|
@@ -35,6 +35,12 @@ declare class DotLottiePlayerLight extends DotLottiePlayerBase {
|
|
|
35
35
|
}): AnimationConfiguration<RendererType.SVG>;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
declare enum MouseOut {
|
|
39
|
+
Pause = "pause",
|
|
40
|
+
Reverse = "reverse",
|
|
41
|
+
Stop = "stop",
|
|
42
|
+
Void = "void"
|
|
43
|
+
}
|
|
38
44
|
declare enum PlayerState {
|
|
39
45
|
Completed = "completed",
|
|
40
46
|
Destroyed = "destroyed",
|
|
@@ -148,8 +154,8 @@ declare abstract class DotLottiePlayerBase extends PropertyCallbackElement {
|
|
|
148
154
|
get loop(): Loop;
|
|
149
155
|
set mode(value: PlayMode);
|
|
150
156
|
get mode(): PlayMode;
|
|
151
|
-
set mouseout(value:
|
|
152
|
-
get mouseout():
|
|
157
|
+
set mouseout(value: MouseOut);
|
|
158
|
+
get mouseout(): MouseOut;
|
|
153
159
|
set objectfit(value: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down');
|
|
154
160
|
get objectfit(): "contain" | "cover" | "fill" | "none" | "scale-down";
|
|
155
161
|
set once(value: boolean);
|
|
@@ -276,4 +282,4 @@ declare class DotLottiePlayerCanvas extends DotLottiePlayerBase {
|
|
|
276
282
|
}): AnimationConfiguration<RendererType.Canvas>;
|
|
277
283
|
}
|
|
278
284
|
|
|
279
|
-
export { PlayerState, DotLottiePlayerCanvas as default, tagName };
|
|
285
|
+
export { MouseOut, PlayerState, DotLottiePlayerCanvas as default, tagName };
|
package/dist/canvas.js
CHANGED
|
@@ -145,6 +145,13 @@ var ObjectFit = /*#__PURE__*/ function(ObjectFit) {
|
|
|
145
145
|
ObjectFit["ScaleDown"] = "scale-down";
|
|
146
146
|
return ObjectFit;
|
|
147
147
|
}({});
|
|
148
|
+
var MouseOut = /*#__PURE__*/ function(MouseOut) {
|
|
149
|
+
MouseOut["Pause"] = "pause";
|
|
150
|
+
MouseOut["Reverse"] = "reverse";
|
|
151
|
+
MouseOut["Stop"] = "stop";
|
|
152
|
+
MouseOut["Void"] = "void";
|
|
153
|
+
return MouseOut;
|
|
154
|
+
}({});
|
|
148
155
|
var PlayerState = /*#__PURE__*/ function(PlayerState) {
|
|
149
156
|
PlayerState["Completed"] = "completed";
|
|
150
157
|
PlayerState["Destroyed"] = "destroyed";
|
|
@@ -496,15 +503,15 @@ const notImplemented = 'Method is not implemented';
|
|
|
496
503
|
get mouseout() {
|
|
497
504
|
const val = this.getAttribute('mouseout');
|
|
498
505
|
switch(val){
|
|
499
|
-
case
|
|
500
|
-
case
|
|
501
|
-
case
|
|
506
|
+
case MouseOut.Void:
|
|
507
|
+
case MouseOut.Pause:
|
|
508
|
+
case MouseOut.Reverse:
|
|
502
509
|
{
|
|
503
510
|
return val;
|
|
504
511
|
}
|
|
505
512
|
default:
|
|
506
513
|
{
|
|
507
|
-
return
|
|
514
|
+
return MouseOut.Stop;
|
|
508
515
|
}
|
|
509
516
|
}
|
|
510
517
|
}
|
|
@@ -1469,7 +1476,7 @@ const notImplemented = 'Method is not implemented';
|
|
|
1469
1476
|
if (scrollY <= this._playerState.scrollY) {
|
|
1470
1477
|
scrollPosition = this._playerState.scrollY - scrollY;
|
|
1471
1478
|
}
|
|
1472
|
-
const scrollProgress = scrollPosition / innerHeight, currentFrame = clamp(scrollProgress * (totalFrames - 1),
|
|
1479
|
+
const scrollProgress = scrollPosition / innerHeight, currentFrame = clamp(scrollProgress * (totalFrames - 1), 0, totalFrames);
|
|
1473
1480
|
requestAnimationFrame(()=>{
|
|
1474
1481
|
if (currentFrame >= totalFrames) {
|
|
1475
1482
|
this.playerState = PlayerState.Paused;
|
|
@@ -1546,7 +1553,7 @@ const notImplemented = 'Method is not implemented';
|
|
|
1546
1553
|
if (!this.hover || !this._lottieInstance || isTouch()) {
|
|
1547
1554
|
return;
|
|
1548
1555
|
}
|
|
1549
|
-
if (this.mouseout ===
|
|
1556
|
+
if (this.mouseout === MouseOut.Reverse) {
|
|
1550
1557
|
this._lottieInstance.setDirection(1);
|
|
1551
1558
|
}
|
|
1552
1559
|
if (this.playerState === PlayerState.Completed) {
|
|
@@ -1565,16 +1572,16 @@ const notImplemented = 'Method is not implemented';
|
|
|
1565
1572
|
return;
|
|
1566
1573
|
}
|
|
1567
1574
|
switch(this.mouseout){
|
|
1568
|
-
case
|
|
1575
|
+
case MouseOut.Void:
|
|
1569
1576
|
{
|
|
1570
1577
|
break;
|
|
1571
1578
|
}
|
|
1572
|
-
case
|
|
1579
|
+
case MouseOut.Pause:
|
|
1573
1580
|
{
|
|
1574
1581
|
this.pause();
|
|
1575
1582
|
break;
|
|
1576
1583
|
}
|
|
1577
|
-
case
|
|
1584
|
+
case MouseOut.Reverse:
|
|
1578
1585
|
{
|
|
1579
1586
|
// const { direction = 1 } =
|
|
1580
1587
|
// this._multiAnimationSettings.length > 0 ?
|
|
@@ -1744,4 +1751,4 @@ if (!isServer) {
|
|
|
1744
1751
|
customElements.define(tagName, DotLottiePlayerCanvas);
|
|
1745
1752
|
}
|
|
1746
1753
|
|
|
1747
|
-
export { PlayerState, DotLottiePlayerCanvas as default, tagName };
|
|
1754
|
+
export { MouseOut, PlayerState, DotLottiePlayerCanvas as default, tagName };
|
package/dist/full.d.ts
CHANGED
|
@@ -21,6 +21,12 @@ declare class DotLottiePlayerLight extends DotLottiePlayerBase {
|
|
|
21
21
|
}): AnimationConfiguration<RendererType.SVG>;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
declare enum MouseOut {
|
|
25
|
+
Pause = "pause",
|
|
26
|
+
Reverse = "reverse",
|
|
27
|
+
Stop = "stop",
|
|
28
|
+
Void = "void"
|
|
29
|
+
}
|
|
24
30
|
declare enum PlayerState {
|
|
25
31
|
Completed = "completed",
|
|
26
32
|
Destroyed = "destroyed",
|
|
@@ -148,8 +154,8 @@ declare abstract class DotLottiePlayerBase extends PropertyCallbackElement {
|
|
|
148
154
|
get loop(): Loop;
|
|
149
155
|
set mode(value: PlayMode);
|
|
150
156
|
get mode(): PlayMode;
|
|
151
|
-
set mouseout(value:
|
|
152
|
-
get mouseout():
|
|
157
|
+
set mouseout(value: MouseOut);
|
|
158
|
+
get mouseout(): MouseOut;
|
|
153
159
|
set objectfit(value: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down');
|
|
154
160
|
get objectfit(): "contain" | "cover" | "fill" | "none" | "scale-down";
|
|
155
161
|
set once(value: boolean);
|
|
@@ -276,4 +282,4 @@ declare class DotLottiePlayer extends DotLottiePlayerBase {
|
|
|
276
282
|
}): AnimationConfiguration<RendererType>;
|
|
277
283
|
}
|
|
278
284
|
|
|
279
|
-
export { PlayerState, DotLottiePlayer as default, tagName };
|
|
285
|
+
export { MouseOut, PlayerState, DotLottiePlayer as default, tagName };
|
package/dist/full.js
CHANGED
|
@@ -145,6 +145,13 @@ var ObjectFit = /*#__PURE__*/ function(ObjectFit) {
|
|
|
145
145
|
ObjectFit["ScaleDown"] = "scale-down";
|
|
146
146
|
return ObjectFit;
|
|
147
147
|
}({});
|
|
148
|
+
var MouseOut = /*#__PURE__*/ function(MouseOut) {
|
|
149
|
+
MouseOut["Pause"] = "pause";
|
|
150
|
+
MouseOut["Reverse"] = "reverse";
|
|
151
|
+
MouseOut["Stop"] = "stop";
|
|
152
|
+
MouseOut["Void"] = "void";
|
|
153
|
+
return MouseOut;
|
|
154
|
+
}({});
|
|
148
155
|
var PlayerState = /*#__PURE__*/ function(PlayerState) {
|
|
149
156
|
PlayerState["Completed"] = "completed";
|
|
150
157
|
PlayerState["Destroyed"] = "destroyed";
|
|
@@ -496,15 +503,15 @@ const notImplemented = 'Method is not implemented';
|
|
|
496
503
|
get mouseout() {
|
|
497
504
|
const val = this.getAttribute('mouseout');
|
|
498
505
|
switch(val){
|
|
499
|
-
case
|
|
500
|
-
case
|
|
501
|
-
case
|
|
506
|
+
case MouseOut.Void:
|
|
507
|
+
case MouseOut.Pause:
|
|
508
|
+
case MouseOut.Reverse:
|
|
502
509
|
{
|
|
503
510
|
return val;
|
|
504
511
|
}
|
|
505
512
|
default:
|
|
506
513
|
{
|
|
507
|
-
return
|
|
514
|
+
return MouseOut.Stop;
|
|
508
515
|
}
|
|
509
516
|
}
|
|
510
517
|
}
|
|
@@ -1469,7 +1476,7 @@ const notImplemented = 'Method is not implemented';
|
|
|
1469
1476
|
if (scrollY <= this._playerState.scrollY) {
|
|
1470
1477
|
scrollPosition = this._playerState.scrollY - scrollY;
|
|
1471
1478
|
}
|
|
1472
|
-
const scrollProgress = scrollPosition / innerHeight, currentFrame = clamp(scrollProgress * (totalFrames - 1),
|
|
1479
|
+
const scrollProgress = scrollPosition / innerHeight, currentFrame = clamp(scrollProgress * (totalFrames - 1), 0, totalFrames);
|
|
1473
1480
|
requestAnimationFrame(()=>{
|
|
1474
1481
|
if (currentFrame >= totalFrames) {
|
|
1475
1482
|
this.playerState = PlayerState.Paused;
|
|
@@ -1546,7 +1553,7 @@ const notImplemented = 'Method is not implemented';
|
|
|
1546
1553
|
if (!this.hover || !this._lottieInstance || isTouch()) {
|
|
1547
1554
|
return;
|
|
1548
1555
|
}
|
|
1549
|
-
if (this.mouseout ===
|
|
1556
|
+
if (this.mouseout === MouseOut.Reverse) {
|
|
1550
1557
|
this._lottieInstance.setDirection(1);
|
|
1551
1558
|
}
|
|
1552
1559
|
if (this.playerState === PlayerState.Completed) {
|
|
@@ -1565,16 +1572,16 @@ const notImplemented = 'Method is not implemented';
|
|
|
1565
1572
|
return;
|
|
1566
1573
|
}
|
|
1567
1574
|
switch(this.mouseout){
|
|
1568
|
-
case
|
|
1575
|
+
case MouseOut.Void:
|
|
1569
1576
|
{
|
|
1570
1577
|
break;
|
|
1571
1578
|
}
|
|
1572
|
-
case
|
|
1579
|
+
case MouseOut.Pause:
|
|
1573
1580
|
{
|
|
1574
1581
|
this.pause();
|
|
1575
1582
|
break;
|
|
1576
1583
|
}
|
|
1577
|
-
case
|
|
1584
|
+
case MouseOut.Reverse:
|
|
1578
1585
|
{
|
|
1579
1586
|
// const { direction = 1 } =
|
|
1580
1587
|
// this._multiAnimationSettings.length > 0 ?
|
|
@@ -1759,4 +1766,4 @@ if (!isServer) {
|
|
|
1759
1766
|
customElements.define(tagName, DotLottiePlayer);
|
|
1760
1767
|
}
|
|
1761
1768
|
|
|
1762
|
-
export { PlayerState, DotLottiePlayer as default, tagName };
|
|
1769
|
+
export { MouseOut, PlayerState, DotLottiePlayer as default, tagName };
|
package/dist/light.d.ts
CHANGED
|
@@ -21,6 +21,12 @@ declare class DotLottiePlayer extends DotLottiePlayerBase {
|
|
|
21
21
|
}): AnimationConfiguration<RendererType>;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
declare enum MouseOut {
|
|
25
|
+
Pause = "pause",
|
|
26
|
+
Reverse = "reverse",
|
|
27
|
+
Stop = "stop",
|
|
28
|
+
Void = "void"
|
|
29
|
+
}
|
|
24
30
|
declare enum PlayerState {
|
|
25
31
|
Completed = "completed",
|
|
26
32
|
Destroyed = "destroyed",
|
|
@@ -148,8 +154,8 @@ declare abstract class DotLottiePlayerBase extends PropertyCallbackElement {
|
|
|
148
154
|
get loop(): Loop;
|
|
149
155
|
set mode(value: PlayMode);
|
|
150
156
|
get mode(): PlayMode;
|
|
151
|
-
set mouseout(value:
|
|
152
|
-
get mouseout():
|
|
157
|
+
set mouseout(value: MouseOut);
|
|
158
|
+
get mouseout(): MouseOut;
|
|
153
159
|
set objectfit(value: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down');
|
|
154
160
|
get objectfit(): "contain" | "cover" | "fill" | "none" | "scale-down";
|
|
155
161
|
set once(value: boolean);
|
|
@@ -276,4 +282,4 @@ declare class DotLottiePlayerLight extends DotLottiePlayerBase {
|
|
|
276
282
|
}): AnimationConfiguration<RendererType.SVG>;
|
|
277
283
|
}
|
|
278
284
|
|
|
279
|
-
export { PlayerState, DotLottiePlayerLight as default, tagName };
|
|
285
|
+
export { MouseOut, PlayerState, DotLottiePlayerLight as default, tagName };
|
package/dist/light.js
CHANGED
|
@@ -145,6 +145,13 @@ var ObjectFit = /*#__PURE__*/ function(ObjectFit) {
|
|
|
145
145
|
ObjectFit["ScaleDown"] = "scale-down";
|
|
146
146
|
return ObjectFit;
|
|
147
147
|
}({});
|
|
148
|
+
var MouseOut = /*#__PURE__*/ function(MouseOut) {
|
|
149
|
+
MouseOut["Pause"] = "pause";
|
|
150
|
+
MouseOut["Reverse"] = "reverse";
|
|
151
|
+
MouseOut["Stop"] = "stop";
|
|
152
|
+
MouseOut["Void"] = "void";
|
|
153
|
+
return MouseOut;
|
|
154
|
+
}({});
|
|
148
155
|
var PlayerState = /*#__PURE__*/ function(PlayerState) {
|
|
149
156
|
PlayerState["Completed"] = "completed";
|
|
150
157
|
PlayerState["Destroyed"] = "destroyed";
|
|
@@ -496,15 +503,15 @@ const notImplemented = 'Method is not implemented';
|
|
|
496
503
|
get mouseout() {
|
|
497
504
|
const val = this.getAttribute('mouseout');
|
|
498
505
|
switch(val){
|
|
499
|
-
case
|
|
500
|
-
case
|
|
501
|
-
case
|
|
506
|
+
case MouseOut.Void:
|
|
507
|
+
case MouseOut.Pause:
|
|
508
|
+
case MouseOut.Reverse:
|
|
502
509
|
{
|
|
503
510
|
return val;
|
|
504
511
|
}
|
|
505
512
|
default:
|
|
506
513
|
{
|
|
507
|
-
return
|
|
514
|
+
return MouseOut.Stop;
|
|
508
515
|
}
|
|
509
516
|
}
|
|
510
517
|
}
|
|
@@ -1469,7 +1476,7 @@ const notImplemented = 'Method is not implemented';
|
|
|
1469
1476
|
if (scrollY <= this._playerState.scrollY) {
|
|
1470
1477
|
scrollPosition = this._playerState.scrollY - scrollY;
|
|
1471
1478
|
}
|
|
1472
|
-
const scrollProgress = scrollPosition / innerHeight, currentFrame = clamp(scrollProgress * (totalFrames - 1),
|
|
1479
|
+
const scrollProgress = scrollPosition / innerHeight, currentFrame = clamp(scrollProgress * (totalFrames - 1), 0, totalFrames);
|
|
1473
1480
|
requestAnimationFrame(()=>{
|
|
1474
1481
|
if (currentFrame >= totalFrames) {
|
|
1475
1482
|
this.playerState = PlayerState.Paused;
|
|
@@ -1546,7 +1553,7 @@ const notImplemented = 'Method is not implemented';
|
|
|
1546
1553
|
if (!this.hover || !this._lottieInstance || isTouch()) {
|
|
1547
1554
|
return;
|
|
1548
1555
|
}
|
|
1549
|
-
if (this.mouseout ===
|
|
1556
|
+
if (this.mouseout === MouseOut.Reverse) {
|
|
1550
1557
|
this._lottieInstance.setDirection(1);
|
|
1551
1558
|
}
|
|
1552
1559
|
if (this.playerState === PlayerState.Completed) {
|
|
@@ -1565,16 +1572,16 @@ const notImplemented = 'Method is not implemented';
|
|
|
1565
1572
|
return;
|
|
1566
1573
|
}
|
|
1567
1574
|
switch(this.mouseout){
|
|
1568
|
-
case
|
|
1575
|
+
case MouseOut.Void:
|
|
1569
1576
|
{
|
|
1570
1577
|
break;
|
|
1571
1578
|
}
|
|
1572
|
-
case
|
|
1579
|
+
case MouseOut.Pause:
|
|
1573
1580
|
{
|
|
1574
1581
|
this.pause();
|
|
1575
1582
|
break;
|
|
1576
1583
|
}
|
|
1577
|
-
case
|
|
1584
|
+
case MouseOut.Reverse:
|
|
1578
1585
|
{
|
|
1579
1586
|
// const { direction = 1 } =
|
|
1580
1587
|
// this._multiAnimationSettings.length > 0 ?
|
|
@@ -1743,4 +1750,4 @@ if (!isServer) {
|
|
|
1743
1750
|
customElements.define(tagName, DotLottiePlayerLight);
|
|
1744
1751
|
}
|
|
1745
1752
|
|
|
1746
|
-
export { PlayerState, DotLottiePlayerLight as default, tagName };
|
|
1753
|
+
export { MouseOut, PlayerState, DotLottiePlayerLight as default, tagName };
|
package/dist/svg.d.ts
CHANGED
|
@@ -35,6 +35,12 @@ declare class DotLottiePlayerLight extends DotLottiePlayerBase {
|
|
|
35
35
|
}): AnimationConfiguration<RendererType.SVG>;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
declare enum MouseOut {
|
|
39
|
+
Pause = "pause",
|
|
40
|
+
Reverse = "reverse",
|
|
41
|
+
Stop = "stop",
|
|
42
|
+
Void = "void"
|
|
43
|
+
}
|
|
38
44
|
declare enum PlayerState {
|
|
39
45
|
Completed = "completed",
|
|
40
46
|
Destroyed = "destroyed",
|
|
@@ -148,8 +154,8 @@ declare abstract class DotLottiePlayerBase extends PropertyCallbackElement {
|
|
|
148
154
|
get loop(): Loop;
|
|
149
155
|
set mode(value: PlayMode);
|
|
150
156
|
get mode(): PlayMode;
|
|
151
|
-
set mouseout(value:
|
|
152
|
-
get mouseout():
|
|
157
|
+
set mouseout(value: MouseOut);
|
|
158
|
+
get mouseout(): MouseOut;
|
|
153
159
|
set objectfit(value: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down');
|
|
154
160
|
get objectfit(): "contain" | "cover" | "fill" | "none" | "scale-down";
|
|
155
161
|
set once(value: boolean);
|
|
@@ -276,4 +282,4 @@ declare class DotLottiePlayerSVG extends DotLottiePlayerBase {
|
|
|
276
282
|
}): AnimationConfiguration<RendererType.SVG>;
|
|
277
283
|
}
|
|
278
284
|
|
|
279
|
-
export { PlayerState, DotLottiePlayerSVG as default, tagName };
|
|
285
|
+
export { MouseOut, PlayerState, DotLottiePlayerSVG as default, tagName };
|
package/dist/svg.js
CHANGED
|
@@ -145,6 +145,13 @@ var ObjectFit = /*#__PURE__*/ function(ObjectFit) {
|
|
|
145
145
|
ObjectFit["ScaleDown"] = "scale-down";
|
|
146
146
|
return ObjectFit;
|
|
147
147
|
}({});
|
|
148
|
+
var MouseOut = /*#__PURE__*/ function(MouseOut) {
|
|
149
|
+
MouseOut["Pause"] = "pause";
|
|
150
|
+
MouseOut["Reverse"] = "reverse";
|
|
151
|
+
MouseOut["Stop"] = "stop";
|
|
152
|
+
MouseOut["Void"] = "void";
|
|
153
|
+
return MouseOut;
|
|
154
|
+
}({});
|
|
148
155
|
var PlayerState = /*#__PURE__*/ function(PlayerState) {
|
|
149
156
|
PlayerState["Completed"] = "completed";
|
|
150
157
|
PlayerState["Destroyed"] = "destroyed";
|
|
@@ -496,15 +503,15 @@ const notImplemented = 'Method is not implemented';
|
|
|
496
503
|
get mouseout() {
|
|
497
504
|
const val = this.getAttribute('mouseout');
|
|
498
505
|
switch(val){
|
|
499
|
-
case
|
|
500
|
-
case
|
|
501
|
-
case
|
|
506
|
+
case MouseOut.Void:
|
|
507
|
+
case MouseOut.Pause:
|
|
508
|
+
case MouseOut.Reverse:
|
|
502
509
|
{
|
|
503
510
|
return val;
|
|
504
511
|
}
|
|
505
512
|
default:
|
|
506
513
|
{
|
|
507
|
-
return
|
|
514
|
+
return MouseOut.Stop;
|
|
508
515
|
}
|
|
509
516
|
}
|
|
510
517
|
}
|
|
@@ -1469,7 +1476,7 @@ const notImplemented = 'Method is not implemented';
|
|
|
1469
1476
|
if (scrollY <= this._playerState.scrollY) {
|
|
1470
1477
|
scrollPosition = this._playerState.scrollY - scrollY;
|
|
1471
1478
|
}
|
|
1472
|
-
const scrollProgress = scrollPosition / innerHeight, currentFrame = clamp(scrollProgress * (totalFrames - 1),
|
|
1479
|
+
const scrollProgress = scrollPosition / innerHeight, currentFrame = clamp(scrollProgress * (totalFrames - 1), 0, totalFrames);
|
|
1473
1480
|
requestAnimationFrame(()=>{
|
|
1474
1481
|
if (currentFrame >= totalFrames) {
|
|
1475
1482
|
this.playerState = PlayerState.Paused;
|
|
@@ -1546,7 +1553,7 @@ const notImplemented = 'Method is not implemented';
|
|
|
1546
1553
|
if (!this.hover || !this._lottieInstance || isTouch()) {
|
|
1547
1554
|
return;
|
|
1548
1555
|
}
|
|
1549
|
-
if (this.mouseout ===
|
|
1556
|
+
if (this.mouseout === MouseOut.Reverse) {
|
|
1550
1557
|
this._lottieInstance.setDirection(1);
|
|
1551
1558
|
}
|
|
1552
1559
|
if (this.playerState === PlayerState.Completed) {
|
|
@@ -1565,16 +1572,16 @@ const notImplemented = 'Method is not implemented';
|
|
|
1565
1572
|
return;
|
|
1566
1573
|
}
|
|
1567
1574
|
switch(this.mouseout){
|
|
1568
|
-
case
|
|
1575
|
+
case MouseOut.Void:
|
|
1569
1576
|
{
|
|
1570
1577
|
break;
|
|
1571
1578
|
}
|
|
1572
|
-
case
|
|
1579
|
+
case MouseOut.Pause:
|
|
1573
1580
|
{
|
|
1574
1581
|
this.pause();
|
|
1575
1582
|
break;
|
|
1576
1583
|
}
|
|
1577
|
-
case
|
|
1584
|
+
case MouseOut.Reverse:
|
|
1578
1585
|
{
|
|
1579
1586
|
// const { direction = 1 } =
|
|
1580
1587
|
// this._multiAnimationSettings.length > 0 ?
|
|
@@ -1743,4 +1750,4 @@ if (!isServer) {
|
|
|
1743
1750
|
customElements.define(tagName, DotLottiePlayerSVG);
|
|
1744
1751
|
}
|
|
1745
1752
|
|
|
1746
|
-
export { PlayerState, DotLottiePlayerSVG as default, tagName };
|
|
1753
|
+
export { MouseOut, PlayerState, DotLottiePlayerSVG as default, tagName };
|