Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions submissions/examples/text-gradient/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Text Gradient Animation Class

An animated gradient text effect using `background-clip: text` with a smoothly shifting multi-colour gradient. Works on headings, spans, paragraphs β€” any text element. Customisable via CSS custom properties.

## Classes

| Class | Description |
|---|---|
| `ease-text-gradient` | Animated gradient text (4s cycle) |
| `ease-text-gradient-slow` | Slower variant (8s cycle) |
| `ease-text-gradient-fast` | Faster variant (2s cycle) |

## Custom Properties

| Property | Default | Description |
|---|---|---|
| `--ease-gradient-from` | `#7c6cff` | Left gradient colour |
| `--ease-gradient-mid` | `#a78bfa` | Middle gradient colour |
| `--ease-gradient-to` | `#3b82f6` | Right gradient colour |

## Usage

```html
<h1 class="ease-text-gradient">Animated Gradient Heading</h1>
<p class="ease-text-gradient ease-text-gradient-slow">Slower variant</p>
<span class="ease-text-gradient" style="--ease-gradient-from: #22c55e; --ease-gradient-to: #06b6d4;">Custom colours</span>
```

## Why it fits EaseMotion CSS

Pure CSS animated gradient text using `background-clip: text` with `ease-` prefixed keyframes (`ease-kf-text-gradient`), speed modifier classes, customisable gradient colours via CSS custom properties, and respects `prefers-reduced-motion`.
32 changes: 32 additions & 0 deletions submissions/examples/text-gradient/demo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Text Gradient β€” EaseMotion CSS</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>

<h1 class="ease-text-gradient" style="font-size: 3rem; text-align: center; margin-top: 2rem;">
Animated Gradient Text
</h1>

<p class="ease-text-gradient ease-text-gradient-slow" style="font-size: 1.25rem; text-align: center; max-width: 600px; margin: 1rem auto;">
A slower animated gradient that shifts over 8 seconds β€” perfect for descriptive text or subtitles.
</p>

<h2 class="ease-text-gradient ease-text-gradient-fast" style="--ease-gradient-from: #f43f5e; --ease-gradient-to: #f59e0b; --ease-gradient-mid: #a78bfa; text-align: center; margin-top: 3rem;">
Fast Variant (2s) with Custom Colours
</h2>

<p style="text-align: center; margin-top: 2rem;">
Inline span gradient: <span class="ease-text-gradient" style="--ease-gradient-from: #22c55e; --ease-gradient-to: #06b6d4; font-weight: 700;">green to cyan</span> works on any element.
</p>

<p style="text-align: center; color: rgba(255,255,255,0.4); font-size: 0.75rem; margin-top: 3rem;">
Customise via <code>--ease-gradient-from</code>, <code>--ease-gradient-mid</code>, <code>--ease-gradient-to</code>
</p>

</body>
</html>
60 changes: 60 additions & 0 deletions submissions/examples/text-gradient/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/* ============================================================
EaseMotion CSS β€” Animated Gradient Text Effect
Issue #1182
============================================================ */

/* ── Base animation class ─────────────────────────────────── */

.ease-text-gradient {
--ease-gradient-from: #7c6cff;
--ease-gradient-mid: #a78bfa;
--ease-gradient-to: #3b82f6;

background: linear-gradient(
90deg,
var(--ease-gradient-from),
var(--ease-gradient-mid),
var(--ease-gradient-to),
var(--ease-gradient-from)
);
background-size: 300% auto;
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
color: transparent;
animation: ease-kf-text-gradient 4s linear infinite;
}

/* ── Speed variants ──────────────────────────────────────── */

.ease-text-gradient-slow {
animation-duration: 8s;
}

.ease-text-gradient-fast {
animation-duration: 2s;
}

/* ── Keyframes ────────────────────────────────────────────── */

@keyframes ease-kf-text-gradient {
0% { background-position: 0% center; }
100% { background-position: 300% center; }
}

/* ── Reduced motion ──────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
.ease-text-gradient {
animation: none;
background: linear-gradient(
90deg,
var(--ease-gradient-from),
var(--ease-gradient-to)
);
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
color: transparent;
}
}
Loading