AI CSS Animations

Glossy Aqua Button

A skeuomorphic, candy-like pill with a glass highlight across its top half. On hover light wells up from the bottom and throbs slowly, like the default button in early Mac OS X.

Also known as: web 2.0 glossy button, skeuomorphic button css, aqua button.

HTML

<button class="btn-glossy-aqua"><span class="btn-glossy-aqua-label">Download</span></button>

CSS

.btn-glossy-aqua {
  --c: var(--btn-color, #3b82f6);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  font: 600 var(--btn-size, 18px)/1.2 system-ui, sans-serif;
  cursor: pointer;
  position: relative;
  isolation: isolate;
  padding: 0.8em 2.3em;
  border: 1px solid color-mix(in srgb, var(--c) 55%, #000);
  border-radius: 2em;
  background: linear-gradient(color-mix(in srgb, var(--c) 65%, #fff), var(--c) 50%, color-mix(in srgb, var(--c) 82%, #000) 50%, color-mix(in srgb, var(--c) 85%, #fff));
  color: #fff;
  text-shadow: 0 -1px 0 color-mix(in srgb, var(--c) 50%, #000);
  box-shadow: 0 0.15em 0.35em rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: box-shadow 0.3s ease;}
.btn-glossy-aqua::before {
  content: "";
  position: absolute;
  top: 1px;
  left: 0.8em;
  right: 0.8em;
  height: 48%;
  border-radius: 2em 2em 1em 1em / 1.2em 1.2em 0.5em 0.5em;
  background: linear-gradient(rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.12));
  opacity: 0.85;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.btn-glossy-aqua::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(ellipse 60% 75% at 50% 100%, rgba(255, 255, 255, 0.7), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.btn-glossy-aqua-label { position: relative; }
.btn-glossy-aqua:is(:hover, :focus-visible) {
  box-shadow: 0 0.3em 0.8em color-mix(in srgb, var(--c) 50%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.btn-glossy-aqua:is(:hover, :focus-visible)::before { opacity: 1; }
.btn-glossy-aqua:is(:hover, :focus-visible)::after {
  opacity: 1;
  animation: btn-glossy-aqua-throb 1.6s ease-in-out 0.4s infinite;
}
@keyframes btn-glossy-aqua-throb {
  50% { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
  .btn-glossy-aqua, .btn-glossy-aqua *, .btn-glossy-aqua::before, .btn-glossy-aqua::after, .btn-glossy-aqua *::before, .btn-glossy-aqua *::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