Euclid is a creative coding playground built with ClojureScript and Quil (Processing). It allows you to create, organize, and showcase generative art sketches in a single web application.
- Node.js (for
shadow-cljs) - Java (JDK 17+ recommended for Quil 4.3+)
- Install dependencies:
npm install
- Start the development server:
npx shadow-cljs watch app
- Open your browser at http://localhost:8083.
The app supports hot-reloading, so changes to your code will appear instantly.
The project uses a Registry & Manifest pattern to manage sketches dynamically, with a clean separation between system code and user content.
System Files (in src/):
entry.cljs: The main entry point. Initializes the app and handles sketch switching logic.menu.cljs: Renders the navigation menu overlay.registry.cljs: Central atom storing all loaded sketches' configuration.manifest.cljs: The "Table of Contents". Requires all sketch namespaces so they're included in the build.utils/: Shared utility modules (e.g.,vectorop.cljsfor vector math).
User Content (in src/sketches/):
- Individual sketch files (e.g.,
flow.cljs,cross.cljs,euclid.cljs, etc.) - Each file is a standalone creative work that registers itself.
- Create a file in
src/sketches/(e.g.,mysketch.cljs). - Define your sketch using the
registry/def-sketchhelper at the bottom of your file:(ns sketches.mysketch (:require [quil.core :as q] [registry :as registry] [menu :as menu])) ;; ... your setup, update, draw functions ... (registry/def-sketch "My Sketch Name" '(100 200 255) ;; RGB Color for menu button {:host "sketch" :setup setup :draw draw :size [menu/w menu/h] :middleware [menu/show-frame-rate]})
- Register it by adding the namespace to
src/manifest.cljs:(ns manifest (:require [sketches.mysketch] ;; <-- Add this ...))
- Save, and it will automatically appear in the menu!
The project is configured to deploy to GitHub Pages automatically via GitHub Actions.
Pushing to the main branch triggers a workflow that:
- Builds the project using
shadow-cljs release prod. - Commits the artifacts to the
publishbranch. - GitHub Pages serves the content from the
publishbranch.
To build for production locally:
npx shadow-cljs release prodThis generates the optimized assets in docs/.