A lightweight JavaScript RIPscrip renderer with a reusable API, a standalone viewer, examples, and an optional PHP URL proxy.
ripscrip.js— reusable JavaScript APIripscrip-viewer.html— standalone browser UI usingripscrip.jsripscrip-example.html— programmatic usage example usingripscrip.jsrip-proxy.php— optional same-origin proxy for remote RIP URLsREADME.md— this file
Open:
ripscrip-viewer.html
The standalone viewer uses ripscrip.js for all RIP rendering. It provides:
- local file upload
- remote URL loading
- optional proxy endpoint
- source textarea
- canvas scale control
- PNG export
<divid="rip-target"></div><scriptsrc="ripscrip.js"></script><script>constviewer=newRipScripViewer("#rip-target",{scale: 2});viewer.renderString("!|*|c0F|@0505Hello RIPscrip|c0C|C50280F");</script><divid="rip-target"></div><scriptsrc="ripscrip.js"></script><script>constviewer=newRipScripViewer("#rip-target",{scale: 2,proxy: "/rip-proxy.php?url="});asyncfunctionrenderRemote(){awaitviewer.renderUrl("https://files.artpacks.org/2005/sadist05.zip/k%21triump.rip");}renderRemote().catch(console.error);</script>constviewer=newRipScripViewer(target,options);Options:
target— DOM element or CSS selectorscale— display scale multiplier, default1proxy— optional proxy endpoint for remote URL loadingappend— iffalse, clears target before inserting the canvasclassName— class applied to the generated canvas
viewer.renderString(ripText);awaitviewer.renderUrl(url);viewer.clear();viewer.setScale(3);viewer.toDataURL();renderString() and renderUrl() return:
{canvas,commands,unsupported,skipped,messages}Direct browser fetches to third-party RIP URLs usually fail unless the remote server sends CORS headers.
Use the included rip-proxy.php on the same origin as your page:
proxy: "/rip-proxy.php?url="This renderer supports a practical subset of RIPscrip commands, including common drawing primitives used by legacy RIP art files. It is intended as a lightweight browser renderer rather than a full RIPTerm clone.