Last active
March 21, 2024 10:14
-
-
Save langolf/0a827739b2bcd8faadb564c1ae4c3dd2 to your computer and use it in GitHub Desktop.
reac
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { CanvasSpace, Pt } from 'pts'; | |
const space = new CanvasSpace('#app'); | |
const form = new space.getForm(); | |
space.add((time, ftime) => { | |
let pt = new Pt(space.center); | |
form.fill('red').point(pt, 10, 'circle'); | |
}); | |
space.bindMouse().play(); | |
const Button = props => <button {...props}>Press me</button>; | |
export default function App() { | |
return ( | |
<main | |
style={{ | |
width: '100vw', | |
height: '100vh', | |
}} | |
> | |
<h1>Header</h1> | |
<Button onClick={() => console.log('gu')} /> | |
<div | |
id="app" | |
style={{ | |
width: 500, | |
height: 200, | |
position: 'absolute', | |
top: '50%', | |
left: '50%', | |
transform: 'translate(-50%, -50%)', | |
border: '1px dashed yellow', | |
}} | |
></div> | |
</main> | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"scripts": [ | |
"react", | |
"react-dom" | |
], | |
"styles": [] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment