Skip to content

Instantly share code, notes, and snippets.

@ingmarh
Last active December 21, 2018 12:40
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 ingmarh/af2a899ee51f41f4efdc48508e267d9d to your computer and use it in GitHub Desktop.
Save ingmarh/af2a899ee51f41f4efdc48508e267d9d to your computer and use it in GitHub Desktop.
Snowflakes
/* Adapted from https://github.com/pajasevi/CSSnowflakes/blob/177a894ca6127a927986c08c641d7215c55b9dfc/dev/snowflakes.css */
nav ul > li::before {
display: block;
content: "❅";
color: #fff;
font-size: 1em;
font-family: Arial, sans-serif;
text-shadow: 0 0 5px #000;
}
@keyframes snowflakes-fall {
0% {
top: -10%;
}
100% {
top: 100%;
}
}
@keyframes snowflakes-shake {
0%{
transform: translateX(0px);
}
50% {
transform: translateX(80px);
}
100% {
transform: translateX(0px);
}
}
nav ul > li::before {
position: fixed;
top: -10%;
z-index: 9999;
user-select: none;
cursor: default;
animation-name: snowflakes-fall, snowflakes-shake;
animation-duration: 10s, 3s;
animation-timing-function: linear, ease-in-out;
animation-iteration-count: infinite, infinite;
animation-play-state: running, running;
}
nav ul > li:nth-of-type(0)::before {
left: 1%;
animation-delay: 0s, 0s;
}
nav ul > li:nth-of-type(1)::before {
left: 10%;
animation-delay: 1s, 1s;
}
nav ul > li:nth-of-type(2)::before {
left: 20%;
animation-delay: 6s, 0.5s;
}
nav ul > li:nth-of-type(3)::before {
left: 30%;
animation-delay: 4s, 2s;
}
nav ul > li:nth-of-type(4)::before {
left: 40%;
animation-delay: 2s, 2s;
}
nav ul > li:nth-of-type(5)::before {
left: 50%;
animation-delay: 8s, 3s;
}
nav ul > li:nth-of-type(6)::before {
left: 60%;
animation-delay: 6s, 2s;
}
nav ul > li:nth-of-type(7)::before {
left: 70%;
animation-delay: 2.5s, 1s;
}
nav ul > li:nth-of-type(8)::before {
left: 80%;
animation-delay: 1s, 0s;
}
nav ul > li:nth-of-type(9)::before {
left: 90%;
animation-delay: 3s, 1.5s;
}
nav ul > li:nth-of-type(10)::before {
left: 25%;
animation-delay: 2s, 0s;
}
nav ul > li:nth-of-type(11)::before {
left: 65%;
animation-delay: 4s, 2.5s;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment