Skip to content

Commit

Permalink
Fix: zigzag animation duration and delay [TMZ-301](#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
mserino authored Jan 13, 2025
1 parent e0ad36e commit 5fbf094
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
4 changes: 4 additions & 0 deletions modules/content/assets/scss/hello-plus-zigzag.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
--zigzag-animation-delay: 0;
--zigzag-animation-duration: 1s;

--zigzag-animation-duration-slow: 2s;
--zigzag-animation-duration-normal: 1s;
--zigzag-animation-duration-fast: 0.8s;

align-items: center;
background-color: transparent;
display: flex;
Expand Down
18 changes: 8 additions & 10 deletions modules/content/widgets/zig-zag.php
Original file line number Diff line number Diff line change
Expand Up @@ -1046,26 +1046,24 @@ private function add_box_style_section() {
);

$this->add_control(
'animation_duration',
'zigzag_animation_duration',
[
'label' => esc_html__( 'Animation Duration', 'hello-plus' ),
'type' => Controls_Manager::SELECT,
'default' => '',
'options' => [
'2s' => esc_html__( 'Slow', 'hello-plus' ),
'1s' => esc_html__( 'Normal', 'hello-plus' ),
'800ms' => esc_html__( 'Fast', 'hello-plus' ),
'slow' => esc_html__( 'Slow', 'hello-plus' ),
'normal' => esc_html__( 'Normal', 'hello-plus' ),
'fast' => esc_html__( 'Fast', 'hello-plus' ),
],
'default' => 'normal',
'selectors' => [
'{{WRAPPER}} .ehp-zigzag' => '--zigzag-animation-duration: {{VALUE}};',
'{{WRAPPER}} .ehp-zigzag' => '--zigzag-animation-duration: var(--zigzag-animation-duration-{{VALUE}});',
],
'prefix_class' => 'animated-',
'condition' => [
'animation!' => '',
'zigzag_animation!' => '',
],
]
);

$this->add_control(
'animation_delay',
[
Expand All @@ -1078,7 +1076,7 @@ private function add_box_style_section() {
'{{WRAPPER}} .ehp-zigzag' => '--zigzag-animation-delay: {{VALUE}}ms;',
],
'condition' => [
'animation!' => '',
'zigzag_animation!' => '',
],
'render_type' => 'none',
'frontend_available' => true,
Expand Down

0 comments on commit 5fbf094

Please sign in to comment.