                      (classes/remove pause-button "invisible")))
     (events/listen pause-button EventType/CLICK
                    (fn []
-                     (pause-after-next-frame sketch)
+                     (q/with-sketch sketch
+                       (q/no-loop))
                      (classes/remove play-button "hidden")
                      (classes/add pause-button "invisible")))))
 

                        (str "by " author))
    (let [sketch (run-fn (query-selector host ".canvas-container") 200)]
      (when (should-start-paused?)
        (setup-play-pause-functionality host sketch))
        (when white-play-button?
          (classes/add (query-selector host ".play") "white")))))

(defn register-example! [name author run-fn &
                         {:keys [interactive? display-name]

  (->> (cstr/replace name " " "-")
       (str "/sketches/show/example_")))

(defn should-start-paused? []
  (boolean (query-selector ".container.examples-page")))

(defn setup-play-pause-functionality [host sketch]
  (let [play-button (query-selector host ".play")
        pause-button (query-selector host ".pause")]
    (classes/remove play-button "hidden")
