AI CSS Animations

Ocean Text Effect

Deep sea-blue letters with rings of light crossing inside them, like sun on shallow water. Two tiled layers of soft elliptical rings drift in opposite directions over a depth gradient.

Also known as: water text css, underwater text effect, ocean gradient text.

Sea Breeze

HTML

<div class="txt-ocean-text">Sea Breeze</div>

CSS

.txt-ocean-text {
  --c: var(--txt-color, #3b82f6);
  font-size: var(--txt-size, 32px);
  font-family: system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.2;
  font-weight: 900;
  background:
    radial-gradient(ellipse 50% 45% at 50% 50%, transparent 45%, rgb(255 255 255 / 0.55) 62%, transparent 78%) 0 0 / 1.1em 0.55em,
    radial-gradient(ellipse 50% 45% at 50% 50%, transparent 45%, rgb(165 243 252 / 0.6) 62%, transparent 78%) 0.5em 0.25em / 0.8em 0.45em,
    linear-gradient(180deg, color-mix(in srgb, var(--c) 15%, #22d3ee) 0%, color-mix(in srgb, var(--c) 15%, #0284c7) 55%, color-mix(in srgb, var(--c) 15%, #1e3a8a) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: txt-ocean-text-swell 3s linear infinite;}
@keyframes txt-ocean-text-swell {
  to { background-position: 1.1em 0.55em, -0.3em 0.25em, 0 0; }
}

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

Customizing this snippet

  • Color: set --txt-color on the element or a parent. Currently previewing #3b82f6.
  • Font size: set --txt-size. Every other dimension is in em, so the whole thing scales together. Currently previewing 40px.
  • 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 text animations