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
<div id="rip-target"></div>
<script src="ripscrip.js"></script>
<script>
const viewer = new RipScripViewer("#rip-target", {
scale: 2
});
viewer.renderString("!|*|c0F|@0505Hello RIPscrip|c0C|C50280F");
</script><div id="rip-target"></div>
<script src="ripscrip.js"></script>
<script>
const viewer = new RipScripViewer("#rip-target", {
scale: 2,
proxy: "/rip-proxy.php?url="
});
async function renderRemote() {
await viewer.renderUrl("https://files.artpacks.org/2005/sadist05.zip/k%21triump.rip");
}
renderRemote().catch(console.error);
</script>const viewer = new RipScripViewer(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);
await viewer.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.