beautiful-backgrounds 0.0.7 → 1.1.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.
Files changed (47) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +61 -76
  3. package/build/bb.es.js +2995 -0
  4. package/build/bb.es.js.map +1 -0
  5. package/build/bb.js +8 -0
  6. package/build/bb.js.map +1 -0
  7. package/build/index.d.ts +8 -0
  8. package/build/src/BeautifulBackground.d.ts +25 -0
  9. package/build/src/Particle.d.ts +53 -0
  10. package/build/src/Symbol.d.ts +7 -0
  11. package/build/src/components/ambientRibbon.d.ts +25 -0
  12. package/build/src/components/concentricPulse.d.ts +19 -0
  13. package/{dist/components/DigitalRain.d.ts → build/src/components/digitalRain.d.ts} +13 -11
  14. package/build/src/components/hexagonWave.d.ts +29 -0
  15. package/build/src/components/liquidLines.d.ts +24 -0
  16. package/build/src/components/neonRails.d.ts +31 -0
  17. package/build/src/components/startTrail.d.ts +33 -0
  18. package/build/src/stories/AmbientRibbon.stories.d.ts +16 -0
  19. package/build/src/stories/ConcentricPulse.stories.d.ts +15 -0
  20. package/build/src/stories/DigitalRain.stories.d.ts +13 -0
  21. package/build/src/stories/HexagonWave.stories.d.ts +19 -0
  22. package/build/src/stories/LiquidLines.stories.d.ts +17 -0
  23. package/build/src/stories/NeonRails.stories.d.ts +20 -0
  24. package/build/src/stories/StartTrail.stories.d.ts +20 -0
  25. package/build/src/utils/color.d.ts +2 -0
  26. package/build/src/utils/function.d.ts +1 -0
  27. package/build/src/utils/lit.d.ts +2 -0
  28. package/{dist → build/src}/utils/number.d.ts +0 -1
  29. package/build/vite.svg +1 -0
  30. package/package.json +58 -27
  31. package/dist/beautiful-backgrounds.min.js +0 -1
  32. package/dist/components/BeautifulBackground.d.ts +0 -28
  33. package/dist/components/BeautifulBackground.js +0 -110
  34. package/dist/components/DigitalRain.js +0 -85
  35. package/dist/components/Particle.d.ts +0 -18
  36. package/dist/components/Particle.js +0 -44
  37. package/dist/components/StarTrail.d.ts +0 -30
  38. package/dist/components/StarTrail.js +0 -95
  39. package/dist/components/Symbol.d.ts +0 -7
  40. package/dist/components/Symbol.js +0 -18
  41. package/dist/index.d.ts +0 -2
  42. package/dist/index.js +0 -2
  43. package/dist/utils/color.d.ts +0 -1
  44. package/dist/utils/color.js +0 -7
  45. package/dist/utils/number.js +0 -20
  46. package/dist/utils/object.js +0 -9
  47. /package/{dist → build/src}/utils/object.d.ts +0 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 by Stefan Nieke
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # Beautiful Backgrounds
2
2
 
3
3
  [![Build][build-badge]][build]
