@oalacea/chaosui 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/bin/cli.js +216 -0
- package/components/backgrounds/glow-orbs/glow-orbs.module.css +31 -0
- package/components/backgrounds/glow-orbs/index.tsx +87 -0
- package/components/backgrounds/light-beams/index.tsx +80 -0
- package/components/backgrounds/light-beams/light-beams.module.css +27 -0
- package/components/backgrounds/noise-canvas/index.tsx +113 -0
- package/components/backgrounds/noise-canvas/noise-canvas.module.css +8 -0
- package/components/backgrounds/particle-field/index.tsx +81 -0
- package/components/backgrounds/particle-field/particle-field.module.css +31 -0
- package/components/buttons/chaos-button/chaos-button.module.css +173 -0
- package/components/buttons/chaos-button/index.tsx +60 -0
- package/components/buttons/glitch-button/glitch-button.module.css +197 -0
- package/components/buttons/glitch-button/index.tsx +53 -0
- package/components/effects/cursor-follower/cursor-follower.module.css +50 -0
- package/components/effects/cursor-follower/index.tsx +83 -0
- package/components/effects/screen-distortion/index.tsx +54 -0
- package/components/effects/screen-distortion/screen-distortion.module.css +127 -0
- package/components/effects/warning-tape/index.tsx +64 -0
- package/components/effects/warning-tape/warning-tape.module.css +29 -0
- package/components/glow-orbs/glow-orbs.module.css +31 -0
- package/components/glow-orbs/index.tsx +87 -0
- package/components/light-beams/index.tsx +80 -0
- package/components/light-beams/light-beams.module.css +27 -0
- package/components/noise-canvas/index.tsx +113 -0
- package/components/noise-canvas/noise-canvas.module.css +8 -0
- package/components/overlays/noise-overlay/index.tsx +56 -0
- package/components/overlays/noise-overlay/noise-overlay.module.css +20 -0
- package/components/overlays/scanlines/index.tsx +61 -0
- package/components/overlays/scanlines/scanlines.module.css +16 -0
- package/components/overlays/static-flicker/index.tsx +51 -0
- package/components/overlays/static-flicker/static-flicker.module.css +27 -0
- package/components/overlays/vignette/index.tsx +58 -0
- package/components/overlays/vignette/vignette.module.css +7 -0
- package/components/package.json +13 -0
- package/components/particle-field/index.tsx +81 -0
- package/components/particle-field/particle-field.module.css +31 -0
- package/components/text/distortion-text/distortion-text.module.css +100 -0
- package/components/text/distortion-text/index.tsx +53 -0
- package/components/text/falling-text/falling-text.module.css +57 -0
- package/components/text/falling-text/index.tsx +61 -0
- package/components/text/flicker-text/flicker-text.module.css +91 -0
- package/components/text/flicker-text/index.tsx +48 -0
- package/components/text/glitch-text/glitch-text.module.css +142 -0
- package/components/text/glitch-text/index.tsx +53 -0
- package/package.json +38 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
.flicker {
|
|
2
|
+
display: inline-block;
|
|
3
|
+
--min-opacity: 0;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
/* SLOW */
|
|
7
|
+
.slow {
|
|
8
|
+
animation: flicker-slow 4s infinite;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@keyframes flicker-slow {
|
|
12
|
+
0%, 100% { opacity: 1; }
|
|
13
|
+
50% { opacity: 1; }
|
|
14
|
+
52% { opacity: var(--min-opacity); }
|
|
15
|
+
54% { opacity: 1; }
|
|
16
|
+
80% { opacity: 1; }
|
|
17
|
+
82% { opacity: var(--min-opacity); }
|
|
18
|
+
84% { opacity: 1; }
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/* NORMAL */
|
|
22
|
+
.normal {
|
|
23
|
+
animation: flicker-normal 2s infinite;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@keyframes flicker-normal {
|
|
27
|
+
0%, 100% { opacity: 1; }
|
|
28
|
+
33% { opacity: 1; }
|
|
29
|
+
34% { opacity: var(--min-opacity); }
|
|
30
|
+
35% { opacity: 1; }
|
|
31
|
+
66% { opacity: 1; }
|
|
32
|
+
67% { opacity: var(--min-opacity); }
|
|
33
|
+
68% { opacity: 1; }
|
|
34
|
+
69% { opacity: var(--min-opacity); }
|
|
35
|
+
70% { opacity: 1; }
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* FAST */
|
|
39
|
+
.fast {
|
|
40
|
+
animation: flicker-fast 0.5s infinite;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@keyframes flicker-fast {
|
|
44
|
+
0%, 100% { opacity: 1; }
|
|
45
|
+
10% { opacity: var(--min-opacity); }
|
|
46
|
+
20% { opacity: 1; }
|
|
47
|
+
30% { opacity: var(--min-opacity); }
|
|
48
|
+
40% { opacity: 1; }
|
|
49
|
+
60% { opacity: 1; }
|
|
50
|
+
70% { opacity: var(--min-opacity); }
|
|
51
|
+
80% { opacity: 1; }
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* ERRATIC */
|
|
55
|
+
.erratic {
|
|
56
|
+
animation: flicker-erratic 3s infinite;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@keyframes flicker-erratic {
|
|
60
|
+
0%, 100% { opacity: 1; }
|
|
61
|
+
5% { opacity: var(--min-opacity); }
|
|
62
|
+
6% { opacity: 1; }
|
|
63
|
+
7% { opacity: var(--min-opacity); }
|
|
64
|
+
8% { opacity: 1; }
|
|
65
|
+
25% { opacity: 1; }
|
|
66
|
+
26% { opacity: var(--min-opacity); }
|
|
67
|
+
27% { opacity: 1; }
|
|
68
|
+
50% { opacity: 1; }
|
|
69
|
+
51% { opacity: var(--min-opacity); }
|
|
70
|
+
52% { opacity: 1; }
|
|
71
|
+
53% { opacity: var(--min-opacity); }
|
|
72
|
+
54% { opacity: 1; }
|
|
73
|
+
55% { opacity: var(--min-opacity); }
|
|
74
|
+
56% { opacity: 1; }
|
|
75
|
+
75% { opacity: 1; }
|
|
76
|
+
76% { opacity: var(--min-opacity); }
|
|
77
|
+
77% { opacity: 1; }
|
|
78
|
+
90% { opacity: 1; }
|
|
79
|
+
91% { opacity: var(--min-opacity); }
|
|
80
|
+
92% { opacity: 1; }
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/* HOVER ONLY */
|
|
84
|
+
.hoverOnly {
|
|
85
|
+
animation: none;
|
|
86
|
+
opacity: 1;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.hoverOnly:hover {
|
|
90
|
+
animation: flicker-normal 0.5s infinite;
|
|
91
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { forwardRef, HTMLAttributes } from 'react';
|
|
4
|
+
import styles from './flicker-text.module.css';
|
|
5
|
+
|
|
6
|
+
export interface FlickerTextProps extends HTMLAttributes<HTMLSpanElement> {
|
|
7
|
+
/** The text to display */
|
|
8
|
+
children: string;
|
|
9
|
+
/** Flicker speed: slow, normal, fast, erratic */
|
|
10
|
+
speed?: 'slow' | 'normal' | 'fast' | 'erratic';
|
|
11
|
+
/** Minimum opacity during flicker */
|
|
12
|
+
minOpacity?: number;
|
|
13
|
+
/** Flicker only on hover */
|
|
14
|
+
hoverOnly?: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const FlickerText = forwardRef<HTMLSpanElement, FlickerTextProps>(
|
|
18
|
+
(
|
|
19
|
+
{
|
|
20
|
+
children,
|
|
21
|
+
speed = 'normal',
|
|
22
|
+
minOpacity = 0,
|
|
23
|
+
hoverOnly = false,
|
|
24
|
+
className,
|
|
25
|
+
style,
|
|
26
|
+
...props
|
|
27
|
+
},
|
|
28
|
+
ref
|
|
29
|
+
) => {
|
|
30
|
+
return (
|
|
31
|
+
<span
|
|
32
|
+
ref={ref}
|
|
33
|
+
className={`${styles.flicker} ${styles[speed]} ${hoverOnly ? styles.hoverOnly : ''} ${className || ''}`}
|
|
34
|
+
style={{
|
|
35
|
+
'--min-opacity': minOpacity,
|
|
36
|
+
...style,
|
|
37
|
+
} as React.CSSProperties}
|
|
38
|
+
{...props}
|
|
39
|
+
>
|
|
40
|
+
{children}
|
|
41
|
+
</span>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
FlickerText.displayName = 'FlickerText';
|
|
47
|
+
|
|
48
|
+
export default FlickerText;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
.glitch {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: inline-block;
|
|
4
|
+
--glitch-color: #ff0040;
|
|
5
|
+
--glitch-color-alt: #00ffff;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.glitch::before,
|
|
9
|
+
.glitch::after {
|
|
10
|
+
content: attr(data-text);
|
|
11
|
+
position: absolute;
|
|
12
|
+
top: 0;
|
|
13
|
+
left: 0;
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: 100%;
|
|
16
|
+
pointer-events: none;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.glitch::before {
|
|
20
|
+
color: var(--glitch-color);
|
|
21
|
+
z-index: -1;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.glitch::after {
|
|
25
|
+
color: var(--glitch-color-alt);
|
|
26
|
+
z-index: -2;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* SUBTLE */
|
|
30
|
+
.subtle::before {
|
|
31
|
+
animation: glitch-subtle-1 3s infinite linear alternate-reverse;
|
|
32
|
+
clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.subtle::after {
|
|
36
|
+
animation: glitch-subtle-2 3s infinite linear alternate-reverse;
|
|
37
|
+
clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
|
|
38
|
+
opacity: 0.8;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@keyframes glitch-subtle-1 {
|
|
42
|
+
0%, 100% { transform: translate(0); }
|
|
43
|
+
20% { transform: translate(-1px, 1px); }
|
|
44
|
+
40% { transform: translate(-1px, -1px); }
|
|
45
|
+
60% { transform: translate(1px, 1px); }
|
|
46
|
+
80% { transform: translate(1px, -1px); }
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@keyframes glitch-subtle-2 {
|
|
50
|
+
0%, 100% { transform: translate(0); }
|
|
51
|
+
20% { transform: translate(1px, -1px); }
|
|
52
|
+
40% { transform: translate(1px, 1px); }
|
|
53
|
+
60% { transform: translate(-1px, -1px); }
|
|
54
|
+
80% { transform: translate(-1px, 1px); }
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* MEDIUM */
|
|
58
|
+
.medium::before {
|
|
59
|
+
animation: glitch-medium-1 0.3s infinite linear alternate-reverse;
|
|
60
|
+
clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.medium::after {
|
|
64
|
+
animation: glitch-medium-2 0.3s infinite linear alternate-reverse;
|
|
65
|
+
clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
|
|
66
|
+
opacity: 0.8;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@keyframes glitch-medium-1 {
|
|
70
|
+
0%, 100% { transform: translate(0); }
|
|
71
|
+
20% { transform: translate(-2px, 2px); }
|
|
72
|
+
40% { transform: translate(-2px, -2px); }
|
|
73
|
+
60% { transform: translate(2px, 2px); }
|
|
74
|
+
80% { transform: translate(2px, -2px); }
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@keyframes glitch-medium-2 {
|
|
78
|
+
0%, 100% { transform: translate(0); }
|
|
79
|
+
20% { transform: translate(2px, -2px); }
|
|
80
|
+
40% { transform: translate(2px, 2px); }
|
|
81
|
+
60% { transform: translate(-2px, -2px); }
|
|
82
|
+
80% { transform: translate(-2px, 2px); }
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* INTENSE */
|
|
86
|
+
.intense::before {
|
|
87
|
+
animation: glitch-intense-1 0.15s infinite linear alternate-reverse;
|
|
88
|
+
clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.intense::after {
|
|
92
|
+
animation: glitch-intense-2 0.15s infinite linear alternate-reverse;
|
|
93
|
+
clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
|
|
94
|
+
opacity: 0.8;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
@keyframes glitch-intense-1 {
|
|
98
|
+
0% { transform: translate(0); }
|
|
99
|
+
10% { transform: translate(-3px, 3px); }
|
|
100
|
+
20% { transform: translate(3px, -3px); }
|
|
101
|
+
30% { transform: translate(-3px, -3px); }
|
|
102
|
+
40% { transform: translate(3px, 3px); }
|
|
103
|
+
50% { transform: translate(-3px, 0); }
|
|
104
|
+
60% { transform: translate(3px, 0); }
|
|
105
|
+
70% { transform: translate(0, 3px); }
|
|
106
|
+
80% { transform: translate(0, -3px); }
|
|
107
|
+
90% { transform: translate(-3px, 3px); }
|
|
108
|
+
100% { transform: translate(0); }
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
@keyframes glitch-intense-2 {
|
|
112
|
+
0% { transform: translate(0); }
|
|
113
|
+
10% { transform: translate(3px, -3px); }
|
|
114
|
+
20% { transform: translate(-3px, 3px); }
|
|
115
|
+
30% { transform: translate(3px, 3px); }
|
|
116
|
+
40% { transform: translate(-3px, -3px); }
|
|
117
|
+
50% { transform: translate(3px, 0); }
|
|
118
|
+
60% { transform: translate(-3px, 0); }
|
|
119
|
+
70% { transform: translate(0, -3px); }
|
|
120
|
+
80% { transform: translate(0, 3px); }
|
|
121
|
+
90% { transform: translate(3px, -3px); }
|
|
122
|
+
100% { transform: translate(0); }
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/* STATIC (no animation) */
|
|
126
|
+
.static::before {
|
|
127
|
+
animation: none;
|
|
128
|
+
transform: translate(-2px, 2px);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.static::after {
|
|
132
|
+
animation: none;
|
|
133
|
+
transform: translate(2px, -2px);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.static:hover::before {
|
|
137
|
+
animation: glitch-medium-1 0.2s infinite linear alternate-reverse;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.static:hover::after {
|
|
141
|
+
animation: glitch-medium-2 0.2s infinite linear alternate-reverse;
|
|
142
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { forwardRef, HTMLAttributes } from 'react';
|
|
4
|
+
import styles from './glitch-text.module.css';
|
|
5
|
+
|
|
6
|
+
export interface GlitchTextProps extends HTMLAttributes<HTMLSpanElement> {
|
|
7
|
+
/** The text to display with glitch effect */
|
|
8
|
+
children: string;
|
|
9
|
+
/** Glitch intensity: subtle, medium, intense */
|
|
10
|
+
intensity?: 'subtle' | 'medium' | 'intense';
|
|
11
|
+
/** Glitch color (CSS color for the offset layers) */
|
|
12
|
+
glitchColor?: string;
|
|
13
|
+
/** Secondary glitch color */
|
|
14
|
+
glitchColorAlt?: string;
|
|
15
|
+
/** Disable animation (static glitch) */
|
|
16
|
+
static?: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const GlitchText = forwardRef<HTMLSpanElement, GlitchTextProps>(
|
|
20
|
+
(
|
|
21
|
+
{
|
|
22
|
+
children,
|
|
23
|
+
intensity = 'medium',
|
|
24
|
+
glitchColor = '#ff0040',
|
|
25
|
+
glitchColorAlt = '#00ffff',
|
|
26
|
+
static: isStatic = false,
|
|
27
|
+
className,
|
|
28
|
+
style,
|
|
29
|
+
...props
|
|
30
|
+
},
|
|
31
|
+
ref
|
|
32
|
+
) => {
|
|
33
|
+
return (
|
|
34
|
+
<span
|
|
35
|
+
ref={ref}
|
|
36
|
+
className={`${styles.glitch} ${styles[intensity]} ${isStatic ? styles.static : ''} ${className || ''}`}
|
|
37
|
+
data-text={children}
|
|
38
|
+
style={{
|
|
39
|
+
'--glitch-color': glitchColor,
|
|
40
|
+
'--glitch-color-alt': glitchColorAlt,
|
|
41
|
+
...style,
|
|
42
|
+
} as React.CSSProperties}
|
|
43
|
+
{...props}
|
|
44
|
+
>
|
|
45
|
+
{children}
|
|
46
|
+
</span>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
GlitchText.displayName = 'GlitchText';
|
|
52
|
+
|
|
53
|
+
export default GlitchText;
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@oalacea/chaosui",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Glitch, noise, and distortion components for React. Copy-paste like shadcn.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"chaos-ui": "./bin/cli.js",
|
|
8
|
+
"chaosui": "./bin/cli.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"bin",
|
|
12
|
+
"components"
|
|
13
|
+
],
|
|
14
|
+
"keywords": [
|
|
15
|
+
"react",
|
|
16
|
+
"components",
|
|
17
|
+
"glitch",
|
|
18
|
+
"noise",
|
|
19
|
+
"distortion",
|
|
20
|
+
"ui",
|
|
21
|
+
"effects",
|
|
22
|
+
"css",
|
|
23
|
+
"animation"
|
|
24
|
+
],
|
|
25
|
+
"author": "Oalacea",
|
|
26
|
+
"license": "MIT",
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "https://github.com/Pamacea/chaos.git"
|
|
30
|
+
},
|
|
31
|
+
"homepage": "https://github.com/Pamacea/chaos",
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"commander": "^12.0.0",
|
|
34
|
+
"picocolors": "^1.0.0",
|
|
35
|
+
"prompts": "^2.4.2",
|
|
36
|
+
"fs-extra": "^11.2.0"
|
|
37
|
+
}
|
|
38
|
+
}
|