hexagoncircle / click-spark

Add a little spark to your clicks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

click-spark

Add a little spark to your clicks. ✨

CodePen demo

Usage

Put the custom element before the closing </body> tag:

<body>
  <!-- other page elements -->
  <click-spark></click-spark>
</body>

Change spark color

Set a spark color via CSS custom property:

<click-spark style="--click-spark-color: blue"></click-spark>

Set active elements

Want the spark to only occur on particular elements? Pass in a comma-separated list of selectors:

<click-spark active-on=".send-sparks, #i-love-sparks, [data-sparks]"></click-spark>

Here's a CodePen demo of that example.

Dev notes

This is very experimental and created for the joy of the web. More testing should be done before deploying this one to prod.

PRs and feedback always welcome. 🎷

About

Add a little spark to your clicks

License:MIT License


Languages

Language:JavaScript 100.0%