Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Adding support for py5-web #318

Draft
wants to merge 27 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
6c75798
(WIP) Adding support for py5-web
taconi Jan 2, 2025
95a918e
Merge branch 'main' into 317-py5
taconi Jan 3, 2025
d5df23b
Adjusting compatibility with py5
taconi Jan 3, 2025
0a096b4
Increasing compatibility with the py5 api
taconi Jan 3, 2025
37959fc
Increasing compatibility with the py5 api
taconi Jan 4, 2025
13f348d
Merge branch 'main' into 317-py5
taconi Jan 5, 2025
39a3672
Update pyodide
taconi Jan 6, 2025
4092790
Fixing py5 random functions
taconi Jan 6, 2025
026dd8e
Fixing Vertex Based Shapes Functions
taconi Jan 6, 2025
7ff76c3
Creating set_println_stream function
taconi Jan 6, 2025
af1adad
Merge branch 'main' into 317-py5
taconi Jan 6, 2025
21ea669
Merge branch 'main' into 317-py5
taconi Jan 7, 2025
65ed5ed
Adding py5 copyright
taconi Jan 7, 2025
4c33543
Fix py5.println
taconi Jan 7, 2025
110bd9a
Key event support
taconi Jan 7, 2025
02f31e0
Implementing Py5Vector based on py5 code
taconi Jan 7, 2025
00a6ec9
Implementing Py5MouseEvent based on py5 code
taconi Jan 8, 2025
a936966
Merge branch 'main' into 317-py5
taconi Jan 10, 2025
f8b71ab
Merge branch 'main' into 317-py5
taconi Jan 13, 2025
fa096c0
Removing non-py5 functions
taconi Jan 20, 2025
4e2128d
Set stderr
taconi Jan 20, 2025
9fa7738
fix build
taconi Jan 20, 2025
e89faff
Adjusting py5 panicCodes
taconi Jan 25, 2025
56eddd3
Adjustment in comparison of *args
taconi Jan 26, 2025
40880d8
Remap error adjustment
taconi Jan 26, 2025
d8f5180
Removing try/except to handle events to avoid omitting errors in call…
taconi Jan 26, 2025
a55560e
Merge branch 'main' into 317-py5
taconi Jan 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
class="min-h-screen font-sans antialiased overscroll-none overflow-hidden text-slate-50"
>
<div id="root"></div>
<script src="https://cdn.jsdelivr.net/pyodide/v0.27.0/full/pyodide.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/p5.js"></script>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
27 changes: 27 additions & 0 deletions packages/web/src/components/py5-canvas.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from "react";
import { cn } from "@/lib/utils";
import { DisplaySettings } from "@/lib/display-settings";

interface Py5CanvasProps {
fullscreen?: boolean;
displaySettings: DisplaySettings;
ref: React.RefObject<HTMLCanvasElement>;
}

const Py5Canvas = ({ fullscreen, displaySettings, ref }: Py5CanvasProps) => (
<canvas
ref={ref}
className={cn(
"absolute top-0 left-0",
fullscreen && "h-full w-full block overflow-hidden",
)}
style={{
imageRendering: "pixelated",
display: displaySettings.showCanvas ? "" : "none",
}}
width={window.innerWidth / displaySettings.canvasPixelSize}
height={window.innerHeight / displaySettings.canvasPixelSize}
/>
);

export default React.memo(Py5Canvas);
Loading
Loading