diff options
author | Mohammad Amoush <mohammad_amoush@brown.edu> | 2019-07-24 11:00:09 -0400 |
---|---|---|
committer | Mohammad Amoush <mohammad_amoush@brown.edu> | 2019-07-24 11:00:09 -0400 |
commit | 5591060e868053c8839fcc1de1ae77d4dac361ac (patch) | |
tree | cd2ec5a046686e5cf481a157fbebbcc479368282 /src/client/views/nodes/FaceRectangle.tsx | |
parent | 2edcfb8a755b7fec7f937f135c794cbadbe0c94e (diff) | |
parent | 7fce10e6d687364feac6fd93a362634018a9f3ee (diff) |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into youtube-api-muhammed
Diffstat (limited to 'src/client/views/nodes/FaceRectangle.tsx')
-rw-r--r-- | src/client/views/nodes/FaceRectangle.tsx | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/client/views/nodes/FaceRectangle.tsx b/src/client/views/nodes/FaceRectangle.tsx new file mode 100644 index 000000000..887efc0d5 --- /dev/null +++ b/src/client/views/nodes/FaceRectangle.tsx @@ -0,0 +1,29 @@ +import React = require("react"); +import { observer } from "mobx-react"; +import { observable, runInAction } from "mobx"; +import { RectangleTemplate } from "./FaceRectangles"; + +@observer +export default class FaceRectangle extends React.Component<{ rectangle: RectangleTemplate }> { + @observable private opacity = 0; + + componentDidMount() { + setTimeout(() => runInAction(() => this.opacity = 1), 500); + } + + render() { + let rectangle = this.props.rectangle; + return ( + <div + style={{ + ...rectangle.style, + opacity: this.opacity, + transition: "1s ease opacity", + position: "absolute", + borderRadius: 5 + }} + /> + ); + } + +}
\ No newline at end of file |