Embed an app
For: App makers, bloggers and teachers who want a running app on their own page.
You can put any built-in app, or any program you shared, on another site. Visitors play it right there, on the real calculator simulator. It is one <iframe>, and any site may use it.
Get the code
- A built-in app: open its page, such as playplisp.com/app/tally, and press Embed. In the Workbench, the menu's Embed gives the code for the app you started from, as it was, not your changes. To embed your changes, use Share.
- Your own program: press Share in the Workbench and make a short link, then press Embed. A program needs a short link before it can be embedded, and it must be an app (it has a
defapp). Plain programs, and programs shared with a long link (as under 13), can't be embedded.
Choose what to show, press Copy, and paste the code into your page.
The code
This is the code the Embed button gives for Tally:
<iframe src="https://playplisp.com/embed/tally" width="430" height="447" title="Tally on p'lisp calc" style="border:0;max-width:100%;color-scheme:normal" loading="lazy" allow="autoplay"></iframe>
The same app with the screen alone:
<iframe src="https://playplisp.com/embed/tally?view=screen" width="480" height="248" title="Tally on p'lisp calc" style="border:0;max-width:100%;color-scheme:normal" loading="lazy" allow="autoplay"></iframe>
The address is https://playplisp.com/embed/ and then one of these:
- A built-in app: its id, as in
/embed/tally. - A shared program:
s/and the code from its short link. A short linkhttps://playplisp.com/s/<code>embeds ashttps://playplisp.com/embed/s/<code>.
Options
Add these to the address, after a ?, and join two with &.
view | Shows | Size in the code |
|---|---|---|
face (the default) | The whole calculator | 430 by 447 |
screen | The screen alone | 480 by 248 |
theme picks the colours: midnight, vapor-sunset, vapor-arcade, ocean, forest, coal. Without it the page uses vapor-arcade. For example https://playplisp.com/embed/snake?view=screen&theme=ocean.
Size. The width and height in the code fit the view you chose. The calculator keeps its shape in whatever size you give it, at the top and centred across, and max-width:100% lets it shrink on a phone.
Sound. The app starts with the sound off. A visitor turns it on with SHIFT then 0. Keep allow="autoplay" in the code so the sound can play.
The built-in apps
| App | Its id |
|---|---|
| Snake | snake |
| Paddle | paddle |
| Runner | runner |
| Flameball | flameball |
| Rock Paper Scissors | rps |
| Flap | flap |
| Slipstream | slipstream |
| Deep dive | deepdive |
| Resistor | resistor |
| Tally | tally |
| Timer | timer |
| Converter | converter |
| Bits | bits |
| Plot | plot |
| Steps | steps |
| Beam | beam |
What visitors get
- A built-in app starts by itself.
- A shared program waits until the visitor presses Play, so nothing runs before they ask.
- The program stays yours. If a shared program is removed, it no longer loads on any site, and the frame says so.
- Nothing is kept. The embed sets no cookie, stores nothing in the visitor's browser and keeps no log. A link in the frame's corner takes visitors to the app on playplisp.com.
Controlling it from your page
Not yet. Your page can show the embed but can't send it keys or read its screen. Only playplisp.com's own pages can do that.