Skip to content

Instantly share code, notes, and snippets.

@bassplayer7
Created November 30, 2016 00:00
Show Gist options
  • Save bassplayer7/c1991d632d1e566263ff8e338678b7b0 to your computer and use it in GitHub Desktop.
Save bassplayer7/c1991d632d1e566263ff8e338678b7b0 to your computer and use it in GitHub Desktop.
Start of fireworks display
@keyframes flash {
0% {
transform: scale(0.1);
opacity: 1;
}
80% {
transform: scale(2);
opacity: 1;
}
93% {
opacity: 1;
}
100% {
transform: scale(1.4);
opacity: 0;
}
}
.winner__flash {
width: 80vw;
height: 50vh;
position: relative;
> * {
width: 30vw;
height: 30vw;
background-color: $white;
border-radius: 100%;
animation-duration: 300ms;
animation-name: flash;
animation-iteration-count: 1;
animation-timing-function: ease-out;
position: absolute;
top: 0;
left: 0;
opacity: 0;
}
}
.circle-2 {
animation-duration: 400ms;
left: 70%;
background-color: $yellow;
}
.circle-3 {
animation-duration: 450ms;
left: 40%;
top: 40%;
background-color: lighten($green, 20);
}
.circle-4 {
animation-duration: 350ms;
left: 6%;
top: 41%;
background-color: lighten($blue, 20);
}
.circle-5 {
animation-duration: 380ms;
left: 45%;
top: 12%;
background-color: $white;
}
.circle-6 {
animation-duration: 350ms;
left: 44%;
top: 44%;
background-color: $yellow;
}
this.fireworks = ko.pureComputed(function() {
var numberFireworks = 20,
variations = 6,
currentVariant = 1,
fireworkArray = [],
i = 0;
for (i; i <= numberFireworks; i++) {
if (currentVariant > variations) {
currentVariant = 1;
}
fireworkArray.push({
className: 'circle-' + currentVariant,
itemStyle: 'animation-delay: ' + i * getRandomArbitrary(100, 170) + 'ms'
});
currentVariant++;
}
return fireworkArray;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment