Skip to content

Instantly share code, notes, and snippets.

@richleach
Created May 7, 2020 21:52
Show Gist options
  • Save richleach/7b7c4813fad6792cff3f4daa286712bf to your computer and use it in GitHub Desktop.
Save richleach/7b7c4813fad6792cff3f4daa286712bf to your computer and use it in GitHub Desktop.
CSS: Use of the cubic-bezier timing function to create custom timing of animations (instead of ease, ease-in, etc)
:root {
--main-color: blue;
}
.hover-text {
transition: all 3s;
}
.hover-text:hover {
color: var(--main-color);
font-size: 20px;
}
//www.cubic-bezier.com to use their handy graph that generates graph coordinates for you
.box {
position: fixed;
width: 50px;
height: 50px;
background: red;
border: 1px solid black;
animation: size-down cubic-bezier(1,0,1,1) 0.5s 1 alternate both;
}
@keyframes size-down {
100% {transform: scale(0.3, 0.3); background: var(--main-color);}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment