snowies 0.0.0-stage → 0.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.
- package/LICENSE +21 -0
- package/README.md +63 -2
- package/dist/auto.cjs +1192 -0
- package/dist/auto.cjs.map +1 -0
- package/dist/auto.d.cts +5 -0
- package/dist/auto.d.ts +5 -0
- package/dist/auto.js +46 -0
- package/dist/auto.js.map +1 -0
- package/dist/chunk-XFLVBGZZ.js +1149 -0
- package/dist/chunk-XFLVBGZZ.js.map +1 -0
- package/dist/index.cjs +1158 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +41 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/snowies.global.js +280 -0
- package/dist/snowies.global.js.map +1 -0
- package/dist/types-CMTuJTs7.d.cts +155 -0
- package/dist/types-CMTuJTs7.d.ts +155 -0
- package/package.json +65 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 L2Ernestoo
|
|
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,3 +1,64 @@
|
|
|
1
|
-
#
|
|
1
|
+
# snowies
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Paquete navideño **cero dependencias**, escrito en **TypeScript puro** y optimizado para GPU/batería. Funciona en cualquier proyecto web (HTML, Vue, React, Astro, Next.js, Laravel, etc.).
|
|
4
|
+
|
|
5
|
+
## Características
|
|
6
|
+
|
|
7
|
+
- **Nieve en Canvas 2D**: 3 capas de profundidad, sprites pre-renderizados, pausa automática al cambiar de pestaña (`visibilitychange`) y modo `contrasting` para fondos claros.
|
|
8
|
+
- **Luces navideñas fijas arriba**: cable SVG, focos con filamento y halo, balanceo suave, iluminación al pasar el mouse y destello al hacer clic (encapsulado en Shadow DOM).
|
|
9
|
+
- **Snow Burst en botones**: explosión radial de nieve y cristales SVG al hacer clic en botones + gorrito de nieve opcional en `[data-snowies-btn]`.
|
|
10
|
+
- **Botón flotante ON/OFF discreto y personalizable**: encapsulado en Shadow DOM, modo solo icono por defecto (`variant: 'icon' | 'pill'`), tamaños, temas, icono SVG propio, estilos custom y persistencia en `localStorage`.
|
|
11
|
+
- **Presets y programación por fechas**: activa Navidad automáticamente entre fechas (ej. `12-01` a `01-06`).
|
|
12
|
+
- **Accesible**: respeta `prefers-reduced-motion: reduce`.
|
|
13
|
+
|
|
14
|
+
## Instalación
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install snowies
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Uso rápido (ESM / TypeScript)
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import { createSnowies } from 'snowies';
|
|
24
|
+
|
|
25
|
+
const snowies = createSnowies({
|
|
26
|
+
preset: 'classic', // 'classic' | 'minimal' | 'festive' | 'light' | 'lights-only' | 'snow-only'
|
|
27
|
+
schedule: { from: '12-01', to: '01-06' },
|
|
28
|
+
toggleButton: {
|
|
29
|
+
variant: 'icon', // 'icon' | 'pill'
|
|
30
|
+
size: 'sm', // 'sm' | 'md'
|
|
31
|
+
theme: 'minimal', // 'minimal' | 'dark' | 'light' | 'festive'
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
// Control programático
|
|
36
|
+
snowies.toggle();
|
|
37
|
+
snowies.update({ snow: { density: 'heavy', contrasting: true } });
|
|
38
|
+
snowies.destroy();
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Uso directo por CDN
|
|
42
|
+
|
|
43
|
+
```html
|
|
44
|
+
<script
|
|
45
|
+
src="https://unpkg.com/snowies"
|
|
46
|
+
data-preset="classic"
|
|
47
|
+
data-from="12-01"
|
|
48
|
+
data-to="01-06"
|
|
49
|
+
defer
|
|
50
|
+
></script>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Desarrollo local
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
npm install
|
|
57
|
+
npm run dev # Abre el playground interactivo
|
|
58
|
+
npm run test # Ejecuta los tests unitarios
|
|
59
|
+
npm run build # Genera dist/ (ESM, CJS, .d.ts y CDN global)
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Licencia
|
|
63
|
+
|
|
64
|
+
MIT
|