Foreplay — toys to test the water
This is an exhibition of games and tools written in Sex, that are capable to run in the browser.
Layout
The page is static, a toy is one folder, each toy keeps its own Emscripten runtime.
index.html gallery shell
site.css
site.js menu, hash, frame, source
toys.json the menu
toys/<id>/
<id>.sex
index.html what the frame loads
<id>.js
<id>.wasm
toys.json is a list:
[
{
"id": "triangle",
"title": "Triangle",
"blurb": "The basic thing in games.",
"source": "triangle.sex"
}
]
id is the folder name and the hash (#triangle). source is the Sex
file the source button shows. Leave source out when a toy has nothing
to show.
Serve this directory with any static file server:
python3 -m http.server
Opening index.html from disk will not load toys.json.
Adding a toy
- Put the program at
toys/<id>/<id>.sex. - Compile it with
sexc, then Emscripten, and writeindex.html,<id>.js, and<id>.wasminto that same folder. - Add an entry to
toys.json.
The wasm and the generated page stay in the repo, so the gallery is only files.
Description
Languages
JavaScript
44.9%
CSS
42.6%
HTML
12.5%