Concentric circles (CSS)

In this example below you will see how to do a Concentric circles (CSS) with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by Mamboleoo, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright Mamboleoo ©
  • HTML
  • CSS
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>Concentric circles (CSS)</title>
  
  
  
      <link rel="stylesheet" href="css/style.css">

  
</head>

<body>

  <flower>
  <butterfly></butterfly>
  <butterfly></butterfly>
  <butterfly></butterfly>
  <butterfly></butterfly>
  <butterfly></butterfly>
  <butterfly></butterfly>
  <butterfly></butterfly>
  <butterfly></butterfly>
  <butterfly></butterfly>
  <butterfly></butterfly>
  <butterfly></butterfly>
  <butterfly></butterfly>
  <butterfly></butterfly>
  <butterfly></butterfly>
  <butterfly></butterfly>
  <butterfly></butterfly>
  <butterfly></butterfly>
</flower>
  
  

</body>

</html>

/*Downloaded from https://www.codeseek.co/Mamboleoo/concentric-circles-css-WyQKGX */
body {
  margin: 0;
  height: 100vh;
  display: flex;
}

flower {
  margin: auto;
  width: 60vmin;
  height: 60vmin;
  position: relative;
}

butterfly {
  background: black;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  animation: wheel 8s infinite cubic-bezier(0.35, 0, 0.6, 1);
  border: 2px solid white;
  background: linear-gradient(to top, white 50%, black 50.1%);
}
butterfly:nth-child(1) {
  width: 94.4444444444%;
  height: 94.4444444444%;
  transform: translate(-50%, -50%) rotate(2880deg);
}
butterfly:nth-child(2) {
  width: 88.8888888889%;
  height: 88.8888888889%;
  transform: translate(-50%, -50%) rotate(2520deg);
}
butterfly:nth-child(3) {
  width: 83.3333333333%;
  height: 83.3333333333%;
  transform: translate(-50%, -50%) rotate(2160deg);
}
butterfly:nth-child(4) {
  width: 77.7777777778%;
  height: 77.7777777778%;
  transform: translate(-50%, -50%) rotate(1800deg);
}
butterfly:nth-child(5) {
  width: 72.2222222222%;
  height: 72.2222222222%;
  transform: translate(-50%, -50%) rotate(1440deg);
}
butterfly:nth-child(6) {
  width: 66.6666666667%;
  height: 66.6666666667%;
  transform: translate(-50%, -50%) rotate(1080deg);
}
butterfly:nth-child(7) {
  width: 61.1111111111%;
  height: 61.1111111111%;
  transform: translate(-50%, -50%) rotate(720deg);
}
butterfly:nth-child(8) {
  width: 55.5555555556%;
  height: 55.5555555556%;
  transform: translate(-50%, -50%) rotate(360deg);
}
butterfly:nth-child(9) {
  width: 50%;
  height: 50%;
  transform: translate(-50%, -50%) rotate(0deg);
}
butterfly:nth-child(10) {
  width: 44.4444444444%;
  height: 44.4444444444%;
  transform: translate(-50%, -50%) rotate(-360deg);
}
butterfly:nth-child(11) {
  width: 38.8888888889%;
  height: 38.8888888889%;
  transform: translate(-50%, -50%) rotate(-720deg);
}
butterfly:nth-child(12) {
  width: 33.3333333333%;
  height: 33.3333333333%;
  transform: translate(-50%, -50%) rotate(-1080deg);
}
butterfly:nth-child(13) {
  width: 27.7777777778%;
  height: 27.7777777778%;
  transform: translate(-50%, -50%) rotate(-1440deg);
}
butterfly:nth-child(14) {
  width: 22.2222222222%;
  height: 22.2222222222%;
  transform: translate(-50%, -50%) rotate(-1800deg);
}
butterfly:nth-child(15) {
  width: 16.6666666667%;
  height: 16.6666666667%;
  transform: translate(-50%, -50%) rotate(-2160deg);
}
butterfly:nth-child(16) {
  width: 11.1111111111%;
  height: 11.1111111111%;
  transform: translate(-50%, -50%) rotate(-2520deg);
}
butterfly:nth-child(17) {
  width: 5.5555555556%;
  height: 5.5555555556%;
  transform: translate(-50%, -50%) rotate(-2880deg);
}

@keyframes wheel {
  to {
    transform: translate(-50%, -50%) rotate(0deg);
  }
}

Comments