The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Text smoke effect
Shanerprice
post Nov 14 2022, 06:15 PM
Post #1





Group: Members
Posts: 1
Joined: 14-November 22
Member No.: 28,634



Hello,

I found this text smoke effect which vanishes the text on mouseover. Is there a way to modify it so instead of mouseover the text vanishes 20 seconds after page load? Thank you

<style>
.smoke .elementor-widget-container span{
cursor: default;
position: relative;
display: inline-block;
}
.smoke .elementor-widget-container span.active{
animation: smoke 1s linear;
}
@keyframes smoke{
50%{
opacity: 1;
}
100%{
opacity: 0;
filter: blur(20px);
transform: translateX(300px) translateY(-300px) rotate(360deg) scale(4);
}
}
.smoke .elementor-widget-container span.back{
opacity: 0;
filter: blur(20px);
animation: back 1s linear 0.5s;
}
@keyframes back{
100%{
opacity: 1;
filter: blur(0);
}
}
</style>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
(function($){
$(document).ready(function(){

var heading = $('.smoke .elementor-widget-container').children()

heading.each(function(){
$(this).html($(this).text().replace(/\S/g, '<span>$&</span>'))
})

var headingLetter = heading.find('span')

headingLetter.on('mouseover', function(){
$(this).removeClass('back').addClass('active')
})

headingLetter.on('animationend webkitAnimationEnd oAnimationEnd MSAnimationEnd', function(e){
if ( $(e.target).hasClass('active') ){
$(this).removeClass('active').addClass('back')
}else{
$(this).removeClass('back')
}
})

})
}(jQuery))
</script>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 27th April 2024 - 02:20 AM