/g,">").replace(/"/g,""").replace(/'/g,"'")}let a={},c=[];function d(e,n,t){a={...a,dynamic:e,core:n,leinProject:t}}function u(){c=["wh","with-style"]}window.onload=()=>{let{dynamic:n,core:t,leinProject:i}=a;if(n&&(document.getElementById("code-dynamic").innerHTML=o(n)),t&&(document.getElementById("code-core").innerHTML=o(t)),i&&(document.getElementById("code-lein-project").innerHTML=o(i)),c){let e={wh:';; Copyright (c) 2016 Tyler Hobbs\n;; MIT License\n;; https://github.com/thobbs/genartlib/\n(defn h\n "Returns a given percentage of the height Quil-specific."\n ([] (h 1.0))\n ([percentage] (* (height) percentage)))\n\n;; Copyright (c) 2016 Tyler Hobbs\n;; MIT License\n;; https://github.com/thobbs/genartlib/\n(defn w\n "Returns a given percentage of the width. Quil-specific."\n ([] (w 1.0))\n ([percentage] (* (width) percentage)))\n',"with-style":"(defmacro with-style [& body]\n `(do\n (q/push-style)\n (try\n ~@body\n (finally (q/pop-style)))))\n"},n=c.map(n=>e[n]).join("\n");document.getElementById("code-helpers").innerHTML=o(n)}e(r).addPlugin((0,l.number)()),e(r).highlightAll()}}),l("2tEiH",function(e,t){n(e.exports,"number",()=>i);let i=e=>({"after:highlightElement":({el:e,result:n,text:t})=>{let i=n.value.split("\n");i.pop();let r=i.length.toString().length,s=i.map((e,n)=>{let t=(n+1).toString().padStart(r);return`${e}`}).join("\n");e.innerHTML=s}})}),s("d3dEA"),s("7Y8VX");var o=s("gUHNU");(0,o.make)('(ns sketch.dynamic\n (:require [clojure.string :as string]\n [artlib.quil.global :refer :all]\n [artlib.color.dictionary :as cd]\n [easings.core :as ease]\n [genartlib.util :refer [w h]]\n [quil.core :as q]))\n\n(let [color-dict (cd/init)\n palette (cycle (cd/get-combination-hsb color-dict :332))\n\n this-file (slurp "src/clj/sketch/dynamic.clj")\n text (->> this-file\n (string/split-lines)\n (filter (complement string/blank?))\n (map string/trim)\n (string/join " "))\n len (- (count text) 85)\n line-len (int (/ len 42))\n \n lines (loop [source text\n dest ""\n len line-len]\n (if-let [whitespace-idx (string/index-of source " " (dec len))]\n (let [left (.substring source 0 whitespace-idx)\n right (.substring source whitespace-idx)\n delta (- line-len (count left))\n dest (str dest "\\n" (string/trimr left))\n source (string/triml right)]\n (if (> (count source) 0)\n (recur source dest (+ line-len delta))\n dest))\n (str dest "\\n" source)))\n lines (string/trim lines)]\n (defn draw [state]\n (q/background 0 0 10)\n (let [frame (:frame state)\n f (/ frame 300)\n y0 0.04\n font-size 22\n font (q/create-font "Source Code Pro" font-size)]\n\n (q/text-font font font-size)\n (doseq [[idx line] (map-indexed vector (string/split-lines lines))]\n (let [line-height (* (/ (+ (q/text-descent) (q/text-ascent)) (q/height)) 1.15)\n y (+ y0 (* line-height idx))\n amt (+ 1e-3 (ease/ease-in-out-sine (* 0.3 (Math/sin (* f Math/PI)))))]\n\n (dotimes [n 5]\n (let [jitter (+ (* amt 0.01) 0.001)\n x (gauss 0.01 jitter)\n y (gauss y jitter)]\n (with-style\n (q/fill 0 0 100 0.15)\n (q/text (format "%2s %s" (inc idx) line) (w 0.01) (h y)))))\n\n (dotimes [n 5]\n (let [color (first (drop (int (* 55 (q/noise n (* f 0.2)))) palette))\n n2 (* 0.3 (Math/cos (* n f Math/TAU)))\n y (+ y (* 0.01 (- (q/noise n) 0.5)))\n x-offset (* amt\n (ease/ease-out-quint\n (+ 1 (Math/cos (+ n2 (* idx -0.1) (* f Math/TAU))))))]\n (with-style\n (apply q/fill (concat color [0.5]))\n (q/text (str " " line) (w (+ 0.01 x-offset)) (h y))))))))))\n','(ns sketch.core\n (:require [artlib.quil.middleware :refer [animation-mode]]\n [clojure.core.matrix :refer [set-current-implementation]]\n [quil.middleware :as qm]\n [sketch.dynamic :as dynamic]\n [quil.core :as q]))\n\n(set-current-implementation :vectorz)\n(println)\n\n(q/defsketch example\n :title "genuary-2025-03"\n :setup (fn [] {})\n :draw dynamic/draw\n :update identity\n :size [1080 1080]\n :animation {:render? true :dirname "1"}\n :middleware [qm/fun-mode animation-mode])\n\n','(defproject genuary-2025-01-03 "0.1.0-SNAPSHOT"\n :description "FIXME: write description"\n :url "https://example.com/FIXME"\n :license {:name "Apache License, Version 2.0"\n :url "https://www.apache.org/licenses/LICENSE-2.0.html"}\n :dependencies [[org.clojure/clojure "1.11.1"]\n [com.dedovic/artlib-core "0.0.10"]\n [com.dedovic/easings-clj "0.1.0"]\n [genartlib/genartlib "1.0.0"]] ; utility functions\n :jvm-opts ["-Xms4000m" "-Xmx4000M" ; 4GB heap size\n "-server"\n "-Dsun.java2d.uiScale=1.0"] ; adjust scaling for high DPI displays\n :source-paths ["src/clj"]\n :java-source-paths ["src/java"]\n :resource-paths ["resources"])\n'),(0,o.withDefaultHelpers)();
dynamic.clj
core.clj
helpers
project.clj