• Stars
    star
    402
  • Rank 107,380 (Top 3 %)
  • Language
    TypeScript
  • Created almost 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

WebGL effects for React elements
REACT-VFX

REACT-VFX: WebGL effects for React elements!!



Install

npm i -S react-vfx

Usage

REACT-VFX exports VFXSpan, VFXImg and VFXVideo. These components works just like <span>, <img> and <video> - accepts all properties they have, but they are rendered in WebGL world with shader effects!

import * as VFX from 'react-vfx';

export default () => (
    <VFX.VFXProvider>
        {/* Render text as image, then apply the shader effect! */}
        <VFX.VFXSpan shader="rainbow">Hi there!</VFX.VFXSpan>

        {/* Render image with shader */}
        <VFX.VFXImg src="cat.png" alt="image" shader="rgbShift"/>

        {/* It also supports animated GIFs! */}
        <VFX.VFXImg src="doge.gif" shader="pixelate"/>

        {/* and videos! */}
        <VFX.VFXVideo src="mind_blown.mp4"
            autoplay playsinline loop muted
            shader="halftone"/>
    </VFX.VFXProvider>
);

NOTE: VFXSpan doesn't work if the content includes child nodes.

// OK
<a href="https://example.com"><VFXSpan>Yo</VFXSpan></a>

// NG: link styles are not rendered correctly
<VFXSpan><a href="https://example.com">Yo</a></VFXSpan>

Custom Shader

import { VFXSpan } from 'react-vfx';

const blink = `
uniform vec2 resolution;
uniform vec2 offset;
uniform float time;
uniform sampler2D src;

void main() {
    vec2 uv = (gl_FragCoord.xy - offset) / resolution;
    gl_FragColor = texture2D(src, uv) * step(.5, fract(time));
}
`;

export default = () => (
    <VFXSpan shader={blink}></VFXSpan>
);

Future work

  • Passing custom uniforms
  • Passing custom textures

Author

AMAGI

LICENSE

MIT

More Repositories

1

veda

โšกVJ / Live Coding on Atomโšก
TypeScript
470
star
2

vedajs

Framework for Shader Arts
TypeScript
139
star
3

kao

CLI kaomoji searcher
JavaScript
74
star
4

MDMT

๐Ÿ’ŠMarkdown Document Template๐Ÿ’Š
TypeScript
67
star
5

node-aviglitch

A node.js porting of aviglitch rubygem by ucnv.
JavaScript
63
star
6

json-editor-app

Dead simple JSON editor using josdejong/jsoneditor
TypeScript
54
star
7

irasutoya

ใ„ใ‚‰ใ™ใจใ‚„ๆคœ็ดขใ‚ณใƒžใƒณใƒ‰
JavaScript
53
star
8

BRDG20180827

A Unity-VJ system created for ADIRECTOR CHANNEL, 2018-08-27.
C#
48
star
9

glsl2img

GLSL image converter
JavaScript
45
star
10

lolipop

loli pop song player
JavaScript
41
star
11

react-hands-on

FRONTEND CONFERENCE 2017 - Reactใƒใƒณใ‚บใ‚ชใƒณ็”จใƒฌใƒใ‚ธใƒˆใƒช
JavaScript
39
star
12

webgl-study

GLSL
36
star
13

eslint-plugin-no-zangyo

ๆœฌๆ—ฅใฏใƒŽใƒผๆฎ‹ๆฅญใƒ‡ใƒผใงใ™
JavaScript
25
star
14

UnityMaskShader

Mask shader for installation apps.
C#
22
star
15

aozora

CLI for Aozora Bunko ๐Ÿ“š
JavaScript
21
star
16

evil

DAW in Web Audio API
JavaScript
20
star
17

react-infinite-scroll-container

A simple component for infinite scroll
JavaScript
20
star
18

jovi-jovi

Rust
15
star
19

glslify-lite

A fast, lightweight fork of glslify
TypeScript
15
star
20

veda-vscode

โ˜ EXPERIMENTALโ˜  vscode port of VEDA
TypeScript
15
star
21

VEDA-InfiniteRave

GLSL
13
star
22

anylint

๐Ÿ”ฎLinter for any languages๐Ÿ”ฎ
JavaScript
12
star
23

console-tube

Watch Youtube from Google Chrome debug console.
JavaScript
11
star
24

veda-toplapjp02

GLSL
11
star
25

vfx-graph-study

C#
10
star
26

veda.gl

VEDA Website
JavaScript
10
star
27

md2hatena

Markdown to Hatena Syntax converter
JavaScript
10
star
28

async-node

Run Node.js scripts wrapped with async function
JavaScript
9
star
29

cyro

JavaScript
8
star
30

algorave2017

VJ set for Algorave Tokyo 2017
GLSL
8
star
31

glsl-livecoder-examples

Examples for glsl-livecoder
GLSL
8
star
32

veda-physarum

Physarum simulation based on Sage Jenson's article
GLSL
7
star
33

linter-glslify

๐Ÿ’ซGLSL linter for Atom, powered by glslify๐Ÿ’ซ
TypeScript
7
star
34

clonepool

Git clone and branch manager
Scala
6
star
35

what-do-i-depend-on

See what you depend on.
JavaScript
6
star
36

