(This page includes affiliate links. If you click and purchase, I receive a small commission at no extra cost from you and that way you can support me. I only recommend tools that I have personally used and loved.)
Don’t want to make from scratch? Get the template instead 🙂
Introduction – Text Switcher Sequence using Elementor, Javascript, CSS and GSAP
In this tutorial, we will learn to create a text sequence that loops and changes text with different animations. Please watch the video for in-depth explanation or read for below for base explanation.
Before Line
You can Replace
Replace Any Text
Automatically Adjusts Width
Disable Width Adjustment?
Highly Customizable
You can Replace
After Lines
1 – Move Up (Translate Y) for text reveals
- dm-switcher-1 is the CSS class of the container that contains all the text.
- dm-switcher-text-1 is the CSS class of all the texts widgets/div. Make sure to add duplicate of the first text at the end.
- Make the height and min-height to your required height. Anything outside this is invisible.
- Change duration to control the speed of text moving.
- Change delay to define how long the text is shown before switching.
- Remove Line 80 and Line 105 – 117 if you don’t want the size of the container to switch based on the text size.
At DMmotionarts, We Provide
Elementor Templates
WordPress Tutorials
Full Code
Youtube Videos
Like and Subscribe
Elementor Templates
2 – Move Left (Translate X) for text reveals
- dm-switcher-3 is the CSS class of the container that contain the wrapper container.
- dm-switcher-text-3-wrapper is the CSS class of the container that contains all the texts.
- dm-switcher-text-3 is the CSS class of all the texts widgets/div. Make sure to add duplicate of the first text at the end.
- Make the height and min-height to your required height. Anything outside this is invisible.
- Change duration to control the speed of text moving.
- Change delay to define how long the text is shown before switching.
At DMmotionarts, We Provide
Elementor Templates
Youtube Tutorials
Quality Content
3 – Fade Effect with Left, Right, Up and Down Direction Option
- dm-switcher-text-4 is the CSS class of the container that contains all the texts.
- dm-switcher-text-3 is the CSS class of all the texts widgets/div. Make sure to add duplicate of the first text at the end.
- Line 31-50 decides the direction for text moving for desktop and mobile(767px).
- You can change 767 to different breakpoint to include tablet too. For Elementor tablet breakpoint is 1024px.
- Line 33 – 34 decides for mobile. TranslateX moves towards left or right. Change 500 to your desired moving distance. 300 moves it left and -300 moves it right (It is opposite because in the code later, I used minus but too lazy to change it)
- If you want to move it up or down, simply change the TranslateY to your desired value and make TranslateX to be 0.
- dmEnterDuration controls the time it takes for text to reach center after entering.
- dmExitDuration controls the time it takes for text to go from center to exit.
- dmSwitchSpeed controls when the next text to show. It is in ms i.e 5s is 5000.
At DMmotionarts, We Provide
Elementor Templates
Youtube Tutorials
Quality Content
4 – Color Reveal Switcher (Left, Right, Up or Down Direction)
- dm-switcher-text-5 is the CSS class of all the texts.
- dm-switcher-text-5-overlay is the CSS class of the widget used for our color.
- animation is set to 2s at line 15 in CSS. You can increase it or lower for different speed.
- @keyframes use clip-path inset to create the reveal effect. Change the inset values at 0% time and 100% time to change the direction of reveal. You can make it go right to left, up to down or vice versa.
- At Line 64, we decide when to switch the text. For this example, it is set to 1000 i.e 1s. As our animation is 2s long, we want to change the text right at middle of the animation. If you decide to change the animation timing, then use half of its value here.
- At Line 67, we decide when to play the logic again. In our example: animation takes 2s, so we have decided to use 3000 i.e 3s to do the logic again. This means our Text is shown for 1s before doing animation again.
At DMmotionarts, We Provide
Elementor Templates
5 – Scramble Text to Switch (For more effects and in-depth details, watch my Scramble Text Video or Blog)
- dm-switcher-text-switcher is the CSS class given to the heading widget.
- duration controls how long it should take to reveal characters.
- text controls what text should it switch to.
- chars controls what should be shown when doing scrambling. Use your custom string, or type “lowerCase”, “upperCase” or “upperAndLowerCase” to use all alphabets in the respective format.
- revealDelay controls how long the scrambling should show before starting to reveal. Make sure to keep it less than duration.
- speed defines how quickly the scrambling should happen.
- delimiter allows you to de-scramble word by word instead of char by char. Simply add space between the quotation marks. Example : ‘ ‘
- Simply copy line 44 – 54 to add more lines.
- It is important to add the same text at the end as your original text for seamless loop.
At DMmotionarts, We Provide
Elementor Templates
Youtube Tutorials
Quality Content
6 – Switch based on CSS properties
- dm-switcher-text-7 is the CSS class of all the texts.
- .dmActive is the CSS class for the text that is shown
- Any CSS property you add in dm-switcher-text-7 is added to inactive/hidden texts.
- Any CSS property you add in dm-switcher-text-7.dmActive is added to active/shown text only.
- This allows you to create any effect like fade, translate, scale easily.
- transition controls the time it takes to change its state. Both dm-switcher-text-7 and dmActive has transition and transition-delay, this allows to for both entry and exit transitions.
- transition-delay controls how long it should wait before changing.
- Line 51, 3000 i.e 3s defines when to change the text.
- If the transition is not working, then add !important after 1s. This would force CSS to use it.