BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/@react-bits/ASCIIText-TS-TW

ASCIIText

react-bits/ASCIIText-TS-TW
FreeComponent

Renders text with an animated ASCII background for a retro feel.

Live preview

live · rendered by the registry
Rendered by @react-bits on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://www.reactbits.dev/r/ASCIIText-TS-TW.json

Source

ASCIIText/ASCIIText.tsxwww.reactbits.dev/r/ASCIIText-TS-TW.json · first 6 KB
1// Component ported and enhanced from https://codepen.io/JuanFuentes/pen/eYEeoyE
2
3import { useEffect, useRef } from 'react';
4import * as THREE from 'three';
5
6const vertexShader = `
7varying vec2 vUv;
8uniform float uTime;
9uniform float mouse;
10uniform float uEnableWaves;
11
12void main() {
13 vUv = uv;
14 float time = uTime * 5.;
15
16 float waveFactor = uEnableWaves;
17
18 vec3 transformed = position;
19
20 transformed.x += sin(time + position.y) * 0.5 * waveFactor;
21 transformed.y += cos(time + position.z) * 0.15 * waveFactor;
22 transformed.z += sin(time + position.x) * waveFactor;
23
24 gl_Position = projectionMatrix * modelViewMatrix * vec4(transformed, 1.0);
25}
26`;
27
28const fragmentShader = `
29varying vec2 vUv;
30uniform float mouse;
31uniform float uTime;
32uniform sampler2D uTexture;
33
34void main() {
35 float time = uTime;
36 vec2 pos = vUv;
37
38 float move = sin(time + mouse) * 0.01;
39 float r = texture2D(uTexture, pos + cos(time * 2. - time + pos.x) * .01).r;
40 float g = texture2D(uTexture, pos + tan(time * .5 + pos.x - time) * .01).g;
41 float b = texture2D(uTexture, pos - cos(time * 2. + time + pos.y) * .01).b;
42 float a = texture2D(uTexture, pos).a;
43 gl_FragColor = vec4(r, g, b, a);
44}
45`;
46
47function map(n: number, start: number, stop: number, start2: number, stop2: number) {
48 return ((n - start) / (stop - start)) * (stop2 - start2) + start2;
49}
50
51const PX_RATIO = typeof window !== 'undefined' ? window.devicePixelRatio : 1;
52
53interface AsciiFilterOptions {
54 fontSize?: number;
55 fontFamily?: string;
56 charset?: string;
57 invert?: boolean;
58}
59
60class AsciiFilter {
61 renderer: THREE.WebGLRenderer;
62 domElement: HTMLDivElement;
63 pre: HTMLPreElement;
64 canvas: HTMLCanvasElement;
65 context: CanvasRenderingContext2D | null;
66 deg: number;
67 invert: boolean;
68 fontSize: number;
69 fontFamily: string;
70 charset: string;
71 width: number = 0;
72 height: number = 0;
73 center: { x: number; y: number } = { x: 0, y: 0 };
74 mouse: { x: number; y: number } = { x: 0, y: 0 };
75 cols: number = 0;
76 rows: number = 0;
77
78 constructor(renderer: THREE.WebGLRenderer, { fontSize, fontFamily, charset, invert }: AsciiFilterOptions = {}) {
79 this.renderer = renderer;
80 this.domElement = document.createElement('div');
81 this.domElement.style.position = 'absolute';
82 this.domElement.style.top = '0';
83 this.domElement.style.left = '0';
84 this.domElement.style.width = '100%';
85 this.domElement.style.height = '100%';
86
87 this.pre = document.createElement('pre');
88// … truncated

What it pulls in

npm packages

  • three@^0.180.0

Files it writes

  • ASCIIText/ASCIIText.tsx

Facts

Registry
@react-bits
Type
registry:component
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-03
Last confirmed
today

Go to the source

Docs on @react-bits www.reactbits.dev DavidHDev/react-bits on GitHub Raw registry item This item as JSON

More from @react-bits

All 556 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
AnimatedContentAnimatedContent-JS-CSS@react-bitsComponentsFree1 dep
AnimatedContentAnimatedContent-JS-TW@react-bitsComponentsFree1 dep
AnimatedContentAnimatedContent-TS-CSS@react-bitsComponentsFree1 dep
AnimatedContentAnimatedContent-TS-TW@react-bitsComponentsFree1 dep
AnimatedListAnimatedList-JS-CSS@react-bitsComponentsFree1 dep · 2 files
AnimatedListAnimatedList-JS-TW@react-bitsComponentsFree1 dep
AnimatedListAnimatedList-TS-CSS@react-bitsComponentsFree1 dep · 2 files
AnimatedListAnimatedList-TS-TW@react-bitsComponentsFree1 dep
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex