File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 5454 function runDefaultSketch ( ) {
5555 // Simple colorful Hydra sketch
5656 // Creates flowing gradients with rotation
57- osc ( 10 , 0.1 , 1.2 )
57+ const defaultCode = ` osc(10, 0.1, 1.2)
5858 .color(0.9, 0.7, 0.8)
5959 .diff(osc(12, 0.08)
6060 .rotate(0.3))
6161 .modulateScale(osc(2)
6262 .rotate(() => time * 0.05), 0.5)
6363 .blend(o0, 0.4)
64- . out ( o0 ) ;
64+ .out(o0)` ;
65+
66+ eval ( defaultCode ) ;
67+ // Save as current sketch so it persists through resize
68+ window . currentSketch = defaultCode ;
6569 }
6670
6771 // Function to update Hydra sketch with new code
7680 // Evaluate the new sketch code
7781 eval ( code ) ;
7882
83+ // Save the current sketch code for resize events
84+ window . currentSketch = code ;
85+
7986 // Notify parent that sketch was updated successfully
8087 if ( window . parent ) {
8188 window . parent . postMessage ( {
You can’t perform that action at this time.
0 commit comments