youstream

a wrapper of youtube-dl, returns a stream
JavaScript
6
star
37

hatena-blog-theme-boilerplate

A boilerplate for Hatena Blog theme using Sass and ITCSS.
Shell
6
star
38

byob-kyoto-2018

LET ้ดจๅท BE LIGHT
6
star
39

color-of-the-year

List of Pantone's Color of the Year.
JavaScript
5
star
40

MUTEK2018

5
star
41

mokugyo

cookieclicker palody
JavaScript
5
star
42

meetup-todo

ๅ‹‰ๅผทไผšใฎTODOใƒชใ‚นใƒˆใ ใ‚ˆ๏ผใฟใ‚“ใชPullReqใ—ใฆใญ๏ผ
5
star
43

launchpad-to-osc

Use launchpad mini as mixer
JavaScript
5
star
44

UnityLaserShader

C#
5
star
45

glitch-you-avi

"glitch you" avi version
C++
5
star
46

eslint-plugin-only-ascii

Detect non-ascii characters in the source code.
JavaScript
5
star
47

UnitySceneSwitcher

Scene Switcher works on HDRP
Mathematica
4
star
48

vj-nodefest2017

VJ set for Nodefest at Tokyo, 2017-11-25
GLSL
4
star
49

veda-dommune201903

VJ set for DOMMUNE on 2019-03-21
GLSL
4
star
50

vj-little-forest

VJ set for little forest at Kyoto, 2017-11-10
GLSL
4
star
51

osc-to-midi-rust

Rust
4
star
52

veda-glsl-effects

My GLSL Sandbox
GLSL
4
star
53

flumpt-traveler

Time travel middleware for mizchi/flumpt
JavaScript
4
star
54

riffseq

simple sequencer with riffwave
JavaScript
4
star
55

my-twitter-snapshot

3
star
56

react-svgporn

A react wrapper for SVG PORN logos
JavaScript
3
star
57

npmenv

Shell
3
star
58

spektra4

GLSL
3
star
59

Pagelang

brainf*** w/ pager
JavaScript
3
star
60

wp-theme-template

WordPressใƒ†ใƒผใƒž็ทจ้›†็”จใƒ†ใƒณใƒ—ใƒฌใƒผใƒˆ
CSS
3
star
61

nextbook

GitBook-like Site Generator w/ Next.js
JavaScript
3
star
62

find-nearby-twitterer

Rust
3
star
63

ZIGSIM-NDI-Test

C#
3
star
64

glslschool

GLSL
2
star
65

vedajs-capture

vedajs + ccapture.js example
GLSL
2
star
66

EventEmitterDecorator

EventEmitter mixin as ES7 decorator
JavaScript
2
star
67

video-diff-checker

A CLI tool to compare diffs between video files.
JavaScript
2
star
68

post-internet

Chrome extension for post-processing the internet
JavaScript
2
star
69

language-hatena

Syntax highlighting and snippets for Hatena Notation (ใฏใฆใช่จ˜ๆณ•).
JavaScript
2
star
70

wd3

webdriverio v3 test
JavaScript
2
star
71

notan-alpha-on-render-texture-test

Rust
2
star
72

dare

Ruby
2
star
73

ZIGSIM-Parallax

C#
2
star
74

glsl-livecoder-kyotojs13

GLSL
2
star
75

ZIGSIM-VRM-Test

C#
2
star
76

glslang-validator-prebuilt

NPM wrapper for glslangValidator
JavaScript
2
star
77

nvidia-smi-chart

JavaScript
2
star
78

ZIGSIMPRO-Depth-examples

2
star
79

cybozu-to-google

JavaScript
2
star
80

restore-the-order-theme

Keynote theme for my presentation at Nodefest2015 https://speakerdeck.com/fand/hurontoendonizhi-xu-woqu-rili-sufang-fa
2
star
81

5000choyen-cli

JavaScript
1
star
82

circle-text

โ’ธโ“„โ“ƒโ“‹โ’บโ“‡โ“‰ใ€€โ’ธโ’ฝโ’ถโ“‡โ“ˆใ€€โ“‰โ“„ใ€€โ’บโ“ƒโ’ธโ“โ“„โ“ˆโ’บโ’นใ€€โ’ธโ’ฝโ’ถโ“‡โ“ˆ
JavaScript
1
star
83

blend-mode-test

1
star
84

veda-kyotojs14

GLSL
1
star
85

veda-server-bug

repo for debug server mode
GLSL
1
star
86

BlenderKiraShader

1
star
87

image-to-sdf

TypeScript
1
star
88

wasynth

Synthesizer with Web Audio API
JavaScript
1
star
89

evil2

JavaScript
1
star
90

sample-node

An easy sampler AudioNode
JavaScript
1
star
91

fand-icon

1
star
92

scatterfont

glitch svg webfont
HTML
1
star
93

QiitaSort

Add sort button to Qiita search
JavaScript
1
star
94

deno-sandbox

TypeScript
1
star
95

fand.github.io

user page
HTML
1
star
96

pixelmatcher

JavaScript
1
star
97

glide

Rust
1
star
98

css-orbit-controls

TypeScript
1
star
99

veda-obj-examples

GLSL
1
star
100

othello

js othello
JavaScript
1
star