CSS Animation Examples | Rotating 3D Dots CSS Loader

Last Updated: 2025-09-02 14:14:22

rotating 3d dots css loader

If you are looking for a sleek, modern CSS loader, this Rotating 3D Dots CSS Loader is perfect for your website or project. This loader features smooth, rotating dots with realistic shadow and push effects that create a 3D-like animation. It is fully CSS-based, lightweight, and easy to integrate without any JavaScript. The loader is perfectly centered on the page with a matching dark background to give a professional, modern feel. You can download the complete source code.

Source Code Explanation

β—ˆ Body Styling: Sets up the page so that the loader is perfectly centered vertically and horizontally. It also applies a background color that matches the loader’s theme.

β—ˆ Loader Wrapper (.pl): This is the main circular container of the loader. It defines size, rotation, shadows, and letter spacing to create the 3D effect.

β—ˆ Dot Element (.pl__dot): Each small dot is absolutely positioned inside the loader. They are animated and given shadows to appear as 3D spheres.

β—ˆ Dot Before Pseudo (.pl__dot:before): This pseudo-element is responsible for the front face of the dot. It animates smoothly with translate to create a push-in effect.

β—ˆ Dot After Pseudo (.pl__dot:after): This adds the bottom section of each dot with a rotated shape and shadow to enhance the 3D appearance. It also animates using clip-path for dynamic movement.

β—ˆ Animations (shadow724): Controls the shadow effect of each dot. It changes the shadow size and depth to create a pulsating, lifelike motion.

β—ˆ Animations (pushInOut1724): Manages the translation of the front face of the dot, giving a smooth push-in and push-out motion in sync with the shadows.

β—ˆ Animations (pushInOut2724): Animates the bottom section of the dot, modifying clip-path and color to simulate 3D rotation along the circular path.

β—ˆ Dot Positioning (nth-child selectors): Each dot is rotated around the circle with a different animation-delay to create a smooth sequential rotation.

β—ˆ Text Inside Loader (.pl__text): If you want to add text inside the loader, it is rotated and styled with shadow to align perfectly with the loader rotation.

Β 

body {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
  background: #2e3138;
}

.pl {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 14em;
  height: 14em;
  color: white;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transform: rotateX(30deg) rotateZ(45deg);
  box-shadow: 2em 0 2em rgba(0,0,0,0.2) inset, -2em 0 2em rgba(255,255,255,0.1) inset;
  border-radius: 50%;
}

.pl__dot {
  position: absolute;
  top: calc(50% - 0.75em);
  left: calc(50% - 0.75em);
  width: 1.5em;
  height: 1.5em;
  border-radius: 50%;
  box-shadow: 0.1em 0.1em 0 0.1em black, 0.3em 0 0.3em rgba(0,0,0,0.5);
  animation: shadow724 2s infinite;
}

.pl__dot:before {
  content: "";
  display: block;
  position: absolute;
  left: 0;
  width: inherit;
  height: inherit;
  z-index: 1;
  border-radius: inherit;
  background-color: var(--bg);
  box-shadow: 0.05em 0 0.1em rgba(255,255,255,0.2) inset;
  transition: background-color var(--trans-dur);
  animation: pushInOut1724 2s infinite;
}

.pl__dot:after {
  content: "";
  display: block;
  position: absolute;
  bottom: 0;
  left: 0;
  width: inherit;
  height: 3em;
  border-radius: 0.75em;
  transform: rotate(-45deg);
  transform-origin: 50% 2.25em;
  background-color: var(--primary1);
  box-shadow: 0.1em 0.3em 0.2em rgba(255,255,255,0.4) inset, 0 -0.4em 0.2em #2e3138 inset, 0 -1em 0.25em rgba(0,0,0,0.3) inset;
  clip-path: polygon(0 75%, 100% 75%, 100% 100%, 0 100%);
  transition: background-color var(--trans-dur);
  animation: pushInOut2724 2s infinite;
}

/* Animations */
@keyframes shadow724 { ... }
@keyframes pushInOut1724 { ... }
@keyframes pushInOut2724 { ... }

You can download the complete source code.

Β 

This Rotating 3D Dots CSS Loader is a simple yet elegant CSS-only loader that can enhance user experience on your website. It demonstrates how shadows, rotations, and pseudo-elements can create a 3D animation effect without any JavaScript. You can customize colors, size, and animation speed to match your design.

Still you face problems, feel free to contact with me, I will try my best to help you.