4
+ [![Coverage][coverage-badge]][coverage]
5
+ [![Npm][npm-badge]][npm]
6
+ [![Storybook](https://cdn.jsdelivr.net/gh/storybookjs/brand@main/badge/badge-storybook.svg)](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>
4
9
 
5
10
  The "Beautiful Backgrounds" library offers a collection of customizable web components designed to enhance web pages with visually appealing animated backgrounds. Easy to integrate and use, these components are perfect for adding dynamic and interactive elements to your web applications.
6
11
 
@@ -8,9 +13,9 @@ The "Beautiful Backgrounds" library offers a collection of customizable web comp
8
13
 
9
14
  ## Features
10
15
 
11
- - **Multiple Background Components**: A variety of background components, each offering unique visual effects.
12
- - **Customizable and Interactive**: Each component comes with customizable properties to suit different design needs.
13
- - **Responsive and Efficient**: Components are responsive to screen size changes and optimized for performance.
16
+ - **Multiple Background Components**: A variety of background components, each offering unique visual effects.
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.
14
19
 
15
20
  ## Installation
16
21
 
@@ -21,99 +26,79 @@ npm i beautiful-backgrounds --save
21
26
  ```
22
27
 
23
28
  ```js
24
- import { BbStarTrail } from 'beautiful-backgrounds';
29
+ import { BbStarTrail } from "beautiful-backgrounds";
25
30
  ```
26
31
 
27
32
  In browsers with [`esm.sh`][esmsh]:
28
33
 
29
34
  ```html
30
35
  <script type="module">
31
- import { BbStarTrail } from 'https://esm.sh/beautiful-backgrounds';
36
+ import { BbStarTrail } from "https://esm.sh/beautiful-backgrounds";
32
37
  </script>
33
38
  ```
34
39
 
35
40
  ## Usage
36
41
 
37
- ### Star Trail
42
+ The best way to explore all the possibilities, interactive controls, and properties for each background is through our [Storybook](https://niekes.github.io/beautiful-backgrounds/). It provides a real-time environment to tweak parameters and see the results instantly.
38
43
 
39
- ```html
40
- <bb-star-trail
41
- data-num-stars="567"
42
- data-star-size-min="0.1"
43
- data-star-size-max="1.5"
44
- data-star-speed-min="0.001"
45
- data-star-speed-max="0.003"
46
- data-star-color-hue-start="30"
47
- data-star-color-hue-end="75"
48
- data-star-color-saturation-start="90"
49
- data-star-color-saturation-end="90"
50
- data-star-color-lightness-start="40"
51
- data-star-color-lightness-end="60"
52
- data-orbit-radius-min="10"
53
- data-orbit-radius-max="300"
54
- data-star-lifespan-min="1000"
55
- data-star-lifespan-max="50000"
56
- data-width="500"
57
- data-height="500"
58
- ></bb-star-trail>
59
- ```
44
+ ---
60
45
 
61
- #### Attributes for bb-star-trail
62
-
63
- - `data-num-stars`: Number of stars to be rendered.
64
- - `data-star-size-min`: Minimum size of a star.
65
- - `data-star-size-max`: Maximum size of a star.
66
- - `data-star-speed-min`: Minimum speed of a star.
67
- - `data-star-speed-max`: Maximum speed of a star.
68
- - `data-star-color-hue-start`: Starting hue for star color. Should be a value between 0 and 360.
69
- - `data-star-color-hue-end`: Ending hue for star color. Should be a value between 0 and 360.
70
- - `data-star-color-saturation-start`: Specifies the starting color saturation for star color. Should be a value between 0 and 100.
71
- - `data-star-color-saturation-start`: Specifies the ending color saturation for star color. Should be a value between 0 and 100.
72
- - `data-star-color-lightness-start`: Specifies the starting color lightness for star color. Should be a value between 0 and 100.
73
- - `data-star-color-lightness-start`: Specifies the ending color lightness for star color. Should be a value between 0 and 100.
74
- - `data-radius-min`: Minimum radius for star orbit.
75
- - `data-radius-max`: Maximum radius for star orbit.
76
- - `data-star-lifespan-min`: Minimum lifespan of a star in milliseconds.
77
- - `data-star-lifespan-max`: Maximum lifespan of a star in milliseconds.
78
- - `data-width`: Width of the star trail component, remove to fit the size of the container
79
- - `data-height`: height of the star trail component, remove to fit the size of the container
80
- - `data-background-color`: Background color of the canvas element
81
-
82
- ### Digital Rain
46
+ ### [Ambient Ribbon](https://github.com/niekes/beautiful-backgrounds/blob/main/src/components/ambientRibbon.ts)
83
47
 
84
- ```html
85
- <bb-digital-rain
86
- data-characteras="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
87
- data-font-size="16"
88
- data-font-color-hue-start="60"
89
- data-font-color-hue-end="150"
90
- ata-font-color-saturation-start="90"
91
- ata-font-color-saturation-end="90"
92
- ata-font-color-lightness-start="40"
93
- ata-font-color-lightness-end="60"
94
- data-speed="1"
95
- ></bb-star-trail>
96
- ```
48
+ A beautiful, flowing animation of multiple ribbons with deep control over wave physics, rotation, and color transitions. Perfect for high-end, elegant design themes.
49
+
50
+ - 📖 [View in Storybook](https://niekes.github.io/beautiful-backgrounds/?path=/story/backgrounds-ambient-ribbon--signature-flow)
51
+ - 🔗 [Source Code](https://github.com/niekes/beautiful-backgrounds/blob/main/src/components/ambientRibbon.ts)
52
+
53
+ ### [Concentric Pulse](https://github.com/niekes/beautiful-backgrounds/blob/main/src/components/concentricPulse.ts)
54
+
55
+ Concentric rings around the center that breathe in a staggered wave while their colors flow outwards through a gradient. You can tune the ring count, spacing, pulse amplitude, speed and colors, from a calm deep-sea glow to a bright neon look.
56
+
57
+ - 📖 [View in Storybook](https://niekes.github.io/beautiful-backgrounds/?path=/story/backgrounds-concentric-pulse--signature-pulse)
58
+ - 🔗 [Source Code](https://github.com/niekes/beautiful-backgrounds/blob/main/src/components/concentricPulse.ts)
59
+
60
+ ### [Digital Rain](https://github.com/niekes/beautiful-backgrounds/blob/main/src/components/digitalRain.ts)
61
+
62
+ A classic matrix-style falling character effect. Highly customizable with character sets, font sizes, speeds, and complex color gradients. Perfect for a retro-hacker or high-tech aesthetic.
63
+
64
+ - 📖 [View in Storybook](https://niekes.github.io/beautiful-backgrounds/?path=/story/backgrounds-digital-rain--classic-matrix-rain)
65
+ - 🔗 [Source Code](https://github.com/niekes/beautiful-backgrounds/blob/main/src/components/digitalRain.ts)
66
+
67
+ ### [Hexagon Wave](https://github.com/niekes/beautiful-backgrounds/blob/main/src/components/hexagonWave.ts)
68
+
69
+ A sleek, organic waving grid of hexagons (or other polygons). It features dynamic shading, lightness boosts, and wave physics that create a premium, rhythmic motion across the screen.
70
+
71
+ - 📖 [View in Storybook](https://niekes.github.io/beautiful-backgrounds/?path=/story/backgrounds-hexagon-wave--honeycomb-pulsar)
72
+ - 🔗 [Source Code](https://github.com/niekes/beautiful-backgrounds/blob/main/src/components/hexagonWave.ts)
73
+
74
+ ### [Liquid Lines](https://github.com/niekes/beautiful-backgrounds/blob/main/src/components/liquidLines.ts)
75
+
76
+ A fluid, undulating animation of multiple lines with gradients and 3D depth effects. It offers extensive control over wave physics, line thickness, and color transitions, making it perfect for organic or "liquid" design themes.
77
+
78
+ - 📖 [View in Storybook](https://niekes.github.io/beautiful-backgrounds/?path=/story/backgrounds-liquid-lines--serpentine-flow)
79
+ - 🔗 [Source Code](https://github.com/niekes/beautiful-backgrounds/blob/main/src/components/liquidLines.ts)
80
+
81
+ ### [Neon Rails](https://github.com/niekes/beautiful-backgrounds/blob/main/src/components/neonRails.ts)
82
+
83
+ Fast-moving particles that follow a geometric grid, creating long neon trails. It's ideal for "electric" or "cyberpunk" themes, offering deep control over particle lifespan, grid geometry, and trail opacity.
84
+
85
+ - 📖 [View in Storybook](https://niekes.github.io/beautiful-backgrounds/?path=/story/backgrounds-neon-rails--cyber-grid-network)
86
+ - 🔗 [Source Code](https://github.com/niekes/beautiful-backgrounds/blob/main/src/components/neonRails.ts)
97
87
 
98
- #### Attributes for bb-digital-rain
88
+ ### [Star Trail](https://github.com/niekes/beautiful-backgrounds/blob/main/src/components/startTrail.ts)
99
89
 
100
- - `data-characters`: Sets the characters for the digital rain effect.
101
- - `data-font-size`: Defines the font size of the falling characters.
102
- - `data-font-color-hue-start`: Specifies the starting color hue for the rain. Should be a value between 0 and 360.
103
- - `data-font-color-hue-end`: Sets the ending color hue for the rain. Should be a value between 0 and 360.
104
- - `data-font-color-saturation-start`: Specifies the starting color saturation for the rain. Should be a value between 0 and 100.
105
- - `data-font-color-saturation-start`: Specifies the ending color saturation for the rain. Should be a value between 0 and 100.
106
- - `data-font-color-lightness-start`: Specifies the starting color lightness for the rain. Should be a value between 0 and 100.
107
- - `data-font-color-lightness-start`: Specifies the ending color lightness for the rain. Should be a value between 0 and 100.
108
- - `data-speed`: Controls the falling speed of the digital rain.
109
- - `data-background-color`: Background color of the canvas element
90
+ A beautiful celestial animation featuring orbiting stars with fading trails. You can adjust orbit radii, star sizes, and colors to create anything from a subtle night sky to a vibrant cosmic nebula.
110
91
 
111
- [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/A0A3QJPZ9)
92
+ - 📖 [View in Storybook](https://niekes.github.io/beautiful-backgrounds/?path=/story/backgrounds-star-trail--galactic-vortex)
93
+ - 🔗 [Source Code](https://github.com/niekes/beautiful-backgrounds/blob/main/src/components/startTrail.ts)
112
94
 
113
95
  <!-- Links -->
114
96
 
115
- [build-badge]: https://github.com/niekes/beautiful-backgrounds/workflows/main/badge.svg
97
+ [build-badge]: https://img.shields.io/github/actions/workflow/status/niekes/beautiful-backgrounds/ci.yml
116
98
  [build]: https://github.com/niekes/beautiful-backgrounds/actions
99
+ [coverage-badge]: https://img.shields.io/codecov/c/github/niekes/beautiful-backgrounds.svg
100
+ [coverage]: https://codecov.io/github/niekes/beautiful-backgrounds
117
101
  [esmsh]: https://esm.sh
102
+ [examples]: https://niekes.github.io/beautiful-backgrounds/
103
+ [npm-badge]: https://img.shields.io/npm/v/beautiful-backgrounds
118
104
  [npm]: https://www.npmjs.com/package/beautiful-backgrounds
119
- [examples]: https://codepen.io/collection/aMPozo