diff --git a/client/src/animations.test.js b/client/src/animations.test.js index 6ea4ccec..bc36db15 100644 --- a/client/src/animations.test.js +++ b/client/src/animations.test.js @@ -2,11 +2,13 @@ const preact = require('preact'); const TrippyTriangle = require('./components/svgs/trippy.triangle'); const Amplify = require('./components/svgs/amplify'); +const Hex = require('./components/svgs/hex'); const Animations = () => (
+
); diff --git a/client/src/components/svgs/hex.jsx b/client/src/components/svgs/hex.jsx new file mode 100644 index 00000000..4904079e --- /dev/null +++ b/client/src/components/svgs/hex.jsx @@ -0,0 +1,61 @@ +const preact = require('preact'); +const { Component } = require('preact'); + +class TrippyTriangle extends Component { + constructor() { + super(); + this.state = { delta: 0 }; + this.progress = this.progress.bind(this); + } + + render() { + const { delta } = this.state; + + const curvePoint = 200 * Math.sin(delta); + + const curve = min => min * 2 + (min / 2) * Math.sin(delta); + + return ( + + + + + + + + + ); + } + + progress() { + const delta = this.state.delta + 0.1; + this.setState({ delta }); + requestAnimationFrame(this.progress); + } + + componentDidMount() { + requestAnimationFrame(this.progress); + } + + componentWillUnmount() { + // clearAnimation(this.props.id); + } +} + +module.exports = TrippyTriangle;