Skip to content

Instantly share code, notes, and snippets.

@SharmaTushar
Created February 12, 2017 08:13
Show Gist options
  • Save SharmaTushar/b6d59bc31c8630df8b3bf48cfeb9da99 to your computer and use it in GitHub Desktop.
Save SharmaTushar/b6d59bc31c8630df8b3bf48cfeb9da99 to your computer and use it in GitHub Desktop.
Rotating Gradient Circles
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
.parent {
position: relative;
text-align: center;
display: flex;
vertical-align: middle;
justify-content: center;
width: 100%;
height:100%;
}
.child {
position: absolute;
background: radial-gradient(circle, black, red, orange, yellow, green, blue, indigo, violet);
display: block;
width: 200px;
height: 400px;
border-radius: 50%;
-webkit-animation-duration: 300s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-timing-function: linear;
}
#child1 {
-webkit-animation-name: rotate-cw;
}
#child2 {
-webkit-animation-name: rotate-acw;
}
@-webkit-keyframes rotate-cw {
from {
-webkit-transform: rotate(0deg);
}
to {
-webkit-transform: rotate(1440deg);
}
}
@-webkit-keyframes rotate-acw {
from {
-webkit-transform: rotate(1440deg);
}
to {
-webkit-transform: rotate(0deg);
}
}
</style>
</head>
<body>
<div class="parent">
<div class="child" id="child1"></div>
<div class="child" id="child2"></div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment