Spinny Boxes!

In this example below you will see how to do a Spinny Boxes! with some HTML / CSS and Javascript

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

<head>
  <meta charset="UTF-8">
  <title>Spinny Boxes!</title>
  
  
  
      <link rel="stylesheet" href="css/style.css">

  
</head>

<body>

  <div id='container'>
  <div class='box box-1'></div>
  <div class='box box-2'></div>
  <div class='box box-3'></div>
  <div class='box box-4'></div>
  <div class='box box-5'></div>
  <div class='box box-6'></div>
  <div class='box box-7'></div>
  <div class='box box-8'></div>
  <div class='box box-9'></div>
  <div class='box box-10'></div>
  <div class='box box-11'></div>
  <div class='box box-12'></div>
  <div class='box box-13'></div>
  <div class='box box-14'></div>
  <div class='box box-15'></div>
  <div class='box box-16'></div>
  <div class='box box-17'></div>
  <div class='box box-18'></div>
  <div class='box box-19'></div>
  <div class='box box-20'></div>
  <div class='box box-21'></div>
  <div class='box box-22'></div>
  <div class='box box-23'></div>
  <div class='box box-24'></div>
  <div class='box box-25'></div>
  <div class='box box-26'></div>
  <div class='box box-27'></div>
  <div class='box box-28'></div>
  <div class='box box-29'></div>
  <div class='box box-30'></div>
  <div class='box box-31'></div>
  <div class='box box-32'></div>
  <div class='box box-33'></div>
  <div class='box box-34'></div>
  <div class='box box-35'></div>
  <div class='box box-36'></div>
  <div class='box box-37'></div>
  <div class='box box-38'></div>
  <div class='box box-39'></div>
  <div class='box box-40'></div>
  <div class='box box-41'></div>
  <div class='box box-42'></div>
  <div class='box box-43'></div>
  <div class='box box-44'></div>
  <div class='box box-45'></div>
  <div class='box box-46'></div>
  <div class='box box-47'></div>
  <div class='box box-48'></div>
  <div class='box box-49'></div>
  <div class='box box-50'></div>
</div>
  
  

</body>

</html>

/*Downloaded from https://www.codeseek.co/chrismbarr/spinny-boxes-oIwDd */
body {
  background: #CCC;
}

#container {
  background: #DDD;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  width: 250px;
  height: 250px;
  padding: 83.3333333333px;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: all 1s;
}
#container:hover {
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.3);
}
#container:hover .box {
  transform: rotate(45deg);
}

.box {
  border: 1px solid #777;
  position: absolute;
  transition: all 1s;
  height: 250px;
  width: 250px;
}

.box-1 {
  transform: rotate(6.2deg);
}

.box-2 {
  transform: rotate(12.4deg);
}

.box-3 {
  transform: rotate(18.6deg);
}

.box-4 {
  transform: rotate(24.8deg);
}

.box-5 {
  transform: rotate(31deg);
}

.box-6 {
  transform: rotate(37.2deg);
}

.box-7 {
  transform: rotate(43.4deg);
}

.box-8 {
  transform: rotate(49.6deg);
}

.box-9 {
  transform: rotate(55.8deg);
}

.box-10 {
  transform: rotate(62deg);
}

.box-11 {
  transform: rotate(68.2deg);
}

.box-12 {
  transform: rotate(74.4deg);
}

.box-13 {
  transform: rotate(80.6deg);
}

.box-14 {
  transform: rotate(86.8deg);
}

.box-15 {
  transform: rotate(93deg);
}

.box-16 {
  transform: rotate(99.2deg);
}

.box-17 {
  transform: rotate(105.4deg);
}

.box-18 {
  transform: rotate(111.6deg);
}

.box-19 {
  transform: rotate(117.8deg);
}

.box-20 {
  transform: rotate(124deg);
}

.box-21 {
  transform: rotate(130.2deg);
}

.box-22 {
  transform: rotate(136.4deg);
}

.box-23 {
  transform: rotate(142.6deg);
}

.box-24 {
  transform: rotate(148.8deg);
}

.box-25 {
  transform: rotate(155deg);
}

.box-26 {
  transform: rotate(161.2deg);
}

.box-27 {
  transform: rotate(167.4deg);
}

.box-28 {
  transform: rotate(173.6deg);
}

.box-29 {
  transform: rotate(179.8deg);
}

.box-30 {
  transform: rotate(186deg);
}

.box-31 {
  transform: rotate(192.2deg);
}

.box-32 {
  transform: rotate(198.4deg);
}

.box-33 {
  transform: rotate(204.6deg);
}

.box-34 {
  transform: rotate(210.8deg);
}

.box-35 {
  transform: rotate(217deg);
}

.box-36 {
  transform: rotate(223.2deg);
}

.box-37 {
  transform: rotate(229.4deg);
}

.box-38 {
  transform: rotate(235.6deg);
}

.box-39 {
  transform: rotate(241.8deg);
}

.box-40 {
  transform: rotate(248deg);
}

.box-41 {
  transform: rotate(254.2deg);
}

.box-42 {
  transform: rotate(260.4deg);
}

.box-43 {
  transform: rotate(266.6deg);
}

.box-44 {
  transform: rotate(272.8deg);
}

.box-45 {
  transform: rotate(279deg);
}

.box-46 {
  transform: rotate(285.2deg);
}

.box-47 {
  transform: rotate(291.4deg);
}

.box-48 {
  transform: rotate(297.6deg);
}

.box-49 {
  transform: rotate(303.8deg);
}

.box-50 {
  transform: rotate(310deg);
}

Comments