Created
March 3, 2018 20:20
-
-
Save lonekorean/7b9974c99db1fcb80b40f06588f83e0e to your computer and use it in GitHub Desktop.
CSS to animate polka dot fade
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
.polka-dot { | |
--dot-spacing: 20px; | |
--dot-fade-offset: 0%; | |
--dot-color: #fc466b; | |
background: paint(polka-dot-fade); | |
/* other styles as needed... */ | |
} | |
.polka-dot:hover, .polka-dot:focus { | |
animation: pulse 2s ease-out 6 alternate; | |
/* other styles as needed... */ | |
} | |
@keyframes pulse { | |
from { | |
--dot-fade-offset: 0%; | |
--dot-color: #fc466b; | |
} | |
to { | |
--dot-fade-offset: 100%; | |
--dot-color: #3f5efb; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment