Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1342351

    Hello and thank you for your help,

    I would like to know how to add animation (for example: appear from the left, or the right) to elements on a page?

    thank you very much!

    #1342424

    Hey VirtuHouse,
    This can be done with Keyframe Animations this article is pretty good but if you search Google I’m sure you will find more examples. In the example below I created a page with two text blocks, one has left text alignment and the other right, in the custom classes for each element I used either text-box-left or text-box-right
    2022-02-26_017.jpg
    then I used this css:

    @keyframes slide-in-left {
        from {
          transform: translateX(-100%);
        }
        to {
          transform: translateX(0%);
        }
      }
    
      @keyframes slide-in-right {
        from {
          transform: translateX(100%);
        }
        to {
          transform: translateX(0%);
        }
      }
    
    
      .text-box-right {
        animation: slide-in-right 1000ms;
      }
      .text-box-left {
        animation: slide-in-left 1000ms;
      }

    and now on page load the text slides in
    2022-02-26_018.jpg
    this basic example can be applied to other elements, or you can search for more advanced examples, but this should help you get started.

    Best regards,
    Mike

    #1342494

    Sometimes these keyframe animations starts when an eventlistner is fired. One of these events is when an element appears in the viewport, or a certain scroll distance has been completed. Sometimes there are little tools in themes that observe whether an element appears in the viewport or not.
    Thus, Enfold is embedded a script that can perform such tasks. ( keyword is: waypoint script ).
    You can see it in shortcodes.js file on line 232ff
    and the helper function itself is on line 705ff

    #1342496

    Hi,
    Thank you Guenni007 this is a good point.
    So to expand on the above example to trigger the animation when the element is in view and not just on page load, we will add the class avia_animate_when_visible to the custom class with a space after the text-box-left or text-box-right classes
    2022-02-27_003.jpg
    and changed the css to this:

      @keyframes slide-in-left {
        from {
          transform: translateX(-100%);
        }
        to {
          transform: translateX(0%);
        }
      }
    
      @keyframes slide-in-right {
        from {
          transform: translateX(100%);
        }
        to {
          transform: translateX(0%);
        }
      }
    
    
      .text-box-right.avia_start_animation {
        animation: slide-in-right 1000ms;
      }
      .text-box-left.avia_start_animation {
        animation: slide-in-left 1000ms;
      }

    note the avia_start_animation class in the css, the waypoint script that Guenni007 pointed out changes the avia_animate_when_visible class to avia_start_animation so the css will work.
    2022-02-27_004.jpg

    Best regards,
    Mike

    #1342520

    thank you very much! It works.

    Is there a list of animation I can use?
    For example, if I want some element appears like the elements of the timeline (is it the fadein animation?)

    Do I have to add that class: avia_start_delayed_animation.fade-in ?

    • This reply was modified 3 years, 1 month ago by VirtuHouse.
    #1342555

    you can look inside the shortcodes.css file form lines 663ff
    those classes:
    fade-in , pop-up , top-to-bottom , bottom-to-top , left-to-right , right-to-left , av-rotateIn , av-rotateInUpLeft , av-rotateInUpRight
    the keyframe names are under those classes …
    _____
    yes – but on the classes input field classes that are on the same elment are added by only ohne space between without dots.
    you can see it on mikes first image above:
    https://kriesi.at/support/topic/animation-on-element/#post-1342496

    #1342556

    Hi,
    There is a partial list of animation classes in our documentation , to use the timeline fadein animation that will also use the waypoint, so it will trigger when the element in view, you would use these classes with no dots and separated with a space, like this:
    avia_animate_when_visible fade-in av-animated-generic
    the avia_start_delayed_animation class starts the animation on page load and doesn’t wait for the element to be in view, so it depends on when you want the animation to be triggered.

    Best regards,
    Mike

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.