From 036fcf62080887cd18fb8b46cef00b9f3db810be Mon Sep 17 00:00:00 2001 From: Mattia <82611659+Xhst@users.noreply.github.com> Date: Mon, 8 Apr 2024 21:01:01 +0000 Subject: [PATCH] gh-pages --- index.html | 2 +- mandelbrot-set.js | 1 - multibrot-set.js | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 mandelbrot-set.js create mode 100644 multibrot-set.js diff --git a/index.html b/index.html index 8de78ab..95d4416 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -Mandelbrot Set
Mandelbrot Set
Max iteration
Julia position
\ No newline at end of file +Multibrot & Julia Sets
Mandelbrot Set

Multibrot & Julia Sets

Mandelbrot controls
Julia controls

Settings

Max iteration
Exponent
Bail-out radius
Julia point
Side by side  

\ No newline at end of file diff --git a/mandelbrot-set.js b/mandelbrot-set.js deleted file mode 100644 index 981dd14..0000000 --- a/mandelbrot-set.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var e={182:(e,n,r)=>{r.r(n),r.d(n,{default:()=>t});const t="// Define the maximum number of iterations for the Mandelbrot set calculation\r\n// the value between the @ is replaced with the actual value during compilation,\r\n// which can be set by the user in the application, that's because OpenGL doesn't support dynamic loops\r\nconst int MAX_ITERATIONS = @MAX_ITERATIONS@;\r\n\r\n// Set the precision for floating-point operations\r\nprecision mediump float;\r\n\r\n// Uniform variables representing the resolution of the screen,\r\n// scaling factor, and center position of the Mandelbrot set\r\nuniform vec2 resolution;\r\nuniform float scale;\r\nuniform vec2 center;\r\nuniform vec3 colors[16];\r\nuniform vec2 position;\r\n\r\nvoid main() {\r\n vec2 scale2 = vec2(scale, scale * resolution.y / resolution.x);\r\n\r\n // Calculate the position of the current pixel in the complex plane\r\n vec2 z = (gl_FragCoord.xy - resolution / 2.0) * (scale2 / resolution) - center;\r\n \r\n // Initialize the iteration count to 0\r\n int iterations = 0;\r\n \r\n // Iterate to determine whether the current pixel is in the Mandelbrot set\r\n for (int i = 0; i < MAX_ITERATIONS; i++) {\r\n // Check if the magnitude of z exceeds 2, indicating it's not in the set\r\n if (length(z) > 2.0) {\r\n // Exit the loop if the escape condition is met\r\n break;\r\n }\r\n \r\n // Calculate the next iteration of z using the Mandelbrot formula\r\n vec2 newZ = vec2(z.x * z.x - z.y * z.y, 2.0 * z.x * z.y) + position;\r\n \r\n // Update the value of z for the next iteration\r\n z = newZ;\r\n \r\n // Increment the iteration count\r\n iterations++;\r\n }\r\n\r\n float a = float(iterations) / float(MAX_ITERATIONS);\r\n vec3 colorV;\r\n\r\n if (a < 0.0625) {\r\n colorV = colors[0];\r\n } else if (a < 0.125) {\r\n colorV = colors[1];\r\n } else if (a < 0.1875) {\r\n colorV = colors[2];\r\n } else if (a < 0.25) {\r\n colorV = colors[3];\r\n } else if (a < 0.3125) {\r\n colorV = colors[4];\r\n } else if (a < 0.375) {\r\n colorV = colors[5];\r\n } else if (a < 0.4375) {\r\n colorV = colors[6];\r\n } else if (a < 0.5) {\r\n colorV = colors[7];\r\n } else if (a < 0.5625) {\r\n colorV = colors[8];\r\n } else if (a < 0.625) {\r\n colorV = colors[9];\r\n } else if (a < 0.6875) {\r\n colorV = colors[10];\r\n } else if (a < 0.75) {\r\n colorV = colors[11];\r\n } else if (a < 0.8125) {\r\n colorV = colors[12];\r\n } else if (a < 0.875) {\r\n colorV = colors[13];\r\n } else if (a < 0.9375) {\r\n colorV = colors[14];\r\n } else {\r\n colorV = colors[15];\r\n }\r\n\r\n gl_FragColor = vec4(colorV, 1.0);\r\n}\r\n"},882:(e,n,r)=>{r.r(n),r.d(n,{default:()=>t});const t="// Define the maximum number of iterations for the Mandelbrot set calculation\r\n// the value between the @ is replaced with the actual value during compilation,\r\n// which can be set by the user in the application, that's because OpenGL doesn't support dynamic loops\r\nconst int MAX_ITERATIONS = @MAX_ITERATIONS@;\r\n\r\n// Set the precision for floating-point operations\r\nprecision mediump float;\r\n\r\n// Uniform variables representing the resolution of the screen,\r\n// scaling factor, and center position of the Mandelbrot set\r\nuniform vec2 resolution;\r\nuniform float scale;\r\nuniform vec2 center;\r\nuniform vec3 colors[16];\r\nuniform vec2 position;\r\n\r\nvoid main() {\r\n vec2 scale2 = vec2(scale, scale * resolution.y / resolution.x);\r\n\r\n // Calculate the position of the current pixel in the complex plane\r\n vec2 z = (gl_FragCoord.xy - resolution / 2.0) * (scale2 / resolution) - center;\r\n \r\n // Initialize the iteration count to 0\r\n int iterations = 0;\r\n \r\n // Iterate to determine whether the current pixel is in the Mandelbrot set\r\n for (int i = 0; i < MAX_ITERATIONS; i++) {\r\n // Check if the magnitude of z exceeds 2, indicating it's not in the set\r\n if (length(z) > 2.0) {\r\n // Exit the loop if the escape condition is met\r\n break;\r\n }\r\n \r\n // Calculate the next iteration of z using the Mandelbrot formula\r\n vec2 newZ = vec2(z.x * z.x - z.y * z.y, 2.0 * z.x * z.y) + position;\r\n \r\n // Update the value of z for the next iteration\r\n z = newZ;\r\n \r\n // Increment the iteration count\r\n iterations++;\r\n }\r\n\r\n // Calculate the color based on the number of iterations\r\n float color = float(iterations) / float(MAX_ITERATIONS);\r\n \r\n // Output the final color for the current pixel\r\n gl_FragColor = vec4(color, color, color, 1.0);\r\n}\r\n"},604:(e,n,r)=>{r.r(n),r.d(n,{default:()=>t});const t="// Define the maximum number of iterations for the Mandelbrot set calculation\r\n// the value between the @ is replaced with the actual value during compilation,\r\n// which can be set by the user in the application, that's because OpenGL doesn't support dynamic loops\r\nconst int MAX_ITERATIONS = @MAX_ITERATIONS@;\r\n\r\n// Set the precision for floating-point operations\r\nprecision mediump float;\r\n\r\n// Uniform variables representing the resolution of the screen,\r\n// scaling factor, and center position of the Mandelbrot set\r\nuniform vec2 resolution;\r\nuniform float scale;\r\nuniform vec2 center;\r\nuniform vec3 colors[16];\r\nuniform vec2 position;\r\n\r\nvoid main() {\r\n vec2 scale2 = vec2(scale, scale * resolution.y / resolution.x);\r\n\r\n // Calculate the position of the current pixel in the complex plane\r\n vec2 z = (gl_FragCoord.xy - resolution / 2.0) * (scale2 / resolution) - center;\r\n \r\n // Initialize the iteration count to 0\r\n int iterations = 0;\r\n \r\n // Iterate to determine whether the current pixel is in the Mandelbrot set\r\n for (int i = 0; i < MAX_ITERATIONS; i++) {\r\n // Check if the magnitude of z exceeds 2, indicating it's not in the set\r\n if (length(z) > 2.0) {\r\n // Exit the loop if the escape condition is met\r\n break;\r\n }\r\n \r\n // Calculate the next iteration of z using the Mandelbrot formula\r\n vec2 newZ = vec2(z.x * z.x - z.y * z.y, 2.0 * z.x * z.y) + position;\r\n \r\n // Update the value of z for the next iteration\r\n z = newZ;\r\n \r\n // Increment the iteration count\r\n iterations++;\r\n }\r\n\r\n float a = float(iterations) / float(MAX_ITERATIONS);\r\n vec3 colorV;\r\n\r\n if (a < 0.0625) {\r\n colorV = mix(colors[0], colors[1], a);\r\n } else if (a < 0.125) {\r\n colorV = mix(colors[1], colors[2], a);\r\n } else if (a < 0.1875) {\r\n colorV = mix(colors[2], colors[3], a);\r\n } else if (a < 0.25) {\r\n colorV = mix(colors[3], colors[4], a);\r\n } else if (a < 0.3125) {\r\n colorV = mix(colors[4], colors[5], a);\r\n } else if (a < 0.375) {\r\n colorV = mix(colors[5], colors[6], a);\r\n } else if (a < 0.4375) {\r\n colorV = mix(colors[6], colors[7], a);\r\n } else if (a < 0.5) {\r\n colorV = mix(colors[7], colors[8], a);\r\n } else if (a < 0.5625) {\r\n colorV = mix(colors[8], colors[9], a);\r\n } else if (a < 0.625) {\r\n colorV = mix(colors[9], colors[10], a);\r\n } else if (a < 0.6875) {\r\n colorV = mix(colors[10], colors[11], a);\r\n } else if (a < 0.75) {\r\n colorV = mix(colors[11], colors[12], a);\r\n } else if (a < 0.8125) {\r\n colorV = mix(colors[12], colors[13], a);\r\n } else if (a < 0.875) {\r\n colorV = mix(colors[13], colors[14], a);\r\n } else {\r\n colorV = mix(colors[14], colors[15], a);\r\n }\r\n\r\n gl_FragColor = vec4(colorV, 1.0);\r\n}\r\n"},668:(e,n,r)=>{r.r(n),r.d(n,{default:()=>t});const t="// Define the maximum number of iterations for the Mandelbrot set calculation\r\n// the value between the @ is replaced with the actual value during compilation,\r\n// which can be set by the user in the application, that's because OpenGL doesn't support dynamic loops\r\nconst int MAX_ITERATIONS = @MAX_ITERATIONS@;\r\n\r\n// Set the precision for floating-point operations\r\nprecision mediump float;\r\n\r\n// Uniform variables representing the resolution of the screen,\r\n// scaling factor, and center position of the Mandelbrot set\r\nuniform vec2 resolution;\r\nuniform float scale;\r\nuniform vec2 center;\r\nuniform vec3 colors[16];\r\nuniform vec2 position;\r\n\r\nvoid main() {\r\n vec2 scale2 = vec2(scale, scale * resolution.y / resolution.x);\r\n\r\n // Calculate the position of the current pixel in the complex plane\r\n vec2 z = (gl_FragCoord.xy - resolution / 2.0) * (scale2 / resolution) - center;\r\n \r\n // Initialize the iteration count to 0\r\n int iterations = 0;\r\n\r\n // Initialize the escape radius\r\n float escapeRadius = 256.0;\r\n \r\n // Iterate to determine whether the current pixel is in the Mandelbrot set\r\n for (int i = 0; i < MAX_ITERATIONS + 2; i++) {\r\n // Check if the magnitude of z exceeds the escape radius, indicating it's not in the set\r\n if (length(z) > escapeRadius) {\r\n // Exit the loop if the escape condition is met\r\n break;\r\n }\r\n \r\n // Calculate the next iteration of z using the Mandelbrot formula\r\n z = vec2(z.x * z.x - z.y * z.y, 2.0 * z.x * z.y) + position;\r\n \r\n // Increment the iteration count\r\n iterations++;\r\n }\r\n \r\n iterations = iterations - (iterations / 16) * 16;\r\n\r\n // Calculate the normalized iteration count\r\n float normalizedIterations = float(iterations) + 1.0 - (log(log(length(z)) / log(2.0))) / log(2.0);\r\n\r\n vec3 color = vec3(0.0);\r\n int idx = int(normalizedIterations);\r\n for (int i = 0; i < 16; i++) {\r\n if (i == idx) {\r\n color = mix(colors[i], colors[i + 1], fract(normalizedIterations));\r\n break;\r\n }\r\n }\r\n \r\n // Output the final color for the current pixel\r\n gl_FragColor = vec4(color, 1.0);\r\n}"},205:(e,n,r)=>{r.r(n),r.d(n,{default:()=>t});const t="// Define the maximum number of iterations for the Mandelbrot set calculation\r\n// the value between the @ is replaced with the actual value during compilation,\r\n// which can be set by the user in the application, that's because OpenGL doesn't support dynamic loops\r\nconst int MAX_ITERATIONS = @MAX_ITERATIONS@;\r\n\r\n// Set the precision for floating-point operations\r\nprecision mediump float;\r\n\r\n// Uniform variables representing the resolution of the screen,\r\n// scaling factor, and center position of the Mandelbrot set\r\nuniform vec2 resolution;\r\nuniform float scale;\r\nuniform vec2 center;\r\nuniform vec3 colors[16];\r\n\r\nvoid main() {\r\n\r\n vec2 scale2 = vec2(scale, scale * resolution.y / resolution.x);\r\n\r\n // Calculate the position of the current pixel in the complex plane\r\n vec2 position = (gl_FragCoord.xy - resolution / 2.0) * (scale2 / resolution) - center;\r\n \r\n // Initialize the complex number z to (0, 0)\r\n vec2 z = vec2(0.0, 0.0);\r\n \r\n // Initialize the iteration count to 0\r\n int iterations = 0;\r\n \r\n // Iterate to determine whether the current pixel is in the Mandelbrot set\r\n for (int i = 0; i < MAX_ITERATIONS; i++) {\r\n // Check if the magnitude of z exceeds 2, indicating it's not in the set\r\n if (length(z) > 2.0) {\r\n // Exit the loop if the escape condition is met\r\n break;\r\n }\r\n \r\n // Calculate the next iteration of z using the Mandelbrot formula\r\n vec2 newZ = vec2(z.x * z.x - z.y * z.y, 2.0 * z.x * z.y) + position;\r\n \r\n // Update the value of z for the next iteration\r\n z = newZ;\r\n \r\n // Increment the iteration count\r\n iterations++;\r\n }\r\n\r\n float a = float(iterations) / float(MAX_ITERATIONS);\r\n vec3 colorV;\r\n\r\n if (a < 0.0625) {\r\n colorV = colors[0];\r\n } else if (a < 0.125) {\r\n colorV = colors[1];\r\n } else if (a < 0.1875) {\r\n colorV = colors[2];\r\n } else if (a < 0.25) {\r\n colorV = colors[3];\r\n } else if (a < 0.3125) {\r\n colorV = colors[4];\r\n } else if (a < 0.375) {\r\n colorV = colors[5];\r\n } else if (a < 0.4375) {\r\n colorV = colors[6];\r\n } else if (a < 0.5) {\r\n colorV = colors[7];\r\n } else if (a < 0.5625) {\r\n colorV = colors[8];\r\n } else if (a < 0.625) {\r\n colorV = colors[9];\r\n } else if (a < 0.6875) {\r\n colorV = colors[10];\r\n } else if (a < 0.75) {\r\n colorV = colors[11];\r\n } else if (a < 0.8125) {\r\n colorV = colors[12];\r\n } else if (a < 0.875) {\r\n colorV = colors[13];\r\n } else if (a < 0.9375) {\r\n colorV = colors[14];\r\n } else {\r\n colorV = colors[15];\r\n }\r\n\r\n gl_FragColor = vec4(colorV, 1.0);\r\n}\r\n"},315:(e,n,r)=>{r.r(n),r.d(n,{default:()=>t});const t="// Define the maximum number of iterations for the Mandelbrot set calculation\r\n// the value between the @ is replaced with the actual value during compilation,\r\n// which can be set by the user in the application, that's because OpenGL doesn't support dynamic loops\r\nconst int MAX_ITERATIONS = @MAX_ITERATIONS@;\r\n\r\n// Set the precision for floating-point operations\r\nprecision mediump float;\r\n\r\n// Uniform variables representing the resolution of the screen,\r\n// scaling factor, and center position of the Mandelbrot set\r\nuniform vec2 resolution;\r\nuniform float scale;\r\nuniform vec2 center;\r\nuniform vec3 colors[16];\r\n\r\nvoid main() {\r\n\r\n vec2 scale2 = vec2(scale, scale * resolution.y / resolution.x);\r\n\r\n // Calculate the position of the current pixel in the complex plane\r\n vec2 position = (gl_FragCoord.xy - resolution / 2.0) * (scale2 / resolution) - center;\r\n \r\n // Initialize the complex number z to (0, 0)\r\n vec2 z = vec2(0.0, 0.0);\r\n \r\n // Initialize the iteration count to 0\r\n int iterations = 0;\r\n \r\n // Iterate to determine whether the current pixel is in the Mandelbrot set\r\n for (int i = 0; i < MAX_ITERATIONS; i++) {\r\n // Check if the magnitude of z exceeds 2, indicating it's not in the set\r\n if (length(z) > 2.0) {\r\n // Exit the loop if the escape condition is met\r\n break;\r\n }\r\n \r\n // Calculate the next iteration of z using the Mandelbrot formula\r\n vec2 newZ = vec2(z.x * z.x - z.y * z.y, 2.0 * z.x * z.y) + position;\r\n \r\n // Update the value of z for the next iteration\r\n z = newZ;\r\n \r\n // Increment the iteration count\r\n iterations++;\r\n }\r\n\r\n // Calculate the color based on the number of iterations\r\n float color = float(iterations) / float(MAX_ITERATIONS);\r\n\r\n // Output the final color for the current pixel\r\n gl_FragColor = vec4(color, color, color, 1.0);\r\n}\r\n"},755:(e,n,r)=>{r.r(n),r.d(n,{default:()=>t});const t="// Define the maximum number of iterations for the Mandelbrot set calculation\r\n// the value between the @ is replaced with the actual value during compilation,\r\n// which can be set by the user in the application, that's because OpenGL doesn't support dynamic loops\r\nconst int MAX_ITERATIONS = @MAX_ITERATIONS@;\r\n\r\n// Set the precision for floating-point operations\r\nprecision mediump float;\r\n\r\n// Uniform variables representing the resolution of the screen,\r\n// scaling factor, and center position of the Mandelbrot set\r\nuniform vec2 resolution;\r\nuniform float scale;\r\nuniform vec2 center;\r\nuniform vec3 colors[16];\r\n\r\nvoid main() {\r\n\r\n vec2 scale2 = vec2(scale, scale * resolution.y / resolution.x);\r\n\r\n // Calculate the position of the current pixel in the complex plane\r\n vec2 position = (gl_FragCoord.xy - resolution / 2.0) * (scale2 / resolution) - center;\r\n \r\n // Initialize the complex number z to (0, 0)\r\n vec2 z = vec2(0.0, 0.0);\r\n \r\n // Initialize the iteration count to 0\r\n int iterations = 0;\r\n \r\n // Iterate to determine whether the current pixel is in the Mandelbrot set\r\n for (int i = 0; i < MAX_ITERATIONS; i++) {\r\n // Check if the magnitude of z exceeds 2, indicating it's not in the set\r\n if (length(z) > 2.0) {\r\n // Exit the loop if the escape condition is met\r\n break;\r\n }\r\n \r\n // Calculate the next iteration of z using the Mandelbrot formula\r\n vec2 newZ = vec2(z.x * z.x - z.y * z.y, 2.0 * z.x * z.y) + position;\r\n \r\n // Update the value of z for the next iteration\r\n z = newZ;\r\n \r\n // Increment the iteration count\r\n iterations++;\r\n }\r\n\r\n float a = float(iterations) / float(MAX_ITERATIONS);\r\n vec3 colorV;\r\n\r\n if (a < 0.0625) {\r\n colorV = mix(colors[0], colors[1], a);\r\n } else if (a < 0.125) {\r\n colorV = mix(colors[1], colors[2], a);\r\n } else if (a < 0.1875) {\r\n colorV = mix(colors[2], colors[3], a);\r\n } else if (a < 0.25) {\r\n colorV = mix(colors[3], colors[4], a);\r\n } else if (a < 0.3125) {\r\n colorV = mix(colors[4], colors[5], a);\r\n } else if (a < 0.375) {\r\n colorV = mix(colors[5], colors[6], a);\r\n } else if (a < 0.4375) {\r\n colorV = mix(colors[6], colors[7], a);\r\n } else if (a < 0.5) {\r\n colorV = mix(colors[7], colors[8], a);\r\n } else if (a < 0.5625) {\r\n colorV = mix(colors[8], colors[9], a);\r\n } else if (a < 0.625) {\r\n colorV = mix(colors[9], colors[10], a);\r\n } else if (a < 0.6875) {\r\n colorV = mix(colors[10], colors[11], a);\r\n } else if (a < 0.75) {\r\n colorV = mix(colors[11], colors[12], a);\r\n } else if (a < 0.8125) {\r\n colorV = mix(colors[12], colors[13], a);\r\n } else if (a < 0.875) {\r\n colorV = mix(colors[13], colors[14], a);\r\n } else {\r\n colorV = mix(colors[14], colors[15], a);\r\n }\r\n\r\n gl_FragColor = vec4(colorV, 1.0);\r\n}\r\n"},509:(e,n,r)=>{r.r(n),r.d(n,{default:()=>t});const t="// Define the maximum number of iterations for the Mandelbrot set calculation\r\n// the value between the @ is replaced with the actual value during compilation,\r\n// which can be set by the user in the application, that's because OpenGL doesn't support dynamic loops\r\nconst int MAX_ITERATIONS = @MAX_ITERATIONS@;\r\n\r\n// Set the precision for floating-point operations\r\nprecision mediump float;\r\n\r\n// Uniform variables representing the resolution of the screen,\r\n// scaling factor, and center position of the Mandelbrot set\r\nuniform vec2 resolution;\r\nuniform float scale;\r\nuniform vec2 center;\r\nuniform vec3 colors[16];\r\n\r\nvoid main() {\r\n\r\n vec2 scale2 = vec2(scale, scale * resolution.y / resolution.x);\r\n\r\n // Calculate the position of the current pixel in the complex plane\r\n vec2 position = (gl_FragCoord.xy - resolution / 2.0) * (scale2 / resolution) - center;\r\n \r\n // Initialize the complex number z to (0, 0)\r\n vec2 z = vec2(0.0, 0.0);\r\n \r\n // Initialize the iteration count to 0\r\n int iterations = 0;\r\n \r\n // Initialize the escape radius\r\n float escapeRadius = 20.0;\r\n \r\n // Iterate to determine whether the current pixel is in the Mandelbrot set\r\n for (int i = 0; i < MAX_ITERATIONS; i++) {\r\n // Check if the magnitude of z exceeds the escape radius, indicating it's not in the set\r\n if (length(z) > escapeRadius) {\r\n // Exit the loop if the escape condition is met\r\n break;\r\n }\r\n \r\n // Calculate the next iteration of z using the Mandelbrot formula\r\n vec2 newZ = vec2(z.x * z.x - z.y * z.y, 2.0 * z.x * z.y) + position;\r\n \r\n // Update the value of z for the next iteration\r\n z = newZ;\r\n \r\n // Increment the iteration count\r\n iterations++;\r\n }\r\n\r\n iterations = iterations - (iterations / 16) * 16;\r\n\r\n // Calculate the normalized iteration count\r\n float normalizedIterations = float(iterations) + 1.0 - (log(log(length(z)) / log(2.0))) / log(2.0);\r\n\r\n vec3 color = vec3(0.0);\r\n int idx = int(normalizedIterations);\r\n for (int i = 0; i < 16; i++) {\r\n if (i == idx) {\r\n color = mix(colors[i], colors[i + 1], fract(normalizedIterations));\r\n break;\r\n }\r\n }\r\n \r\n // Output the final color for the current pixel\r\n gl_FragColor = vec4(color, 1.0);\r\n}\r\n"},450:(e,n,r)=>{r.r(n),r.d(n,{default:()=>t});const t="// Define the attribute for the position of the vertex\r\nattribute vec2 position;\r\n\r\nvoid main() {\r\n // Set the position of the vertex in clip space\r\n gl_Position = vec4(position, 0, 1);\r\n}"},253:function(e,n,r){var t=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0});const o=t(r(450)),i=t(r(315)),a=t(r(882)),l=t(r(205)),c=t(r(182)),s=t(r(755)),u=t(r(604)),f=t(r(509)),d=t(r(668)),h=.01;let m=null,p={x:.25,y:0,z:4},g={x:.285,y:.01},v=[{r:9/255,g:1/255,b:47/255},{r:4/255,g:4/255,b:73/255},{r:0,g:7/255,b:100/255},{r:12/255,g:44/255,b:138/255},{r:24/255,g:82/255,b:177/255},{r:57/255,g:125/255,b:209/255},{r:134/255,g:181/255,b:229/255},{r:211/255,g:236/255,b:248/255},{r:241/255,g:233/255,b:191/255},{r:248/255,g:201/255,b:95/255},{r:1,g:170/255,b:0},{r:.8,g:128/255,b:0},{r:.6,g:87/255,b:0},{r:106/255,g:52/255,b:3/255},{r:66/255,g:30/255,b:15/255},{r:25/255,g:7/255,b:26/255}];function x(e){const n=e.getContext("webgl"),r=parseInt(document.getElementById("max-iterations").value);let t;switch(document.getElementById("color-alg").value){default:case"0":t=i.default;break;case"1":t=l.default;break;case"2":t=s.default;break;case"3":t=f.default}w(n,y(n,r,t)),E(e),n.drawArrays(n.TRIANGLE_STRIP,0,4)}function I(e){const n=e.getContext("webgl"),r=parseInt(document.getElementById("max-iterations").value);let t;switch(document.getElementById("color-alg").value){default:case"0":t=a.default;break;case"1":t=c.default;break;case"2":t=u.default;break;case"3":t=d.default}w(n,y(n,r,t)),E(e,g),n.drawArrays(n.TRIANGLE_STRIP,0,4)}function b(){const e=document.createElement("canvas");document.getElementById("canvas-container").appendChild(e);let n=document.getElementById("side-by-side").checked;return e.width=n?window.innerWidth/2:window.innerWidth,e.height=window.innerHeight,e}function z(e,n,r){const t=e.createShader(n);return e.shaderSource(t,r),e.compileShader(t),t}function y(e,n,r){const t=z(e,e.VERTEX_SHADER,o.default),i=z(e,e.FRAGMENT_SHADER,r.replace("@MAX_ITERATIONS@",String(n))),a=e.createProgram();return e.attachShader(a,t),e.attachShader(a,i),e.linkProgram(a),e.useProgram(a),a}function w(e,n){const r=e.getAttribLocation(n,"position"),t=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,t),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,1]),e.STATIC_DRAW),e.enableVertexAttribArray(r),e.vertexAttribPointer(r,2,e.FLOAT,!1,0,0)}function E(e,n=void 0){const r=e.getContext("webgl"),t=r.getParameter(r.CURRENT_PROGRAM),o=r.getUniformLocation(t,"resolution");r.uniform2f(o,e.width,e.height);const i=r.getUniformLocation(t,"scale");r.uniform1f(i,p.z);const a=r.getUniformLocation(t,"center");r.uniform2f(a,p.x,p.y);const l=r.getUniformLocation(t,"colors"),c=v.flatMap((e=>[e.r,e.g,e.b]));if(r.uniform3fv(l,c),null!=n){const e=r.getUniformLocation(t,"position");r.uniform2f(e,n.x,n.y)}}function A(e){const n=e.getContext("webgl"),r=n.getParameter(n.CURRENT_PROGRAM);n.uniform2f(n.getUniformLocation(r,"resolution"),e.width,e.height),n.uniform1f(n.getUniformLocation(r,"scale"),p.z),n.uniform2f(n.getUniformLocation(r,"center"),p.x,p.y),n.drawArrays(n.TRIANGLE_STRIP,0,4)}function T(e,n){g.x=e,g.y=n,document.getElementById("julia-x").value=e.toFixed(6),document.getElementById("julia-y").value=n.toFixed(6)}!function(e,n){document.addEventListener("mouseup",(()=>{m&&clearInterval(m)})),document.addEventListener("touchend",(()=>{m&&clearInterval(m)})),document.getElementById("max-iterations-btn").addEventListener("click",(()=>{const r=parseInt(document.getElementById("max-iterations").value);T(parseFloat(document.getElementById("julia-x").value),parseFloat(document.getElementById("julia-y").value)),console.log("Drawing Mandelbrot set with max iterations:",r),x(e),I(n)})),document.getElementById("side-by-side").addEventListener("change",(()=>{const r=document.getElementById("side-by-side").checked;e.width=r?window.innerWidth/2:window.innerWidth,e.height=window.innerHeight,n.width=r?window.innerWidth/2:window.innerWidth,n.height=window.innerHeight,A(e),A(n)})),document.getElementById("color-alg").addEventListener("change",(()=>{x(e),I(n)})),e.addEventListener("click",(e=>{r(e)})),e.addEventListener("mousedown",(e=>{m=setInterval((()=>{r(e)}),100)})),e.addEventListener("touchstart",(e=>{m=setInterval((()=>{r(e)}),100)}));const r=r=>{const t=e.getBoundingClientRect(),o=(r instanceof MouseEvent?r.clientX:r.touches[0].clientX)-t.left,i=(r instanceof MouseEvent?r.clientY:r.touches[0].clientY)-t.top,a=o,l=e.height-i,c=(a-e.width/2)*(p.z/e.width)-p.x,s=(l-e.height/2)*(p.z/e.width)-p.y;console.log(o,i,c,s),T(c,s),function(e){const n=e.getContext("webgl"),r=n.getParameter(n.CURRENT_PROGRAM);n.uniform1f(n.getUniformLocation(r,"scale"),p.z),n.uniform2f(n.getUniformLocation(r,"center"),p.x,p.y),n.uniform2f(n.getUniformLocation(r,"position"),g.x,g.y),n.drawArrays(n.TRIANGLE_STRIP,0,4)}(n)};document.getElementById("move-down").addEventListener("touchstart",(()=>{m=setInterval((()=>{p.y-=h,A(e),A(n)}),100)})),document.getElementById("move-up").addEventListener("touchstart",(()=>{m=setInterval((()=>{p.y+=h,A(e),A(n)}),100)})),document.getElementById("move-left").addEventListener("touchstart",(()=>{m=setInterval((()=>{p.x-=h,A(e),A(n)}),100)})),document.getElementById("move-right").addEventListener("touchstart",(()=>{m=setInterval((()=>{p.x+=h,A(e),A(n)}),100)})),document.getElementById("zoom-out").addEventListener("touchstart",(()=>{m=setInterval((()=>{p.z-=h,A(e),A(n)}),100)})),document.getElementById("zoom-in").addEventListener("touchstart",(()=>{m=setInterval((()=>{p.z+=h,A(e),A(n)}),100)})),document.getElementById("move-down").addEventListener("mousedown",(()=>{m=setInterval((()=>{p.y-=h,A(e),A(n)}),100)})),document.getElementById("move-up").addEventListener("mousedown",(()=>{m=setInterval((()=>{p.y+=h,A(e),A(n)}),100)})),document.getElementById("move-left").addEventListener("mousedown",(()=>{m=setInterval((()=>{p.x-=h,A(e),A(n)}),100)})),document.getElementById("move-right").addEventListener("mousedown",(()=>{m=setInterval((()=>{p.x+=h,A(e),A(n)}),100)})),document.getElementById("zoom-out").addEventListener("mousedown",(()=>{m=setInterval((()=>{p.z-=h,A(e),A(n)}),100)})),document.getElementById("zoom-in").addEventListener("mousedown",(()=>{m=setInterval((()=>{p.z+=h,A(e),A(n)}),100)})),document.getElementById("move-down").addEventListener("click",(()=>{p.y-=h,A(e),A(n)})),document.getElementById("move-up").addEventListener("click",(()=>{p.y+=h,A(e),A(n)})),document.getElementById("move-left").addEventListener("click",(()=>{p.x-=h,A(e),A(n)})),document.getElementById("move-right").addEventListener("click",(()=>{p.x+=h,A(e),A(n)})),document.getElementById("zoom-out").addEventListener("click",(()=>{p.z-=h,A(e),A(n)})),document.getElementById("zoom-in").addEventListener("click",(()=>{p.z+=h,A(e),A(n)})),window.addEventListener("keydown",(r=>{if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(r.key)||["w","a","s","d"].includes(r.key)||["z","x"].includes(r.key)){switch(r.preventDefault(),r.key){case"ArrowUp":case"w":p.y+=h;break;case"ArrowDown":case"s":p.y-=h;break;case"ArrowLeft":case"a":p.x-=h;break;case"ArrowRight":case"d":p.x+=h;break;case"z":p.z+=h;break;case"x":p.z-=h}A(e),A(n)}}))}(function(){const e=b();if(!e.getContext("webgl"))throw new Error("WebGL not supported");return x(e),e}(),function(){const e=b();if(!e.getContext("webgl"))throw new Error("WebGL not supported");return I(e),e}())}},n={};function r(t){var o=n[t];if(void 0!==o)return o.exports;var i=n[t]={exports:{}};return e[t].call(i.exports,i,i.exports,r),i.exports}r.d=(e,n)=>{for(var t in n)r.o(n,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},r.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r(253)})(); \ No newline at end of file diff --git a/multibrot-set.js b/multibrot-set.js new file mode 100644 index 0000000..2835d46 --- /dev/null +++ b/multibrot-set.js @@ -0,0 +1 @@ +(()=>{"use strict";var t={461:(t,e,n)=>{n.r(e),n.d(e,{default:()=>r});const r="\r\nfloat a = float(iterations) / float(MAX_ITERATIONS);\r\n\r\nif (a < 0.0625) {\r\n color = colors[0];\r\n} else if (a < 0.125) {\r\n color = colors[1];\r\n} else if (a < 0.1875) {\r\n color = colors[2];\r\n} else if (a < 0.25) {\r\n color = colors[3];\r\n} else if (a < 0.3125) {\r\n color = colors[4];\r\n} else if (a < 0.375) {\r\n color = colors[5];\r\n} else if (a < 0.4375) {\r\n color = colors[6];\r\n} else if (a < 0.5) {\r\n color = colors[7];\r\n} else if (a < 0.5625) {\r\n color = colors[8];\r\n} else if (a < 0.625) {\r\n color = colors[9];\r\n} else if (a < 0.6875) {\r\n color = colors[10];\r\n} else if (a < 0.75) {\r\n color = colors[11];\r\n} else if (a < 0.8125) {\r\n color = colors[12];\r\n} else if (a < 0.875) {\r\n color = colors[13];\r\n} else if (a < 0.9375) {\r\n color = colors[14];\r\n} else {\r\n color = colors[15];\r\n}"},377:(t,e,n)=>{n.r(e),n.d(e,{default:()=>r});const r="\r\nfloat a = float(iterations) / float(MAX_ITERATIONS);\r\ncolor = vec3(a, a, a);"},375:(t,e,n)=>{n.r(e),n.d(e,{default:()=>r});const r="\r\nfloat a = float(iterations) / float(MAX_ITERATIONS);\r\n\r\nif (a < 0.0625) {\r\n color = mix(colors[0], colors[1], a);\r\n} else if (a < 0.125) {\r\n color = mix(colors[1], colors[2], a);\r\n} else if (a < 0.1875) {\r\n color = mix(colors[2], colors[3], a);\r\n} else if (a < 0.25) {\r\n color = mix(colors[3], colors[4], a);\r\n} else if (a < 0.3125) {\r\n color = mix(colors[4], colors[5], a);\r\n} else if (a < 0.375) {\r\n color = mix(colors[5], colors[6], a);\r\n} else if (a < 0.4375) {\r\n color = mix(colors[6], colors[7], a);\r\n} else if (a < 0.5) {\r\n color = mix(colors[7], colors[8], a);\r\n} else if (a < 0.5625) {\r\n color = mix(colors[8], colors[9], a);\r\n} else if (a < 0.625) {\r\n color = mix(colors[9], colors[10], a);\r\n} else if (a < 0.6875) {\r\n color = mix(colors[10], colors[11], a);\r\n} else if (a < 0.75) {\r\n color = mix(colors[11], colors[12], a);\r\n} else if (a < 0.8125) {\r\n color = mix(colors[12], colors[13], a);\r\n} else if (a < 0.875) {\r\n color = mix(colors[13], colors[14], a);\r\n} else {\r\n color = mix(colors[14], colors[15], a);\r\n}"},931:(t,e,n)=>{n.r(e),n.d(e,{default:()=>r});const r="\r\niterations = iterations - (iterations / 16) * 16;\r\n\r\n// Calculate the normalized iteration count\r\nfloat normalizedIterations = float(iterations) + 1.0 - (log(log(length(z)) / log(P))) / log(P);\r\n\r\nint idx = int(normalizedIterations);\r\nfor (int i = 0; i < 16; i++) {\r\n if (i == idx) {\r\n color = mix(colors[i], colors[i + 1], fract(normalizedIterations));\r\n break;\r\n }\r\n}"},680:(t,e,n)=>{n.r(e),n.d(e,{default:()=>r});const r="\r\n#define PI 3.1415926538\r\n#define atan2(y, x) (mix(PI/2.0 - atan(x,y), atan(y,x), float(abs(x) > abs(y))))\r\n\r\nprecision mediump float;\r\n\r\nconst float P = @EXPONENT@;\r\nconst int MAX_ITERATIONS = @MAX_ITERATIONS@;\r\nconst float BAILOUT_RADIUS = @BAILOUT@;\r\n\r\nuniform vec2 resolution;\r\nuniform vec2 offset;\r\n\r\nuniform float scale;\r\n\r\nuniform vec3 colors[@COLORS_COUNT@];\r\n\r\n@UNIFORMS@\r\n\r\nvoid main() {\r\n vec3 color = vec3(0.0, 0.0, 0.0);\r\n vec2 scale2 = vec2(scale, scale * resolution.y / resolution.x);\r\n\r\n @VARIABLES@\r\n \r\n @ITERATIONS_ALGORITHM@\r\n\r\n @COLORING_ALGORITHM@\r\n\r\n gl_FragColor = vec4(color, 1.0);\r\n}"},841:(t,e,n)=>{n.r(e),n.d(e,{default:()=>r});const r="\r\n// The power of the Multibrot set\r\n\r\nfloat x = z.x;\r\nfloat y = z.y;\r\n\r\nfloat xtemp;\r\n\r\nint iterations = 0;\r\n\r\nfor (int i = 0; i < MAX_ITERATIONS; i++) {\r\n if (x*x + y*y > BAILOUT_RADIUS) {\r\n // Exit the loop if the escape condition is met\r\n break;\r\n }\r\n\r\n xtemp = pow(x * x + y * y, P / 2.0) * cos(P * atan2(y, x)) + position.x;\r\n y = pow(x * x + y * y, P / 2.0) * sin(P * atan2(y, x)) + position.y;\r\n x = xtemp; \r\n\r\n z = vec2(x, y);\r\n\r\n // Increment the iteration count\r\n iterations++;\r\n}"},243:(t,e,n)=>{n.r(e),n.d(e,{default:()=>r});const r="\r\nuniform vec2 position;"},483:(t,e,n)=>{n.r(e),n.d(e,{default:()=>r});const r="\r\nvec2 z = (gl_FragCoord.xy - resolution.xy / 2.0) / resolution.y * scale2 + offset;"},916:(t,e,n)=>{n.r(e),n.d(e,{default:()=>r});const r="\r\nvec2 position = (gl_FragCoord.xy - resolution.xy / 2.0) / resolution.y * scale2 + offset;\r\nvec2 z = vec2(0.0, 0.0);"},450:(t,e,n)=>{n.r(e),n.d(e,{default:()=>r});const r="// Define the attribute for the position of the vertex\r\nattribute vec2 position;\r\n\r\nvoid main() {\r\n // Set the position of the vertex in clip space\r\n gl_Position = vec4(position, 0, 1);\r\n}"},750:function(t,e,n){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Application=void 0;const a=r(n(483)),o=r(n(916)),s=r(n(243)),i=r(n(841)),l=r(n(377)),d=r(n(461)),u=r(n(375)),c=r(n(931)),h=n(250),m=n(163),v=n(222),E=n(663);class f{constructor(){this.canvasContainer=document.getElementById("canvas-container");let t=document.getElementById("side-by-side").checked?window.innerWidth/2:window.innerWidth,e=window.innerHeight;this.multibrot=new h.Canvas(this.canvasContainer,t,e),this.julia=new h.Canvas(this.canvasContainer,t,e),this.multibrotShader=new m.Shader,this.juliaShader=new m.Shader}start(){this.multibrot.init(),this.julia.init(),new E.InputHandler(this),this.draw()}draw(){this.setupShaders(),this.multibrot.draw(this.multibrotShader),this.julia.draw(this.juliaShader,this.getJuliaSeed())}setupShaders(){this.multibrotShader.updateExponent(this.getExponent()),this.multibrotShader.updateMaxIterations(this.getMaxIterations()),this.multibrotShader.updateBailOut(this.getBailOut()),this.multibrotShader.updateVariables(o.default),this.multibrotShader.updateIterationsAlgorithm(i.default),this.multibrotShader.updateColoringAlgorithm(this.getColoringAlgorithm()),this.multibrotShader.updateColors(v.basePalette),this.juliaShader.updateExponent(this.getExponent()),this.juliaShader.updateMaxIterations(this.getMaxIterations()),this.juliaShader.updateBailOut(this.getBailOut()),this.juliaShader.updateUniforms(s.default),this.juliaShader.updateVariables(a.default),this.juliaShader.updateIterationsAlgorithm(i.default),this.juliaShader.updateColoringAlgorithm(this.getColoringAlgorithm()),this.juliaShader.updateColors(v.basePalette)}getExponent(){return parseFloat(document.getElementById("exponent").value)}getMaxIterations(){return parseInt(document.getElementById("max-iterations").value)}getBailOut(){return parseFloat(document.getElementById("bail-out").value)}getColoringAlgorithm(){let t;switch(document.getElementById("color-alg").value){default:case"0":t=l.default;break;case"1":t=d.default;break;case"2":t=u.default;break;case"3":t=c.default}return t}getJuliaSeed(){return{x:parseFloat(document.getElementById("julia-x").value),y:parseFloat(document.getElementById("julia-y").value)}}get multibrotCanvas(){return this.multibrot}get juliaCanvas(){return this.julia}}e.Application=f,(new f).start()},250:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Canvas=void 0,e.Canvas=class{constructor(t,e,n){this.wrappedScale=4,this.offset={x:0,y:0},this.parent=t,this.wrappedWidth=e,this.wrappedHeight=n}init(){this.canvas=document.createElement("canvas"),this.canvas.width=this.width,this.canvas.height=this.height,this.parent.appendChild(this.canvas)}draw(t,e=null){const n=this.canvas.getContext("webgl");if(!n)return void console.error("WebGL not supported");t.assembleProgramSource();let r=this.createShaderProgram(n,t.vertexShaderSource,t.fragmentShaderSource);this.setUpVertexBuffer(n,r),this.setUpUniforms(n,t,r,e),n.drawArrays(n.TRIANGLE_STRIP,0,4)}createShaderProgram(t,e,n){const r=this.createShader(t,t.VERTEX_SHADER,e),a=this.createShader(t,t.FRAGMENT_SHADER,n),o=t.createProgram();return t.attachShader(o,r),t.attachShader(o,a),t.linkProgram(o),t.useProgram(o),o}createShader(t,e,n){const r=t.createShader(e);return t.shaderSource(r,n),t.compileShader(r),r}setUpVertexBuffer(t,e){const n=t.getAttribLocation(e,"position"),r=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,r),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,1]),t.STATIC_DRAW),t.enableVertexAttribArray(n),t.vertexAttribPointer(n,2,t.FLOAT,!1,0,0)}setUpUniforms(t,e,n,r=null){const a=t.getUniformLocation(n,"resolution"),o=t.getUniformLocation(n,"scale"),s=t.getUniformLocation(n,"offset"),i=t.getUniformLocation(n,"colors"),l=t.getUniformLocation(n,"position");if(a&&t.uniform2f(a,this.width,this.height),o&&t.uniform1f(o,this.wrappedScale),s&&t.uniform2f(s,this.offset.x,this.offset.y),i){const n=e.getColors().flatMap((t=>[t.r,t.g,t.b]));t.uniform3fv(i,n)}l&&(r||(r={x:0,y:0}),t.uniform2f(l,r.x,r.y))}get width(){return this.wrappedWidth}set width(t){this.wrappedWidth=t,this.canvas.width=t}get height(){return this.wrappedHeight}set height(t){this.wrappedHeight=t,this.canvas.height=t}get canvasElement(){return this.canvas}get scale(){return this.wrappedScale}set scale(t){this.wrappedScale=t}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}set offsetX(t){this.offset.x=t}set offsetY(t){this.offset.y=t}}},222:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.basePalette=void 0,e.basePalette=[{r:9/255,g:1/255,b:47/255},{r:4/255,g:4/255,b:73/255},{r:0,g:7/255,b:100/255},{r:12/255,g:44/255,b:138/255},{r:24/255,g:82/255,b:177/255},{r:57/255,g:125/255,b:209/255},{r:134/255,g:181/255,b:229/255},{r:211/255,g:236/255,b:248/255},{r:241/255,g:233/255,b:191/255},{r:248/255,g:201/255,b:95/255},{r:1,g:170/255,b:0},{r:.8,g:128/255,b:0},{r:.6,g:87/255,b:0},{r:106/255,g:52/255,b:3/255},{r:66/255,g:30/255,b:15/255},{r:25/255,g:7/255,b:26/255}]},663:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InputHandler=void 0,e.InputHandler=class{constructor(t){this.SCALE_STEP=.05,this.interval=null,this.addEventListeners(t)}addEventListeners(t){document.addEventListener("mouseup",(()=>{this.interval&&clearInterval(this.interval)})),document.addEventListener("touchend",(()=>{this.interval&&clearInterval(this.interval)})),document.getElementById("redraw-btn").addEventListener("click",(()=>{t.draw()})),document.getElementById("side-by-side").addEventListener("change",(()=>{let e=document.getElementById("side-by-side").checked?window.innerWidth/2:window.innerWidth,n=window.innerHeight;t.multibrotCanvas.width=e,t.multibrotCanvas.height=n,t.juliaCanvas.width=e,t.juliaCanvas.height=n,t.draw()})),document.getElementById("color-alg").addEventListener("change",(()=>{t.draw()})),t.multibrotCanvas.canvasElement.addEventListener("click",(t=>{e(t)})),t.multibrotCanvas.canvasElement.addEventListener("touchstart",(t=>{e(t)}));const e=e=>{const n=t.multibrotCanvas.canvasElement.getBoundingClientRect(),r=t.multibrotCanvas.width,a=t.multibrotCanvas.height,o=t.multibrotCanvas.offsetX,s=t.multibrotCanvas.offsetY,i=t.multibrotCanvas.scale,l=i/r*((e instanceof MouseEvent?e.clientX:e.touches[0].clientX)-n.left-r/2)+o,d=i/r*(a-((e instanceof MouseEvent?e.clientY:e.touches[0].clientY)-n.top)-a/2)+s;document.getElementById("julia-x").value=l.toString(),document.getElementById("julia-y").value=d.toString(),t.draw()};document.getElementById("m-move-up").addEventListener("touchstart",(()=>{this.interval=setInterval((()=>{t.multibrotCanvas.offsetY-=this.SCALE_STEP,t.draw()}),100)})),document.getElementById("m-move-down").addEventListener("touchstart",(()=>{this.interval=setInterval((()=>{t.multibrotCanvas.offsetY+=this.SCALE_STEP,t.draw()}),100)})),document.getElementById("m-move-right").addEventListener("touchstart",(()=>{this.interval=setInterval((()=>{t.multibrotCanvas.offsetX-=this.SCALE_STEP,t.draw()}),100)})),document.getElementById("m-move-left").addEventListener("touchstart",(()=>{this.interval=setInterval((()=>{t.multibrotCanvas.offsetX+=this.SCALE_STEP,t.draw()}),100)})),document.getElementById("m-zoom-out").addEventListener("touchstart",(()=>{this.interval=setInterval((()=>{t.multibrotCanvas.scale+=this.SCALE_STEP,t.draw()}),100)})),document.getElementById("m-zoom-in").addEventListener("touchstart",(()=>{this.interval=setInterval((()=>{t.multibrotCanvas.scale-=this.SCALE_STEP,t.draw()}),100)})),document.getElementById("m-move-up").addEventListener("mousedown",(()=>{this.interval=setInterval((()=>{t.multibrotCanvas.offsetY-=this.SCALE_STEP,t.draw()}),100)})),document.getElementById("m-move-down").addEventListener("mousedown",(()=>{this.interval=setInterval((()=>{t.multibrotCanvas.offsetY+=this.SCALE_STEP,t.draw()}),100)})),document.getElementById("m-move-right").addEventListener("mousedown",(()=>{this.interval=setInterval((()=>{t.multibrotCanvas.offsetX-=this.SCALE_STEP,t.draw()}),100)})),document.getElementById("m-move-left").addEventListener("mousedown",(()=>{this.interval=setInterval((()=>{t.multibrotCanvas.offsetX+=this.SCALE_STEP,t.draw()}),100)})),document.getElementById("m-zoom-out").addEventListener("mousedown",(()=>{this.interval=setInterval((()=>{t.multibrotCanvas.scale+=this.SCALE_STEP,t.draw()}),100)})),document.getElementById("m-zoom-in").addEventListener("mousedown",(()=>{this.interval=setInterval((()=>{t.multibrotCanvas.scale-=this.SCALE_STEP,t.draw()}),100)})),document.getElementById("m-move-up").addEventListener("click",(()=>{t.multibrotCanvas.offsetY-=this.SCALE_STEP,t.draw()})),document.getElementById("m-move-down").addEventListener("click",(()=>{t.multibrotCanvas.offsetY+=this.SCALE_STEP,t.draw()})),document.getElementById("m-move-right").addEventListener("click",(()=>{t.multibrotCanvas.offsetX-=this.SCALE_STEP,t.draw()})),document.getElementById("m-move-left").addEventListener("click",(()=>{t.multibrotCanvas.offsetX+=this.SCALE_STEP,t.draw()})),document.getElementById("m-zoom-out").addEventListener("click",(()=>{t.multibrotCanvas.scale+=this.SCALE_STEP,t.draw()})),document.getElementById("m-zoom-in").addEventListener("click",(()=>{t.multibrotCanvas.scale-=this.SCALE_STEP,t.draw()})),document.getElementById("j-move-up").addEventListener("touchstart",(()=>{this.interval=setInterval((()=>{t.juliaCanvas.offsetY-=this.SCALE_STEP,t.draw()}),100)})),document.getElementById("j-move-down").addEventListener("touchstart",(()=>{this.interval=setInterval((()=>{t.juliaCanvas.offsetY+=this.SCALE_STEP,t.draw()}),100)})),document.getElementById("j-move-right").addEventListener("touchstart",(()=>{this.interval=setInterval((()=>{t.juliaCanvas.offsetX-=this.SCALE_STEP,t.draw()}),100)})),document.getElementById("j-move-left").addEventListener("touchstart",(()=>{this.interval=setInterval((()=>{t.juliaCanvas.offsetX+=this.SCALE_STEP,t.draw()}),100)})),document.getElementById("j-zoom-out").addEventListener("touchstart",(()=>{this.interval=setInterval((()=>{t.juliaCanvas.scale+=this.SCALE_STEP,t.draw()}),100)})),document.getElementById("j-zoom-in").addEventListener("touchstart",(()=>{this.interval=setInterval((()=>{t.juliaCanvas.scale-=this.SCALE_STEP,t.draw()}),100)})),document.getElementById("j-move-up").addEventListener("mousedown",(()=>{this.interval=setInterval((()=>{t.juliaCanvas.offsetY-=this.SCALE_STEP,t.draw()}),100)})),document.getElementById("j-move-down").addEventListener("mousedown",(()=>{this.interval=setInterval((()=>{t.juliaCanvas.offsetY+=this.SCALE_STEP,t.draw()}),100)})),document.getElementById("j-move-right").addEventListener("mousedown",(()=>{this.interval=setInterval((()=>{t.juliaCanvas.offsetX-=this.SCALE_STEP,t.draw()}),100)})),document.getElementById("j-move-left").addEventListener("mousedown",(()=>{this.interval=setInterval((()=>{t.juliaCanvas.offsetX+=this.SCALE_STEP,t.draw()}),100)})),document.getElementById("j-zoom-out").addEventListener("mousedown",(()=>{this.interval=setInterval((()=>{t.juliaCanvas.scale+=this.SCALE_STEP,t.draw()}),100)})),document.getElementById("j-zoom-in").addEventListener("mousedown",(()=>{this.interval=setInterval((()=>{t.juliaCanvas.scale-=this.SCALE_STEP,t.draw()}),100)})),document.getElementById("j-move-up").addEventListener("click",(()=>{t.juliaCanvas.offsetY-=this.SCALE_STEP,t.draw()})),document.getElementById("j-move-down").addEventListener("click",(()=>{t.juliaCanvas.offsetY+=this.SCALE_STEP,t.draw()})),document.getElementById("j-move-right").addEventListener("click",(()=>{t.juliaCanvas.offsetX-=this.SCALE_STEP,t.draw()})),document.getElementById("j-move-left").addEventListener("click",(()=>{t.juliaCanvas.offsetX+=this.SCALE_STEP,t.draw()})),document.getElementById("j-zoom-out").addEventListener("click",(()=>{t.juliaCanvas.scale+=this.SCALE_STEP,t.draw()})),document.getElementById("j-zoom-in").addEventListener("click",(()=>{t.juliaCanvas.scale-=this.SCALE_STEP,t.draw()})),document.getElementById("move-up").addEventListener("touchstart",(()=>{this.interval=setInterval((()=>{t.multibrotCanvas.offsetY-=this.SCALE_STEP,t.juliaCanvas.offsetY-=this.SCALE_STEP,t.draw()}),100)})),document.getElementById("move-down").addEventListener("touchstart",(()=>{this.interval=setInterval((()=>{t.multibrotCanvas.offsetY+=this.SCALE_STEP,t.juliaCanvas.offsetY+=this.SCALE_STEP,t.draw()}),100)})),document.getElementById("move-right").addEventListener("touchstart",(()=>{this.interval=setInterval((()=>{t.multibrotCanvas.offsetX-=this.SCALE_STEP,t.juliaCanvas.offsetX-=this.SCALE_STEP,t.draw()}),100)})),document.getElementById("move-left").addEventListener("touchstart",(()=>{this.interval=setInterval((()=>{t.multibrotCanvas.offsetX+=this.SCALE_STEP,t.juliaCanvas.offsetX+=this.SCALE_STEP,t.draw()}),100)})),document.getElementById("zoom-out").addEventListener("touchstart",(()=>{this.interval=setInterval((()=>{t.multibrotCanvas.scale+=this.SCALE_STEP,t.juliaCanvas.scale+=this.SCALE_STEP,t.draw()}),100)})),document.getElementById("zoom-in").addEventListener("touchstart",(()=>{this.interval=setInterval((()=>{t.multibrotCanvas.scale-=this.SCALE_STEP,t.juliaCanvas.scale-=this.SCALE_STEP,t.draw()}),100)})),document.getElementById("move-up").addEventListener("mousedown",(()=>{this.interval=setInterval((()=>{t.multibrotCanvas.offsetY-=this.SCALE_STEP,t.juliaCanvas.offsetY-=this.SCALE_STEP,t.draw()}),100)})),document.getElementById("move-down").addEventListener("mousedown",(()=>{this.interval=setInterval((()=>{t.multibrotCanvas.offsetY+=this.SCALE_STEP,t.juliaCanvas.offsetY+=this.SCALE_STEP,t.draw()}),100)})),document.getElementById("move-right").addEventListener("mousedown",(()=>{this.interval=setInterval((()=>{t.multibrotCanvas.offsetX-=this.SCALE_STEP,t.juliaCanvas.offsetX-=this.SCALE_STEP,t.draw()}),100)})),document.getElementById("move-left").addEventListener("mousedown",(()=>{this.interval=setInterval((()=>{t.multibrotCanvas.offsetX+=this.SCALE_STEP,t.juliaCanvas.offsetX+=this.SCALE_STEP,t.draw()}),100)})),document.getElementById("zoom-out").addEventListener("mousedown",(()=>{this.interval=setInterval((()=>{t.multibrotCanvas.scale+=this.SCALE_STEP,t.juliaCanvas.scale+=this.SCALE_STEP,t.draw()}),100)})),document.getElementById("zoom-in").addEventListener("mousedown",(()=>{this.interval=setInterval((()=>{t.multibrotCanvas.scale-=this.SCALE_STEP,t.juliaCanvas.scale-=this.SCALE_STEP,t.draw()}),100)})),document.getElementById("move-up").addEventListener("click",(()=>{t.multibrotCanvas.offsetY-=this.SCALE_STEP,t.juliaCanvas.offsetY-=this.SCALE_STEP,t.draw()})),document.getElementById("move-down").addEventListener("click",(()=>{t.multibrotCanvas.offsetY+=this.SCALE_STEP,t.juliaCanvas.offsetY+=this.SCALE_STEP,t.draw()})),document.getElementById("move-right").addEventListener("click",(()=>{t.multibrotCanvas.offsetX-=this.SCALE_STEP,t.juliaCanvas.offsetX-=this.SCALE_STEP,t.draw()})),document.getElementById("move-left").addEventListener("click",(()=>{t.multibrotCanvas.offsetX+=this.SCALE_STEP,t.juliaCanvas.offsetX+=this.SCALE_STEP,t.draw()})),document.getElementById("zoom-out").addEventListener("click",(()=>{t.multibrotCanvas.scale+=this.SCALE_STEP,t.juliaCanvas.scale+=this.SCALE_STEP,t.draw()})),document.getElementById("zoom-in").addEventListener("click",(()=>{t.multibrotCanvas.scale-=this.SCALE_STEP,t.juliaCanvas.scale-=this.SCALE_STEP,t.draw()}))}}},163:function(t,e,n){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Shader=void 0;const a=r(n(680)),o=r(n(450));e.Shader=class{constructor(){this.shaderOptions={exponent:2,maxIterations:100,bailOut:2,colors:[{r:0,g:0,b:0}],uniforms:"",variables:"",iterationsAlgorithm:"",coloringAlgorithm:""}}updateExponent(t){this.shaderOptions.exponent=t}updateMaxIterations(t){this.shaderOptions.maxIterations=t}updateBailOut(t){this.shaderOptions.bailOut=t}updateColors(t){this.shaderOptions.colors=t}updateUniforms(t){this.shaderOptions.uniforms=t}updateVariables(t){this.shaderOptions.variables=t}updateIterationsAlgorithm(t){this.shaderOptions.iterationsAlgorithm=t}updateColoringAlgorithm(t){this.shaderOptions.coloringAlgorithm=t}assembleProgramSource(){this.wrappedFragmentShaderSource=a.default.replace("@EXPONENT@",this.shaderOptions.exponent.toFixed(2).toString()).replace("@MAX_ITERATIONS@",this.shaderOptions.maxIterations.toString()).replace("@BAILOUT@",this.shaderOptions.bailOut.toFixed(2).toString()).replace("@COLORS_COUNT@",this.shaderOptions.colors.length.toString()).replace("@UNIFORMS@",this.shaderOptions.uniforms).replace("@VARIABLES@",this.shaderOptions.variables).replace("@ITERATIONS_ALGORITHM@",this.shaderOptions.iterationsAlgorithm).replace("@COLORING_ALGORITHM@",this.shaderOptions.coloringAlgorithm),this.wrappedVertexShaderSource=o.default}getColors(){return this.shaderOptions.colors}get fragmentShaderSource(){return this.wrappedFragmentShaderSource}get vertexShaderSource(){return this.wrappedVertexShaderSource}}}},e={};function n(r){var a=e[r];if(void 0!==a)return a.exports;var o=e[r]={exports:{}};return t[r].call(o.exports,o,o.exports,n),o.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n(750)})(); \ No newline at end of file