mirror of
https://github.com/gre/gl-react.git
synced 2026-01-25 16:43:36 +00:00
25 lines
540 B
JavaScript
25 lines
540 B
JavaScript
const React = require("react");
|
|
const GL = require("gl-react");
|
|
|
|
class Transition extends React.Component {
|
|
render () {
|
|
const { width, height, shader, progress, from, to, uniforms } = this.props;
|
|
const scale = window.devicePixelRatio;
|
|
return <GL.View
|
|
shader={shader}
|
|
width={width}
|
|
height={height}
|
|
opaque={false}
|
|
uniforms={{
|
|
progress,
|
|
from,
|
|
to,
|
|
...uniforms,
|
|
resolution: [ width * scale, height * scale ]
|
|
}}
|
|
/>;
|
|
}
|
|
}
|
|
|
|
module.exports = Transition;
|