Created
October 21, 2019 22:02
-
-
Save fabioluzm/94498dc3849632de2681f70c1b23016b to your computer and use it in GitHub Desktop.
CSS Transitions
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
.trigger | |
.box |
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
$('.trigger').on('click', function(){ | |
$(this).toggleClass('clicked'); | |
}); |
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://code.jquery.com/jquery-2.2.4.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
body | |
padding: 50px | |
.trigger | |
width: 200px | |
height: 200px | |
border: 20px solid #999 | |
background: #ddd | |
.box | |
display: inline-block | |
background: pink | |
width: 200px | |
height: 200px | |
transition: transform 300ms cubic-bezier(0, 0.47, 0.32, 1.97) | |
pointer-events: none | |
.trigger.clicked .box | |
transform: translate(200px, 150px) rotate(20deg) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment