DEV Community

Gustavo Flores
Gustavo Flores

Posted on

9 2

Pulse Loading with CSS

Hi!
this is a quick tutorial to make a Pulse Loading with only HTML and CSS!

HTML

<div class="pulse-wrapper">
  <div class="pulse"></div>  
</div>
Enter fullscreen mode Exit fullscreen mode

CSS

/* this is to keep you loading wrapper on the middle of screen */
div.pulse-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate3d(-50%, -50%, 0);
}

div.pulse {
  height: 50px;
  width: 50px;
  background-color: rgb(199, 153, 8);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
    40% {
        transform: scale(1.1);
        box-shadow: 0 0 0 20px rgba(199, 153, 8, 0.3);
    }

    80% {
        transform: scale(1);
        box-shadow: 0 0 0 40px rgba(199, 153, 8, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(199, 153, 8, 0)
    }
}
Enter fullscreen mode Exit fullscreen mode

and that's all folks!

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay