Skip to content

Instantly share code, notes, and snippets.

@davidsharp
Last active October 21, 2021 23:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidsharp/5388435a08e2011d415cf4db1ac01b98 to your computer and use it in GitHub Desktop.
Save davidsharp/5388435a08e2011d415cf4db1ac01b98 to your computer and use it in GitHub Desktop.
A short and sweet CSS snippet for slightly spooky swaying text and more
.sway {
display: inline-block;
animation-duration: 2s;
animation-name: sway;
animation-iteration-count: infinite;
animation-direction: alternate;
animation-timing-function: ease-in-out;
}
@keyframes sway {
from {
transform: skewX(15deg);
}
to {
transform: skewX(-15deg);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment