Skip to content

Commit 443d7e0

Browse files
ZDStudiosclaude
authored andcommitted
Add a single file browser demo
Nothing to install and nothing to download: index.html is a small standalone version of the same idea, in about 1600 lines of HTML, CSS and JavaScript with no dependencies and no build step. It carries over the parts that matter: the Scratch 3 shapes drawn as SVG paths from the same puzzle geometry, one continuous drawer that glides between sections, dragging with snapping, C shaped mouths, reporters that drop into slots, and the Python appearing live beside you to copy or save. A small interpreter means Run really works in the page, and clicking a loose block still reports its answer in a bubble. Each block is described once and that description drives all three things: how it is drawn, the Python it generates and how it runs. Pointer events throughout, so a mouse, a pen or a finger all work. Twenty six blocks across five categories. Everything else stays in the desktop app, which the page links to. The glide and the interpreter step on timers rather than animation frames, so both still finish properly in a background tab where no frames are drawn. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 8212381 commit 443d7e0

2 files changed

Lines changed: 1636 additions & 0 deletions

File tree

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ Python standard library**.
3131
python scratchpy_studio.py
3232
```
3333

34+
### 👉 [Try the browser demo](https://zdstudios.github.io/scratchpy-studio/) — no install, nothing to download
35+
36+
[`index.html`](index.html) is a small standalone version of the same idea: one
37+
file, no dependencies, no build step. Drag blocks, watch the Python appear, press
38+
Run and it executes right there in the page. It is a taste of the real thing —
39+
the desktop app has 148 blocks, pip, file handling and the rest.
40+
3441
---
3542

3643
## Why it is different
@@ -333,6 +340,32 @@ finally runs the generated example program and checks its output.
333340

334341
---
335342

343+
## The browser demo
344+
345+
[`index.html`](index.html) is a self-contained demo you can open by
346+
double-clicking it, or visit at
347+
**[zdstudios.github.io/scratchpy-studio](https://zdstudios.github.io/scratchpy-studio/)**.
348+
349+
It shares the desktop app's ideas in about 1,600 lines of HTML, CSS and
350+
JavaScript with **no dependencies and no build step**:
351+
352+
* the same Scratch 3 shapes, drawn as SVG paths from the same puzzle geometry
353+
* one continuous drawer that glides between sections
354+
* drag, snap, C-shaped mouths, reporters that drop into slots
355+
* the Python it makes, updating live beside you — copy it or save it as a `.py`
356+
* a small interpreter so **Run** actually works in the page, and clicking a loose
357+
block still shows its answer in a bubble
358+
359+
Each block is described once, and that single description drives all three
360+
things: how it is drawn, the Python it generates, and how it runs. It works with
361+
a mouse, a pen or a finger.
362+
363+
The demo keeps 26 blocks across five categories. Everything else — the other
364+
120 blocks, pip, the venv, files, the web blocks, the Python importer, the MCP
365+
server — lives in the desktop app.
366+
367+
---
368+
336369
## What it puts on disk
337370

338371
| Name | What it holds |

0 commit comments

Comments
 (0)