diff --git a/submissions/examples/particle-burst-55617/README.md b/submissions/examples/particle-burst-55617/README.md new file mode 100644 index 00000000000..de57b035553 --- /dev/null +++ b/submissions/examples/particle-burst-55617/README.md @@ -0,0 +1,16 @@ +# CSS-Only Particle Burst Button + +## What does this do? +A button that shoots out a burst of "particles" or confetti when clicked. While this usually requires JavaScript, it can be achieved in pure CSS using the `:active` state and complex, multi-layered `box-shadow` animations that expand outward and fade. + +## How is it used? +```html + +``` + +## Why does it fit EaseMotion CSS? +It relies entirely on the CSS `:active` pseudo-class and highly optimized `box-shadow` manipulations to create a gamified micro-interaction. It's extremely satisfying to click and delightfully avoids heavy canvas or DOM element injections for particles. + +## Tech Stack +- HTML +- CSS (No JavaScript) diff --git a/submissions/examples/particle-burst-55617/demo.html b/submissions/examples/particle-burst-55617/demo.html new file mode 100644 index 00000000000..11e3c503fb8 --- /dev/null +++ b/submissions/examples/particle-burst-55617/demo.html @@ -0,0 +1,23 @@ + + + + + + Particle Burst Button Demo + + + + + + + diff --git a/submissions/examples/particle-burst-55617/style.css b/submissions/examples/particle-burst-55617/style.css new file mode 100644 index 00000000000..1a2d8c331d4 --- /dev/null +++ b/submissions/examples/particle-burst-55617/style.css @@ -0,0 +1,61 @@ +.ease-btn-particle { + position: relative; + appearance: none; + background: #f43f5e; + padding: 12px 24px; + border: none; + color: white; + font-size: 1.1rem; + font-weight: 600; + border-radius: 8px; + cursor: pointer; + outline: none; + z-index: 2; + transition: transform 0.1s ease; +} + +.ease-btn-particle:active { + transform: scale(0.95); +} + +.ease-btn-particle::before { + content: ''; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 100%; + height: 100%; + border-radius: 8px; + z-index: -1; + pointer-events: none; + background-color: transparent; + transition: all 0.3s ease; +} + +.ease-btn-particle:active::before { + /* Complex box-shadow to simulate multiple particles flying out */ + box-shadow: + -30px -40px 0 0 rgba(244, 63, 94, 0.8), + 40px -30px 0 0 rgba(244, 63, 94, 0.6), + 35px 35px 0 0 rgba(244, 63, 94, 0.4), + -40px 30px 0 0 rgba(244, 63, 94, 0.7), + -10px -50px 0 0 rgba(244, 63, 94, 0.5), + 50px 10px 0 0 rgba(244, 63, 94, 0.9), + 10px 50px 0 0 rgba(244, 63, 94, 0.3), + -50px -10px 0 0 rgba(244, 63, 94, 0.8); + animation: ease-particle-burst 0.5s ease-out forwards; +} + +@keyframes ease-particle-burst { + 0% { + width: 100%; + height: 100%; + opacity: 1; + } + 100% { + width: 200%; + height: 250%; + opacity: 0; + } +}