0xb558…7eba

All memos sent from and to 0xb558…7eba.

ATOM is a way of thinking about digital images. The pixel is the atomic unit of every digital image — each pixel is three numbers that define the intensity of red, green, and blue light sources. Every digital image has two representations, a linear sequence of numbers and those numbers converted into a grid of lights that form an image. ATOM is the collision of the objective and subjective, it’s a space to explore. An early version of ATOM, called ORA, was written in C++ in 2003. It was the first time I thought precisely about images as data and data as images. At that time, I was loading photographs into the system to “see” them in different ways, to look at their data through other representations. ATOM, created from scratch in 2023, is completely generative and synthesized. The static gooey color patterns are the core of ATOM. They are generated with code that combines sine waves. These patterns are the data sources that drive three other diagrammatic representations of each pattern image: color blocks, RGB signals, extruded terrain. ATOM is my Rosetta Stone. It’s the foundation for ""An Empty Room,"" my work exhibited at the Los Angeles County Museum of Art (LACMA) in Spring 2023, and also ""923 Empty Rooms,"" a long-form generative art release with Bright Moments and Art Blocks in August 2023. This work all builds on my ""Still Life"" series, first exhibited at the bitforms gallery in New York in 2016 and concluding there with the final ""Still Life"" exhibition in November 2023. Press “spacebar” to keep exploring the “space” of possibilities within the features of each mint. The ‘B’ key changes the background value.
Gone are their worlds. Actions taken that silenced these places for a thousand years. The echo of distant cannons forgotten, the souls of their victims evaporated, claimed by the void. A new epoch now, a different era. Long after the cold and the dark came to claim everything, smoldering under the ashes of memory, we find the veins and arteries of their civilization. Clusters of roots, cavernous extensions of what they lost, that drive themselves deep into the earth. Potent icons of existential dread, of what is gone. Their meaning is unknown, but not unknowable. These RELICS will bring to light what we have forgotten, ancient memories of their catastrophe, so we can learn how not to replicate it.
Upon encountering Matisse's ""Blue Nudes"" series, I found myself intrigued by the photograph of a room adorned with these simple yet evocative depictions of the human form. At first glance the figures appeared as harmonious abstractions, each embodying a shared pose while subtly diverging in unique ways upon closer inspection. This experience ignited my fascination with the artistic endeavor to recreate the same essence through multiple iterations, prompting a contemplation on the role of variations in a generative art series in an era often fixated on extravagant algorithmic diversity. Here we aim to celebrate subtlety. This project employs not only the randomness inherent to algorithms but also the serendipity of human intervention. Anchored in my own hand-drawn inputs, the process intertwines organic paths with algorithmic automation, generating polygons that exude the beauty of nuanced distinctions. Beyond technique, this endeavor mirrors an autobiographical passage — a celebration of my evolution from functional coder to constructor of pure form. Matisse's iconic method of composing with cut paper — initially a preparatory ritual — mirrors my own journey. What once served utilitarian software now finds purpose in artistry, code morphing into my chosen medium of artistic expression. This metamorphosis, a kinship to Matisse's transformation, is my homage to the creative odyssey that beckons when code transcends its pragmatic origins.
let REF_CANVAS_SIZE = 1024; let REF_BUFFER_SIZE = 512; let REF_STROKE_HALF = 0.5; let REF_STROKE_FULL = 1.0; let STROKE_QUART = 0.0; let STROKE_HALF = 0.0; let STROKE_FULL = 0.0; let CANVAS_SIZE = 0; let BUFFER_SIZE = 0; let BG = "#090809"; let BLACK = "#000000"; let LIME = "#cccc66"; let TURQ = "#04edcd"; let WHITE = "#FFFFFF"; let ORANGE = "#FF9900"; let ORANGE_RED = "#cc6600"; let RED_ORANGE = "#ff4800" let MID_GREY = "#CCCCCC"; let DRK_GREY = "#333333"; let RED_PINK = "#ff003c"; let GREEN = "#c5cd7a"; let PINK = "#c90a48"; let FRAME_COL = MID_GREY; let SYSTEM_COL = WHITE; let SEED; let RES_MULTI; let RES_REDUC; let ROOT_DATA = []; let HASH_DATA = []; let BLUR; let palettes_start = [ ["#cccc66", "#999933", "#999966", "#04edcd"], ["#3d2ba5", "#2b53a5", "#2b4ba5", "#04edcd"], ["#cc3300", "#cc6600", "#cc9933", "#04edcd"], ["#ff003c", "#89223b", "#93237d", "#04edcd"] ]; let palettes_stop = [ ["#cdb966", "#9a8637", "#8d8371", "#88b4a1"], ["#773f61", "#5c5286", "#8d4b4d", "#88b4a1"], ["#cd4a28", "#b36347", "#cd6a31", "#88b4a1"], ["#ed3c34", "#7e264a", "#5c358a", "#88b4a1"] ]; function setup() { SEED = parseInt(tokenData.hash.slice(0, 16), 16); randomSeed(SEED); noiseSeed(SEED); noiseDetail(8); let ss = min(windowWidth, windowHeight); RES_MULTI = ss / REF_CANVAS_SIZE; RES_REDUC = REF_CANVAS_SIZE / ss; CANVAS_SIZE = rm(REF_CANVAS_SIZE); BUFFER_SIZE = rm(REF_BUFFER_SIZE); STROKE_HALF = rm(REF_STROKE_HALF); STROKE_FULL = rm(REF_STROKE_FULL); STROKE_QUART = STROKE_HALF / 2.0; createCanvas(CANVAS_SIZE, CANVAS_SIZE, WEBGL); BLUR = new p5.Shader(this._renderer, blur_vertex, blur_fragment); shader(BLUR); set_relicdata(); let MAIN_BUFFER = comp(); fill("#FF9900"); BLUR.setUniform('tex0', MAIN_BUFFER); BLUR.setUniform('blur_amount', rm(8)); BLUR.setUniform('blur_curve', 1); BLUR.setUniform('texelSize', [1 / width, 1 / height]); rect(0, 0, CANVAS_SIZE, CANVAS_SIZE); } function set_relicdata() { function lerp(start, end, amt) { return (1 - amt) * start + amt * end } let hashdata = []; for (let j = 0; j < 32; j++) { let pair = tokenData.hash.slice(2 + (j * 2), 4 + (j * 2)); let npair = parseInt(pair, 16) / 255.0; hashdata.push(npair); } let val_count = hashdata[0]; let val_age = hashdata[1]; let val_pallete = hashdata[2]; let val_creep = hashdata[3]; let val_chaos = hashdata[4]; let val_size = hashdata[5]; let min_core_radius = 30; let max_core_radius = 60; let min_root_radius = 30; let max_root_radius = 30; let min_root_count = 3; let max_root_count = 8; let min_age = 10.0; let max_age = 30.0; let min_taper = 0.0; let min_chaos = 1.0; let max_chaos = 1.5; let min_creep = 0.0; let max_creep = max_core_radius; let min_offset = min_core_radius; let max_offset = max_core_radius; let environment_buffer = 10; let relic_origin = createVector(REF_BUFFER_SIZE / 2, REF_BUFFER_SIZE / 2); let core_radius = round(lerp(min_core_radius, max_core_radius, val_size)); let root_count = Math.round(lerp(min_root_count, max_root_count, val_count)); let root_nodes = root_count - 2; let chaos = round(lerp(min_chaos, max_chaos, val_chaos)); let creep = round(lerp(min_creep, max_creep, val_creep)); let greatest_root_radius = 0; let greatest_offset = 0; let pallete = Math.round(lerp(0, 3, val_pallete)); for (let i = root_count - 1; i >= 0; i--) { let col = rint(2); let angle = TWO_PI / root_nodes; let offset = round(lerp(min_offset, max_offset, random(1.0))); let overlaps = BLACK; let root_radius = round(lerp(min_root_radius, max_root_radius, random(1.0))); greatest_root_radius = (root_radius > greatest_root_radius) ? root_radius : greatest_root_radius; greatest_offset = (offset > greatest_offset) ? offset : greatest_offset; let max_taper = (root_radius / 2); let taper = round(lerp(min_taper, max_taper, random(1.0))); let env_radius = (greatest_root_radius + core_radius + greatest_offset + environment_buffer); let colour_index = col; let strength = 120; let age = round(lerp(min_age, max_age, val_age)); let env_root = (i == 0); let core_root = (i == 1); if (env_root) { offset = 0.0; overlaps = -1; colour_index = 3; strength = 20; age = 50; root_radius = env_radius; creep = 0; } if (core_root) { offset = 0.0; root_radius = core_radius; strength = 120; } ROOT_DATA[i] = get_rootdata(relic_origin, root_radius, angle * (i - 2), age, taper, chaos, creep, offset, overlaps, strength, pallete, colour_index, i); } } function get_rootdata(relic_origin, root_radius, angle, age, taper, chaos, creep, offset, overlaps, strength, pallete, colour_index, no) { let root_data = { relic_origin: relic_origin, root_radius: root_radius, angle: angle, age: age, taper: taper, chaos: chaos, creep: creep, offset: offset, overlaps: overlaps, pallete: pallete, colour_index: colour_index, strength: strength, no: no }; return root_data; } function comp() { let layer_composite = create_layer(CANVAS_SIZE); layer_composite.background(BG); let layer_gradient = create_layer(CANVAS_SIZE); gradient(layer_gradient, 0, 0, CANVAS_SIZE, CANVAS_SIZE, color(BLACK), color(PINK), Axis.y); render_layer(layer_gradient, layer_composite, ADD, 10, Axis.none); let layer_holo = create_layer(CANVAS_SIZE); let layer_basesystem = generate(systems_arrays, Axis.y, BUFFER_SIZE); render_layer(layer_basesystem, layer_holo, ADD, 40, Axis.y); render_layer(layer_basesystem, layer_holo, ADD, 10, Axis.x); render_layer(layer_basesystem, layer_holo, ADD, 10, Axis.z); let layer_relics = generate(draw_relics, Axis.y, rm(1)); render_layer(layer_relics, layer_holo, ADD, 100, Axis.y, false); render_layer(layer_relics, layer_holo, ADD, 100, Axis.y, false); let layer_frame = generate(frame, Axis.x, BUFFER_SIZE / 8); render_layer(layer_frame, layer_holo, ADD, 80, Axis.x); render_layer(layer_frame, layer_holo, ADD, 40, Axis.y); let layer_gradients = generate(grads, Axis.x, BUFFER_SIZE); render_layer(layer_gradients, layer_holo, ADD, 60, Axis.x); render_layer(layer_gradients, layer_holo, ADD, 60, Axis.y); render_layer(layer_gradients, layer_holo, ADD, 60, Axis.z); render_layer(layer_holo, layer_composite, ADD, 100, Axis.none, CANVAS_SIZE / 2, CANVAS_SIZE / 2, CANVAS_SIZE * 0.9, CANVAS_SIZE * 0.9, CENTER); render_layer(layer_holo, layer_composite, ADD, 20, Axis.none, CANVAS_SIZE / 2, CANVAS_SIZE / 2, CANVAS_SIZE * 0.9, CANVAS_SIZE * 0.9, CENTER, true, BUFFER_SIZE * 0.9); return layer_composite; } function draw_indicator(surface, x, y, rad, strk) { surface.strokeWeight(STROKE_QUART); surface.stroke(strk); surface.noFill(); surface.circle(x, y, rad); let s = rad / 4; surface.line(x - (s), y, x + s, y); surface.line(x, y - (s), x, y + (s)); } function draw_relics(graphics, surface, i, axis) { surface.push(); let norm_inc = i / BUFFER_SIZE; let inc = (axis == Axis.none) ? 0 : i; surface.translate(inc, inc); graphics.background("#000000"); graphics.fill(0); let overall_rotational_increment = PI / BUFFER_SIZE; let vertex_arrays = []; let drawn = 0; for (let j = 0; j < ROOT_DATA.length; j++) { let root = ROOT_DATA[j]; let overall_rotation = overall_rotational_increment * i; let radial_offset = (root.offset + (-1.0 * root.creep * norm_inc) * root.chaos); let root_angle = root.angle * root.chaos; let root_origin_x = root.relic_origin.x + (sin(root_angle + overall_rotation) * radial_offset); let root_origin_y = root.relic_origin.y + (cos(root_angle + overall_rotation) * radial_offset); let root_origin = createVector(root_origin_x, root_origin_y); let root_age = root.age; let root_radius = (root.root_radius - (norm_inc * root.taper) * root.chaos); let color_start = color(palettes_start[root.pallete][root.colour_index]); let color_stop = color(palettes_stop[root.pallete][root.colour_index]); let root_colour = lerpColor(color_start, color_stop, norm_inc); root_colour.setAlpha(root.strength); if (noise(rr(i)) > 0.875 && (j % 3 == 0) && (j > 1)) { draw_indicator(surface, rm(root_origin_x), rm(root_origin_y), rm(root_radius + root_age), 150); } vertex_arrays[j] = contour_plot(i, root_origin, root_age, root_radius, root.no); contour_draw(graphics, vertex_arrays[j], STROKE_HALF, root_colour); if (i == BUFFER_SIZE) { surface.noFill(); surface.strokeWeight(rm(0.05)); surface.stroke(DRK_GREY); surface.circle(BUFFER_SIZE / 2, BUFFER_SIZE / 2, (ROOT_DATA[0].root_radius * 2 + 20)); } } for (let j = 0; j < ROOT_DATA.length; j++) { let root = ROOT_DATA[j]; contour_draw(graphics, vertex_arrays[j], STROKE_HALF, -1, root.overlaps); } commit(surface, ADD, graphics, axis, 100); surface.pop(); return surface; } function contour_plot(i, origin, age, radius, root_no) { let reduced_i = rr(i); let radial_steps = 50; let points = []; let ang = TWO_PI / radial_steps; let frequency = 0.015; let affected_radius = radius - abs(sin(reduced_i * 0.01) * radius / 8); for (let j = 0; j <= radial_steps; j++) { let theta = ang * j; let ct = cos(theta); let st = sin(theta); let sample_x = (ct); let sample_y = (st); let sample_z = reduced_i * frequency; let ken = noise(sample_x, sample_y, sample_z); let noise_offset = ken * age; let final_radius = ((affected_radius - noise_offset) + noise(reduced_i * 0.1) * 3.0); let x = rm(origin.x + (final_radius * ct)); let y = rm(origin.y + (final_radius * st)); points.push(createVector(x, y)); } return points; } function contour_draw(surface, vert_array, stroke_weight, stroke_colour = -1, fill_color = -1) { if (fill_color == -1) surface.noFill(); else { surface.fill(fill_color); } if (stroke_colour == -1) surface.noStroke(); else { surface.stroke(stroke_colour); surface.strokeWeight(stroke_weight); } surface.beginShape(); for (let k = 1; k < vert_array.length; k++) { let x = (vert_array[k].x); let y = (vert_array[k].y); surface.vertex(x, y); } surface.endShape(CLOSE); } function grads(graphics, surface, i, axis) { surface.push(); let offset = get_offset_for_axis(axis); surface.translate(offset.x * i, offset.y * i); graphics.background("#000000"); graphics.noFill(); gradient(graphics, 0, graphics.height / 2, graphics.width, graphics.height / 2, color(BLACK), color(GREEN), Axis.y); commit(surface, ADD, graphics, axis, 7); surface.pop(); return surface; } function gradient(surface, x, y, w, h, col_start, col_finish, axis) { let col = 0; surface.strokeWeight(STROKE_FULL); surface.noFill(); if (axis == Axis.x) { for (let i = 0; i < w; i++) { col = lerpColor(col_start, col_finish, i / w); surface.stroke(col); surface.line(x + i, y, x + i, y + h); } } else { for (let i = 0; i < h; i++) { col = lerpColor(col_start, col_finish, i / h); surface.stroke(col); surface.line(x, y + i, x + w, y + i); } } } function systems_arrays(graphics, surface, i, axis) { surface.push(); let offset = get_offset_for_axis(axis); surface.translate(offset.x * i, offset.y * i); graphics.background("#000000"); graphics.noFill(); system(graphics) commit(surface, ADD, graphics, axis, 100); surface.pop(); return surface; } function system(srf) { let w = srf.width / 2; let h = ((srf.width - w) / 2); srf.background(BLACK); let cell_size = rm(16); for (let y = h; y < (BUFFER_SIZE - h); y += cell_size) { srf.stroke(64); srf.strokeWeight(STROKE_FULL); for (let x = h; x < (BUFFER_SIZE - h); x += cell_size) { srf.noStroke(); srf.fill(MID_GREY); srf.circle(x, y, rm(2)); } } let s = subsystem(w, h); srf.push(); srf.translate(srf.width / 2, srf.height / 2); for (let i = 0; i < 4; i++) { srf.rotate(i * HALF_PI); srf.imageMode(CORNER); srf.image(s, -(s.width / 2), -(srf.height / 2)); } srf.pop(); } function subsystem(w, h) { let surf = createGraphics(w, h); let remains = surf.height; function draw_row(row_width, cell_y, cell_h) { let divisions = rint(5) + 1; let row = row_width; for (let i = 0; i < divisions; i++) row /= 2; let cell_width = row; let count = row_width / cell_width; let stroke_color = color(SYSTEM_COL); stroke_color.setAlpha(rint(255)); for (let i = 0; i < count; i++) { draw_cell(i * cell_width, cell_y, cell_width, cell_h, stroke_color) } } function draw_cell(cx, cy, cw, ch, strk) { surf.stroke(strk); surf.strokeWeight(STROKE_HALF); surf.fill(BLACK); surf.rect(cx, cy, cw, ch); } while (true) { let remove = (128 >> rint(5)); if ((remains - remove) < 0) { let r = remains; remove = r; remains = 0; draw_row(surf.width, remains, remove); break; } else { remains -= remove; draw_row(surf.width, remains, remove); if (remains == 0) break; } } return surf; } function generate(draw_function, axis, step_size, iterations = BUFFER_SIZE, surface_size = CANVAS_SIZE, buffer_size = BUFFER_SIZE) { let surface = create_layer(surface_size); let graphics = create_layer(buffer_size); for (let i = 0; i <= iterations; i += step_size) { draw_function(graphics, surface, i, axis); } return surface; } function get_offset_for_axis(axis) { return (axis == Axis.none) ? createVector(0, 0) : createVector(1, 1); } function create_layer(dim) { let layer = createGraphics(dim, dim); layer.imageMode(CORNERS); return layer; } function commit(surface, blend_mode, image, axis, opacity_percentage) { surface.blendMode(blend_mode); let opacity = map(opacity_percentage, 0, 100, 0, 255); if (axis == Axis.x) { surface.push(); surface.scale(-0.5, 1); surface.translate(-image.width, 0); surface.tint(255, opacity); surface.image(image, -image.width, 0); surface.pop(); } else { surface.tint(255, opacity); surface.image(image, 0, 0); } } function frame(graphics, surface, i, axis) { surface.push(); let offset = get_offset_for_axis(axis); surface.translate(offset.x * i, offset.y * i); graphics.background("#000000"); graphics.noFill(); graphics.strokeWeight(STROKE_HALF); graphics.stroke(FRAME_COL); let b = rm(6); let s = BUFFER_SIZE; graphics.line(0, 0, b, 0); graphics.line(0, 0, 0, b); graphics.line(s, 0, s, b); graphics.line(s, 0, s - b, 0); graphics.line(s, s, s, s - b); graphics.line(s, s, s - b, s); graphics.line(0, s, b, s); graphics.line(0, s, 0, s - b); graphics.stroke(FRAME_COL); graphics.strokeWeight(STROKE_HALF); graphics.rect(0, 0, s, s); commit(surface, ADD, graphics, axis, rint(75) + 25); surface.pop(); return surface; } function orth(index, layer) { let base_x = createVector(rm(1024 - 68), rm(259)); let base_y = createVector(rm(509), rm(1)); let base_z = createVector(rm(68), rm(259)); switch (index) { case 0: layer.translate(base_x.x, base_x.y); layer.rotate(radians(30.0)); layer.shearX(radians(30.0)); layer.scale(-1.0, 0.86062); break; case 1: layer.translate(base_y.x, base_y.y); layer.rotate(radians(30.0)); layer.shearX(radians(-30.0)); layer.scale(1.0, 0.86062); break; case 2: layer.translate(base_z.x, base_z.y); layer.rotate(radians(-30.0)); layer.shearX(radians(-30.0)); layer.scale(1.0, 0.86062); break; } } function rint(x) { return round(random(x)); } function render_layer(layer, target, blend_mode, opacity_percentage, axis, x = 0, y = 0, w = CANVAS_SIZE, h = CANVAS_SIZE, mode = CORNER, reflect = false, offset_y = 0) { target.push(); if (axis != Axis.none) orth(axis, target); if (reflect) { target.scale(1, -1); target.translate(0, -(CANVAS_SIZE + offset_y)); } target.imageMode(mode); target.blendMode(blend_mode); target.tint(255, map(opacity_percentage, 0, 100, 0, 255)); target.image(layer, x, y, w, h); target.pop(); } const Axis = { x: 0, y: 1, z: 2, none: 3 }; let blur_vertex = ` attribute vec3 aPosition; attribute vec2 aTexCoord; varying vec2 vTexCoord; void main() { vTexCoord = aTexCoord; vec4 positionVec4 = vec4(aPosition, 1.0); positionVec4.xy = positionVec4.xy * 2.0 - 1.0; gl_Position = positionVec4; } `; let blur_fragment = ` precision mediump float; varying vec2 vTexCoord; uniform sampler2D tex0; uniform float blur_amount; uniform float blur_curve; uniform vec2 texelSize; float gamma = 2.2; vec3 tone_mapping(vec3 color) { color = max(vec3(0.), color - vec3(0.004)); color = (color * (6.2 * color + .5)) / (color * (6.2 * color + 1.7) + 0.06); return color; } void main() { vec2 uv = vTexCoord; uv.y = 1.0 - uv.y; float x = uv.y; float curve = (blur_curve==1.0) ? (max(abs( ((x - 0.289) / 0.428 - 0.504) / 0.5 ), (x - 0.289) / 0.428 / 1.085 * -0.056 + 0.5) * 0.533 + -0.247) : 1.0; float spread = curve * blur_amount; vec2 offset = texelSize * spread; vec4 tex = texture2D(tex0, uv); tex += texture2D(tex0, uv + vec2(-offset.x, -offset.y)); tex += texture2D(tex0, uv + vec2(0.0, -offset.y)); tex += texture2D(tex0, uv + vec2(offset.x, -offset.y)); tex += texture2D(tex0, uv + vec2(-offset.x, 0.0)); tex += texture2D(tex0, uv + vec2(offset.x, 0.0)); tex += texture2D(tex0, uv + vec2(-offset.x, offset.y)); tex += texture2D(tex0, uv + vec2(0.0, offset.y)); tex += texture2D(tex0, uv + vec2(offset.x, offset.y)); tex /= 9.0; vec3 mapped = tone_mapping(tex.xyz); float grain = 0.05; float noise = (fract(sin(dot(uv, vec2(12.9898,78.233)*2.0)) * 43758.5453)); vec3 final = mix(mapped, tex.xyz, 0.71); vec2 st = vec2(uv.x-0.5, uv.t-0.5) * 2.0; float vignette = 1.0 - (0.35*length(st)); vec3 col = final - noise * grain; vec2 bl = step(vec2(0.016),uv); vec2 tr = step(vec2(0.016),1.0-uv); vec3 border = vec3(bl.x * bl.y * tr.x * tr.y); gl_FragColor = vec4(col * vignette * border, 1.0); } `; function rm(value) { return RES_MULTI * value; } function rr(value) { return RES_REDUC * value; }
let REF_CANVAS_SIZE = 1024; let REF_BUFFER_SIZE = 512; let REF_STROKE_HALF = 0.5; let REF_STROKE_FULL = 1.0; let STROKE_HALF = 0.0; let STROKE_FULL = 0.0; let CANVAS_SIZE = 0; let BUFFER_SIZE = 0; let BG = "#090809"; let BLACK = "#000000"; let LIME = "#cccc66"; let TURQ = "#04edcd"; let WHITE = "#FFFFFF"; let ORANGE = "#FF9900"; let ORANGE_RED = "#cc6600"; let RED_ORANGE = "#ff4800" let MID_GREY = "#CCCCCC"; let DRK_GREY = "#333333"; let RED_PINK = "#ff003c"; let GREEN = "#c5cd7a"; let PINK = "#c90a48"; let FRAME_COL = MID_GREY; let SYSTEM_COL = WHITE; let SEED; let RES_MULTI; let RES_REDUC; let ROOT_DATA = []; let HASH_DATA = []; let BLUR; function setup() { SEED = parseInt(tokenData.hash.slice(0, 16), 16); randomSeed(SEED); noiseSeed(SEED); noiseDetail(8); let ss = min(windowWidth, windowHeight); RES_MULTI = ss / REF_CANVAS_SIZE; RES_REDUC = REF_CANVAS_SIZE / ss; CANVAS_SIZE = rm(REF_CANVAS_SIZE); BUFFER_SIZE = rm(REF_BUFFER_SIZE); STROKE_HALF = rm(REF_STROKE_HALF); STROKE_FULL = rm(REF_STROKE_FULL); createCanvas(CANVAS_SIZE, CANVAS_SIZE, WEBGL); BLUR = new p5.Shader(this._renderer, blur_vertex, blur_fragment); shader(BLUR); set_relicdata(); let MAIN_BUFFER = comp(); fill("#FF9900"); BLUR.setUniform('tex0', MAIN_BUFFER); BLUR.setUniform('blur_amount', rm(8)); BLUR.setUniform('blur_curve', 1); BLUR.setUniform('texelSize', [1 / width, 1 / height]); rect(0, 0, CANVAS_SIZE, CANVAS_SIZE); } function set_relicdata() { function lerp(start, end, amt) { return (1 - amt) * start + amt * end } let hashdata = []; for (let j = 0; j < 32; j++) { let pair = tokenData.hash.slice(2 + (j * 2), 4 + (j * 2)); let npair = parseInt(pair, 16) / 255.0; hashdata.push(npair); } let val_count = hashdata[0]; let val_age = hashdata[1]; let val_pallete = hashdata[2]; let val_creep = hashdata[3]; let val_chaos = hashdata[4]; let val_size = hashdata[5]; let palettes = [ ["#cccc66", "#999933", "#999966", "#04edcd"], ["#3d2ba5", "#2b53a5", "#2b4ba5", "#04edcd"], ["#cc3300", "#cc6600", "#cc9933", "#04edcd"], ["#ff003c", "#89223b", "#93237d", "#04edcd"] ]; let min_core_radius = 30; let max_core_radius = 60; let min_root_radius = 30; let max_root_radius = 30; let min_root_count = 3; let max_root_count = 8; let min_age = 10.0; let max_age = 30.0; let min_taper = 0.0; let min_chaos = 1.0; let max_chaos = 1.5; let min_creep = 0.0; let max_creep = max_core_radius; let min_offset = min_core_radius; let max_offset = max_core_radius; let environment_buffer = 10; let relic_origin = createVector(REF_BUFFER_SIZE / 2, REF_BUFFER_SIZE / 2); let core_radius = round(lerp(min_core_radius, max_core_radius, val_size)); let root_count = Math.round(lerp(min_root_count, max_root_count, val_count)); let root_nodes = root_count - 2; let chaos = round(lerp(min_chaos, max_chaos, val_chaos)); let creep = round(lerp(min_creep, max_creep, val_creep)); let greatest_root_radius = 0; let greatest_offset = 0; let pallete = Math.round(lerp(0, 3, val_pallete)); for (let i = root_count - 1; i >= 0; i--) { let col = rint(2); let angle = TWO_PI / root_nodes; let offset = round(lerp(min_offset, max_offset, random(1.0))); let overlaps = BLACK; let root_radius = round(lerp(min_root_radius, max_root_radius, random(1.0))); greatest_root_radius = (root_radius > greatest_root_radius) ? root_radius : greatest_root_radius; greatest_offset = (offset > greatest_offset) ? offset : greatest_offset; let max_taper = (root_radius / 2); let taper = round(lerp(min_taper, max_taper, random(1.0))); let env_radius = (greatest_root_radius + core_radius + greatest_offset + environment_buffer); let colour = palettes[pallete][col]; let strength = 120; let age = round(lerp(min_age, max_age, val_age)); let env_root = (i == 0); let core_root = (i == 1); if (env_root) { offset = 0.0; overlaps = -1; colour = palettes[pallete][3]; strength = 20; age = 50; root_radius = env_radius; creep = 0; } if (core_root) { offset = 0.0; root_radius = core_radius; strength = 120; } ROOT_DATA[i] = get_rootdata(relic_origin, root_radius, angle * (i - 2), age, taper, chaos, creep, colour, offset, overlaps, strength, i); } } function get_rootdata(relic_origin, root_radius, angle, age, taper, chaos, creep, colour, offset, overlaps, strength, no) { let root_data = { relic_origin: relic_origin, root_radius: root_radius, angle: angle, age: age, taper: taper, chaos: chaos, creep: creep, colour: colour, offset: offset, overlaps: overlaps, strength: strength, no: no }; return root_data; } function comp() { let layer_composite = create_layer(CANVAS_SIZE); layer_composite.background(BG); let layer_gradient = create_layer(CANVAS_SIZE); gradient(layer_gradient, 0, 0, CANVAS_SIZE, CANVAS_SIZE, color(BLACK), color(PINK), Axis.y); render_layer(layer_gradient, layer_composite, ADD, 10, Axis.none); let layer_holo = create_layer(CANVAS_SIZE); let layer_basesystem = generate(systems_arrays, Axis.y, BUFFER_SIZE); render_layer(layer_basesystem, layer_holo, ADD, 40, Axis.y); render_layer(layer_basesystem, layer_holo, ADD, 10, Axis.x); render_layer(layer_basesystem, layer_holo, ADD, 10, Axis.z); let layer_relics = generate(draw_relics, Axis.y, rm(1)); render_layer(layer_relics, layer_holo, ADD, 100, Axis.y, false); render_layer(layer_relics, layer_holo, ADD, 100, Axis.y, false); let layer_frame = generate(frame, Axis.x, BUFFER_SIZE / 8); render_layer(layer_frame, layer_holo, ADD, 80, Axis.x); render_layer(layer_frame, layer_holo, ADD, 40, Axis.y); let layer_gradients = generate(grads, Axis.x, BUFFER_SIZE); render_layer(layer_gradients, layer_holo, ADD, 60, Axis.x); render_layer(layer_gradients, layer_holo, ADD, 60, Axis.y); render_layer(layer_gradients, layer_holo, ADD, 60, Axis.z); render_layer(layer_holo, layer_composite, ADD, 100, Axis.none, CANVAS_SIZE / 2, CANVAS_SIZE / 2, CANVAS_SIZE * 0.9, CANVAS_SIZE * 0.9, CENTER); render_layer(layer_holo, layer_composite, ADD, 20, Axis.none, CANVAS_SIZE / 2, CANVAS_SIZE / 2, CANVAS_SIZE * 0.9, CANVAS_SIZE * 0.9, CENTER, true, BUFFER_SIZE * 0.9); return layer_composite; } function draw_relics(graphics, surface, i, axis) { surface.push(); let norm_inc = i / BUFFER_SIZE; let inc = (axis == Axis.none) ? 0 : i; surface.translate(inc, inc); graphics.background("#000000"); graphics.fill(0); let overall_rotational_increment = PI / BUFFER_SIZE; let vertex_arrays = []; for (let j = 0; j < ROOT_DATA.length; j++) { let root = ROOT_DATA[j]; let overall_rotation = overall_rotational_increment * i; let radial_offset = (root.offset + (-1.0 * root.creep * norm_inc) * root.chaos); let root_angle = root.angle * root.chaos; let root_origin_x = root.relic_origin.x + (sin(root_angle + overall_rotation) * radial_offset); let root_origin_y = root.relic_origin.y + (cos(root_angle + overall_rotation) * radial_offset); let root_origin = createVector(root_origin_x, root_origin_y); let root_age = root.age; let root_radius = (root.root_radius - (norm_inc * root.taper) * root.chaos); let root_colour = color(root.colour); root_colour.setAlpha(root.strength); vertex_arrays[j] = contour_plot(i, root_origin, root_age, root_radius, root.no); contour_draw(graphics, vertex_arrays[j], STROKE_HALF, root_colour); if (i == BUFFER_SIZE) { surface.noFill(); surface.strokeWeight(0.05); surface.stroke(MID_GREY); surface.circle(BUFFER_SIZE / 2, BUFFER_SIZE / 2, (ROOT_DATA[0].root_radius * 2 + 20)); } } for (let j = 0; j < ROOT_DATA.length; j++) { let root = ROOT_DATA[j]; contour_draw(graphics, vertex_arrays[j], STROKE_HALF, -1, root.overlaps); } commit(surface, ADD, graphics, axis, 100); surface.pop(); return surface; } function contour_plot(i, origin, age, radius, root_no) { let reduced_i = rr(i); let radial_steps = 50; let points = []; let ang = TWO_PI / radial_steps; let frequency = 0.015; let affected_radius = radius - abs(sin(reduced_i * 0.01) * radius / 8); let sample_offset = root_no; for (let j = 0; j <= radial_steps; j++) { let theta = ang * j; let ct = cos(theta); let st = sin(theta); let sample_x = (ct); let sample_y = (st); let sample_z = reduced_i * frequency; let ken = noise(sample_x, sample_y, sample_z); let noise_offset = ken * age; let final_radius = ((affected_radius - noise_offset) + noise(reduced_i * 0.1) * 3.0); let x = rm(origin.x + (final_radius * ct)); let y = rm(origin.y + (final_radius * st)); points.push(createVector(x, y)); } return points; } function contour_draw(surface, vert_array, stroke_weight, stroke_colour = -1, fill_color = -1) { if (fill_color == -1) surface.noFill(); else { surface.fill(fill_color); } if (stroke_colour == -1) surface.noStroke(); else { surface.stroke(stroke_colour); surface.strokeWeight(stroke_weight); } surface.beginShape(); for (let k = 1; k < vert_array.length; k++) { let x = (vert_array[k].x); let y = (vert_array[k].y); surface.vertex(x, y); } surface.endShape(CLOSE); } function grads(graphics, surface, i, axis) { surface.push(); let offset = get_offset_for_axis(axis); surface.translate(offset.x * i, offset.y * i); graphics.background("#000000"); graphics.noFill(); gradient(graphics, 0, graphics.height / 2, graphics.width, graphics.height / 2, color(BLACK), color(GREEN), Axis.y); commit(surface, ADD, graphics, axis, 7); surface.pop(); return surface; } function gradient(surface, x, y, w, h, col_start, col_finish, axis) { let col = 0; surface.strokeWeight(STROKE_FULL); surface.noFill(); if (axis == Axis.x) { for (let i = 0; i < w; i++) { col = lerpColor(col_start, col_finish, i / w); surface.stroke(col); surface.line(x + i, y, x + i, y + h); } } else { for (let i = 0; i < h; i++) { col = lerpColor(col_start, col_finish, i / h); surface.stroke(col); surface.line(x, y + i, x + w, y + i); } } } function systems_arrays(graphics, surface, i, axis) { surface.push(); let offset = get_offset_for_axis(axis); surface.translate(offset.x * i, offset.y * i); graphics.background("#000000"); graphics.noFill(); system(graphics) commit(surface, ADD, graphics, axis, 100); surface.pop(); return surface; } function system(srf) { let w = srf.width / 2; let h = ((srf.width - w) / 2); srf.background(BLACK); let cell_size = rm(16); for (let y = h; y < (BUFFER_SIZE - h); y += cell_size) { srf.stroke(64); srf.strokeWeight(STROKE_FULL); for (let x = h; x < (BUFFER_SIZE - h); x += cell_size) { srf.noStroke(); srf.fill(MID_GREY); srf.circle(x, y, rm(2)); } } let s = subsystem(w, h); srf.push(); srf.translate(srf.width / 2, srf.height / 2); for (let i = 0; i < 4; i++) { srf.rotate(i * HALF_PI); srf.imageMode(CORNER); srf.image(s, -(s.width / 2), -(srf.height / 2)); } srf.pop(); } function subsystem(w, h) { let surf = createGraphics(w, h); let remains = surf.height; function draw_row(row_width, cell_y, cell_h) { let divisions = rint(5) + 1; let row = row_width; for (let i = 0; i < divisions; i++) row /= 2; let cell_width = row; let count = row_width / cell_width; let stroke_color = color(SYSTEM_COL); stroke_color.setAlpha(rint(255)); for (let i = 0; i < count; i++) { draw_cell(i * cell_width, cell_y, cell_width, cell_h, stroke_color) } } function draw_cell(cx, cy, cw, ch, strk) { surf.stroke(strk); surf.strokeWeight(STROKE_HALF); surf.fill(BLACK); surf.rect(cx, cy, cw, ch); } while (true) { let remove = (128 >> rint(5)); if ((remains - remove) < 0) { let r = remains; remove = r; remains = 0; draw_row(surf.width, remains, remove); break; } else { remains -= remove; draw_row(surf.width, remains, remove); if (remains == 0) break; } } return surf; } function generate(draw_function, axis, step_size, iterations = BUFFER_SIZE, surface_size = CANVAS_SIZE, buffer_size = BUFFER_SIZE) { let surface = create_layer(surface_size); let graphics = create_layer(buffer_size); for (let i = 0; i <= iterations; i += step_size) { draw_function(graphics, surface, i, axis); } return surface; } function get_offset_for_axis(axis) { return (axis == Axis.none) ? createVector(0, 0) : createVector(1, 1); } function create_layer(dim) { let layer = createGraphics(dim, dim); layer.imageMode(CORNERS); return layer; } function commit(surface, blend_mode, image, axis, opacity_percentage) { surface.blendMode(blend_mode); let opacity = map(opacity_percentage, 0, 100, 0, 255); if (axis == Axis.x) { surface.push(); surface.scale(-0.5, 1); surface.translate(-image.width, 0); surface.tint(255, opacity); surface.image(image, -image.width, 0); surface.pop(); } else { surface.tint(255, opacity); surface.image(image, 0, 0); } } function frame(graphics, surface, i, axis) { surface.push(); let offset = get_offset_for_axis(axis); surface.translate(offset.x * i, offset.y * i); graphics.background("#000000"); graphics.noFill(); graphics.strokeWeight(STROKE_FULL); graphics.stroke(FRAME_COL); let b = rm(6); let s = BUFFER_SIZE; graphics.line(0, 0, b, 0); graphics.line(0, 0, 0, b); graphics.line(s, 0, s, b); graphics.line(s, 0, s - b, 0); graphics.line(s, s, s, s - b); graphics.line(s, s, s - b, s); graphics.line(0, s, b, s); graphics.line(0, s, 0, s - b); graphics.stroke(FRAME_COL); graphics.strokeWeight(STROKE_HALF); graphics.rect(0, 0, s, s); commit(surface, ADD, graphics, axis, rint(75) + 25); surface.pop(); return surface; } function orth(index, layer) { let base_x = createVector(rm(1024 - 68), rm(259)); let base_y = createVector(rm(509), rm(1)); let base_z = createVector(rm(68), rm(259)); switch (index) { case 0: layer.translate(base_x.x, base_x.y); layer.rotate(radians(30.0)); layer.shearX(radians(30.0)); layer.scale(-1.0, 0.86062); break; case 1: layer.translate(base_y.x, base_y.y); layer.rotate(radians(30.0)); layer.shearX(radians(-30.0)); layer.scale(1.0, 0.86062); break; case 2: layer.translate(base_z.x, base_z.y); layer.rotate(radians(-30.0)); layer.shearX(radians(-30.0)); layer.scale(1.0, 0.86062); break; } } function rint(x) { return round(random(x)); } function render_layer(layer, target, blend_mode, opacity_percentage, axis, x = 0, y = 0, w = CANVAS_SIZE, h = CANVAS_SIZE, mode = CORNER, reflect = false, offset_y = 0) { target.push(); if (axis != Axis.none) orth(axis, target); if (reflect) { target.scale(1, -1); target.translate(0, -(CANVAS_SIZE + offset_y)); } target.imageMode(mode); target.blendMode(blend_mode); target.tint(255, map(opacity_percentage, 0, 100, 0, 255)); target.image(layer, x, y, w, h); target.pop(); } const Axis = { x: 0, y: 1, z: 2, none: 3 }; let blur_vertex = ` attribute vec3 aPosition; attribute vec2 aTexCoord; varying vec2 vTexCoord; void main() { vTexCoord = aTexCoord; vec4 positionVec4 = vec4(aPosition, 1.0); positionVec4.xy = positionVec4.xy * 2.0 - 1.0; gl_Position = positionVec4; } `; let blur_fragment = ` precision mediump float; varying vec2 vTexCoord; uniform sampler2D tex0; uniform float blur_amount; uniform float blur_curve; uniform vec2 texelSize; float gamma = 2.2; vec3 tone_mapping(vec3 color) { color = max(vec3(0.), color - vec3(0.004)); color = (color * (6.2 * color + .5)) / (color * (6.2 * color + 1.7) + 0.06); return color; } void main() { vec2 uv = vTexCoord; uv.y = 1.0 - uv.y; float x = uv.y; float curve = (blur_curve==1.0) ? (max(abs( ((x - 0.289) / 0.428 - 0.504) / 0.5 ), (x - 0.289) / 0.428 / 1.085 * -0.056 + 0.5) * 0.533 + -0.247) : 1.0; float spread = curve * blur_amount; vec2 offset = texelSize * spread; vec4 tex = texture2D(tex0, uv); tex += texture2D(tex0, uv + vec2(-offset.x, -offset.y)); tex += texture2D(tex0, uv + vec2(0.0, -offset.y)); tex += texture2D(tex0, uv + vec2(offset.x, -offset.y)); tex += texture2D(tex0, uv + vec2(-offset.x, 0.0)); tex += texture2D(tex0, uv + vec2(offset.x, 0.0)); tex += texture2D(tex0, uv + vec2(-offset.x, offset.y)); tex += texture2D(tex0, uv + vec2(0.0, offset.y)); tex += texture2D(tex0, uv + vec2(offset.x, offset.y)); tex /= 9.0; vec3 mapped = tone_mapping(tex.xyz); float grain = 0.05; float noise = (fract(sin(dot(uv, vec2(12.9898,78.233)*2.0)) * 43758.5453)); vec3 final = mix(mapped, tex.xyz, 0.71); vec2 st = vec2(uv.x-0.5, uv.t-0.5) * 2.0; float vignette = 1.0 - (0.35*length(st)); vec3 col = final - noise * grain; vec2 bl = step(vec2(0.016),uv); vec2 tr = step(vec2(0.016),1.0-uv); vec3 border = vec3(bl.x * bl.y * tr.x * tr.y); gl_FragColor = vec4(col * vignette * border, 1.0); } `; function rm(value) { return RES_MULTI * value; } function rr(value) { return RES_REDUC * value; }
var seed = parseInt(tokenData.hash.slice(0, 16), 16); p5.disableFriendlyErrors = true; let pg; let A, B; let A1, A2, A3, A4; let B1, B2, B3, B4; let D1, D2; let xx, yy; let imageDim = 400; let imageLength = imageDim * imageDim; let signalHeight; let numBlocks = imageDim/4; let lastBlockTime = 0; let blockDelay = 375; let dotsDensity = 36; let signalIndex = imageDim * 4; let blockIndex = 0; let drawSignals = true; let drawImage = true; let drawBlocks = true; let drawDots = true; let angle = 0.0; let angleSpeed = 0.01; let newImgData = []; let boff = 0; let ratio = 0.0; // Features let weirdo = false; let doubleWaves = false; let wave1 = -1; let wave2 = -1; function setup() { createCanvas(windowWidth, windowHeight, WEBGL); colorMode(HSB, 360, 100, 100); r = new RND(seed); // BEGIN features if (r.rb(0, 1) > 0.95) { weirdo = true; } if (r.rb(0, 1) > 0.6) { doubleWaves = true; } wave1 = int(r.rb(1, 3)); wave2 = int(r.rb(1, 3)); // END features generateRandImage(); rectMode(CENTER); imageMode(CENTER); setDimensions(); frameRate(30); } function draw() { if (weirdo) { background(newImgData[blockIndex], 80, 100); } else { background(6, 15, 23+boff); } if (drawBlocks) { blocks(); } if (drawSignals) { signals(); } if (drawDots) { dots(); } if (drawImage) { image(pg, A2, B2, D1, D1); } signalIndex += 4; blockIndex += 2; if (signalIndex > pg.pixels.length) { signalIndex = imageDim * 4; } if (blockIndex > newImgData.length) { blockIndex = 0; } } function generateRandImage() { pg = createGraphics(imageDim, imageDim); pg.colorMode(HSB, 360, 100, 100); pg.loadPixels(); waves(pg, wave1, 1); if (doubleWaves) { waves(pg, wave2, 2); } pg.updatePixels(); } function waves(p, wtype, round) { let speed1 = r.rb(0.00001, 0.0005); let angle1 = 0; let speed2 = r.rb(0.00001, 0.0005); let angle2 = 0; let s = 80.0; let b = 100.0; let wscale = r.rb(0.5, 2.0); let imgIndexTemp = 0; p.colorMode(HSB, 360, 100, 100); p.loadPixels(); for (let x = 0; x < p.width; x++) { for (let y = 0; y < p.height; y++) { let angle3 = map(y, 0, p.height, 0, TWO_PI*wscale); if (wtype == 1) { let h1 = map(sin(angle1), -1, 1, 0, 1); let h2 = map(sin(angle2+angle3), -1, 1, 0, 1); let hc = (h1 * h2) * 360; if (round == 1) { newImgData[imgIndexTemp] = hc; p.set(x, y, color(hc, s, b)); } else { let w = (newImgData[imgIndexTemp] + hc)/2; newImgData[imgIndexTemp] = w; p.set(x, y, color(w, s, b)); } } else if (wtype == 2) { let h1 = map(sin(angle1+angle3), -1, 1, 0, 1); let h2 = map(sin(angle2)+sin(angle3), -1, 1, 0, 1); let hc = (h1 * h2) * 360; if (round == 1) { newImgData[imgIndexTemp] = hc; p.set(x, y, color(hc, s, b)); } else { let w = (newImgData[imgIndexTemp] + hc)/2; newImgData[imgIndexTemp] = w; p.set(x, y, color(w, s, b)); } } imgIndexTemp++; angle1 += speed1; angle2 += speed2; } } p.updatePixels(); } function dots() { let rr = D1/imageDim; push(); translate(A1, B1); scale(rr); rotateY(angle); let yyy = 0; let xx = -imageDim/2; let yy = -imageDim/2 for (let i = 0; i < imageLength; i += dotsDensity) { stroke(119, 100, 100); if (i % imageDim == 0) { yyy += dotsDensity/2; } if (i > 0) { point(xx + (i%imageDim), yy + i/imageDim, newImgData[i] - 180); } } pop(); angle += angleSpeed; } function signals() { if (height < width) { push(); translate(0, B2); stroke(255); strokeWeight(1); for (let i = 0; i < pg.width; i++) { let curr = signalIndex - (i*4); let x = map(i, 0, pg.width, -width / 2, width / 2); let ry = map(pg.pixels[curr], 0, 255, -signalHeight/2, signalHeight/2); let gy = map(pg.pixels[curr+1], 0, 255, -signalHeight/2, signalHeight/2); let by = map(pg.pixels[curr+2], 0, 255, -signalHeight/2, signalHeight/2); if (i > 0) { point(x*2, ry-signalHeight); point(x*2, gy); point(x*2, by+signalHeight); } } pop(); } else { push(); translate(A2, 0); stroke(255); strokeWeight(1); for (let i = 0; i < pg.height; i++) { let curr = signalIndex - (i*4); let y = map(i, 0, pg.height, -height / 2, height / 2); let ry = map(pg.pixels[curr], 0, 255, -signalHeight/2, signalHeight/2); let gy = map(pg.pixels[curr+1], 0, 255, -signalHeight/2, signalHeight/2); let by = map(pg.pixels[curr+2], 0, 255, -signalHeight/2, signalHeight/2); if (i > 0) { point(ry-signalHeight, y*2); point(gy, y*2); point(by+signalHeight, y*2); } } pop(); } } function blocks() { noStroke(); for (let i = 0; i < numBlocks; i+=3) { let idx = (blockIndex + ((numBlocks-1) - i)); fill(newImgData[idx], 80, 100); if (width >= height) { xx = map(i, 0, numBlocks, A4, A3); yy = map(i, 0, numBlocks, B4, B3); } else { xx = map(i, 0, numBlocks, A3, A4); yy = map(i, 0, numBlocks, B3, B4); } square(xx, yy, D2); } } function setDimensions() { A = width/2; B = height/2; ratio = A/B; //print(ratio); if (width > height) { A1 = A * -0.5625; A2 = A1; A3 = A * 0.1875; A4 = A * 0.5; B1 = B * -0.389; B2 = B * 0.389; B3 = B * 0.278; B4 = B * -0.278; D1 = B * 0.6; D2 = B * 1.1; } else { A1 = A * -0.389; A2 = A * 0.389; A3 = A * -0.278; A4 = A * 0.278; B1 = B * 0.5625; B2 = B1; B3 = B * -0.1873; B4 = B * -0.5; D1 = A * 0.6; D2 = A * 1.1; } if (ratio > 0.8 && ratio < 1.0) { let d = map(ratio, 0.8, 1.0, 1.0, 0.7) D1 = D1 * d; D2 = D2 * d; } else if (ratio >= 1.0 && ratio < 1.2) { let d = map(ratio, 1.0, 1.2, 0.7, 1.0) D1 = D1 * d; D2 = D2 * d; } signalHeight = D1 / 4.0; } function windowResized() { resizeCanvas(windowWidth, windowHeight); setDimensions(); } function keyPressed() { if (key == ' ') { generateRandImage(); } else if (key == 'b' || key == 'B') { boff += 20; if (boff > 80) { boff = -23; } } else if (key == 's' || key == 'S') { drawSignals = !drawSignals; } else if (key == 't' || key == 'T') { drawDots = !drawDots; } else if (key == 'i' || key == 'I') { drawImage = !drawImage; } } class RND { constructor(seed) { this.seed = seed; } rd() { this.seed ^= this.seed << 13; this.seed ^= this.seed >> 17; this.seed ^= this.seed << 5; return ((this.seed < 0 ? ~this.seed + 1 : this.seed) % 1000) / 1000; } rb(a, b) { return a + (b - a) * this.rd(); } }
let canvas,seed,R,S,featuresInt,featuresReadable;const ratio=.76,colVarParams={hMin:-2.5,hMax:2.5,sMin:-2.5,sMax:15,bMin:-10,bMax:5},bgVarParams={hMin:-5,hMax:5,sMin:-10,sMax:2.5,bMin:-2.5,bMax:5},thicknessDivFactorLowRangeMin=1.75,thicknessDivFactorLowRangeMax=2,thicknessDivFactorHiRangeMin=.5,thicknessDivFactorHiRangeMax=.75,textureSoftLightAlpha=8,textureOverlayAlpha=10,paths=[[{x:.7,y:.07},{x:.59,y:.04},{x:.22,y:.09},{x:.14,y:.16},{x:.23,y:.21},{x:.57,y:.18},{x:.51,y:.12},{x:.54,y:.05},{x:.64,y:.08},{x:.59,y:.18},{x:.7,y:.2},{x:.87,y:.3},{x:.9,y:.59},{x:.81,y:.7},{x:.89,y:.85},{x:.74,y:.66},{x:.8,y:.4},{x:.72,y:.24},{x:.58,y:.19},{x:.5,y:.27},{x:.6,y:.3},{x:.63,y:.24},{x:.61,y:.31},{x:.74,y:.33},{x:.61,y:.54},{x:.07,y:.61},{x:.16,y:.78},{x:.6,y:.81},{x:.92,y:.91},{x:.55,y:.65},{x:.38,y:.34},{x:.22,y:.29},{x:.16,y:.38},{x:.21,y:.66},{x:.27,y:.77},{x:.19,y:.86},],[{x:.71,y:.1},{x:.54,y:.03},{x:.27,y:.06},{x:.08,y:.09},{x:.07,y:.16},{x:.23,y:.23},{x:.64,y:.21},{x:.68,y:.14},{x:.55,y:.06},{x:.43,y:.09},{x:.47,y:.16},{x:.64,y:.2},{x:.8,y:.2},{x:.87,y:.34},{x:.89,y:.57},{x:.81,y:.83},{x:.9,y:.95},{x:.67,y:.78},{x:.79,y:.5},{x:.63,y:.22},{x:.48,y:.3},{x:.53,y:.38},{x:.6,y:.37},{x:.65,y:.3},{x:.6,y:.37},{x:.72,y:.41},{x:.65,y:.51},{x:.1,y:.65},{x:.07,y:.79},{x:.14,y:.88},{x:.5,y:.91},{x:.84,y:.94},{x:.59,y:.83},{x:.45,y:.6},{x:.32,y:.39},{x:.13,y:.29},{x:.1,y:.34},{x:.11,y:.43},{x:.16,y:.73},{x:.2,y:.9},{x:.12,y:.94},],[{x:.69,y:.09},{x:.56,y:.03},{x:.26,y:.07},{x:.16,y:.09},{x:.14,y:.16},{x:.26,y:.21},{x:.56,y:.21},{x:.67,y:.13},{x:.54,y:.06},{x:.43,y:.1},{x:.56,y:.21},{x:.76,y:.19},{x:.89,y:.29},{x:.91,y:.55},{x:.75,y:.82},{x:.89,y:.91},{x:.7,y:.82},{x:.77,y:.64},{x:.71,y:.55},{x:.76,y:.23},{x:.67,y:.21},{x:.64,y:.27},{x:.6,y:.22},{x:.51,y:.31},{x:.62,y:.34},{x:.67,y:.34},{x:.68,y:.44},{x:.64,y:.62},{x:.14,y:.63},{x:.07,y:.72},{x:.31,y:.78},{x:.67,y:.85},{x:.69,y:.73},{x:.69,y:.61},{x:.6,y:.56},{x:.39,y:.42},{x:.26,y:.29},{x:.16,y:.29},{x:.17,y:.43},{x:.25,y:.69},{x:.23,y:.82},{x:.12,y:.91},],[{x:.75,y:.04},{x:.63,y:.03},{x:.31,y:.07},{x:.32,y:.12},{x:.55,y:.14},{x:.77,y:.17},{x:.75,y:.12},{x:.78,y:.06},{x:.89,y:.04},{x:.95,y:.1},{x:.91,y:.17},{x:.79,y:.2},{x:.88,y:.27},{x:.85,y:.53},{x:.87,y:.71},{x:.83,y:.79},{x:.71,y:.78},{x:.65,y:.62},{x:.69,y:.43},{x:.79,y:.23},{x:.61,y:.21},{x:.56,y:.26},{x:.62,y:.31},{x:.69,y:.28},{x:.62,y:.34},{x:.62,y:.59},{x:.23,y:.64},{x:.12,y:.71},{x:.14,y:.79},{x:.51,y:.79},{x:.71,y:.71},{x:.6,y:.62},{x:.49,y:.45},{x:.32,y:.25},{x:.19,y:.23},{x:.16,y:.35},{x:.25,y:.76},{x:.21,y:.86},{x:.16,y:.88},],[{x:.61,y:.06},{x:.27,y:.07},{x:.11,y:.12},{x:.11,y:.17},{x:.24,y:.17},{x:.55,y:.19},{x:.67,y:.21},{x:.73,y:.16},{x:.59,y:.08},{x:.55,y:.19},{x:.67,y:.21},{x:.87,y:.27},{x:.88,y:.43},{x:.87,y:.71},{x:.7,y:.93},{x:.68,y:.64},{x:.79,y:.35},{x:.66,y:.26},{x:.51,y:.32},{x:.57,y:.37},{x:.64,y:.3},{x:.6,y:.37},{x:.72,y:.39},{x:.64,y:.49},{x:.33,y:.54},{x:.1,y:.63},{x:.1,y:.74},{x:.23,y:.86},{x:.8,y:.93},{x:.59,y:.82},{x:.48,y:.6},{x:.36,y:.38},{x:.19,y:.3},{x:.15,y:.38},{x:.1,y:.45},{x:.18,y:.73},{x:.2,y:.89},{x:.12,y:.93},],[{x:.76,y:.07},{x:.16,y:.07},{x:.16,y:.17},{x:.76,y:.17},{x:.76,y:.11},{x:.67,y:.11},{x:.67,y:.17},{x:.91,y:.17},{x:.91,y:.81},{x:.8,y:.81},{x:.8,y:.22},{x:.55,y:.22},{x:.56,y:.32},{x:.64,y:.32},{x:.64,y:.26},{x:.67,y:.26},{x:.67,y:.32},{x:.74,y:.32},{x:.74,y:.48},{x:.12,y:.48},{x:.12,y:.81},{x:.71,y:.81},{x:.71,y:.61},{x:.37,y:.61},{x:.37,y:.24},{x:.23,y:.24},{x:.23,y:.87},{x:.11,y:.87},],[{x:.42,y:.2},{x:.29,y:.15},{x:.16,y:.17},{x:.09,y:.23},{x:.15,y:.29},{x:.33,y:.31},{x:.43,y:.27},{x:.39,y:.22},{x:.33,y:.26},{x:.39,y:.31},{x:.42,y:.41},{x:.5,y:.58},{x:.52,y:.73},{x:.46,y:.84},{x:.15,y:.74},{x:.16,y:.61},{x:.28,y:.51},{x:.43,y:.38},{x:.5,y:.3},{x:.46,y:.29},{x:.55,y:.46},{x:.51,y:.42},{x:.54,y:.29},{x:.61,y:.26},{x:.66,y:.28},{x:.68,y:.33},{x:.66,y:.4},{x:.67,y:.35},{x:.76,y:.31},{x:.84,y:.35},{x:.84,y:.43},{x:.76,y:.62},{x:.81,y:.69},{x:.93,y:.71},],],blue="#0a4f9c",red="#de1215",green="#1aa588",black="#181617",paper="#FBF9EA",classicPalettes=[[green,red,blue],[red],[blue],],colorPalette=[blue,red,green,black,"#ede5d8","#ac1972","#ebca49","#e98110"];let points=[],colors=[];function calculateFeatures($){switch((featuresInt={}).style=[0,1,2][R.weighted_index([.5,.2,.3])],featuresInt.style){case 0:colors=classicPalettes[R.weighted_index([.1,.2,.7])],featuresInt.bg=getColorVariation(paper,bgVarParams);break;case 1:colors=[...colorPalette],featuresInt.bg=colors.splice(colors.indexOf(black),1),colors=R.random_bool(.8)?[paper]:colors.splice(R.random_int(0,colors.length-1),1);break;case 2:colors=[...colorPalette],featuresInt.bg=colors.splice(R.random_int(0,colors.length-1),1)}featuresInt.pathIndex=R.weighted_index([.1,.1,.1,.1,.1,.1,.02]),featuresInt.minSegmentSize=R.random_int(3,7),featuresInt.probSegment=R.random_num(0,.25),featuresInt.probSmooth=R.random_num(.5,1),featuresInt.erraticness=R.random_num(.1,.5),points=paths[featuresInt.pathIndex],featuresReadable={};let e;switch(featuresInt.style){case 0:e="Classic";break;case 1:e="Lino";break;case 2:e="Cut Color"}return featuresReadable.Style=e,featuresReadable.Line=featuresInt.pathIndex<6?numberToRoman(featuresInt.pathIndex+1):"GM",console.log("featuresReadable:",featuresReadable),featuresReadable}function setup(){init(),noLoop()}function draw(){render()}function init(){console.log(`tokenData.hash: ${tokenData.hash}`);let $,e;window.innerHeight<=window.innerWidth/.76?($=.76*Math.max(window.innerHeight,1),e=Math.max(window.innerHeight,1)):($=Math.max(window.innerWidth),e=Math.max(window.innerWidth,1)/.76),console.log(`Canvas w:${$} h:${e}`),createCanvas($,e),pixelDensity(2*displayDensity()),seed=parseInt(tokenData.hash.slice(0,16),16),R=new Random,S=new SimplexNoise(seed),calculateFeatures(tokenData)}function render(){background(featuresInt.bg);let $=segmentPath(points,featuresInt.probSegment,featuresInt.minSegmentSize),e=[];for(let n=0;n<$.length;n++){let r={points:$[n],thickness:R.random_num(.04,.06),erraticness:R.random_dec(),col:0==featuresInt.style?getColorVariation(R.random_choice(colors),colVarParams):R.random_choice(colors)};r.poly=getPolyFromStroke(r.points,r.thickness,r.erraticness),r.poly=smoothPoly(r.poly,3,!0,featuresInt.probSmooth),e.push(r),r.strokePoly=getPolyFromStroke(r.poly,.004,.1);let _=[];for(let t=0;t<R.random_int(5,15);t++){let o={};o.col=getColorVariation(R.random_choice(colors),colVarParams),o.highlightCol=getColorVariation(R.random_choice(["#ffffff","#000000"]),bgVarParams);let a=R.random_num(.1,.25),y=R.random_num(0,TAU),x=R.random_dec(),l=R.random_dec(),s=[];for(let i=y;i<TAU+y;i+=TAU/R.random_int(3,10)){let u=a*R.random_num(.5,1),m=x+u*Math.cos(i),d=l+u*Math.sin(i);s.push({x:m,y:d})}s=smoothPoly(s,3,!0,.75),o.poly=s,o.expandedPoly=scalePoly(s,R.random_num(.002,.004)),o.expandedPolyAlpha=R.random_num(90,120),_.push(o)}r.patches=_}featuresInt.segments=e,console.log("featuresInt:",featuresInt);for(let h=0;h<featuresInt.segments.length;h++){let c=featuresInt.segments[h],f=createGraphics(width,height),g=f.canvas.getContext("2d");for(let p of(g.clearRect(0,0,width,height),g.globalCompositeOperation="destination-over",f.beginShape(),f.fill(1!=featuresInt.style?featuresInt.bg:R.random_choice(colors)),f.noStroke(),c.strokePoly))f.vertex(p.x*width,p.y*height);if(f.endShape(CLOSE),1!=featuresInt.style){for(let b of(f.beginShape(),f.fill(c.col),f.noStroke(),c.poly))f.vertex(b.x*width,b.y*height);f.endShape(CLOSE),g.globalCompositeOperation="source-over",g.clip(),2!=featuresInt.style&&(drawPatches(f,c.patches),drawTexture(f))}image(f,0,0)}0==featuresInt.style&&drawGlobalDiscoloration(),drawGlobalNoiseGrain()}function segmentPath($,e,n){let r=[],_=[];for(let t=0;t<$.length;t++)_.push($[t]),_.length>=n&&t<$.length-n&&R.random_bool(e)&&(_.push($[t+1]),r.push([..._]),_.length=0);return r.push([..._]),r}function getPolyFromStroke($,e,n){let r=[];if($.length>1){for(let _=0;_<$.length-1;_++){let t={x:$[_].x+R.random_num(-.02,.02)*n,y:$[_].y+R.random_num(-.02,.02)*n},o={x:$[_+1].x+R.random_num(-.02,.02)*n,y:$[_+1].y+R.random_num(-.02,.02)*n};0==_&&r.push(getPerpendicularPoint(t,o,0,e/map(t.y,0,1,R.random_num(1.75,2),R.random_num(.5,.75)))),r.push(getPerpendicularPoint(t,o,R.random_num(.4,.6),e/map(t.y,0,1,R.random_num(1.75,2),R.random_num(.5,.75)))),r.push(getPerpendicularPoint(t,o,1,e/map(t.y,0,1,R.random_num(1.75,2),R.random_num(.5,.75))))}for(let a=$.length-1;a>0;a--){let y={x:$[a].x+R.random_num(-.02,.02)*n,y:$[a].y+R.random_num(-.02,.02)*n},x={x:$[a-1].x+R.random_num(-.02,.02)*n,y:$[a-1].y+R.random_num(-.02,.02)*n};r.push(getPerpendicularPoint(y,x,0,e/map(y.y,0,1,R.random_num(1.75,2),R.random_num(.5,.75)))),r.push(getPerpendicularPoint(y,x,R.random_num(.4,.6),e/map(y.y,0,1,R.random_num(1.75,2),R.random_num(.5,.75)))),a==$.length-2&&r.push(getPerpendicularPoint(y,x,1,e/map(y.y,0,1,R.random_num(1.75,2),R.random_num(.5,.75))))}}return r.push(r[0]),r}function getPerpendicularPoint($,e,n,r){let _=atan2(e.y-$.y,e.x-$.x),t=getMidPoint($,e,n);return{x:t.x+r*Math.cos(_-HALF_PI),y:t.y+r*Math.sin(_-HALF_PI)}}function getMidPoint($,e,n){return{x:$.x*(1-n)+e.x*n,y:$.y*(1-n)+e.y*n}}function smoothPoly($,e,n,r){let _=[],t=$.length-1;n&&(t+=2);for(let o=0;o<t;o++){let a=$[o%$.length],y=$[(o+1)%$.length];o!=$.length-1&&(R.random_bool(r)?(_.push({x:.75*a.x+.25*y.x,y:.75*a.y+.25*y.y}),_.push({x:.25*a.x+.75*y.x,y:.25*a.y+.75*y.y})):_.push(a)),o==t-1&&_.push(y)}for(let x=1;x<e;x++)_=smoothPoly([..._],1);return _}function scalePoly($,e){let n=getPolyCentroid($),r=[];for(let _ of $){let t=_,o={x:n.x,y:n.y};r.push({x:t.x*(1+e)+-(o.x*e),y:t.y*(1+e)+-(o.y*e)})}return r}function getPolyCentroid($){let e=0,n=0;for(let r=0;r<$.length;r++){let _=$[r],t=$[(r+1)%$.length],o=_.x*t.y-t.x*_.y;e+=(_.x+t.x)*o,n+=(_.y+t.y)*o}let a=calculatePolygonArea($),y=1/(6*a),x=y*e,l=y*n;return{x:x,y:l}}function calculatePolygonArea($){let e=0;for(let n=0;n<$.length;n++){let r=$[n],_=$[(n+1)%$.length];e+=r.x*_.y-_.x*r.y}return Math.abs(e/=2)}function drawTexture($){let e=R.random_int(0,99999),n=width/10,r=height/100;$.rectMode(CENTER);for(let _=0;_<2;_++)for(let t=-50;t<150;t++)for(let o=-5;o<15;o++){$.push(),$.translate(n*(o+.5),r*(t+.5));let a,y;0==_?(a=.4,y=.01):1==_&&(a=.005,y=.2);let x=map(S.noise3D(e,t*a,o*y),0,1,150,190),l;x>160?($.blendMode(SOFT_LIGHT),l=8):($.blendMode(OVERLAY),l=10),$.fill(x,l),$.noStroke();let s=map(S.noise3D(e,.001*t,.005*o),0,1,-5*r,5*r),i=map(S.noise3D(e,.005*t,.001*o),0,1,-2*n,2*n),u=R.random_num(0,TAU);$.beginShape();for(let m=u;m<TAU+u;m+=TAU/R.random_int(3,10)){let d=i+n*R.random_num(2,4)*Math.cos(m),h=s+r*R.random_num(2,4)*Math.sin(m);$.vertex(d,h)}$.endShape(CLOSE),$.pop()}}function drawPatches($,e){for(let n=0;n<e.length;n++){let r=e[n],_=color(r.highlightCol);for(let t of(_.setAlpha(r.expandedPolyAlpha),$.fill(_),$.beginShape(),r.expandedPoly))$.vertex(t.x*width,t.y*height);for(let o of($.endShape(CLOSE),(_=color(r.col)).setAlpha(255),$.beginShape(),$.fill(_),$.noStroke(),r.poly))$.vertex(o.x*width,o.y*height);$.endShape(CLOSE)}}function drawGlobalDiscoloration(){drawingContext.save();let $=drawingContext.createLinearGradient(width/2,height*R.random_num(-.1,-.2),width/2,1*height),e=drawingContext.createLinearGradient(width/2,height*R.random_num(1.1,1.2),width/2,0*height),n=drawingContext.createLinearGradient(width*R.random_num(-.1,-.2),height/2,1*width,height/2),r=drawingContext.createLinearGradient(width*R.random_num(1.1,1.2),height/2,0*width,height/2);for(let _ of(drawingContext.globalCompositeOperation="color-burn",[$,e,n,r]))_.addColorStop(0,"rgba(0,0,0,0.25)"),_.addColorStop(.5,"rgba(255,255,255,0.05)"),drawingContext.fillStyle=_,drawingContext.fillRect(0,0,width,height);drawingContext.restore()}function drawGlobalNoiseGrain(){drawingContext.save(),drawingContext.globalCompositeOperation="multiply";for(let $=0;$<5e4;$++){push();let e=R.random_dec()*width,n=R.random_dec()*height,r=1==featuresInt.style?color(255):color(R.random_bool(.9)?R.random_num(50,80):featuresInt.bg);r.setAlpha(R.random_bool(.999)?map(S.noise2D(.0025*e,.0025*n),0,1,20,40):R.random_num(80,120)),fill(r),noStroke();let _=width*(R.random_bool(.999)?R.random_num(.001,.003):R.random_num(.004,.006)),t=R.random_num(0,TAU);beginShape();for(let o=t;o<TAU+t;o+=TAU/R.random_int(3,10)){let a=e+(_/2+width*R.random_num(-.001,.001))*Math.cos(o),y=n+(_/2+width*R.random_num(-.001,.001))*.6*Math.sin(o);curveVertex(a,y)}endShape(CLOSE),pop()}drawingContext.restore()}function getColorVariation($,e){let n=color($);if(!R.random_bool(.8))return n.toString("#rrggbb");{let r=R.random_num(e.hMin,e.hMax),_=R.random_num(e.sMin,e.sMax),t=R.random_num(e.bMin,e.bMax),o=hexToHSB($);return o[0]=Math.round((o[0]+r)%360),o[1]=Math.max(Math.min(o[1]+_,100),0),o[2]=Math.max(Math.min(o[2]+t,100),0),color(`hsb(${o[0]}, ${o[1]}%, ${o[2]}%)`).toString("#rrggbb")}}function hexToHSB($){$=$.replace("#","");let e=parseInt($.substring(0,2),16)/255,n=parseInt($.substring(2,4),16)/255,r=parseInt($.substring(4,6),16)/255,_=Math.max(e,n,r),t=Math.min(e,n,r),o;return(o=Math.round(60*(o=_===t?0:_===e?(n-r)/(_-t)%6:_===n?(r-e)/(_-t)+2:(e-n)/(_-t)+4)))<0&&(o+=360),[o,0===_?0:Math.round((_-t)/_*100),Math.round(100*_)]}function numberToRoman($){let e="";for(let n of[{value:1e3,numeral:"M"},{value:900,numeral:"CM"},{value:500,numeral:"D"},{value:400,numeral:"CD"},{value:100,numeral:"C"},{value:90,numeral:"XC"},{value:50,numeral:"L"},{value:40,numeral:"XL"},{value:10,numeral:"X"},{value:9,numeral:"IX"},{value:5,numeral:"V"},{value:4,numeral:"IV"},{value:1,numeral:"I"}])for(;$>=n.value;)e+=n.numeral,$-=n.value;return e}class Random{constructor(){this.useA=!1;let $=function($){let e=parseInt($.substring(0,8),16),n=parseInt($.substring(8,16),16),r=parseInt($.substring(16,24),16),_=parseInt($.substring(24,32),16);return function(){r|=0;let $=((e|=0)+(n|=0)|0)+(_|=0)|0;return _=_+1|0,e=n^n>>>9,n=r+(r<<3)|0,r=(r=r<<21|r>>>11)+$|0,($>>>0)/4294967296}};this.prngA=new $(tokenData.hash.substring(2,34)),this.prngB=new $(tokenData.hash.substring(34,66));for(let e=0;e<1e6;e+=2)this.prngA(),this.prngB()}random_dec(){return this.useA=!this.useA,this.useA?this.prngA():this.prngB()}random_num($,e){return $+(e-$)*this.random_dec()}random_int($,e){return Math.floor(this.random_num($,e+1))}random_bool($){return this.random_dec()<$}random_choice($){return $[this.random_int(0,$.length-1)]}weighted_index($){let e=0;for(let n=0;n<$.length;n++)e+=$[n];let r=e*this.random_dec();for(let _=0;_<$.length;_++){if(r<$[_])return _;r-=$[_]}return $.length-1}}!function(){"use strict";var $=.5*(Math.sqrt(3)-1),e=(3-Math.sqrt(3))/6,n=1/3,r=1/6,_=(Math.sqrt(5)-1)/4,t=(5-Math.sqrt(5))/20;function o($){var e;e="function"==typeof $?$:$?function $(){var e,n=0,r=0,_=0,t=1,o=(e=4022871197,function($){$=$.toString();for(var n=0;n<$.length;n++){var r=.02519603282416938*(e+=$.charCodeAt(n));e=r>>>0,r-=e,r*=e,e=r>>>0,r-=e,e+=4294967296*r}return(e>>>0)*23283064365386963e-26});n=o(" "),r=o(" "),_=o(" ");for(var a=0;a<arguments.length;a++)n-=o(arguments[a]),n<0&&(n+=1),r-=o(arguments[a]),r<0&&(r+=1),_-=o(arguments[a]),_<0&&(_+=1);return o=null,function(){var $=2091639*n+23283064365386963e-26*t;return n=r,r=_,_=$-(t=0|$)}}($):Math.random,this.p=a(e),this.perm=new Uint8Array(512),this.permMod12=new Uint8Array(512);for(var n=0;n<512;n++)this.perm[n]=this.p[255&n],this.permMod12[n]=this.perm[n]%12}function a($){var e,n=new Uint8Array(256);for(e=0;e<256;e++)n[e]=e;for(e=0;e<255;e++){var r=e+~~($()*(256-e)),_=n[e];n[e]=n[r],n[r]=_}return n}o.prototype={grad3:new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]),grad4:new Float32Array([0,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,1,0,1,1,1,0,1,-1,1,0,-1,1,1,0,-1,-1,-1,0,1,1,-1,0,1,-1,-1,0,-1,1,-1,0,-1,-1,1,1,0,1,1,1,0,-1,1,-1,0,1,1,-1,0,-1,-1,1,0,1,-1,1,0,-1,-1,-1,0,1,-1,-1,0,-1,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,0]),noise2D:function(n,r){var _,t,o=this.permMod12,a=this.perm,y=this.grad3,x=0,l=0,s=0,i=(n+r)*$,u=Math.floor(n+i),m=Math.floor(r+i),d=(u+m)*e,h=n-(u-d),c=r-(m-d);h>c?(_=1,t=0):(_=0,t=1);var f=h-_+e,g=c-t+e,p=h-1+2*e,b=c-1+2*e,v=255&u,P=255&m,I=.5-h*h-c*c;if(I>=0){var M=3*o[v+a[P]];I*=I,x=I*I*(y[M]*h+y[M+1]*c)}var w=.5-f*f-g*g;if(w>=0){var C=3*o[v+_+a[P+t]];w*=w,l=w*w*(y[C]*f+y[C+1]*g)}var k=.5-p*p-b*b;if(k>=0){var A=3*o[v+1+a[P+1]];k*=k,s=k*k*(y[A]*p+y[A+1]*b)}return 70*(x+l+s)},noise3D:function($,e,_){var t,o,a,y,x,l,s,i,u,m,d=this.permMod12,h=this.perm,c=this.grad3,f=($+e+_)*n,g=Math.floor($+f),p=Math.floor(e+f),b=Math.floor(_+f),v=(g+p+b)*r,P=$-(g-v),I=e-(p-v),M=_-(b-v);P>=I?I>=M?(x=1,l=0,s=0,i=1,u=1,m=0):P>=M?(x=1,l=0,s=0,i=1,u=0,m=1):(x=0,l=0,s=1,i=1,u=0,m=1):I<M?(x=0,l=0,s=1,i=0,u=1,m=1):P<M?(x=0,l=1,s=0,i=0,u=1,m=1):(x=0,l=1,s=0,i=1,u=1,m=0);var w=P-x+r,C=I-l+r,k=M-s+r,A=P-i+2*r,D=I-u+2*r,V=M-m+2*r,F=P-1+3*r,G=I-1+3*r,L=M-1+3*r,H=255&g,T=255&p,B=255&b,O=.6-P*P-I*I-M*M;if(O<0)t=0;else{var q=3*d[H+h[T+h[B]]];O*=O,t=O*O*(c[q]*P+c[q+1]*I+c[q+2]*M)}var X=.6-w*w-C*C-k*k;if(X<0)o=0;else{var N=3*d[H+x+h[T+l+h[B+s]]];X*=X,o=X*X*(c[N]*w+c[N+1]*C+c[N+2]*k)}var W=.6-A*A-D*D-V*V;if(W<0)a=0;else{var z=3*d[H+i+h[T+u+h[B+m]]];W*=W,a=W*W*(c[z]*A+c[z+1]*D+c[z+2]*V)}var E=.6-F*F-G*G-L*L;if(E<0)y=0;else{var j=3*d[H+1+h[T+1+h[B+1]]];E*=E,y=E*E*(c[j]*F+c[j+1]*G+c[j+2]*L)}return 32*(t+o+a+y)},noise4D:function($,e,n,r){var o,a,y,x,l,s,i,u,m,d,h,c,f,g,p,b,v,P=this.perm,I=this.grad4,M=($+e+n+r)*_,w=Math.floor($+M),C=Math.floor(e+M),k=Math.floor(n+M),A=Math.floor(r+M),D=(w+C+k+A)*t,V=$-(w-D),F=e-(C-D),G=n-(k-D),L=r-(A-D),H=0,T=0,B=0,O=0;V>F?H++:T++,V>G?H++:B++,V>L?H++:O++,F>G?T++:B++,F>L?T++:O++,G>L?B++:O++,s=H>=3?1:0,i=T>=3?1:0,u=B>=3?1:0,m=O>=3?1:0,d=H>=2?1:0,h=T>=2?1:0,c=B>=2?1:0,f=O>=2?1:0,g=H>=1?1:0,p=T>=1?1:0,b=B>=1?1:0;var q=V-s+t,X=F-i+t,N=G-u+t,W=L-m+t,z=V-d+2*t,E=F-h+2*t,j=G-c+2*t,J=L-f+2*t,K=V-g+3*t,Q=F-p+3*t,U=G-b+3*t,Y=L-(v=O>=1?1:0)+3*t,Z=V-1+4*t,$$=F-1+4*t,$e=G-1+4*t,$n=L-1+4*t,$r=255&w,$_=255&C,$t=255&k,$o=255&A,$a=.6-V*V-F*F-G*G-L*L;if($a<0)o=0;else{var $y=P[$r+P[$_+P[$t+P[$o]]]]%32*4;$a*=$a,o=$a*$a*(I[$y]*V+I[$y+1]*F+I[$y+2]*G+I[$y+3]*L)}var $x=.6-q*q-X*X-N*N-W*W;if($x<0)a=0;else{var $l=P[$r+s+P[$_+i+P[$t+u+P[$o+m]]]]%32*4;$x*=$x,a=$x*$x*(I[$l]*q+I[$l+1]*X+I[$l+2]*N+I[$l+3]*W)}var $s=.6-z*z-E*E-j*j-J*J;if($s<0)y=0;else{var $0=P[$r+d+P[$_+h+P[$t+c+P[$o+f]]]]%32*4;$s*=$s,y=$s*$s*(I[$0]*z+I[$0+1]*E+I[$0+2]*j+I[$0+3]*J)}var $i=.6-K*K-Q*Q-U*U-Y*Y;if($i<0)x=0;else{var $u=P[$r+g+P[$_+p+P[$t+b+P[$o+v]]]]%32*4;$i*=$i,x=$i*$i*(I[$u]*K+I[$u+1]*Q+I[$u+2]*U+I[$u+3]*Y)}var $3=.6-Z*Z-$$*$$-$e*$e-$n*$n;if($3<0)l=0;else{var $m=P[$r+1+P[$_+1+P[$t+1+P[$o+1]]]]%32*4;$3*=$3,l=$3*$3*(I[$m]*Z+I[$m+1]*$$+I[$m+2]*$e+I[$m+3]*$n)}return 27*(o+a+y+x+l)}},o._buildPermutationTable=a,window.SimplexNoise=o}();
var seed = parseInt(tokenData.hash.slice(0, 16), 16); p5.disableFriendlyErrors = true; let pg; let A, B; let A1, A2, A3, A4; let B1, B2, B3, B4; let D1, D2; let xx, yy; let imageDim = 400; let imageLength = imageDim * imageDim; let signalHeight; let numBlocks = imageDim/4; let lastBlockTime = 0; let blockDelay = 375; let dotsDensity = 36; let signalIndex = imageDim * 4; let blockIndex = 0; let drawSignals = true; let drawImage = true; let drawBlocks = true; let drawDots = true; let angle = 0.0; let angleSpeed = 0.01; let newImgData = []; let boff = 0; let ratio = 0.0; // Features let weirdo = false; let doubleWaves = false; let wave1 = -1; let wave2 = -1; function setup() { createCanvas(windowWidth, windowHeight, WEBGL); colorMode(HSB, 360, 100, 100); r = new RND(seed); // BEGIN features if (r.rb(0, 1) > 0.95) { weirdo = true; } if (r.rb(0, 1) > 0.6) { doubleWaves = true; } wave1 = int(r.rb(1, 3)); wave2 = int(r.rb(1, 3)); // END features generateRandImage(); rectMode(CENTER); imageMode(CENTER); setDimensions(); frameRate(30); } function draw() { if (weirdo) { background(newImgData[blockIndex], 80, 100); } else { background(6, 15, 23+boff); } if (drawBlocks) { blocks(); } if (drawSignals) { signals(); } if (drawDots) { dots(); } if (drawImage) { image(pg, A2, B2, D1, D1); } signalIndex += 4; blockIndex += 2; if (signalIndex > pg.pixels.length) { signalIndex = imageDim * 4; } if (blockIndex > newImgData.length) { blockIndex = 0; } } function generateRandImage() { pg = createGraphics(imageDim, imageDim); pg.colorMode(HSB, 360, 100, 100); pg.loadPixels(); waves(pg, wave1, 1); if (doubleWaves) { waves(pg, wave2, 2); } pg.updatePixels(); } function waves(p, wtype, round) { let speed1 = r.rb(0.00001, 0.0005); let angle1 = 0; let speed2 = r.rb(0.00001, 0.0005); let angle2 = 0; let s = 80.0; let b = 100.0; let wscale = r.rb(0.5, 2.0); let imgIndexTemp = 0; p.colorMode(HSB, 360, 100, 100); p.loadPixels(); for (let x = 0; x < p.width; x++) { for (let y = 0; y < p.height; y++) { let angle3 = map(y, 0, p.height, 0, TWO_PI*wscale); if (wtype == 1) { let h1 = map(sin(angle1), -1, 1, 0, 1); let h2 = map(sin(angle2+angle3), -1, 1, 0, 1); let hc = (h1 * h2) * 360; if (round == 1) { newImgData[imgIndexTemp] = hc; p.set(x, y, color(hc, s, b)); } else { let w = (newImgData[imgIndexTemp] + hc)/2; newImgData[imgIndexTemp] = w; p.set(x, y, color(w, s, b)); } } else if (wtype == 2) { let h1 = map(sin(angle1+angle3), -1, 1, 0, 1); let h2 = map(sin(angle2)+sin(angle3), -1, 1, 0, 1); let hc = (h1 * h2) * 360; if (round == 1) { newImgData[imgIndexTemp] = hc; p.set(x, y, color(hc, s, b)); } else { let w = (newImgData[imgIndexTemp] + hc)/2; newImgData[imgIndexTemp] = w; p.set(x, y, color(w, s, b)); } } imgIndexTemp++; angle1 += speed1; angle2 += speed2; } } p.updatePixels(); } function dots() { let rr = D1/imageDim; push(); translate(A1, B1); scale(rr); rotateY(angle); let yyy = 0; let xx = -imageDim/2; let yy = -imageDim/2 for (let i = 0; i < imageLength; i += dotsDensity) { stroke(119, 100, 100); if (i % imageDim == 0) { yyy += dotsDensity/2; } if (i > 0) { point(xx + (i%imageDim), yy + i/imageDim, newImgData[i] - 180); } } pop(); angle += angleSpeed; } function signals() { if (height < width) { push(); translate(0, B2); stroke(255); strokeWeight(1); for (let i = 0; i < pg.width; i++) { let curr = signalIndex - (i*4); let x = map(i, 0, pg.width, -width / 2, width / 2); let ry = map(pg.pixels[curr], 0, 255, -signalHeight/2, signalHeight/2); let gy = map(pg.pixels[curr+1], 0, 255, -signalHeight/2, signalHeight/2); let by = map(pg.pixels[curr+2], 0, 255, -signalHeight/2, signalHeight/2); if (i > 0) { point(x*2, ry-signalHeight); point(x*2, gy); point(x*2, by+signalHeight); } } pop(); } else { push(); translate(A2, 0); stroke(255); strokeWeight(1); for (let i = 0; i < pg.height; i++) { let curr = signalIndex - (i*4); let y = map(i, 0, pg.height, -height / 2, height / 2); let ry = map(pg.pixels[curr], 0, 255, -signalHeight/2, signalHeight/2); let gy = map(pg.pixels[curr+1], 0, 255, -signalHeight/2, signalHeight/2); let by = map(pg.pixels[curr+2], 0, 255, -signalHeight/2, signalHeight/2); if (i > 0) { point(ry-signalHeight, y*2); point(gy, y*2); point(by+signalHeight, y*2); } } pop(); } } function blocks() { noStroke(); for (let i = 0; i < numBlocks; i+=3) { let idx = (blockIndex + ((numBlocks-1) - i)); fill(newImgData[idx], 80, 100); if (width >= height) { xx = map(i, 0, numBlocks, A4, A3); yy = map(i, 0, numBlocks, B4, B3); } else { xx = map(i, 0, numBlocks, A3, A4); yy = map(i, 0, numBlocks, B3, B4); } square(xx, yy, D2); } } function setDimensions() { A = width/2; B = height/2; ratio = A/B; //print(ratio); if (width > height) { A1 = A * -0.5625; A2 = A1; A3 = A * 0.1875; A4 = A * 0.5; B1 = B * -0.389; B2 = B * 0.389; B3 = B * 0.278; B4 = B * -0.278; D1 = B * 0.6; D2 = B * 1.1; } else { A1 = A * -0.389; A2 = A * 0.389; A3 = A * -0.278; A4 = A * 0.278; B1 = B * 0.5625; B2 = B1; B3 = B * -0.1873; B4 = B * -0.5; D1 = A * 0.6; D2 = A * 1.1; } if (ratio > 0.8 && ratio < 1.0) { let d = map(ratio, 0.8, 1.0, 1.0, 0.7) D1 = D1 * d; D2 = D2 * d; } else if (ratio >= 1.0 && ratio < 1.2) { let d = map(ratio, 1.0, 1.2, 0.7, 1.0) D1 = D1 * d; D2 = D2 * d; } signalHeight = D1 / 4.0; } function windowResized() { resizeCanvas(windowWidth, windowHeight); setDimensions(); } function keyPressed() { if (key == ' ') { generateRandImage(); } else if (key == 'b' || key == 'B') { boff += 20; if (boff > 80) { boff = 0; } } else if (key == 's' || key == 'S') { drawSignals = !drawSignals; } else if (key == 't' || key == 'T') { drawDots = !drawDots; } else if (key == 'i' || key == 'I') { drawImage = !drawImage; } } class RND { constructor(seed) { this.seed = seed; } rd() { this.seed ^= this.seed << 13; this.seed ^= this.seed >> 17; this.seed ^= this.seed << 5; return ((this.seed < 0 ? ~this.seed + 1 : this.seed) % 1000) / 1000; } rb(a, b) { return a + (b - a) * this.rd(); } }
!function(){"use strict";function t(){let t="0x";for(let e=64;0<e;--e)t+="0123456789abcdef"[~~(16*Math.random())];return t}function e(t,e,n){const r=n/180*h;return a=(([t,e,n])=>{let r=o(t+.3963377774*e+.2158037573*n,3),a=o(t-.1055613458*e-.0638541728*n,3),i=o(t-.0894841775*e-1.291485548*n,3);return[k(~~(255*M(4.0767245293*r-3.3072168827*a+.2307590544*i)),0,255),k(~~(255*M(-1.2681437731*r+2.6093323231*a-.341134429*i)),0,255),k(~~(255*M(-.0041119885*r-.7034763098*a+1.7068625689*i)),0,255)]})([t/=100,(e/=100)?e*s(r):0,e?e*i(r):0]),l=k(~~a[0],0,255),c=k(~~a[1],0,255),"#"+(k(~~a[2],0,255)|c<<8|l<<16|16777216).toString(16).slice(1);var a,l,c}var n=Math.round,r=Math.min,a=Math.floor,o=Math.pow,i=Math.sin,s=Math.cos,l=Math.sqrt,h=Math.PI;const c=o(2,-32),d=32557,g=19605,u=new Uint16Array(4),f=new DataView(u.buffer);let v=null,b=!1;const m=()=>{const t=u[0],e=u[1],n=u[2],r=u[3],a=0|33103+d*t,o=0|63335+d*e+(g*t+(a>>>16)),i=0|31614+d*n+g*e+(62509*t+(o>>>16));u[0]=a,u[1]=o,u[2]=i,u[3]=5125+d*r+(g*n+62509*e)+(22609*t+(i>>>16));const s=(r<<21)+((r>>2^n)<<5)+((n>>2^e)>>11);return c*((s>>>(r>>11)|s<<(31&-(r>>11)))>>>0)},p=(t,e=0)=>{const n=16,r=65535,a=255;for(var o,i=1540483477,s=t.length,l=e^s,h=0;4<=s;)o=((o=t[h]&a|(t[++h]&a)<<8|(t[++h]&a)<<16|(t[++h]&a)<<24)&r)*i+(((o>>>n)*i&r)<<n),l=(l&r)*i+(((l>>>n)*i&r)<<n)^(o=((o^=o>>>24)&r)*i+(((o>>>n)*i&r)<<n)),s-=4,++h;switch(s){case 3:l^=(t[h+2]&a)<<n;case 2:l^=(t[h+1]&a)<<8;case 1:l=((l^=t[h]&a)&r)*i+(((l>>>n)*i&r)<<n)}return l=((l^=l>>>13)&r)*i+(((l>>>16)*i&r)<<16),(l^=l>>>15)>>>0},y=t=>{b=!1,v=null;const e=~~((t.length-2)/2),n=[];for(let r=0;r<e;r++){const e=2+2*r;n.push(parseInt(t.slice(e,e+2),16))}const r=p(n,1690382925),a=p(n,72970470);f.setUint32(0,r),f.setUint32(4,a)},x=(t,e)=>(void 0===e&&(e=t,t=0),m()*(e-t)+t),w=(t,e)=>a(x(t,e)),P=t=>t.length?t[w(t.length)]:void 0;var C=Object.freeze({__proto__:null,value:m,set_seed:y,boolean:()=>.5<m(),chance:(t=.5)=>m()<t,range:x,rangeFloor:w,pick:P,shuffle:t=>{for(var e,n,r=t.length,a=[...t];r;)e=~~(m()*r--),n=a[r],a[r]=a[e],a[e]=n;return a},insideCircle:(t=1,e=[])=>{var n=2*m()*h,r=t*l(m());return e[0]=r*s(n),e[1]=r*i(n),e},weighted:t=>{var e,n=0;for(e=0;e<t.length;e++)n+=t[e];var r=m()*n;for(e=0;e<t.length;e++){if(r<t[e])return e;r-=t[e]}return 0},gaussian:(t=0,e=1)=>{var n=Math.log;if(b){b=!1;var r=v;return v=null,t+e*r}var a=0,o=0,i=0;do{i=(a=2*m()-1)*a+(o=2*m()-1)*o}while(1<=i||0===i);var s=l(-2*n(i)/i);return v=o*s,b=!0,t+e*(a*s)},getRandomHash:t});const k=(t,e,n)=>Math.max(r(t,n),e),M=t=>.0031308<t?1.055*o(t,1/2.4)-.055:12.92*t;class W{constructor({random:t,brushHeight:e,lineWidth:n,baseColor:r}){this.random=t,this.brushHeight=e,this.baseColor=r,this.lineWidth=.0015,this.linePaths=this.generateLinePaths()}getAngle=()=>n(180*this.random.value()*h)/180;generateLinePaths(){const t=this.random,n=t.range(.1,.26),r=1-n;this.lineWidth=r*this.lineWidth;const o=a(t.range(20,90));return Array(o).fill().map((()=>{let a=0+t.range(n,n+.4*n),o=1-t.range(n,n+.4*n),i=t.range(.45+.05*r,.55-.05*r),s=t.pick([-1,1]),l=t.range(o-a,.75*o),h=-1==s?i-.003*r:i+.003*r,c=t.pick([-1,1]),d=[],g=this.getAngle();for(let n=0;n<this.brushHeight;n++)d.push({x1Padding:t.range(a,a+.01*r),x2Padding:t.range(o,o+.01*r),yInc:t.range(.0015*r,.0017*r),color:e(t.range(this.baseColor[0],this.baseColor[0]+10),this.baseColor[1],this.baseColor[2])});return[a,o,i,l,h,c,d,g]}))}draw({context:t,scale:e,dim:n,tx:r,ty:a}){t.lineWidth=n*this.lineWidth,this.linePaths.forEach((([n,o,i,s,l,h,c,d])=>{t.translate(r+.5*e,a+.5*e),t.rotate(d),t.translate(-(r+.5*e),-(a+.5*e)),c.forEach((n=>{t.strokeStyle=n.color,t.beginPath(),t.moveTo(r+n.x1Padding*e,a+i*e),t.quadraticCurveTo(r+s*e,a+l*e,r+n.x2Padding*e,a+i*e),t.stroke(),i=-1==h?i-n.yInc:i+n.yInc,l=-1==h?l-n.yInc:l+n.yInc})),t.setTransform(devicePixelRatio,0,0,devicePixelRatio,0,0)}))}}let I="undefined"==typeof tokenData?t():"string"==typeof tokenData?tokenData:tokenData.hash;(()=>{let t=window,n=document;const o=n.body.appendChild(n.createElement("canvas")),i=o.getContext("2d");let s,l,h,c,d;const g=()=>{i.save(),i.scale(d,d),s(i,h,c),i.restore()},u=()=>{l=r(t.innerWidth,t.innerHeight),h=l,c=l,d=t.devicePixelRatio||1,o.width=~~(h*d),o.height=~~(c*d),o.style.width=`${h}px`,o.style.height=`${c}px`,s&&g()};t.addEventListener("resize",u),u(),s=(t=>{y(t);let n=0;const o=P([0,5,10,30,50,80,180]),i=[x(35,90),x(10,30),x(0,360)],s=P([e(100,0,0)]),l=e(0,0,0),h=x(50,90),c=P([1,.5,.25,.125,.0625]),d=1/c*(1/c);let g=[];for(let t=0;t<d;t++)g.push(new W({random:C,brushHeight:h,baseColor:(u=void 0,n+=o,[i[0],i[1],(u=i[2]+n,0>(u%=360)?u+360:u)])}));var u;let f=[];for(let t=0;1e4>t;t++)f.push(m());const v=(t,e,n,r,o,i)=>{for(let s=0;s<e;s++)for(let l=0;l<e;l++){let e;o<f.length||(o=0),e=f[o];const h=a(40*e);t.fillStyle=`rgba(${200+h}, ${200+h}, ${200+h}, ${i})`,t.fillRect(n+s,r+l,1,1),o++}};return(t,e,n)=>{const a=r(e,n);let o=1>=e/n?e:n,i=.5*(e-o),h=.5*(n-o),u=.05*a,f=i+u,b=h+u;const m=c*(o-2*u);((t,e)=>{t.fillStyle=e})(t,s),t.fillRect(i,h,a,a),t.strokeColor=l,t.lineWidth=5,t.rect(i+u,h+u,a-2*u,a-2*u);for(let e=1;e<d-1;e++)t.moveTo(i+u+e*m,h+u),t.lineTo(i+u+e*m,h+u+(a-2*u));for(let e=1;e<d-1;e++)t.moveTo(i+u,h+u+e*m),t.lineTo(i+u+(a-2*u),h+u+e*m);t.stroke(),v(t,a,i,h,0,.4),g.forEach((e=>{e.draw({context:t,scale:m,dim:a,tx:f,ty:b}),f+=m,f>=a-2*u&&(f=i+u,b+=m)})),v(t,a,i,h,0,.1)}})(I),g()})()}();
!function(){"use strict";function t(){let t="0x";for(let e=64;0<e;--e)t+="0123456789abcdef"[~~(16*Math.random())];return t}function e(t,e,n){const r=n/180*h;return a=(([t,e,n])=>{let r=o(t+.3963377774*e+.2158037573*n,3),a=o(t-.1055613458*e-.0638541728*n,3),i=o(t-.0894841775*e-1.291485548*n,3);return[k(~~(255*M(4.0767245293*r-3.3072168827*a+.2307590544*i)),0,255),k(~~(255*M(-1.2681437731*r+2.6093323231*a-.341134429*i)),0,255),k(~~(255*M(-.0041119885*r-.7034763098*a+1.7068625689*i)),0,255)]})([t/=100,(e/=100)?e*s(r):0,e?e*i(r):0]),l=k(~~a[0],0,255),c=k(~~a[1],0,255),"#"+(k(~~a[2],0,255)|c<<8|l<<16|16777216).toString(16).slice(1);var a,l,c}var n=Math.round,r=Math.min,a=Math.floor,o=Math.pow,i=Math.sin,s=Math.cos,l=Math.sqrt,h=Math.PI;const c=o(2,-32),d=32557,g=19605,u=new Uint16Array(4),f=new DataView(u.buffer);let v=null,b=!1;const m=()=>{const t=u[0],e=u[1],n=u[2],r=u[3],a=0|33103+d*t,o=0|63335+d*e+(g*t+(a>>>16)),i=0|31614+d*n+g*e+(62509*t+(o>>>16));u[0]=a,u[1]=o,u[2]=i,u[3]=5125+d*r+(g*n+62509*e)+(22609*t+(i>>>16));const s=(r<<21)+((r>>2^n)<<5)+((n>>2^e)>>11);return c*((s>>>(r>>11)|s<<(31&-(r>>11)))>>>0)},p=(t,e=0)=>{const n=16,r=65535,a=255;for(var o,i=1540483477,s=t.length,l=e^s,h=0;4<=s;)o=((o=t[h]&a|(t[++h]&a)<<8|(t[++h]&a)<<16|(t[++h]&a)<<24)&r)*i+(((o>>>n)*i&r)<<n),l=(l&r)*i+(((l>>>n)*i&r)<<n)^(o=((o^=o>>>24)&r)*i+(((o>>>n)*i&r)<<n)),s-=4,++h;switch(s){case 3:l^=(t[h+2]&a)<<n;case 2:l^=(t[h+1]&a)<<8;case 1:l=((l^=t[h]&a)&r)*i+(((l>>>n)*i&r)<<n)}return l=((l^=l>>>13)&r)*i+(((l>>>16)*i&r)<<16),(l^=l>>>15)>>>0},y=t=>{b=!1,v=null;const e=~~((t.length-2)/2),n=[];for(let r=0;r<e;r++){const e=2+2*r;n.push(parseInt(t.slice(e,e+2),16))}const r=p(n,1690382925),a=p(n,72970470);f.setUint32(0,r),f.setUint32(4,a)},x=(t,e)=>(void 0===e&&(e=t,t=0),m()*(e-t)+t),w=(t,e)=>a(x(t,e)),P=t=>t.length?t[w(t.length)]:void 0;var C=Object.freeze({__proto__:null,value:m,set_seed:y,boolean:()=>.5<m(),chance:(t=.5)=>m()<t,range:x,rangeFloor:w,pick:P,shuffle:t=>{for(var e,n,r=t.length,a=[...t];r;)e=~~(m()*r--),n=a[r],a[r]=a[e],a[e]=n;return a},insideCircle:(t=1,e=[])=>{var n=2*m()*h,r=t*l(m());return e[0]=r*s(n),e[1]=r*i(n),e},weighted:t=>{var e,n=0;for(e=0;e<t.length;e++)n+=t[e];var r=m()*n;for(e=0;e<t.length;e++){if(r<t[e])return e;r-=t[e]}return 0},gaussian:(t=0,e=1)=>{var n=Math.log;if(b){b=!1;var r=v;return v=null,t+e*r}var a=0,o=0,i=0;do{i=(a=2*m()-1)*a+(o=2*m()-1)*o}while(1<=i||0===i);var s=l(-2*n(i)/i);return v=o*s,b=!0,t+e*(a*s)},getRandomHash:t});const k=(t,e,n)=>Math.max(r(t,n),e),M=t=>.0031308<t?1.055*o(t,1/2.4)-.055:12.92*t;class W{constructor({random:t,brushHeight:e,lineWidth:n,baseColor:r}){this.random=t,this.brushHeight=e,this.baseColor=r,this.lineWidth=.0015,this.linePaths=this.generateLinePaths()}getAngle=()=>n(180*this.random.value()*h)/180;generateLinePaths(){const t=this.random,n=t.range(.1,.26),r=1-n;this.lineWidth=r*this.lineWidth;const o=a(t.range(20,90));return Array(o).fill().map((()=>{let a=0+t.range(n,n+.4*n),o=1-t.range(n,n+.4*n),i=t.range(.45+.05*r,.55-.05*r),s=t.pick([-1,1]),l=t.range(o-a,.75*o),h=-1==s?i-.003*r:i+.003*r,c=t.pick([-1,1]),d=[],g=this.getAngle();for(let n=0;n<this.brushHeight;n++)d.push({x1Padding:t.range(a,a+.01*r),x2Padding:t.range(o,o+.01*r),yInc:t.range(.0015*r,.0017*r),color:e(t.range(this.baseColor[0],this.baseColor[0]+10),this.baseColor[1],this.baseColor[2])});return[a,o,i,l,h,c,d,g]}))}draw({context:t,scale:e,dim:n,tx:r,ty:a}){t.lineWidth=n*this.lineWidth,this.linePaths.forEach((([n,o,i,s,l,h,c,d])=>{t.translate(r+.5*e,a+.5*e),t.rotate(d),t.translate(-(r+.5*e),-(a+.5*e)),c.forEach((n=>{t.strokeStyle=n.color,t.beginPath(),t.moveTo(r+n.x1Padding*e,a+i*e),t.quadraticCurveTo(r+s*e,a+l*e,r+n.x2Padding*e,a+i*e),t.stroke(),i=-1==h?i-n.yInc:i+n.yInc,l=-1==h?l-n.yInc:l+n.yInc})),t.setTransform(devicePixelRatio,0,0,devicePixelRatio,0,0)}))}}let I="undefined"==typeof tokenData?t():"string"==typeof tokenData?tokenData:tokenData.hash;(()=>{let t=window,n=document;const o=n.body.appendChild(n.createElement("canvas")),i=o.getContext("2d");let s,l,h,c,d;const g=()=>{i.save(),i.scale(d,d),s(i,h,c),i.restore()},u=()=>{l=r(t.innerWidth,t.innerHeight),h=l,c=l,d=t.devicePixelRatio||1,o.width=~~(h*d),o.height=~~(c*d),o.style.width=`${h}px`,o.style.height=`${c}px`,s&&g()};t.addEventListener("resize",u),u(),s=(t=>{y(t);let n=0;const o=P([0,5,10,30,50,80,180]),i=[x(35,90),x(10,30),x(0,360)],s=P([e(100,0,0)]),l=e(0,0,0),h=x(50,90),c=P([1,.5,.25,.125,.0625]),d=1/c*(1/c);let g=[];for(let t=0;t<d;t++)g.push(new W({random:C,brushHeight:h,baseColor:(u=void 0,n+=o,[i[0],i[1],(u=i[2]+n,0>(u%=360)?u+360:u)])}));var u;let f=[];for(let t=0;1e4>t;t++)f.push(m());const v=(t,e,n,r,o,i)=>{for(let s=0;s<e;s++)for(let l=0;l<e;l++){let e;o<f.length||(o=0),e=f[o];const h=a(40*e);t.fillStyle=`rgba(${200+h}, ${200+h}, ${200+h}, ${i})`,t.fillRect(n+s,r+l,1,1),o++}};return(t,e,n)=>{const a=r(e,n);let o=1>=e/n?e:n,i=.5*(e-o),h=.5*(n-o),u=.05*a,f=i+u,b=h+u;const m=c*(o-2*u);((t,e)=>{t.fillStyle=e})(t,s),t.fillRect(i,h,a,a),t.strokeColor=l,t.lineWidth=5,t.rect(i+u,h+u,a-2*u,a-2*u);for(let e=1;e<d-1;e++)t.moveTo(i+u+e*m,h+u),t.lineTo(i+u+e*m,h+u+(a-2*u));for(let e=1;e<d-1;e++)t.moveTo(i+u,h+u+e*m),t.lineTo(i+u+(a-2*u),h+u+e*m);t.stroke(),v(t,a,i,h,0,.4),g.forEach((e=>{e.draw({context:t,scale:m,dim:a,tx:f,ty:b}),f+=m,f>=a-2*u&&(f=i+u,b+=m)})),v(t,a,i,h,0,.1)}})(I),g()})()}();