Created
August 26, 2019 18:24
-
-
Save Adefful/78818f2d6d4efea350a8ffeb190ceb70 to your computer and use it in GitHub Desktop.
Text Animation Light
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
</head> | |
<body> | |
<div class="middle"> | |
<div class="text">Click this </div> | |
<p>Please, Like</p> | |
</div> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var textArr = $('.text').text().split(''); | |
$('.text').html(''); | |
$.each(textArr, function(i, v){ | |
$('.text').append('<div class="word">'+v+'</div>'); | |
}) | |
($(".word").click(function(){ | |
$(".word").each( (i, el) => | |
setTimeout( (el) =>$(el).toggleClass("black"), 500 +200*i, el ) ); | |
$(".word").each( (i, el) => | |
setTimeout( (el) =>$(el).toggleClass("black"), 1500 +200*i, el ) ); | |
} | |
)); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$bg: #131419 | |
$cl: #303030 | |
$cl-l:#DDDDE7 | |
body | |
background-color: $bg | |
color: $cl | |
height: 100% | |
.middle | |
display: flex | |
justify-content: center | |
.text | |
font-size: 120px | |
text-transform: uppercase | |
font-weight: 600 | |
text-decoration: none | |
list-style-type: none | |
.word | |
display: inline | |
.black | |
transition: .3s | |
text-shadow: 0px 0px 20px rgba(255,255,255,.6) | |
color: $cl-l | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment