AI CSS Animations

Scroll Down Button

The hero section hint: a mouse outline whose wheel rolls down and fades, above a small Scroll label and two chevrons that blink in turn. Use it as a real button that jumps to the next section.

Also known as: scroll down button css, mouse scroll animation css, scroll indicator button.

HTML

<button class="btn-scroll-down" type="button">
  <span class="btn-scroll-down-mouse" aria-hidden="true"></span>
  <span class="btn-scroll-down-chevrons" aria-hidden="true">
    <svg viewBox="0 0 24 12" style="--i:0"><path d="M6 3l6 6 6-6"/></svg>
    <svg viewBox="0 0 24 12" style="--i:1"><path d="M6 3l6 6 6-6"/></svg>
  </span>
  <span class="btn-scroll-down-label">Scroll</span>
</button>

CSS

.btn-scroll-down {
  --c: var(--btn-color, #3b82f6);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.75em 1.6em;
  border: 0;
  border-radius: 0.6em;
  font: 600 var(--btn-size, 18px)/1.1 system-ui, sans-serif;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  flex-direction: column;
  gap: 0.3em;
  padding: 0.7em 1.1em 0.6em;
  border-radius: 1em;
  background: transparent;
  color: var(--c);
  transition: background-color 0.25s ease, transform 0.2s ease;}
.btn-scroll-down-mouse {
  position: relative;
  width: 1.75em;
  height: 2.75em;
  border: 2px solid currentColor;
  border-radius: 0.9em;
}
.btn-scroll-down-mouse::before {
  content: "";
  position: absolute;
  top: 0.45em;
  left: 50%;
  width: 0.26em;
  height: 0.55em;
  margin-left: -0.13em;
  border-radius: 0.2em;
  background: currentColor;
  animation: btn-scroll-down-wheel 1.8s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
.btn-scroll-down-chevrons {
  display: grid;
  margin-bottom: 0.1em;
}
.btn-scroll-down-chevrons svg {
  display: block;
  width: 1.1em;
  height: 0.55em;
  margin-top: -0.12em;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: btn-scroll-down-blink 1.8s ease-in-out calc(var(--i) * 0.2s + 0.4s) infinite;
}
.btn-scroll-down-label {
  font-size: 0.7em;
  font-weight: 700;
  letter-spacing: 0.25em;
  margin-right: -0.25em;
  text-transform: uppercase;
}
.btn-scroll-down:is(:hover, :focus-visible) { background: color-mix(in srgb, var(--c) 10%, transparent); }
.btn-scroll-down:active { transform: translateY(0.15em); }
@keyframes btn-scroll-down-wheel {
  0%        { opacity: 0; transform: translateY(0); }
  15%       { opacity: 1; transform: translateY(0); }
  70%, 100% { opacity: 0; transform: translateY(0.85em); }
}
@keyframes btn-scroll-down-blink {
  0%, 60%, 100% { opacity: 0.2; }
  25%           { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .btn-scroll-down, .btn-scroll-down *, .btn-scroll-down::before, .btn-scroll-down::after, .btn-scroll-down *::before, .btn-scroll-down *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

Customizing this snippet

  • Color: set --btn-color on the element or a parent. Currently previewing #3b82f6.
  • Base size: set --btn-size. Every other dimension is in em, so the whole thing scales together. Currently previewing 18px.
  • Speed: change the duration on the transition or animation shorthand. Staggered delays are relative, so they keep their rhythm.
  • Reduced motion: the rule at the end of the CSS turns the motion off for people who asked their OS for less of it. Keep it.

Similar buttons