Skip to content
项目

关于

A small web component for making your text spark.

网站与应用开发

这些数字如何统计

实测星标增长

24小时
0
7天
0
15天
0
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

sparkly-text

A small zero-dependency Web Component to add sparkles to text fragments.

Examples

<!-- Add sparkles  -->
<sparkly-text>Hello world</sparkly-text>

<!-- Increase the number of sparkles  -->
<sparkly-text number-of-sparkles="5">Hello world</sparkly-text>

<!-- Color the sparkles  -->
<sparkly-text style="--sparkly-text-color: orange">Hello world</sparkly-text>

<!-- Add rainbow colors   -->
<sparkly-text style="--sparkly-text-color: rainbow">Hello world</sparkly-text>

<!-- Increase the sparkle size  -->
<sparkly-text style="--sparkly-text-size: 2.5em">Hello world</sparkly-text>

Installation

You have a few options (choose one of these):

  • Install via npm: npm install @stefanjudis/sparkly-text
  • Download the source manually from GitHub into your project.
  • Skip this step and use the script directly via a 3rd party CDN (not recommended for production use)

Usage

<!-- Host yourself -->
<script type="module" src="sparkly-text.js"></script>
<!-- 3rd party CDN, not recommended for production use -->
<script
  type="module"
  src="https://www.unpkg.com/@stefanjudis/sparkly-text"
></script>
<!-- 3rd party CDN, not recommended for production use -->
<script type="module" src="https://esm.sh/@stefanjudis/sparkly-text"></script>

Kudos

Big thanks goes to Zach Leatherman for all his fancy components such as table-saw.

探索相关项目

加载中…