Skip to content

Commit 3ff2221

Browse files
committed
fix(esl-animate): fix esl-animate does not work with repeat + ratio 1
Also fixes site examples
1 parent a84e59e commit 3ff2221

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

packages/esl-website/views/examples/animate.njk

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,18 @@ aside:
5252
</ul>
5353
</script>
5454

55+
<script type="text/html"
56+
label="Repeat animation with custom config"
57+
uip-snippet
58+
uip-snippet-js="js-snippet-animate-mixin">
59+
<ul class="round simple-grid simple-grid-list" style="gap: 100px">
60+
{% for i in range(0, 5) -%}
61+
<li class="simple-grid-cell bg-blue round esl-animate-fade"
62+
esl-animate="{repeat: true, ratio: 1}"></li>
63+
{% endfor %}
64+
</ul>
65+
</script>
66+
5567
<script id="js-snippet-animate-element" type="text/plain">
5668
import { ESLAnimate } from '@exadel/esl';
5769
ESLAnimate.register();
@@ -62,18 +74,18 @@ aside:
6274
</script>
6375

6476
<uip-snippets class="uip-toolbar" dropdown-view="@xs"></uip-snippets>
65-
<uip-preview></uip-preview>
66-
<uip-settings target=".simple-grid-cell" label="Settings" resizable vertical="@+sm">
67-
<uip-select-setting label="Animation type:" attribute="class" mode="append">
77+
<uip-preview style="max-height: 600px"></uip-preview>
78+
<uip-settings label="Settings" resizable vertical="@+sm">
79+
<uip-select-setting target=".simple-grid-cell" label="Animation type:" attribute="class" mode="append">
6880
<option value="esl-animate-fade">Fade</option>
6981
<option value="esl-animate-slide up">Slide Up</option>
7082
<option value="esl-animate-slide left">Slide Left</option>
7183
<option value="esl-animate-slide down">Slide Down</option>
7284
<option value="esl-animate-slide right">Slide Right</option>
7385
</uip-select-setting>
74-
<uip-bool-setting label="Repeat" attribute="repeat"></uip-bool-setting>
75-
<uip-bool-setting label="Group" target="esl-animate" attribute="group"></uip-bool-setting>
76-
<uip-slider-setting label="Animation delay:" target="esl-animate" attribute="group-delay" min="100" max="1000"></uip-slider-setting>
86+
<uip-bool-setting target="esl-animate" label="Repeat" attribute="repeat"></uip-bool-setting>
87+
<uip-bool-setting target="esl-animate" label="Group" attribute="group"></uip-bool-setting>
88+
<uip-slider-setting target="esl-animate" label="Animation delay:" attribute="group-delay" min="100" max="1000"></uip-slider-setting>
7789
</uip-settings>
7890
<uip-editor label="Source code (HTML)" collapsible copy></uip-editor>
7991
<uip-editor source="js" label="Source code (JS)" collapsible collapsed copy></uip-editor>

packages/esl/src/esl-animate/core/esl-animate-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export class ESLAnimateService {
5050
/** ESLAnimateService default animation configuration */
5151
protected static DEFAULT_CONFIG: ESLAnimateConfigInner = {cls: 'in', groupDelay: 100, ratio: 0.4};
5252
/** ESLAnimationService IntersectionObserver properties */
53-
protected static OPTIONS_OBSERVER: IntersectionObserverInit = {threshold: [0.001, 0.2, 0.4, 0.6, 0.8]};
53+
protected static OPTIONS_OBSERVER: IntersectionObserverInit = {threshold: [0.001, 0.2, 0.4, 0.6, 0.8, 1]};
5454

5555
/**
5656
* Subscribe ESlAnimateService on element(s) to animate it on viewport intersection

0 commit comments

Comments
 (0)