
/g,">").replace(/"/g,""").replace(/'/g,"'")}let o={},c=[];function m(e,n,t){o={...o,dynamic:e,core:n,leinProject:t}}function d(){c=["wh","with-style"]}window.onload=()=>{let{dynamic:n,core:t,leinProject:a}=o;if(n&&(document.getElementById("code-dynamic").innerHTML=l(n)),t&&(document.getElementById("code-core").innerHTML=l(t)),a&&(document.getElementById("code-lein-project").innerHTML=l(a)),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=l(n)}e(r).addPlugin((0,s.number)()),e(r).highlightAll()}}),s("2tEiH",function(e,t){n(e.exports,"number",()=>a);let a=e=>({"after:highlightElement":({el:e,result:n,text:t})=>{let a=n.value.split("\n");a.pop();let r=a.length.toString().length,i=a.map((e,n)=>{let t=(n+1).toString().padStart(r);return`${e}`}).join("\n");e.innerHTML=i}})}),i("d3dEA"),i("7Y8VX");var l=i("gUHNU");(0,l.make)("(ns sketch.dynamic\n (:require ; [clojure.java.shell :refer [sh]]\n ; [genartlib.algebra :refer :all]\n ; [genartlib.curves :refer :all]\n ; [genartlib.geometry :refer :all]\n ; [genartlib.random :refer :all]\n ; [kdtree :as kd]\n [easings.core :as ease]\n [artlib.quil.global :refer :all]\n [artlib.noise.opensimplex :refer [noise4 noise4-norm]]\n [genartlib.util :refer [w h]]\n [quil.core :as q]))\n\n(let [spacing 0.5\n steps 500\n amt 0.2\n freq (* Math/TAU (/ 1 spacing))\n x-amt 2\n y-amt 6\n slope (/ y-amt x-amt)\n a (->> (range -1 2 spacing)\n (map (fn [x0]\n (map #(let [t %\n x (+ x0 (* x-amt t))\n x (+ x (* amt (Math/sin (* t 2 freq))))\n y (* t y-amt)]\n [x y]) \n (range -0.2 1 (/ 1 steps)))))\n (map #(with-meta % {:slope (/ y-amt x-amt)})))\n b (->> (range -1 2 spacing)\n (map (fn [x0]\n (map #(let [t %\n x (+ x0 (* -1 x-amt t))\n x (+ x (* amt (Math/cos (+ (* t freq) (* t 5)))))\n y (* t y-amt)]\n [x y]) \n (range -0.2 1 (/ 1 steps)))))\n (map #(with-meta % {:slope (/ y-amt x-amt -1)})))]\n (defn draw [state]\n (q/background 0 0 94)\n (let [frame (:frame state)\n f (/ frame 300)\n lines (->> (concat a b)\n (map #(let [line %\n slope (:slope (meta line))\n norm (/ -1 slope)\n n2 (+ norm Math/PI)\n n (noise4 (* 25 (Math/cos (* f Math/TAU))) \n (* 25 (Math/sin (* f Math/TAU))) \n 1.1 \n 2.2)\n offset (->> line\n (map (fn [[x y]]\n (let [t (- f (q/dist x y 0.5 0.5)) \n amt (+ 0.001 \n (* 0.005\n (noise4-norm \n (* 5 (Math/cos (* t Math/TAU)))\n (* 3 (Math/sin (* t Math/TAU)))\n 3.17 2.41)))]\n [(+ x (* amt (Math/cos norm)))\n (+ y (* amt (Math/sin norm)))])))\n reverse)\n line (->> line\n (map (fn [[x y]]\n (let [t (- f (q/dist x y 0.5 0.5)) \n amt (+ 0.001 \n (* 0.005\n (noise4-norm \n (* 3 (Math/cos (* t Math/TAU)))\n (* 3 (Math/sin (* t Math/TAU)))\n 3.17 2.41)))]\n [(+ x (* amt (Math/cos n2)))\n (+ y (* amt (Math/sin n2)))]))))]\n (concat line offset))))]\n (dotimes [i 6]\n (with-style\n (q/fill 0 0 (+ 30 (* 10 i)) 0.3)\n (doseq [x (range 0 1.1 0.005)]\n (doseq [y (range 0 1.1 0.005)]\n (let [n (ease/ease-in-out-quart \n (noise4 (* x 5) (* y 5) 1.3 (+ 5.7 (* 0.03 i))))\n dist (- f (q/dist x y 0.5 0.5))\n dx (noise4 (Math/cos (* dist Math/TAU)) (Math/sin (* dist Math/TAU)) 3.2 1.9)\n dy (noise4 (Math/cos (* dist Math/TAU)) (Math/sin (* dist Math/TAU)) 2.2 3.1)\n x (+ x (* 0.01 dx))\n y (+ y (* 0.01 dy))]\n (when (< 0.01 n)\n (q/ellipse (w x) (h y) (w 0.01) (h 0.01))))))))\n\n (dotimes [n 5]\n (with-style\n (q/fill 200 10 10 0.5)\n (doseq [line lines]\n (q/begin-shape)\n (doseq [[x y] line]\n (let [dx (* 0.01 (noise4 (* 5 (Math/cos x))\n (* 5 (Math/sin y))\n 3.1 (* 1.2 n)))\n dy (* 0.01 (noise4 (* 5 (Math/cos x))\n (* 5 (Math/sin y))\n 1.2 (* 3.4 n)))\n x (+ x dx)\n y (+ y dy)]\n (q/vertex (w x) (h y))))\n (q/end-shape)))))))\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(q/defsketch example\n :title "genuary-2024-01-15"\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-15 "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.14"]\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,l.withDefaultHelpers)();
dynamic.clj
core.clj
helpers
project.clj