beautiful-backgrounds 1.0.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +107 -62
- package/build/bb.es.js +45 -3034
- package/build/bb.es.js.map +1 -1
- package/build/bb.js +46 -5
- package/build/bb.js.map +1 -1
- package/build/index.d.ts +454 -7
- package/package.json +70 -51
- package/build/src/BeautifulBackground.d.ts +0 -25
- package/build/src/Particle.d.ts +0 -53
- package/build/src/Symbol.d.ts +0 -7
- package/build/src/components/ambientRibbon.d.ts +0 -25
- package/build/src/components/digitalRain.d.ts +0 -28
- package/build/src/components/hexagonWave.d.ts +0 -29
- package/build/src/components/liquidLines.d.ts +0 -24
- package/build/src/components/neonRails.d.ts +0 -31
- package/build/src/components/startTrail.d.ts +0 -33
- package/build/src/stories/AmbientRibbon.stories.d.ts +0 -16
- package/build/src/stories/DigitalRain.stories.d.ts +0 -13
- package/build/src/stories/HexagonWave.stories.d.ts +0 -19
- package/build/src/stories/LiquidLines.stories.d.ts +0 -17
- package/build/src/stories/NeonRails.stories.d.ts +0 -20
- package/build/src/stories/StartTrail.stories.d.ts +0 -20
- package/build/src/utils/color.d.ts +0 -2
- package/build/src/utils/function.d.ts +0 -1
- package/build/src/utils/lit.d.ts +0 -2
- package/build/src/utils/number.d.ts +0 -2
- package/build/src/utils/object.d.ts +0 -3
- package/build/vite.svg +0 -1
package/README.md
CHANGED
|
@@ -1,90 +1,135 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://github.com/sponsors/niekes"><img src="https://img.shields.io/badge/Sponsor_beautiful--backgrounds-EA4AAA?logo=githubsponsors&logoColor=white&style=for-the-badge" alt="Sponsor beautiful-backgrounds"></a>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<strong>Animated canvas backgrounds for the web, as drop-in web components.</strong><br>
|
|
7
|
+
Free and open source, kept alive by one maintainer and the people who sponsor the work.
|
|
8
|
+
</p>
|
|
9
|
+
|
|
10
|
+
<p align="center">
|
|
11
|
+
<a href="https://github.com/niekes/beautiful-backgrounds/actions/workflows/ci.yml"><img src="https://github.com/niekes/beautiful-backgrounds/actions/workflows/ci.yml/badge.svg" alt="Build"></a>
|
|
12
|
+
<a href="https://github.com/niekes/beautiful-backgrounds/actions/workflows/ci.yml"><img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/niekes/beautiful-backgrounds/main/.github/badges/coverage.json" alt="Coverage"></a>
|
|
13
|
+
<a href="https://fallow.tools/docs/explanations/health/"><img src="https://raw.githubusercontent.com/niekes/beautiful-backgrounds/main/.github/badges/health.svg" alt="fallow health"></a>
|
|
14
|
+
<a href="https://www.npmjs.com/package/beautiful-backgrounds"><img src="https://img.shields.io/npm/dt/beautiful-backgrounds" alt="npm downloads"></a>
|
|
15
|
+
<a href="https://www.npmjs.com/package/beautiful-backgrounds"><img src="https://img.shields.io/npm/v/beautiful-backgrounds" alt="npm version"></a>
|
|
16
|
+
<a href="https://github.com/Niekes/beautiful-backgrounds/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/beautiful-backgrounds" alt="License"></a>
|
|
17
|
+
<img src="https://img.shields.io/badge/TypeScript-Ready-blue" alt="TypeScript">
|
|
18
|
+
<a href="https://niekes.github.io/beautiful-backgrounds/"><img src="https://cdn.jsdelivr.net/gh/storybookjs/brand@main/badge/badge-storybook.svg" alt="Storybook"></a>
|
|
19
|
+
<a href="https://github.com/niekes/beautiful-backgrounds"><img src="https://img.shields.io/github/stars/niekes/beautiful-backgrounds" alt="GitHub stars"></a>
|
|
20
|
+
<a href="https://github.com/sponsors/niekes"><img src="https://img.shields.io/github/sponsors/niekes?logo=GitHub+Sponsors&logoColor=%23EA4AAA&style=flat" alt="GitHub Sponsors"></a>
|
|
21
|
+
</p>
|
|
22
|
+
|
|
23
|
+
<p align="center">
|
|
24
|
+
<a href="https://niekes.github.io/beautiful-backgrounds/">Storybook</a> ·
|
|
25
|
+
<a href="#using-beautiful-backgrounds">Getting started</a> ·
|
|
26
|
+
<a href="#backgrounds">Backgrounds</a> ·
|
|
27
|
+
<a href="#sponsor-beautiful-backgrounds">Sponsor</a>
|
|
28
|
+
</p>
|
|
2
29
|
|
|
3
|
-
|
|
4
|
-
[![Coverage][coverage-badge]][coverage]
|
|
5
|
-
[![Npm][npm-badge]][npm]
|
|
6
|
-
[](https://niekes.github.io/beautiful-backgrounds/)
|
|
7
|
-
<a href="https://github.com/niekes/beautiful-backgrounds"><img src="https://img.shields.io/github/stars/niekes/beautiful-backgrounds" alt="stars" /></a>
|
|
8
|
-
<a href="https://github.com/sponsors/niekes"><img src="https://img.shields.io/badge/sponsor-30363D?logo=GitHub-Sponsors&logoColor=#EA4AAA" alt="sponsor this project" /></a>
|
|
30
|
+
---
|
|
9
31
|
|
|
10
|
-
|
|
32
|
+
<table>
|
|
33
|
+
<tr style="background-color: #f6f8fa">
|
|
34
|
+
<td><a target="_blank" href="https://niekes.github.io/beautiful-backgrounds/?path=/story/backgrounds-ambient-ribbon--signature-flow"><img src="assets/examples/ambient-ribbon.gif" alt="Ambient Ribbon"></a></td>
|
|
35
|
+
<td><a target="_blank" href="https://niekes.github.io/beautiful-backgrounds/?path=/story/backgrounds-digital-rain--classic-matrix-rain"><img src="assets/examples/digital-rain.gif" alt="Digital Rain"></a></td>
|
|
36
|
+
<td><a target="_blank" href="https://niekes.github.io/beautiful-backgrounds/?path=/story/backgrounds-neon-rails--cyber-grid-network"><img src="assets/examples/neon-rails.gif" alt="Neon Rails"></a></td>
|
|
37
|
+
</tr>
|
|
38
|
+
<tr style="background-color: #f6f8fa">
|
|
39
|
+
<td><a target="_blank" href="https://niekes.github.io/beautiful-backgrounds/?path=/story/backgrounds-hexagon-wave--honeycomb-pulsar"><img src="assets/examples/hexagon-wave.gif" alt="Hexagon Wave"></a></td>
|
|
40
|
+
<td><a target="_blank" href="https://niekes.github.io/beautiful-backgrounds/?path=/story/backgrounds-liquid-lines--serpentine-flow"><img src="assets/examples/liquid-lines.gif" alt="Liquid Lines"></a></td>
|
|
41
|
+
<td><a target="_blank" href="https://niekes.github.io/beautiful-backgrounds/?path=/story/backgrounds-contour-flow--topographic-moss"><img src="assets/examples/contour-flow.gif" alt="Contour Flow"></a></td>
|
|
42
|
+
</tr>
|
|
43
|
+
<tr style="background-color: #f6f8fa">
|
|
44
|
+
<td><a target="_blank" href="https://niekes.github.io/beautiful-backgrounds/?path=/story/backgrounds-star-trail--galactic-vortex"><img src="assets/examples/star-trail.gif" alt="Star Trail"></a></td>
|
|
45
|
+
<td><a target="_blank" href="https://niekes.github.io/beautiful-backgrounds/?path=/story/backgrounds-smoke-ring--nebula"><img src="assets/examples/smoke-ring.gif" alt="Smoke Ring"></a></td>
|
|
46
|
+
<td><a target="_blank" href="https://niekes.github.io/beautiful-backgrounds/?path=/story/backgrounds-light-shafts--crystal"><img src="assets/examples/light-shafts.gif" alt="Light Shafts"></a></td>
|
|
47
|
+
</tr>
|
|
48
|
+
<tr style="background-color: #f6f8fa">
|
|
49
|
+
<td><a target="_blank" href="https://niekes.github.io/beautiful-backgrounds/?path=/story/backgrounds-silk-waves--deep-tide"><img src="assets/examples/silk-waves.gif" alt="Silk Waves"></a></td>
|
|
50
|
+
<td></td>
|
|
51
|
+
<td></td>
|
|
52
|
+
</tr>
|
|
53
|
+
</table>
|
|
11
54
|
|
|
12
|
-
[
|
|
55
|
+
Every background has live controls in the [Storybook](https://niekes.github.io/beautiful-backgrounds/).
|
|
13
56
|
|
|
14
|
-
##
|
|
57
|
+
## Sponsor beautiful-backgrounds
|
|
15
58
|
|
|
16
|
-
-
|
|
17
|
-
- **Customizable and Interactive**: Each component comes with customizable properties to suit different design needs.
|
|
18
|
-
- **Responsive and Efficient**: Components are responsive to screen size changes and optimized for performance.
|
|
59
|
+
**beautiful-backgrounds** is free, and it always will be. There is no company behind it — just one maintainer working in spare time — so the cost of keeping it alive is paid for by the people who use it.
|
|
19
60
|
|
|
20
|
-
|
|
61
|
+
If a background made your site better, [become a sponsor](https://github.com/sponsors/niekes).
|
|
21
62
|
|
|
22
|
-
|
|
63
|
+
| Tier | What you get |
|
|
64
|
+
| ----------- | ------------------------------------------------------------------------------------------- |
|
|
65
|
+
| **$5/mo** | Your name in the [sponsors list](#sponsors) and my sincere thanks |
|
|
66
|
+
| **$25/mo** | The above, plus your logo in the README and in the Storybook, and priority issue triage |
|
|
67
|
+
| **$100/mo** | The above, plus direct email access for feature requests and a mention in the release notes |
|
|
23
68
|
|
|
24
|
-
|
|
25
|
-
npm i beautiful-backgrounds --save
|
|
26
|
-
```
|
|
69
|
+
Where the money goes:
|
|
27
70
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
71
|
+
- **Issue triage and bug fixes.** Sponsorship buys a reply within a couple of days instead of whenever I get to it.
|
|
72
|
+
- **Backgrounds that keep running smoothly.** Testing across browsers and devices as Lit, the canvas APIs and the browsers move on.
|
|
73
|
+
- **The Storybook.** The live examples and controls for every background.
|
|
74
|
+
- **Time for new work.** More backgrounds, better performance on low-power devices, and more ways to configure them.
|
|
31
75
|
|
|
32
|
-
|
|
76
|
+
Prefer a one-off? The [sponsor page](https://github.com/sponsors/niekes) also takes one-time contributions.
|
|
33
77
|
|
|
34
|
-
|
|
35
|
-
<script type="module">
|
|
36
|
-
import { BbStarTrail } from "https://esm.sh/beautiful-backgrounds";
|
|
37
|
-
</script>
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
## Usage
|
|
78
|
+
**Need a company sponsorship or an invoice?** [Get in touch](mailto:s@niekes.com).
|
|
41
79
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
---
|
|
80
|
+
## Sponsors
|
|
45
81
|
|
|
46
|
-
|
|
82
|
+
Thank you to the people who make this possible. Sponsors at $25/mo and above get their logo in this README and in the Storybook; everyone gets their name below.
|
|
47
83
|
|
|
48
|
-
|
|
84
|
+
<!-- New sponsors go below this line, one per line. -->
|
|
49
85
|
|
|
50
|
-
|
|
51
|
-
- 🔗 [Source Code](https://github.com/niekes/beautiful-backgrounds/blob/main/src/stories/digitalRain.ts)
|
|
86
|
+
## Using beautiful-backgrounds
|
|
52
87
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
88
|
+
```bash
|
|
89
|
+
npm install beautiful-backgrounds
|
|
90
|
+
```
|
|
56
91
|
|
|
57
|
-
|
|
58
|
-
- 🔗 [Source Code](https://github.com/niekes/beautiful-backgrounds/blob/main/src/stories/hexagonWave.ts)
|
|
92
|
+
Importing the package registers every background as a custom element:
|
|
59
93
|
|
|
60
|
-
|
|
94
|
+
```js
|
|
95
|
+
import "beautiful-backgrounds";
|
|
96
|
+
```
|
|
61
97
|
|
|
62
|
-
|
|
98
|
+
Or straight from a CDN, without a build step:
|
|
63
99
|
|
|
64
|
-
|
|
65
|
-
|
|
100
|
+
```html
|
|
101
|
+
<script type="module" src="https://esm.sh/beautiful-backgrounds"></script>
|
|
102
|
+
```
|
|
66
103
|
|
|
67
|
-
|
|
104
|
+
Then size an element like any other block, and set its attributes:
|
|
68
105
|
|
|
69
|
-
|
|
106
|
+
```html
|
|
107
|
+
<bb-star-trail
|
|
108
|
+
bg-colors="#000010, #001040"
|
|
109
|
+
particle-amount="800"
|
|
110
|
+
style="width: 100%; height: 400px"
|
|
111
|
+
></bb-star-trail>
|
|
112
|
+
```
|
|
70
113
|
|
|
71
|
-
|
|
72
|
-
- 🔗 [Source Code](https://github.com/niekes/beautiful-backgrounds/blob/main/src/stories/neonRails.ts)
|
|
114
|
+
Each background fills its element, redraws at the new size when the window resizes, and pauses while the tab is hidden. Every attribute is listed with a live control in the [Storybook](https://niekes.github.io/beautiful-backgrounds/).
|
|
73
115
|
|
|
74
|
-
|
|
116
|
+
## Backgrounds
|
|
75
117
|
|
|
76
|
-
|
|
118
|
+
| Background | Element | Looks like |
|
|
119
|
+
| ------------------------------------------------------------------------------------------------------------------------- | --------------------- | ------------------------------------------------------------------------------------ |
|
|
120
|
+
| [Ambient Ribbon](https://niekes.github.io/beautiful-backgrounds/?path=/story/backgrounds-ambient-ribbon--signature-flow) | `<bb-ambient-ribbon>` | Flowing ribbons of light with control over waves and rotation |
|
|
121
|
+
| [Contour Flow](https://niekes.github.io/beautiful-backgrounds/?path=/story/backgrounds-contour-flow--topographic-moss) | `<bb-contour-flow>` | Topographic contour lines, drawn by particles flowing downhill and colored by height |
|
|
122
|
+
| [Digital Rain](https://niekes.github.io/beautiful-backgrounds/?path=/story/backgrounds-digital-rain--classic-matrix-rain) | `<bb-digital-rain>` | Matrix-style falling characters |
|
|
123
|
+
| [Hexagon Wave](https://niekes.github.io/beautiful-backgrounds/?path=/story/backgrounds-hexagon-wave--honeycomb-pulsar) | `<bb-hexagon-wave>` | A shaded grid of hexagons rolling like a wave |
|
|
124
|
+
| [Light Shafts](https://niekes.github.io/beautiful-backgrounds/?path=/story/backgrounds-light-shafts--crystal) | `<bb-light-shafts>` | Upright shafts of soft light drifting sideways, the nearer ones faster |
|
|
125
|
+
| [Liquid Lines](https://niekes.github.io/beautiful-backgrounds/?path=/story/backgrounds-liquid-lines--serpentine-flow) | `<bb-liquid-lines>` | Undulating lines with a sense of depth |
|
|
126
|
+
| [Neon Rails](https://niekes.github.io/beautiful-backgrounds/?path=/story/backgrounds-neon-rails--cyber-grid-network) | `<bb-neon-rails>` | Particles racing along a geometric grid, leaving neon trails |
|
|
127
|
+
| [Silk Waves](https://niekes.github.io/beautiful-backgrounds/?path=/story/backgrounds-silk-waves--deep-tide) | `<bb-silk-waves>` | A sea of rolling waves in one color, shaded from its troughs to its crests |
|
|
128
|
+
| [Smoke Ring](https://niekes.github.io/beautiful-backgrounds/?path=/story/backgrounds-smoke-ring--nebula) | `<bb-smoke-ring>` | A wavy ring of light giving off colored smoke that drifts outward and swirls |
|
|
129
|
+
| [Star Trail](https://niekes.github.io/beautiful-backgrounds/?path=/story/backgrounds-star-trail--galactic-vortex) | `<bb-star-trail>` | Orbiting stars with fading trails |
|
|
77
130
|
|
|
78
|
-
|
|
79
|
-
- 🔗 [Source Code](https://github.com/niekes/beautiful-backgrounds/blob/main/src/stories/startTrail.ts)
|
|
131
|
+
The source of each one lives in [`src/components`](src/components). To build your own, extend `BeautifulBackground` and implement its `loop()`.
|
|
80
132
|
|
|
81
|
-
|
|
133
|
+
## Star History
|
|
82
134
|
|
|
83
|
-
[
|
|
84
|
-
[build]: https://github.com/niekes/beautiful-backgrounds/actions
|
|
85
|
-
[coverage-badge]: https://img.shields.io/codecov/c/github/niekes/beautiful-backgrounds.svg
|
|
86
|
-
[coverage]: https://codecov.io/github/niekes/beautiful-backgrounds
|
|
87
|
-
[esmsh]: https://esm.sh
|
|
88
|
-
[examples]: https://niekes.github.io/beautiful-backgrounds/
|
|
89
|
-
[npm-badge]: https://img.shields.io/npm/v/beautiful-backgrounds
|
|
90
|
-
[npm]: https://www.npmjs.com/package/beautiful-backgrounds
|
|
135
|
+
[](https://www.star-history.com/#niekes/beautiful-backgrounds&type=date&legend=bottom-right)
|