next-js example (just to check it works)

This commit is contained in:
Gaëtan Renaudeau 2018-02-25 10:09:01 +01:00
parent dab6ded6d0
commit c8a6d00e29
4 changed files with 4248 additions and 0 deletions

2
examples/next-js/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
node_modules
.next/

View File

@ -0,0 +1,19 @@
{
"name": "next-js",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"private": true,
"scripts": {
"dev": "next",
"build": "next build",
"start": "next start"
},
"dependencies": {
"gl-react": "3.14.0-beta.dab6ded6",
"gl-react-dom": "3.14.0-beta.dab6ded6",
"next": "^5.0.0",
"react": "^16.2.0",
"react-dom": "^16.2.0"
}
}

View File

@ -0,0 +1,27 @@
import React from "react";
import { Shaders, Node, GLSL } from "gl-react";
import { Surface } from "gl-react-dom";
const shaders = Shaders.create({
helloBlue: {
frag: GLSL`
precision highp float;
varying vec2 uv;
uniform float blue;
void main() {
gl_FragColor = vec4(uv.x, uv.y, blue, 1.0);
}`
}
});
class HelloBlue extends React.Component {
render() {
const { blue } = this.props;
return <Node shader={shaders.helloBlue} uniforms={{ blue }} />;
}
}
export default () => (
<Surface width={300} height={300}>
<HelloBlue blue={0.5} />
</Surface>
);

4200
examples/next-js/yarn.lock Normal file

File diff suppressed because it is too large Load Diff