From c468a92dd9ea9fb03c363c3efae65ecda33b6005 Mon Sep 17 00:00:00 2001 From: plusk Date: Sat, 31 Oct 2020 16:11:28 +0000 Subject: [PATCH 01/21] Initial gh-pages commit From 7e06ab31a98df7b298640c3ae999abf04dac2c3b Mon Sep 17 00:00:00 2001 From: plusk Date: Sat, 31 Oct 2020 16:11:35 +0000 Subject: [PATCH 02/21] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20=20@?= =?UTF-8?q?=203eb2ebf89a7bb71f65c678d9395eff9fdcac7f7c=20[formerly=20076b6?= =?UTF-8?q?41aa717009599c57d6661ea6535e9cef72c]=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: 8941815ef6e92d730a00e16271b8d011846e6b4f --- index.html | 61 +++++++++++++++++ reset.css | 135 ++++++++++++++++++++++++++++++++++++ style.css | 148 ++++++++++++++++++++++++++++++++++++++++ workshop/chords.html | 34 +++++++++ workshop/layers.html | 34 +++++++++ workshop/perlin.html | 34 +++++++++ workshop/recursion.html | 34 +++++++++ 7 files changed, 480 insertions(+) create mode 100644 index.html create mode 100644 reset.css create mode 100644 style.css create mode 100644 workshop/chords.html create mode 100644 workshop/layers.html create mode 100644 workshop/perlin.html create mode 100644 workshop/recursion.html diff --git a/index.html b/index.html new file mode 100644 index 0000000..1c1d28b --- /dev/null +++ b/index.html @@ -0,0 +1,61 @@ + + + + + + + Generative Processing + + + + + +
+
+
+

Big text

+

Slightly smaller text

+
+
+
+
+
+ + +
chords
+ chords +
+ + +
recursion
+ recursion +
+ + +
layers
+ layers +
+ + +
perlin
+ perlin +
+ +
+
+ Instagram + GitHub +
+ + diff --git a/reset.css b/reset.css new file mode 100644 index 0000000..b98ffa3 --- /dev/null +++ b/reset.css @@ -0,0 +1,135 @@ +/* http://meyerweb.com/eric/tools/css/reset/ + v2.0 | 20110126 + License: none (public domain) +*/ + +*, +*::before, +*::after { + box-sizing: border-box; +} + +html, +body, +div, +span, +applet, +object, +iframe, +h1, +h2, +h3, +h4, +h5, +h6, +p, +blockquote, +pre, +a, +abbr, +acronym, +address, +big, +cite, +code, +del, +dfn, +em, +img, +ins, +kbd, +q, +s, +samp, +small, +strike, +strong, +sub, +sup, +tt, +var, +b, +u, +i, +center, +dl, +dt, +dd, +ol, +ul, +li, +fieldset, +form, +label, +legend, +table, +caption, +tbody, +tfoot, +thead, +tr, +th, +td, +article, +aside, +canvas, +details, +embed, +figure, +figcaption, +footer, +header, +hgroup, +menu, +nav, +output, +ruby, +section, +summary, +time, +mark, +audio, +video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} +/* HTML5 display-role reset for older browsers */ +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +menu, +nav, +section { + display: block; +} +body { + line-height: 1; +} +ol, +ul { + list-style: none; +} +blockquote, +q { + quotes: none; +} +blockquote:before, +blockquote:after, +q:before, +q:after { + content: ""; + content: none; +} +table { + border-collapse: collapse; + border-spacing: 0; +} diff --git a/style.css b/style.css new file mode 100644 index 0000000..6f700e9 --- /dev/null +++ b/style.css @@ -0,0 +1,148 @@ +:root { + --text: black; + --background: antiquewhite; + --padding: 50px; + --line-width: 2px; +} + +body { + display: flex; + flex-direction: column; + align-items: center; + padding: 0 calc(var(--padding) * 2) var(--padding); + + color: var(--text); + background: var(--background); + font-family: "Open Sans", sans-serif; + font-size: 1.5rem; +} + +header { + position: relative; + width: 100%; + height: 75vh; + + font-family: "Montserrat", sans-serif; + display: grid; + grid-template-columns: 1fr 3fr; + grid-template-rows: 3fr 1fr; + grid-gap: var(--line-width); + background: var(--text); + margin: var(--padding) 0; +} + +header > div { + background: var(--background); +} + +#header-items { + display: flex; + flex-direction: column; + justify-content: flex-end; + grid-column: 2; + padding: var(--padding); +} + +#header-items > * + * { + margin-top: 1rem; +} + +h1 { + font-size: 5rem; +} + +main { + width: 100%; + display: grid; + grid-gap: calc(var(--padding) / 2); + grid-template-columns: 1fr 1fr; + grid-auto-rows: 40vw; +} + +main .sketch-entrance { + display: block; + position: relative; +} + +.sketch-entrance > div { + position: absolute; + width: 100%; + height: 100%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + + color: transparent; + + transition: backdrop-filter 0.2s, color 0.2s; +} + +.sketch-entrance > div:hover { + color: white; + backdrop-filter: blur(10px); +} + +.sketch-entrance > img { + display: block; + width: 100%; + height: 100%; + object-fit: cover; +} + +footer { + width: 100%; + display: flex; + justify-content: center; + margin-top: var(--padding); + border-top: var(--line-width) solid var(--text); + padding-top: var(--padding); +} + +footer > a { + transition: opacity 0.2s; +} + +footer > a:hover { + opacity: 0.5; +} + +footer > a > img { + width: var(--padding); +} + +footer > * + * { + margin-left: var(--padding); +} + +@media only screen and (max-width: 1000px) { + :root { + --padding: 25px; + } + + body { + padding: var(--padding); + font-size: 1rem; + } + + header { + height: unset; + } + + .empty { + display: none; + } + + #header-items { + grid-row: 1 / -1; + grid-column: 1 / -1; + padding: var(--padding) 0; + } + + h1 { + font-size: 2rem; + } +} diff --git a/workshop/chords.html b/workshop/chords.html new file mode 100644 index 0000000..2efeeec --- /dev/null +++ b/workshop/chords.html @@ -0,0 +1,34 @@ + + + + + + + chords + + + + + + diff --git a/workshop/layers.html b/workshop/layers.html new file mode 100644 index 0000000..a26654f --- /dev/null +++ b/workshop/layers.html @@ -0,0 +1,34 @@ + + + + + + + layers + + + + + + diff --git a/workshop/perlin.html b/workshop/perlin.html new file mode 100644 index 0000000..039cc28 --- /dev/null +++ b/workshop/perlin.html @@ -0,0 +1,34 @@ + + + + + + + perlin + + + + + + diff --git a/workshop/recursion.html b/workshop/recursion.html new file mode 100644 index 0000000..0da147b --- /dev/null +++ b/workshop/recursion.html @@ -0,0 +1,34 @@ + + + + + + + recursion + + + + + + From 7a4fe740ef2a32f9b673ffd9bbc2e164f2082e19 Mon Sep 17 00:00:00 2001 From: Anders Larsen Date: Sat, 31 Oct 2020 17:12:52 +0100 Subject: [PATCH 03/21] Create CNAME Former-commit-id: d9a3f2f3ba58defadfaf629aad9e71badc77ed9e --- CNAME | 1 + 1 file changed, 1 insertion(+) create mode 100644 CNAME diff --git a/CNAME b/CNAME new file mode 100644 index 0000000..c684094 --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +plusk.no \ No newline at end of file From 5a5635910ef8a773865ec0a346c9df261d472c2e Mon Sep 17 00:00:00 2001 From: plusk Date: Sat, 31 Oct 2020 16:18:16 +0000 Subject: [PATCH 04/21] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20=20@?= =?UTF-8?q?=20c155496ef7ce932230ab3c09891b7d347af9d817=20[formerly=2024695?= =?UTF-8?q?5c6d4565d65e4c3f891f67583c2c05a22df]=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: 06a6acb35200e98a4993aff17800618b68023af3 --- index.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 1c1d28b..b885f0a 100644 --- a/index.html +++ b/index.html @@ -24,22 +24,22 @@

Big text

- +
chords
chords
- +
recursion
recursion
- +
layers
layers
- +
perlin
perlin
From adf93c988ceef23c6d1aa690a8801d2bb70fbdca Mon Sep 17 00:00:00 2001 From: plusk Date: Sat, 31 Oct 2020 16:25:58 +0000 Subject: [PATCH 05/21] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20=20@?= =?UTF-8?q?=2031ec76c76df02780b8c24522e2c2fa0f2f24a083=20[formerly=20a0bae?= =?UTF-8?q?ebf96cbebb511c151af5b124baf9cad59ef]=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: 77db755ab6cb6796b2f9ca0ab44334c4ba77cb14 --- workshop/chords.js | 132 ++++++++++++++++++++++++ workshop/layers.js | 144 ++++++++++++++++++++++++++ workshop/perlin.js | 234 ++++++++++++++++++++++++++++++++++++++++++ workshop/recursion.js | 169 ++++++++++++++++++++++++++++++ 4 files changed, 679 insertions(+) create mode 100644 workshop/chords.js create mode 100644 workshop/layers.js create mode 100644 workshop/perlin.js create mode 100644 workshop/recursion.js diff --git a/workshop/chords.js b/workshop/chords.js new file mode 100644 index 0000000..98ac21f --- /dev/null +++ b/workshop/chords.js @@ -0,0 +1,132 @@ +let PALETTES, COLORS, STROKE, BG; + +/* Enable to make a canvas suitable for A2 paper */ +const PRINT_MODE = false; + +/* Get a random palette or choose a specific one from palettes.json */ +const RANDOM_PALETTE = false; +const PALETTE_NAME = "mono"; + +/* Choose a random color from the palette for each line */ +const RANDOM_STROKE = false; + +/* Each line has its own color from the palette */ +const PALETTED_STROKE = false; + +/* How big the circle will be */ +const RADIUS = 400; + +/* How many independent lines will be drawn each frame */ +const LINE_COUNT = 10; + +/* How swiftly the lines will move around (lower is slower) */ +const NOISE_SPEED = 0.05; + +/* How opaque the lines will be, lower means more transparent */ +/* Lower will be smoother, but also takes longer to fill the circle */ +const OPACITY = 0.05; +const STROKE_WEIGHT = 1; + +/* Enable to use randomness instead of noise to select line locations */ +/* This effectively overrides the remaining config */ +const IS_RANDOM = false; + +/* Experimental: mirrors lines through the center */ +const IS_SYMMETRICAL = false; + +/* If not IS_RANDOM: noise will naturally lean towards an angle */ +/* Enable this to vary where the angle is, or disable and specify your own */ +const RANDOM_BIASED_ANGLE = true; +let BIASED_ANGLE = Math.PI / 2; + +/* If not IS_RANDOM: this value effectively says how strong the bias is */ +/* A lower value means the bias is strong, higher means near-random lines */ +const NOISE_RANDOMNESS = 0.75; + +/* + + CONFIG END + +*/ + +function preload() { + PALETTES = loadJSON("/palettes.json"); +} + +function setup() { + const cnv = PRINT_MODE ? createCanvas(4960, 7016) : createCanvas(1080, 1350); + cnv.mouseClicked(clickOnSave); + pixelDensity(1); + + /* Get colors from the palettes */ + const PALETTE_KEYS = Object.keys(PALETTES); + const RANDOM_PALETTE_NAME = + PALETTE_KEYS[(PALETTE_KEYS.length * Math.random()) << 0]; + const PALETTE = !RANDOM_PALETTE + ? PALETTES[PALETTE_NAME] + : PALETTES[RANDOM_PALETTE_NAME]; + console.log("Palette name: ", RANDOM_PALETTE_NAME); + + colorMode(HSL); + COLORS = PALETTE["colors"].map((col) => color(col)); + BG = color(PALETTE.bg); + + /* Sketch-specific setup */ + strokeWeight(STROKE_WEIGHT); + STROKE = random(COLORS); + STROKE.setAlpha(OPACITY); + stroke(STROKE); + background(BG); + + RANDOM_BIASED_ANGLE && (BIASED_ANGLE = random(TWO_PI)); + noiseDetail(4, NOISE_RANDOMNESS); +} + +function draw() { + /* Moves the origin of the coordinate system to the center of the canvas */ + /* Rotate based on the bias angle, be that random or not */ + translate(width / 2, height / 2); + rotate(BIASED_ANGLE); + + /* For every line to be rendered each frame */ + for (let i = 0; i < LINE_COUNT; i++) { + /* Select two random or noised angles on the circle */ + let a1, a2; + if (IS_RANDOM) { + a1 = random(TWO_PI); + a2 = random(TWO_PI); + } else if (IS_SYMMETRICAL) { + a1 = + TWO_PI * noise(0, frameCount * NOISE_SPEED) + (i * TWO_PI) / LINE_COUNT; + a2 = + TWO_PI * noise(1, frameCount * NOISE_SPEED) + (i * TWO_PI) / LINE_COUNT; + } else { + a1 = TWO_PI * noise(i, frameCount * NOISE_SPEED); + a2 = TWO_PI * noise(i + LINE_COUNT, frameCount * NOISE_SPEED); + } + + /* Use the two angles to determine two points on the circle */ + const x1 = RADIUS * cos(a1); + const y1 = RADIUS * sin(a1); + const x2 = RADIUS * cos(a2); + const y2 = RADIUS * sin(a2); + + /* If random, choose a new color for each line */ + if (RANDOM_STROKE) { + const randomColor = random(COLORS); + randomColor.setAlpha(OPACITY); + stroke(randomColor); + } else if (PALETTED_STROKE) { + const palettedColor = COLORS[i % COLORS.length]; + palettedColor.setAlpha(OPACITY); + stroke(palettedColor); + } + + /* Draw a line between the two points */ + line(x1, y1, x2, y2); + } +} + +function clickOnSave() { + saveCanvas(); +} diff --git a/workshop/layers.js b/workshop/layers.js new file mode 100644 index 0000000..9f52a29 --- /dev/null +++ b/workshop/layers.js @@ -0,0 +1,144 @@ +let PALETTES, COLORS, FILL, BG; + +/* Enable to make a canvas suitable for A2 paper */ +const PRINT_MODE = false; + +/* Get a random palette or choose a specific one from palettes.json */ +const RANDOM_PALETTE = false; +const PALETTE_NAME = "genesis"; + +const LAYER_COUNT = 10; + +/* The average radius of the full shape */ +const MEAN_RADIUS = 500; + +/* Enable strokes on the border of each layer, specify weight if enabled */ +const HAS_STROKE = false; +const STROKE_WEIGHT = 1; + +/* Layers are light to dark (from the center), enable to reverse it */ +const INVERTED_GRADIENT = false; + +/* Instead of gradient from light to dark, go from the fill color to dark */ +const CAP_LIGHTNESS = false; + +/* The degree to which noise affects the layers */ +/* Low values are blobby, high values are spikey */ +const NOISE_MULTIPLIER = 0.2; + +/* The speed at which the layers */ +const NOISE_SPEED = 0.005; + +/* Mirror the layers on either axis */ +const SYMMETRICAL_X = false; +const SYMMETRICAL_Y = false; + +/* Background is determined by the gradient, but these flags may override it */ +/* If both flags are true, palette background will be used */ +const USE_FILL_AS_BACKGROUND = true; +const USE_PALETTE_BACKGROUND = false; + +/* The amount of points that make up each layer, lower means "pointier" */ +/* For example 3 points mean triangular layers, 4 means squares */ +/* Higher might not be noticable, but will make for smoother borders */ +const POINT_COUNT = 500; + +/* Mild rotation, negative speed rotates counter-clockwise */ +const ROTATION_SPEED = 0.001; + +/* + + CONFIG END + +*/ + +function preload() { + PALETTES = loadJSON("/palettes.json"); +} + +function setup() { + const cnv = PRINT_MODE ? createCanvas(4960, 7016) : createCanvas(1080, 1350); + cnv.mouseClicked(clickOnSave); + pixelDensity(1); + + /* Get colors from the palettes */ + const PALETTE_KEYS = Object.keys(PALETTES); + const RANDOM_PALETTE_NAME = + PALETTE_KEYS[(PALETTE_KEYS.length * Math.random()) << 0]; + const PALETTE = !RANDOM_PALETTE + ? PALETTES[PALETTE_NAME] + : PALETTES[RANDOM_PALETTE_NAME]; + console.log("Palette name: ", RANDOM_PALETTE_NAME); + + colorMode(HSL); + COLORS = PALETTE["colors"].map((col) => color(col)); + BG = color(PALETTE.bg); + + /* Sketch-specific setup */ + strokeWeight(STROKE_WEIGHT); + FILL = random(COLORS); + HAS_STROKE ? stroke(FILL) : noStroke(); +} + +function draw() { + /* Move coordinate system to center of canvas for easier trigonometry */ + translate(width / 2, height / 2); + + /* Home-made helper function to select background based on config */ + drawBackground(); + + /* Because layers are drawn in sequence, draw large layers on bottom first */ + for (let i = LAYER_COUNT; i > 0; i--) { + drawLayer((MEAN_RADIUS / LAYER_COUNT) * i, i); + } +} + +function drawBackground() { + if (INVERTED_GRADIENT) { + CAP_LIGHTNESS ? background(FILL) : background(255); + } else { + background(0); + } + USE_FILL_AS_BACKGROUND && background(FILL); + USE_PALETTE_BACKGROUND && background(BG); +} + +function drawLayer(r, i) { + /* A number from 0 to 1, where the middle layer would have 0.5 */ + const layerColorFactor = INVERTED_GRADIENT + ? i / LAYER_COUNT + : 1 - i / LAYER_COUNT; + + /* Adjust saturation and lightness based on the layer factor */ + const fillColor = color( + hue(FILL), + layerColorFactor * saturation(FILL), + layerColorFactor * (CAP_LIGHTNESS ? lightness(FILL) : 100) + ); + fill(fillColor); + + /* Iterate through a full circle of angles to make a layer */ + beginShape(); + for (let a = 0; a < TWO_PI; a += TWO_PI / POINT_COUNT) { + /* Maybe overcomplicated way of getting x and y coordinate in noise field */ + const xOff = SYMMETRICAL_Y + ? cos(a) + : map(i * cos(a) + 1, -1, 1, 1, 1 + NOISE_MULTIPLIER); + const yOff = SYMMETRICAL_X + ? sin(a) + : map(i * sin(a) + 1, -1, 1, 1, 1 + NOISE_MULTIPLIER); + + /* Get noise based on x, y, and the "time" */ + const noised = noise(xOff, yOff, frameCount * NOISE_SPEED); + + /* Compute the final x and y and set a vertex there for the shape */ + const x = noised * r * cos(a + frameCount * ROTATION_SPEED); + const y = noised * r * sin(a + frameCount * ROTATION_SPEED); + vertex(x, y); + } + endShape(CLOSE); +} + +function clickOnSave() { + saveCanvas(); +} diff --git a/workshop/perlin.js b/workshop/perlin.js new file mode 100644 index 0000000..fdbacff --- /dev/null +++ b/workshop/perlin.js @@ -0,0 +1,234 @@ +let PALETTES, COLORS, STROKE, BG; + +/* Enable to make a canvas suitable for A2 paper */ +const PRINT_MODE = false; + +/* Get a random palette or choose a specific one from palettes.json */ +const RANDOM_PALETTE = false; +const PALETTE_NAME = "symmeblu"; + +const STROKE_WEIGHT = 2; +const OPACITY = 1; + +/* The amount of walkers that will be actively drawing each frame */ +/* Reducing increases performance, while increasing will fill in faster */ +const WALKER_COUNT = 500; + +/* The smoothness of the noise, makes a big difference */ +/* Lower values result in more gradual angle adjustments, a bit like zooming in */ +/* Higher values will lead to often more jagged lines, walkers gathering up more */ +const NOISE_ZOOM = 0.002; + +/* Disabling means every walker will have its own color */ +/* Enable to color the walkers based on their location / angle */ +/* Matching the stroke noise with the noise zoom make them mostly aligned */ +/* However, making the noise zooms slightly different offer more layered textures */ +const NOISED_STROKE = true; +const STROKE_NOISE_ZOOM = 0.0025; + +/* The amount of steps a walker will take before being respawned */ +/* Longer steps will often lead to being able to gather more */ +/* Shorter steps will give a rougher or more hairy texture */ +/* A wider range also means more random respawns, and a more textured look */ +const MIN_STEPS = 50; +const MAX_STEPS = 100; +/* Shorter steps make smoother lines, while longer ones may be more jagged */ +const STEP_SIZE = STROKE_WEIGHT + 1; + +/* Enable to clip the flow field by adding a big circle on it */ +/* Disabling reveals the flow field of the full canvas */ +const CLIP_CONTENT = true; +const CLIP_RADIUS = 400; + +/* Enable to round angles to their nearest ANGLE_STEP */ +/* This effectively divides the flow field into angles based */ +const ROUNDED_ANGLES = false; +const ANGLE_STEP = Math.PI / 3; + +/* Noise will naturally lean towards an angle */ +/* Enable this to vary where the angle is, or disable and specify your own */ +const RANDOM_ANGLE_BIAS = true; +let ANGLE_BIAS = Math.PI / 2; + +/* Enable for adding "erasers" that draw more background on the noise */ +/* Disabling or reducing will likely lead to a less textured result*/ +const ERASERS_ENABLED = true; +const ERASER_SPAWN_CHANCE = 0.5; + +/* Instead of lines, draw strings of dots */ +/* Works well with very high step sizes */ +const DOT_LINES = false; + +/* + + CONFIG END + +*/ + +const ACTIVE_WALKERS = []; + +function preload() { + PALETTES = loadJSON("/palettes.json"); +} + +function setup() { + const cnv = PRINT_MODE ? createCanvas(4960, 7016) : createCanvas(1080, 1350); + cnv.mouseClicked(clickOnSave); + pixelDensity(1); + + /* Get colors from the palettes */ + const PALETTE_KEYS = Object.keys(PALETTES); + const RANDOM_PALETTE_NAME = + PALETTE_KEYS[(PALETTE_KEYS.length * Math.random()) << 0]; + const PALETTE = !RANDOM_PALETTE + ? PALETTES[PALETTE_NAME] + : PALETTES[RANDOM_PALETTE_NAME]; + console.log("Palette name: ", RANDOM_PALETTE_NAME); + + colorMode(HSL); + COLORS = PALETTE["colors"].map((col) => color(col)); + BG = color(PALETTE.bg); + + /* Sketch-specific setup */ + strokeWeight(STROKE_WEIGHT); + STROKE = random(COLORS); + background(BG); + + for (let c = 0; c < COLORS.length; c++) { + COLORS[c].setAlpha(OPACITY); + } + + /* Randomize the order of the colors so they equate to different angles each run */ + for (let i = COLORS.length - 1; i > 0; i--) { + const j = Math.floor(Math.random() * (i + 1)); + [COLORS[i], COLORS[j]] = [COLORS[j], COLORS[i]]; + } + + /* Not really meant for configration as it is real confusing */ + /* Determines the amount of noise layers and their effect on the final field */ + noiseDetail(3, 0.75); + + if (RANDOM_ANGLE_BIAS) ANGLE_BIAS = random(TWO_PI); + + /* Intiialize all walkers into the ACTIVE_WALKER list */ + for (let i = 0; i < WALKER_COUNT; i++) { + respawnWalker(i); + } +} + +function draw() { + /* Iterate through all walkers */ + for (let i = 0; i < WALKER_COUNT; i++) { + /* If on the first frame, initialize all walkers (happens only once) */ + const walker = ACTIVE_WALKERS[i]; + + /* If the walker has met the end of its lifespawn, respawn it */ + /* If not, have the walker take another step */ + if (walker.steps > walker.step_cap) { + respawnWalker(i); + } else { + /* Determine angle based on noise at its current point in the field */ + let a = noise(walker.x * NOISE_ZOOM, walker.y * NOISE_ZOOM) * TWO_PI; + + if (ROUNDED_ANGLES) a = round(a / ANGLE_STEP) * ANGLE_STEP; + + /* Effectively rotate the canvas to the angle bias */ + a += PI + ANGLE_BIAS; + + stroke(walker.color); + const x2 = walker.x + STEP_SIZE * cos(a); + const y2 = walker.y + STEP_SIZE * sin(a); + + /* Draw a line from the old to the new point, signifying a step */ + if (DOT_LINES) point(walker.x, walker.y); + else line(walker.x, walker.y, x2, y2); + walker.steps++; + + /* Update the walker coordinates */ + walker.x = x2; + walker.y = y2; + + /* A dumb amount of code that basically says one single thing: */ + /* If the walker hits an edge, loop to the other side of the screen */ + if (!CLIP_CONTENT) { + if (walker.x > width) walker.x = 0 - STEP_SIZE; + if (walker.x < 0) walker.x = width + STEP_SIZE; + if (walker.y > height) walker.y = 0 - STEP_SIZE; + if (walker.y < 0) walker.y = height + STEP_SIZE; + } else { + /* Constraint start and end of screen to be the clipped field */ + const xStart = width / 2 - CLIP_RADIUS; + const xEnd = width / 2 + CLIP_RADIUS; + const yStart = height / 2 - CLIP_RADIUS; + const yEnd = height / 2 + CLIP_RADIUS; + + /* Walkers can get stuck, so hide them just out of view */ + if (walker.x > xEnd) walker.x = xStart - STEP_SIZE; + if (walker.x < xStart) walker.x = xEnd + STEP_SIZE; + if (walker.y > yEnd) walker.y = yStart - STEP_SIZE; + if (walker.y < yStart) walker.y = yEnd + STEP_SIZE; + } + } + } + /* After all walkers have been drawn for the frame, add a clipping circle if desired */ + if (CLIP_CONTENT) drawClipCircle(); +} + +/* Set new coordinates, a random amount of steps, and a color for the walker */ +function respawnWalker(i) { + let x = CLIP_CONTENT + ? random(width / 2 - CLIP_RADIUS, width / 2 + CLIP_RADIUS) + : random(0, width); + let y = CLIP_CONTENT + ? random(height / 2 - CLIP_RADIUS, height / 2 + CLIP_RADIUS) + : random(0, height); + + ACTIVE_WALKERS[i] = { + x: x, + y: y, + steps: 0, + step_cap: random(MIN_STEPS, MAX_STEPS), + color: selectWalkerColor(x, y), + }; +} + +/* Set the color of a walker based on their location, or just randomly */ +function selectWalkerColor(x, y) { + /* If erasers are enabled, determine if the walker will become an eraser */ + if (ERASERS_ENABLED && random() < ERASER_SPAWN_CHANCE) { + return BG; + } + if (NOISED_STROKE) { + /* Set walker color based on the noise value at its coordinates, meaning the angle */ + const colorNoise = noise(x * STROKE_NOISE_ZOOM, y * STROKE_NOISE_ZOOM); + + /* Limit the color selection to the size of the given palette */ + const maxIndex = COLORS.length - 1; + let noisedIndex = round(colorNoise * maxIndex); + if (noisedIndex > maxIndex) { + noisedIndex = maxIndex; + } + return COLORS[noisedIndex]; + } else { + return random(COLORS); + } +} + +function drawClipCircle() { + /* Stroke grows in both directions, leading to some wonky diameter calculation */ + const CLIP_STROKE = width + CLIP_RADIUS * 2; + const CLIP_DIAMETER = CLIP_STROKE + CLIP_RADIUS * 2; + + /* Make the circle content transparent so the flow field is visible through the clip */ + noFill(); + + /* Set stroke, draw circle, and reset the stroke weight back to normal */ + stroke(BG); + strokeWeight(CLIP_STROKE); + circle(width / 2, height / 2, CLIP_DIAMETER); + strokeWeight(STROKE_WEIGHT); +} + +function clickOnSave() { + saveCanvas(); +} diff --git a/workshop/recursion.js b/workshop/recursion.js new file mode 100644 index 0000000..8d8a053 --- /dev/null +++ b/workshop/recursion.js @@ -0,0 +1,169 @@ +let PALETTES, COLORS, STROKE, BG; + +/* Enable to make a canvas suitable for A2 paper */ +const PRINT_MODE = false; + +/* Get a random palette or choose a specific one from palettes.json */ +const RANDOM_PALETTE = false; +const PALETTE_NAME = "symmeblu"; + +/* The size of the recursion field */ +const SIZE = 800; + +/* In addition to the thickness of spacing, adjusts maximum recursion depth */ +/* Scaling up the stroke weight would result in larger shapes overall */ +const STROKE_WEIGHT = 4; + +/* Enable to set a stroke on each shape based on the background color */ +const HAS_STROKE = true; + +/* Keep in mind that spawning shape means no subdivision/recursion in the slot */ +const SHAPE_CHANCE = 0.2; + +/* Lower chance means more empty space in the field */ +const BACKGROUND_CHANCE = 0.5; + +/* Will clear the canvas each frame if enabled, disabling leads to overlap */ +const CLEAR_EACH_FRAME = true; + +/* The shape will be randomly selected from the following object */ +/* The random selection is weighted based on the integer values */ +/* Example: 1 is a normal amount, 2 is double, 0 would be none of that type */ +/* The values are weighed in relation to each other, so 1 2 3 4 = 2 4 6 8 */ +const SHAPE_WEIGHTS = [ + { type: "SQUARE", weight: 1 }, + { type: "DIAMOND", weight: 1 }, + { type: "TRIANGLE", weight: 1 }, + { type: "CIRCLE", weight: 1 }, +]; +const WEIGHTED_SHAPES = []; + +/* + + CONFIG END + +*/ + +function preload() { + PALETTES = loadJSON("/palettes.json"); +} + +function setup() { + const cnv = PRINT_MODE ? createCanvas(4960, 7016) : createCanvas(1080, 1350); + cnv.mouseClicked(clickOnSave); + pixelDensity(1); + frameRate(1); + + /* Get colors from the palettes */ + const PALETTE_KEYS = Object.keys(PALETTES); + const RANDOM_PALETTE_NAME = + PALETTE_KEYS[(PALETTE_KEYS.length * Math.random()) << 0]; + const PALETTE = !RANDOM_PALETTE + ? PALETTES[PALETTE_NAME] + : PALETTES[RANDOM_PALETTE_NAME]; + console.log("Palette name: ", RANDOM_PALETTE_NAME); + + colorMode(HSL); + COLORS = PALETTE["colors"].map((col) => color(col)); + BG = color(PALETTE.bg); + + /* Sketch-specific setup */ + strokeWeight(STROKE_WEIGHT); + STROKE = random(COLORS); + strokeJoin(BEVEL); + HAS_STROKE ? stroke(BG) : noStroke(); + + background(BG); + rectMode(CENTER); + + /* Initialize weighted shapes */ + for (let s = 0; s < SHAPE_WEIGHTS.length; s++) { + const shape = SHAPE_WEIGHTS[s]; + for (let w = 0; w < shape.weight; w++) { + WEIGHTED_SHAPES.push(shape.type); + } + } +} + +function draw() { + CLEAR_EACH_FRAME && background(BG); + + /* Start the recursion field */ + /* More fields can be placed by duplicating this line and changing positions */ + step(0, width / 2, height / 2, SIZE); +} + +function step(currentDepth, x, y, r) { + /* Based on chance to spawn shape, stop recursion for the tile */ + /* If the max depth has been met, all tiles will draw a shape */ + if ( + currentDepth != 0 && + (random() < SHAPE_CHANCE || r <= STROKE_WEIGHT * 8) + ) { + drawRandomShape(x, y, r); + return; + } + + /* If no shape this tile, divide recursion field into four smaller tiles */ + const r2 = r / 2; + step(currentDepth + 1, x - r2 / 2, y - r2 / 2, r2); + step(currentDepth + 1, x + r2 / 2, y - r2 / 2, r2); + step(currentDepth + 1, x - r2 / 2, y + r2 / 2, r2); + step(currentDepth + 1, x + r2 / 2, y + r2 / 2, r2); +} + +function drawRandomShape(x, y, r) { + drawBackgroundOrDont(x, y, r); + + /* Select a shape based on shape weights, then draw it */ + const shape = random(WEIGHTED_SHAPES); + if (shape == "DIAMOND") { + drawDiamond(x, y, r); + } else if (shape == "CIRCLE") { + circle(x, y, r); + } else if (shape == "TRIANGLE") { + drawTriangle(x, y, r); + } else if (shape == "SQUARE") { + /* Drawing a background draws a square already */ + /* In other words, do nothing */ + } +} + +/* Set a random background and foreground color for new shape */ +function drawBackgroundOrDont(x, y, r) { + fill(random(COLORS)); + if (random() < BACKGROUND_CHANCE) { + rect(x, y, r); + fill(random(COLORS)); + } +} + +/* Draw what is basically a rotated square */ +function drawDiamond(x, y, r) { + const r2 = r / 2; + beginShape(); + vertex(x + r2, y); + vertex(x, y + r2); + vertex(x - r2, y); + vertex(x, y - r2); + endShape(CLOSE); +} + +/* Draw a triangle in one of the four possible orientations*/ +function drawTriangle(x, y, r) { + const r2 = r / 2; + const excludedCorner = random(["TOPLEFT", "TOPRIGHT", "BOTLEFT", "BOTRIGHT"]); + if (excludedCorner == "TOPLEFT") { + triangle(x - r2, y + r2, x + r2, y - r2, x + r2, y + r2); + } else if (excludedCorner == "TOPRIGHT") { + triangle(x - r2, y - r2, x + r2, y + r2, x - r2, y + r2); + } else if (excludedCorner == "BOTLEFT") { + triangle(x - r2, y - r2, x + r2, y + r2, x + r2, y - r2); + } else if (excludedCorner == "BOTRIGHT") { + triangle(x - r2, y - r2, x - r2, y + r2, x + r2, y - r2); + } +} + +function clickOnSave() { + saveCanvas(); +} From fc2ffcc305ccd616f8e23c4c8428aedb0f4bff2e Mon Sep 17 00:00:00 2001 From: plusk Date: Sat, 31 Oct 2020 16:33:37 +0000 Subject: [PATCH 06/21] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20=20@?= =?UTF-8?q?=207e0aa8bf79a4912e342b2cf4e3b3624d236e0394=20[formerly=20ca794?= =?UTF-8?q?4767bb099495c78f080f6b853960c18bdd6]=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: 9d507228073fa06f0c38c4c22861b8b7ec820d81 --- index.html | 5 ++ workshop/bokeh.html | 34 ++++++++++++++ workshop/bokeh.js | 111 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 150 insertions(+) create mode 100644 workshop/bokeh.html create mode 100644 workshop/bokeh.js diff --git a/index.html b/index.html index b885f0a..a65179b 100644 --- a/index.html +++ b/index.html @@ -24,6 +24,11 @@

Big text

+ +
bokeh
+ bokeh +
+
chords
chords diff --git a/workshop/bokeh.html b/workshop/bokeh.html new file mode 100644 index 0000000..04da9df --- /dev/null +++ b/workshop/bokeh.html @@ -0,0 +1,34 @@ + + + + + + + bokeh + + + + + + diff --git a/workshop/bokeh.js b/workshop/bokeh.js new file mode 100644 index 0000000..9799dcb --- /dev/null +++ b/workshop/bokeh.js @@ -0,0 +1,111 @@ +let PALETTES, COLORS, BG; + +/* Enable to make a canvas suitable for A2 paper */ +const PRINT_MODE = false; + +/* Get a random palette or choose a specific one from palettes.json */ +const RANDOM_PALETTE = false; +const PALETTE_NAME = "speis"; + +/* Shape size will be a random number between these bounds */ +const MIN_SIZE = 2; +const MAX_SIZE = 100; + +/* Shape opacity will be selected based on size, scaled to these bounds */ +const MIN_OPACITY = 0.1; +const MAX_OPACITY = 1; + +/* The shape will be randomly selected from the following object */ +/* The random selection is weighted based on the integer values */ +/* Example: 1 is a normal amount, 2 is double, 0 would be none of that type */ +/* The values are weighed in relation to each other, so 1 2 3 = 2 4 6 */ +const SHAPE_WEIGHTS = [ + { type: "CIRCLE", weight: 1 }, + { type: "TRIANGLE", weight: 1 }, + { type: "SQUARE", weight: 1 }, +]; +const WEIGHTED_SHAPES = []; + +/* + + CONFIG END + +*/ + +function preload() { + PALETTES = loadJSON("palettes.json"); +} + +function setup() { + const cnv = PRINT_MODE ? createCanvas(4960, 7016) : createCanvas(1080, 1350); + cnv.mouseClicked(clickOnSave); + pixelDensity(1); + + /* Get colors from the palettes */ + const PALETTE_KEYS = Object.keys(PALETTES); + const RANDOM_PALETTE_NAME = + PALETTE_KEYS[(PALETTE_KEYS.length * Math.random()) << 0]; + const PALETTE = !RANDOM_PALETTE + ? PALETTES[PALETTE_NAME] + : PALETTES[RANDOM_PALETTE_NAME]; + console.log("Palette name: ", RANDOM_PALETTE_NAME); + + colorMode(HSL); + COLORS = PALETTE["colors"].map((col) => color(col)); + BG = color(PALETTE.bg); + + /* Sketch-specific setup */ + background(BG); + noStroke(); + + /* Initialize weighted shapes */ + for (let s = 0; s < SHAPE_WEIGHTS.length; s++) { + const shape = SHAPE_WEIGHTS[s]; + for (let w = 0; w < shape.weight; w++) { + WEIGHTED_SHAPES.push(shape.type); + } + } +} + +function draw() { + /* Select a random size between the given bounds */ + const size = random(MIN_SIZE, MAX_SIZE); + + /* Set color opacity based on the selected of the shape */ + const fillColor = random(COLORS); + fillColor.setAlpha(1 + MIN_OPACITY - size / MAX_SIZE); + fill(fillColor); + + drawRandomShape(random(width), random(height), size); +} + +function drawRandomShape(x, y, size) { + /* Move to the given coordinates in order to rotate properly */ + translate(x, y); + rotate(random(TWO_PI)); + + /* Select a shape and draw it */ + const shape = random(WEIGHTED_SHAPES); + if (shape == "CIRCLE") { + circle(x, y, size); + } else if (shape == "SQUARE") { + square(x, y, size); + } else if (shape == "TRIANGLE") { + drawTriangle(x, y, size); + } +} + +/* Draw an equilateral triangle */ +function drawTriangle(x, y, size) { + const x1 = x + (cos((1 * TWO_PI) / 3) * size) / 2; + const y1 = y + (sin((1 * TWO_PI) / 3) * size) / 2; + const x2 = x + (cos((2 * TWO_PI) / 3) * size) / 2; + const y2 = y + (sin((2 * TWO_PI) / 3) * size) / 2; + const x3 = x + (cos((3 * TWO_PI) / 3) * size) / 2; + const y3 = y + (sin((3 * TWO_PI) / 3) * size) / 2; + triangle(x1, y1, x2, y2, x3, y3); +} + +function clickOnSave() { + saveCanvas(); +} From 89ffe4e70673c38bcc13611a61ae49f6c1854dfb Mon Sep 17 00:00:00 2001 From: plusk Date: Sat, 31 Oct 2020 16:36:27 +0000 Subject: [PATCH 07/21] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20=20@?= =?UTF-8?q?=20ce8a7ba5d5399c9d5fa366d9c79479dbcd245304=20[formerly=20a57a9?= =?UTF-8?q?e51d0e94c03f6124ff67930e1c7ec2a7f07]=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: a9a2e17acfbc2fb5a33c728d7fc0bae00fbf66d3 --- workshop/bokeh.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workshop/bokeh.js b/workshop/bokeh.js index 9799dcb..731db8f 100644 --- a/workshop/bokeh.js +++ b/workshop/bokeh.js @@ -33,7 +33,7 @@ const WEIGHTED_SHAPES = []; */ function preload() { - PALETTES = loadJSON("palettes.json"); + PALETTES = loadJSON("/palettes.json"); } function setup() { From 6532d0427ac538c20560756ba11b73cb2232d4ad Mon Sep 17 00:00:00 2001 From: plusk Date: Sat, 31 Oct 2020 16:42:16 +0000 Subject: [PATCH 08/21] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20=20@?= =?UTF-8?q?=20f1fa84719d58327011a4ff5cf995b456c27445a6=20[formerly=208ba36?= =?UTF-8?q?fa91faae891850bf8bea8f4a5df2c2cccd5]=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: 193532e545f4d293b16eee41ae2135670659742e --- palettes.json | 969 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 969 insertions(+) create mode 100644 palettes.json diff --git a/palettes.json b/palettes.json new file mode 100644 index 0000000..d3fec83 --- /dev/null +++ b/palettes.json @@ -0,0 +1,969 @@ +{ + "mono": { + "bg": "#000000", + "colors": ["#ffffff"] + }, + "onom": { + "bg": "#FAEBD7", + "colors": ["#000000"] + }, + "genesis": { + "bg": "#FAEBD7", + "colors": ["#5C4B51", "#8CBEB2", "#F2EBBF", "#F3B562", "#F06060"] + }, + "sydney": { + "bg": "#7F4040", + "colors": ["#F7665D", "#F7826B", "#F7A571", "#78F7C2", "#BFF7B0"] + }, + "redrange": { + "bg": "#EFEFEF", + "colors": ["#2B3A42", "#3F5765", "#FF530D"] + }, + "redcent": { + "bg": "#DC3522", + "colors": ["#D9CB9E", "#374140", "#2A2C2B", "#1E1E20"] + }, + "symmeblu": { + "bg": "#333333", + "colors": ["#405952", "#9C9B7A", "#FFD393", "#FF974F", "#F54F29"] + }, + "termos": { + "bg": "#333333", + "colors": ["#4C6472", "#57A4B1", "#B0D894", "#FADE89", "#F95355"] + }, + "vintage": { + "bg": "#333333", + "colors": ["#0A7B83", "#2AA876", "#FFD265", "#F19C65", "#CE4D45"] + }, + "pastella": { + "bg": "#333333", + "colors": ["#A8E6CF", "#BFD192", "#F5E49E", "#F4A28B", "#FF8B94"] + }, + "speis": { + "bg": "#252932", + "colors": ["#fade89", "#d4ea97", "#aef2b3", "#8cf6d5", "#78f7f7"] + }, + "mello": { + "bg": "#FAEBD7", + "colors": ["#F8A255", "#F76F55", "#E14B56", "#A83A55", "#5F2756"] + }, + "online": { + "bg": "#fff", + "colors": ["#0d5474", "#fab758"] + }, + + "cc239": { + "colors": ["#e3dd34", "#78496b", "#f0527f", "#a7e0e2"], + "bg": "#e0eff0" + }, + "cc234": { + "colors": ["#ffce49", "#ede8dc", "#ff5736", "#ff99b4"], + "bg": "#f7f4ed" + }, + "cc232": { + "colors": ["#5c5f46", "#ff7044", "#ffce39", "#66aeaa"], + "bg": "#e9ecde" + }, + "cc238": { + "colors": ["#553c60", "#ffb0a0", "#ff6749", "#fbe090"], + "bg": "#f5e9de" + }, + "cc242": { + "colors": ["#bbd444", "#fcd744", "#fa7b53", "#423c6f"], + "bg": "#faf4e4" + }, + "cc245": { + "colors": ["#0d4a4e", "#ff947b", "#ead3a2", "#5284ab"], + "bg": "#f6f4ed" + }, + "cc273": { + "colors": ["#363d4a", "#7b8a56", "#ff9369", "#f4c172"], + "bg": "#f0efe2" + }, + "dale_paddle": { + "colors": [ + "#ff7a5a", + "#765aa6", + "#fee7bc", + "#515e8c", + "#ffc64a", + "#b460a6", + "#ffffff", + "#4781c1" + ], + "bg": "#abe9e8", + "stroke": "#000000" + }, + "dale_night": { + "colors": [ + "#ae5d9d", + "#f1e8bc", + "#ef8fa3", + "#f7c047", + "#58c9ed", + "#f77150" + ], + "bg": "#00ae83", + "stroke": "#000000" + }, + "dale_cat": { + "colors": [ + "#f77656", + "#f7f7f7", + "#efc545", + "#dfe0e2", + "#3c70bd", + "#66bee4" + ], + "bg": "#f6e0b8", + "stroke": "#000000" + }, + "ducci_jb": { + "colors": ["#395e54", "#e77b4d", "#050006", "#e55486"], + "bg": "#efe0bc", + "stroke": "#050006" + }, + "ducci_a": { + "colors": ["#809498", "#d3990e", "#000000", "#ecddc5"], + "bg": "#863f52", + "stroke": "#ecddc5" + }, + "ducci_b": { + "colors": ["#ecddc5", "#79b27b", "#000000", "#ac6548"], + "bg": "#d5c08e", + "stroke": "#ac6548" + }, + "ducci_d": { + "colors": ["#f3cb4d", "#f2f5e3", "#20191b", "#67875c"], + "bg": "#433d5f", + "stroke": "#67875c" + }, + "ducci_e": { + "colors": ["#c37c2b", "#f6ecce", "#000000", "#386a7a"], + "bg": "#e3cd98", + "stroke": "#386a7a" + }, + "ducci_f": { + "colors": ["#596f7e", "#eae6c7", "#463c21", "#f4cb4c"], + "bg": "#e67300", + "stroke": "#f4cb4c" + }, + "ducci_g": { + "colors": ["#c75669", "#000000", "#11706a"], + "bg": "#ecddc5", + "stroke": "#11706a" + }, + "ducci_h": { + "colors": ["#6b5c6e", "#4a2839", "#d9574a"], + "bg": "#ffc34b", + "stroke": "#d9574a" + }, + "ducci_i": { + "colors": ["#e9dcad", "#143331", "#ffc000"], + "bg": "#a74c02", + "stroke": "#ffc000" + }, + "ducci_j": { + "colors": ["#c47c2b", "#5f5726", "#000000", "#7e8a84"], + "bg": "#ecddc5", + "stroke": "#7e8a84" + }, + "ducci_o": { + "colors": ["#c15e1f", "#e4a13a", "#000000", "#4d545a"], + "bg": "#dfc79b", + "stroke": "#4d545a" + }, + "ducci_q": { + "colors": ["#4bae8c", "#d0c1a0", "#2d3538"], + "bg": "#d06440", + "stroke": "#2d3538" + }, + "ducci_u": { + "colors": ["#f6d700", "#f2d692", "#000000", "#5d3552"], + "bg": "#ff7426", + "stroke": "#5d3552" + }, + "ducci_v": { + "colors": ["#c65f75", "#d3990e", "#000000", "#597e7a"], + "bg": "#f6eccb", + "stroke": "#597e7a" + }, + "ducci_x": { + "colors": ["#dd614a", "#f5cedb", "#1a1e4f"], + "bg": "#fbb900", + "stroke": "#1a1e4f" + }, + "dt01": { + "colors": ["#172a89", "#f7f7f3"], + "bg": "#f3abb0", + "stroke": "#172a89" + }, + "dt02": { + "colors": ["#302956", "#f3c507"], + "bg": "#eee3d3", + "stroke": "#302956" + }, + "dt03": { + "colors": ["#000000", "#a7a7a7"], + "bg": "#0a5e78", + "stroke": "#000000" + }, + "dt04": { + "colors": ["#50978e", "#f7f0df"], + "bg": "#f7f0df", + "stroke": "#000000" + }, + "dt05": { + "colors": ["#ee5d65", "#f0e5cb"], + "bg": "#f0e5cb", + "stroke": "#080708" + }, + "dt06": { + "colors": ["#271f47", "#e7ceb5"], + "bg": "#cc2b1c", + "stroke": "#271f47" + }, + "dt07": { + "colors": ["#6a98a5", "#d24c18"], + "bg": "#efebda", + "stroke": "#efebda" + }, + "dt08": { + "colors": ["#5d9d88", "#ebb43b"], + "bg": "#efebda", + "stroke": "#efebda" + }, + "dt09": { + "colors": ["#052e57", "#de8d80"], + "bg": "#efebda", + "stroke": "#efebda" + }, + "empusa": { + "colors": [ + "#c92a28", + "#e69301", + "#1f8793", + "#13652b", + "#e7d8b0", + "#48233b", + "#e3b3ac" + ], + "bg": "#f0f0f2", + "stroke": "#1a1a1a" + }, + "delphi": { + "colors": [ + "#475b62", + "#7a999c", + "#2a1f1d", + "#fbaf3c", + "#df4a33", + "#f0e0c6", + "#af592c" + ], + "bg": "#f0e0c6", + "stroke": "#2a1f1d" + }, + "mably": { + "colors": [ + "#13477b", + "#2f1b10", + "#d18529", + "#d72a25", + "#e42184", + "#138898", + "#9d2787", + "#7f311b" + ], + "bg": "#dfc792", + "stroke": "#2a1f1d" + }, + "nowak": { + "colors": [ + "#e85b30", + "#ef9e28", + "#c6ac71", + "#e0c191", + "#3f6279", + "#ee854e", + "#180305" + ], + "bg": "#ede4cb", + "stroke": "#180305" + }, + "jupiter": { + "colors": [ + "#c03a53", + "#edd09e", + "#aab5af", + "#023629", + "#eba735", + "#8e9380", + "#6c4127" + ], + "bg": "#e6e2d6", + "stroke": "#12110f" + }, + "hersche": { + "colors": [ + "#df9f00", + "#1f6f50", + "#8e6d7f", + "#da0607", + "#a4a5a7", + "#d3d1c3", + "#42064f", + "#25393a" + ], + "bg": "#f0f5f6", + "stroke": "#0a0a0a" + }, + "cherfi": { + "colors": [ + "#99cb9f", + "#cfb610", + "#d00701", + "#dba78d", + "#2e2c1d", + "#bfbea2", + "#d2cfaf" + ], + "bg": "#e3e2c5", + "stroke": "#332e22" + }, + "harvest": { + "colors": [ + "#313a42", + "#9aad2e", + "#f0ae3c", + "#df4822", + "#8eac9b", + "#cc3d3f", + "#ec8b1c", + "#1b9268" + ], + "bg": "#e5e2cf", + "stroke": "#463930" + }, + "honey": { + "colors": [ + "#f14d42", + "#f4fdec", + "#4fbe5d", + "#265487", + "#f6e916", + "#f9a087", + "#2e99d6" + ], + "bg": "#f4fdec", + "stroke": "#141414" + }, + "jungle": { + "colors": [ + "#adb100", + "#e5f4e9", + "#f4650f", + "#4d6838", + "#cb9e00", + "#689c7d", + "#e2a1a8", + "#151c2e" + ], + "bg": "#cecaa9", + "stroke": "#0e0f27" + }, + "skyspider": { + "colors": [ + "#f4b232", + "#f2dbbd", + "#01799c", + "#e93e48", + "#0b1952", + "#006748", + "#ed817d" + ], + "bg": "#f0dbbc", + "stroke": "#050505" + }, + "atlas": { + "colors": [ + "#5399b1", + "#f4e9d5", + "#de4037", + "#ed942f", + "#4e9e48", + "#7a6e62" + ], + "bg": "#f0c328", + "stroke": "#3d352b" + }, + "hilda01": { + "colors": ["#ec5526", "#f4ac12", "#9ebbc1", "#f7f4e2"], + "bg": "#e7e8d4", + "stroke": "#1e1b1e" + }, + "hilda02": { + "colors": ["#eb5627", "#eebb20", "#4e9eb8", "#f7f5d0"], + "bg": "#77c1c0", + "stroke": "#201d13" + }, + "hilda03": { + "colors": ["#e95145", "#f8b917", "#b8bdc1", "#ffb2a2"], + "bg": "#6b7752", + "stroke": "#010101" + }, + "hilda04": { + "colors": ["#e95145", "#f6bf7a", "#589da1", "#f5d9bc"], + "bg": "#f5ede1", + "stroke": "#000001" + }, + "hilda05": { + "colors": ["#ff6555", "#ffb58f", "#d8eecf", "#8c4b47", "#bf7f93"], + "bg": "#ffda82", + "stroke": "#2b0404" + }, + "hilda06": { + "colors": ["#f75952", "#ffce84", "#74b7b2", "#f6f6f6", "#b17d71"], + "bg": "#f6ecd4", + "stroke": "#0e0603" + }, + "iiso_zeitung": { + "colors": ["#ee8067", "#f3df76", "#00a9c0", "#f7ab76"], + "bg": "#f5efcb", + "stroke": "#111a17" + }, + "iiso_curcuit": { + "colors": ["#f0865c", "#f2b07b", "#6bc4d2", "#1a3643"], + "bg": "#f0f0e8", + "stroke": "#0f1417" + }, + "iiso_airlines": { + "colors": ["#fe765a", "#ffb468", "#4b588f", "#faf1e0"], + "bg": "#fae5c8", + "stroke": "#1c1616" + }, + "iiso_daily": { + "colors": ["#e76c4a", "#f0d967", "#7f8cb6", "#1daeb1", "#ef9640"], + "bg": "#e2ded2", + "stroke": "#000100" + }, + "jud_playground": { + "colors": ["#f04924", "#fcce09", "#408ac9"], + "bg": "#ffffff", + "stroke": "#2e2925" + }, + "jud_horizon": { + "colors": ["#f8c3df", "#f2e420", "#28b3d0", "#648731", "#ef6a7d"], + "bg": "#f2f0e1", + "stroke": "#030305" + }, + "jud_mural": { + "colors": ["#ca3122", "#e5af16", "#4a93a2", "#0e7e39", "#e2b9bd"], + "bg": "#e3ded8", + "stroke": "#1c1616" + }, + "jud_cabinet": { + "colors": ["#f0afb7", "#f6bc12", "#1477bb", "#41bb9b"], + "bg": "#e3ded8", + "stroke": "#020508" + }, + "jung_bird": { + "colors": ["#fc3032", "#fed530", "#33c3fb", "#ff7bac", "#fda929"], + "bg": "#ffffff", + "stroke": "#000000" + }, + "jung_horse": { + "colors": ["#e72e81", "#f0bf36", "#3056a2"], + "bg": "#ffffff", + "stroke": "#000000" + }, + "jung_croc": { + "colors": ["#f13274", "#eed03e", "#405e7f", "#19a198"], + "bg": "#ffffff", + "stroke": "#000000" + }, + "jung_hippo": { + "colors": ["#ff7bac", "#ff921e", "#3ea8f5", "#7ac943"], + "bg": "#ffffff", + "stroke": "#000000" + }, + "jung_wolf": { + "colors": ["#e51c39", "#f1b844", "#36c4b7", "#666666"], + "bg": "#ffffff", + "stroke": "#000000" + }, + "kov_01": { + "colors": [ + "#d24c23", + "#7ba6bc", + "#f0c667", + "#ede2b3", + "#672b35", + "#142a36" + ], + "bg": "#108266", + "stroke": "#132a37" + }, + "kov_02": { + "colors": ["#e8dccc", "#e94641", "#eeaeae"], + "bg": "#6c96be", + "stroke": "#e8dccc" + }, + "kov_03": { + "colors": ["#e3937b", "#d93f1d", "#090d15", "#e6cca7"], + "bg": "#558947", + "stroke": "#090d15" + }, + "kov_04": { + "colors": [ + "#d03718", + "#292b36", + "#33762f", + "#ead7c9", + "#ce7028", + "#689d8d" + ], + "bg": "#deb330", + "stroke": "#292b36" + }, + "kov_05": { + "colors": ["#de3f1a", "#de9232", "#007158", "#e6cdaf", "#869679"], + "bg": "#7aa5a6", + "stroke": "#010006" + }, + "kov_06": { + "colors": [ + "#a87c2a", + "#bdc9b1", + "#f14616", + "#ecbfaf", + "#017724", + "#0e2733", + "#2b9ae9" + ], + "bg": "#dfd4c1", + "stroke": "#292319" + }, + "kov_06b": { + "colors": [ + "#d57846", + "#dfe0cc", + "#de442f", + "#e7d3c5", + "#5ec227", + "#302f35", + "#63bdb3" + ], + "bg": "#dfd4c1", + "stroke": "#292319" + }, + "kov_07": { + "colors": ["#c91619", "#fdecd2", "#f4a000", "#4c2653"], + "bg": "#89c2cd", + "stroke": "#111" + }, + "frozen-rose": { + "colors": ["#29368f", "#e9697b", "#1b164d", "#f7d996"], + "bg": "#f2e8e4" + }, + "winter-night": { + "colors": ["#122438", "#dd672e", "#87c7ca", "#ebebeb"], + "bg": "#ebebeb" + }, + "saami": { + "colors": ["#eab700", "#e64818", "#2c6393", "#eecfca"], + "bg": "#e7e6e4" + }, + "knotberry1": { + "colors": ["#20342a", "#f74713", "#686d2c", "#e9b4a6"], + "bg": "#e5ded8" + }, + "knotberry2": { + "colors": ["#1d3b1a", "#eb4b11", "#e5bc00", "#f29881"], + "bg": "#eae2d0" + }, + "tricolor": { + "colors": ["#ec643b", "#56b7ab", "#f8cb57", "#1f1e43"], + "bg": "#f7f2df" + }, + "foxshelter": { + "colors": ["#ff3931", "#007861", "#311f27", "#bab9a4"], + "bg": "#dddddd" + }, + "hermes": { + "colors": ["#253852", "#51222f", "#b53435", "#ecbb51"], + "bg": "#eeccc2" + }, + "olympia": { + "colors": ["#ff3250", "#ffb33a", "#008c36", "#0085c6", "#4c4c4c"], + "bg": "#faf2e5", + "stroke": "#0b0b0b" + }, + "byrnes": { + "colors": ["#c54514", "#dca215", "#23507f"], + "bg": "#e8e7d4", + "stroke": "#0b0b0b" + }, + "butterfly": { + "colors": ["#f40104", "#f6c0b3", "#99673a", "#f0f1f4"], + "bg": "#191e36", + "stroke": "#191e36" + }, + "floratopia": { + "colors": ["#bf4a2b", "#cd902a", "#4e4973", "#f5d4bc"], + "bg": "#1e1a43", + "stroke": "#1e1a43" + }, + "verena": { + "colors": ["#f1594a", "#f5b50e", "#14a160", "#2969de", "#885fa4"], + "bg": "#e2e6e8", + "stroke": "#1a1a1a" + }, + "florida_citrus": { + "colors": ["#ea7251", "#ebf7f0", "#02aca5"], + "bg": "#9ae2d3", + "stroke": "#050100" + }, + "lemon_citrus": { + "colors": ["#e2d574", "#f1f4f7", "#69c5ab"], + "bg": "#f79eac", + "stroke": "#463231" + }, + "yuma_punk": { + "colors": ["#f05e3b", "#ebdec4", "#ffdb00"], + "bg": "#161616", + "stroke": "#ebdec4" + }, + "moir": { + "colors": ["#a49f4f", "#d4501e", "#f7c558", "#ebbaa6"], + "bg": "#f7f4ef", + "stroke": "#161716" + }, + "sprague": { + "colors": ["#ec2f28", "#f8cd28", "#1e95bb", "#fbaab3", "#fcefdf"], + "bg": "#fcefdf", + "stroke": "#221e1f" + }, + "bloomberg": { + "colors": ["#ff5500", "#f4c145", "#144714", "#2f04fc", "#e276af"], + "bg": "#fff3dd", + "stroke": "#000" + }, + "revolucion": { + "colors": ["#ed555d", "#fffcc9", "#41b797", "#eda126", "#7b5770"], + "bg": "#2d1922", + "stroke": "#fffcc9" + }, + "sneaker": { + "colors": ["#e8165b", "#401e38", "#66c3b4", "#ee7724", "#584098"], + "bg": "#ffffff", + "stroke": "#401e38" + }, + "miradors": { + "colors": ["#ff6936", "#fddc3f", "#0075ca", "#00bb70"], + "bg": "#020202", + "stroke": "#ffffff" + }, + "kaffeprat": { + "colors": ["#BCAA8C", "#D8CDBE", "#484A42", "#746B58", "#9A8C73"], + "bg": "#fff", + "stroke": "#000" + }, + "jrmy": { + "colors": ["#df456c", "#ea6a82", "#270b32", "#471e43"], + "bg": "#ef9198", + "stroke": "#270b32" + }, + "animo": { + "colors": ["#f6c103", "#f6f6f6", "#d1cdc7", "#e7e6e5"], + "bg": "#f5f5f5", + "stroke": "#010001" + }, + "book": { + "colors": [ + "#be1c24", + "#d1a082", + "#037b68", + "#d8b1a5", + "#1c2738", + "#c95a3f" + ], + "bg": "#f5b28a", + "stroke": "#0e0f27" + }, + "rag-mysore": { + "colors": ["#ec6c26", "#613a53", "#e8ac52", "#639aa0"], + "bg": "#d5cda1" + }, + "rag-gol": { + "colors": ["#d3693e", "#803528", "#f1b156", "#90a798"], + "bg": "#f0e0a4" + }, + "rag-belur": { + "colors": ["#f46e26", "#68485f", "#3d273a", "#535d55"], + "bg": "#dcd4a6" + }, + "rag-bangalore": { + "colors": ["#ea720e", "#ca5130", "#e9c25a", "#52534f"], + "bg": "#f9ecd3" + }, + "rag-taj": { + "colors": ["#ce565e", "#8e1752", "#f8a100", "#3ac1a6"], + "bg": "#efdea2" + }, + "rag-virupaksha": { + "colors": ["#f5736a", "#925951", "#feba4c", "#9d9b9d"], + "bg": "#eedfa2" + }, + "rohlfs_1R": { + "colors": ["#004996", "#567bae", "#ff4c48", "#ffbcb3"], + "bg": "#fff8e7", + "stroke": "#004996" + }, + "rohlfs_1Y": { + "colors": ["#004996", "#567bae", "#ffc000", "#ffdca4"], + "bg": "#fff8e7", + "stroke": "#004996" + }, + "rohlfs_1G": { + "colors": ["#004996", "#567bae", "#60bf3c", "#d2deb1"], + "bg": "#fff8e7", + "stroke": "#004996" + }, + "rohlfs_2": { + "colors": ["#4d3d9a", "#f76975", "#ffffff", "#eff0dd"], + "bg": "#58bdbc", + "stroke": "#211029" + }, + "rohlfs_3": { + "colors": ["#abdfdf", "#fde500", "#58bdbc", "#eff0dd"], + "bg": "#f76975", + "stroke": "#211029" + }, + "rohlfs_4": { + "colors": ["#fde500", "#2f2043", "#f76975", "#eff0dd"], + "bg": "#fbbeca", + "stroke": "#211029" + }, + "retro": { + "colors": [ + "#69766f", + "#9ed6cb", + "#f7e5cc", + "#9d8f7f", + "#936454", + "#bf5c32", + "#efad57" + ], + "bg": "#fff" + }, + "retro-washedout": { + "colors": [ + "#878a87", + "#cbdbc8", + "#e8e0d4", + "#b29e91", + "#9f736c", + "#b76254", + "#dfa372" + ], + "bg": "#fff" + }, + "roygbiv-warm": { + "colors": [ + "#705f84", + "#687d99", + "#6c843e", + "#fc9a1a", + "#dc383a", + "#aa3a33", + "#9c4257" + ], + "bg": "#fff" + }, + "roygbiv-toned": { + "colors": [ + "#817c77", + "#396c68", + "#89e3b7", + "#f59647", + "#d63644", + "#893f49", + "#4d3240" + ], + "bg": "#fff" + }, + "present-correct": { + "colors": [ + "#fd3741", + "#fe4f11", + "#ff6800", + "#ffa61a", + "#ffc219", + "#ffd114", + "#fcd82e", + "#f4d730", + "#ced562", + "#8ac38f", + "#79b7a0", + "#72b5b1", + "#5b9bae", + "#6ba1b7", + "#49619d", + "#604791", + "#721e7f", + "#9b2b77", + "#ab2562", + "#ca2847" + ], + "bg": "#fff" + }, + "spatial01": { + "colors": ["#ff5937", "#f6f6f4", "#4169ff"], + "bg": "#f6f6f4", + "stroke": "#ff5937" + }, + "spatial02": { + "colors": ["#ff5937", "#f6f6f4", "#f6f6f4"], + "bg": "#f6f6f4", + "stroke": "#ff5937" + }, + "spatial02i": { + "colors": ["#f6f6f4", "#ff5937", "#ff5937"], + "bg": "#ff5937", + "stroke": "#f6f6f4" + }, + + "spatial03": { + "colors": ["#4169ff", "#f6f6f4", "#f6f6f4"], + "bg": "#f6f6f4", + "stroke": "#4169ff" + }, + "spatial03i": { + "colors": ["#f6f6f4", "#4169ff", "#4169ff"], + "bg": "#4169ff", + "stroke": "#f6f6f4" + }, + "system.#01": { + "colors": ["#ff4242", "#fec101", "#1841fe", "#fcbdcc", "#82e9b5"], + "bg": "#fff", + "stroke": "#000" + }, + "system.#02": { + "colors": ["#ff4242", "#ffd480", "#1e365d", "#edb14c", "#418dcd"], + "bg": "#fff", + "stroke": "#000" + }, + "system.#03": { + "colors": ["#f73f4a", "#d3e5eb", "#002c3e", "#1aa1b1", "#ec6675"], + "bg": "#fff", + "stroke": "#110b09" + }, + "system.#04": { + "colors": [ + "#e31f4f", + "#f0ac3f", + "#18acab", + "#26265a", + "#ea7d81", + "#dcd9d0" + ], + "bg": "#dcd9d0", + "stroke": "#26265a" + }, + "system.#05": { + "colors": ["#db4549", "#d1e1e1", "#3e6a90", "#2e3853", "#a3c9d3"], + "bg": "#fff", + "stroke": "#000" + }, + "system.#06": { + "colors": ["#e5475c", "#95b394", "#28343b", "#f7c6a3", "#eb8078"], + "bg": "#fff", + "stroke": "#000" + }, + "system.#07": { + "colors": ["#d75c49", "#f0efea", "#509da4"], + "bg": "#fff", + "stroke": "#000" + }, + "system.#08": { + "colors": ["#f6625a", "#92b29f", "#272c3f"], + "bg": "#fff", + "stroke": "#000" + }, + "tsu_arcade": { + "colors": [ + "#4aad8b", + "#e15147", + "#f3b551", + "#cec8b8", + "#d1af84", + "#544e47" + ], + "bg": "#cfc7b9", + "stroke": "#251c12" + }, + "tsu_harutan": { + "colors": [ + "#75974a", + "#c83e3c", + "#f39140", + "#e4ded2", + "#f8c5a4", + "#434f55" + ], + "bg": "#cfc7b9", + "stroke": "#251c12" + }, + "tsu_akasaka": { + "colors": [ + "#687f72", + "#cc7d6c", + "#dec36f", + "#dec7af", + "#ad8470", + "#424637" + ], + "bg": "#cfc7b9", + "stroke": "#251c12" + }, + "tundra1": { + "colors": ["#40708c", "#8e998c", "#5d3f37", "#ed6954", "#f2e9e2"], + "bg": "#fff" + }, + "tundra2": { + "colors": [ + "#5f9e93", + "#3d3638", + "#733632", + "#b66239", + "#b0a1a4", + "#e3dad2" + ], + "bg": "#fff" + }, + "tundra3": { + "colors": [ + "#87c3ca", + "#7b7377", + "#b2475d", + "#7d3e3e", + "#eb7f64", + "#d9c67a", + "#f3f2f2" + ], + "bg": "#fff" + }, + "tundra4": { + "colors": [ + "#d53939", + "#b6754d", + "#a88d5f", + "#524643", + "#3c5a53", + "#7d8c7c", + "#dad6cd" + ], + "bg": "#fff" + } +} From 2fa9299e12bc2dce6ce8094f2ea367307c441d3f Mon Sep 17 00:00:00 2001 From: plusk Date: Tue, 3 Nov 2020 00:12:06 +0000 Subject: [PATCH 09/21] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20=20@?= =?UTF-8?q?=200f275f94d13396cd643267631b5e90b2bda3c693=20[formerly=2098181?= =?UTF-8?q?ec5bbaea5fb3410f7e2cecd1ee4158474b5]=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: c8e04f018a9f3ce069643f7f8fae8a851aa8e71b --- palettes.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/palettes.json b/palettes.json index d3fec83..a4ca01d 100644 --- a/palettes.json +++ b/palettes.json @@ -51,6 +51,10 @@ "bg": "#fff", "colors": ["#0d5474", "#fab758"] }, + "stronk": { + "bg": "#FAEBD7", + "colors": ["#70c2ad", "#F3B562", "#F06060", "#97c87e"] + }, "cc239": { "colors": ["#e3dd34", "#78496b", "#f0527f", "#a7e0e2"], From def13378d8dd045fe3169a86071394171742550e Mon Sep 17 00:00:00 2001 From: plusk Date: Fri, 22 Jan 2021 12:12:00 +0000 Subject: [PATCH 10/21] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20=20@?= =?UTF-8?q?=20b89dd4cc0e7c0e3b361ef25465ccdcd181c048f3=20[formerly=20cf8c2?= =?UTF-8?q?c9de7ee6d6bda94dee3ad7281d303d97b5e]=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: afebb9b01f1b7b2a2877d2c3e62fe2d1903ae24b --- palettes.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/palettes.json b/palettes.json index a4ca01d..3e6f2d0 100644 --- a/palettes.json +++ b/palettes.json @@ -3,6 +3,10 @@ "bg": "#000000", "colors": ["#ffffff"] }, + "monomild": { + "bg": "#333333", + "colors": ["#FFFFFF"] + }, "onom": { "bg": "#FAEBD7", "colors": ["#000000"] From d996ee22caaa4f403bfd9a9b902bbfcbc2538b69 Mon Sep 17 00:00:00 2001 From: plusk Date: Thu, 18 Mar 2021 08:36:35 +0000 Subject: [PATCH 11/21] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20=20@?= =?UTF-8?q?=2043adea5aa592731fc0feab88f7ab65ba30727e9b=20[formerly=20f361c?= =?UTF-8?q?882a87d47ae3104d69a6199dce79ffbc526]=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: 2150dafcd9cd6da05b17a2d51972fc4fbcc99e45 --- workshop/layers.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/workshop/layers.js b/workshop/layers.js index 9f52a29..0a71071 100644 --- a/workshop/layers.js +++ b/workshop/layers.js @@ -5,7 +5,7 @@ const PRINT_MODE = false; /* Get a random palette or choose a specific one from palettes.json */ const RANDOM_PALETTE = false; -const PALETTE_NAME = "genesis"; +const PALETTE_NAME = "stronk"; const LAYER_COUNT = 10; @@ -17,10 +17,10 @@ const HAS_STROKE = false; const STROKE_WEIGHT = 1; /* Layers are light to dark (from the center), enable to reverse it */ -const INVERTED_GRADIENT = false; +const INVERTED_GRADIENT = true; /* Instead of gradient from light to dark, go from the fill color to dark */ -const CAP_LIGHTNESS = false; +const CAP_LIGHTNESS = true; /* The degree to which noise affects the layers */ /* Low values are blobby, high values are spikey */ @@ -35,8 +35,8 @@ const SYMMETRICAL_Y = false; /* Background is determined by the gradient, but these flags may override it */ /* If both flags are true, palette background will be used */ -const USE_FILL_AS_BACKGROUND = true; -const USE_PALETTE_BACKGROUND = false; +const USE_FILL_AS_BACKGROUND = false; +const USE_PALETTE_BACKGROUND = true; /* The amount of points that make up each layer, lower means "pointier" */ /* For example 3 points mean triangular layers, 4 means squares */ From 62dea0400c090803fc97516bc8e90e88de499e85 Mon Sep 17 00:00:00 2001 From: plusk Date: Tue, 23 Mar 2021 10:21:11 +0000 Subject: [PATCH 12/21] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20=20@?= =?UTF-8?q?=2058d33442d946df47f881ad21e07b1d5a2dd25ca5=20[formerly=2026657?= =?UTF-8?q?45810fe4815f7aeb5f0a066593fb6632199]=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: 3075c6e24a36825644086786430e11a9b3d44152 --- fagdag/instagram.html | 34 ++++ fagdag/instagram.js | 385 ++++++++++++++++++++++++++++++++++++++++++ fagdag/web.html | 34 ++++ fagdag/web.js | 384 +++++++++++++++++++++++++++++++++++++++++ index.html | 2 +- 5 files changed, 838 insertions(+), 1 deletion(-) create mode 100644 fagdag/instagram.html create mode 100644 fagdag/instagram.js create mode 100644 fagdag/web.html create mode 100644 fagdag/web.js diff --git a/fagdag/instagram.html b/fagdag/instagram.html new file mode 100644 index 0000000..9361521 --- /dev/null +++ b/fagdag/instagram.html @@ -0,0 +1,34 @@ + + + + + + + fagdag/instagram + + + + + + diff --git a/fagdag/instagram.js b/fagdag/instagram.js new file mode 100644 index 0000000..e023a6b --- /dev/null +++ b/fagdag/instagram.js @@ -0,0 +1,385 @@ +let vMax, vMin, TEXT_SIZE, PALETTE, BEKK_PALETTE, BLOBS, SPOTS; + +// How spiky the blobs are +const BLOB_AMP = 0.5; +const LINE_AMP = 0.75; +const SPOT_AMP = 0.5; + +// How steep the easing curve is, tends to push blobs to their rMin or rMax +const BLOB_EASE_STEEPNESS = 4; +const SPOT_EASE_STEEPNESS = 5; +const LINE_EASE_STEEPNESS = 2; + +// The speed at which blobs grow and shrink +const BLOB_ANIMATION_SPEED = 0.002; + +// The speed at which the blob rotates in perlin noise space, made more noticable by more spiky blobs +const ROTATION_SPEED = 0.002; + +// A rough representation of the number of vertices that make up a blob, lower value = more points +const MAX_POINT_DIST = 15; + +// The thickness of lines +const STROKE_WEIGHT = 2; + +const RANDOM_COLORS = false; + +const SPOT_COUNT = 40; +const SPOT_X_SPREAD = 7; +const SPOT_Y_SPREAD = 0.5; +const SPOT_SLANT = 3; +const SPOT_APPEAR_NOISE = 0.005; +const SPOT_DURATION = 500; // 0 means the spots will always be visible + +const MOVE_SPEED = 0.1; +const MOVE_RADIUS = 100; + +/* + Config end +*/ + +function easeInOutCool(steepness, x) { + const mappedX = map(x, 0, 1, -1, 1); + return (1 + Math.tanh(steepness * mappedX)) / 2; +} + +function randomColor() { + const keys = Object.keys(BEKK_PALETTE); + return BEKK_PALETTE[keys[(keys.length * Math.random()) << 0]]; +} + +class Blob { + constructor({ + z, + cx, + cy, + mrx = 0, + mry = 0, + mSpeed = 0, + mAngle = random(TWO_PI), + rMin, + rMax, + amp = BLOB_AMP, + fillColor, + aStart = 0, + aEnd = TWO_PI, + line = false, + animationSpeed = BLOB_ANIMATION_SPEED, + steepness = BLOB_EASE_STEEPNESS, + disappearTime = 0, + }) { + this.z = z; + this.cx = cx; + this.cy = cy; + this.mrx = mrx; + this.mry = mry; + this.mSpeed = mSpeed; + this.mAngle = mAngle; + this.rMin = rMin; + this.rMax = rMax; + this.amp = amp; + this.fillColor = fillColor; + this.aStart = aStart; + this.aEnd = aEnd; + this.line = line; + this.animationSpeed = animationSpeed; + this.steepness = steepness; + this.disappearTime = disappearTime; + this.visible = this.disappearTime === 0; + this.disappearTick = + noise(cx * SPOT_APPEAR_NOISE, cy * SPOT_APPEAR_NOISE) * + this.disappearTime * + (1 - cy / height); + } + + draw() { + if (this.disappearTime !== 0) { + this.disappearTick++; + if (this.disappearTick >= this.disappearTime) { + this.visible = !this.visible; + this.disappearTick = 0; + } + } + + if (!this.visible) { + return; + } + + if (this.line) { + stroke(PALETTE.darkish); + noFill(); + } else { + fill(this.fillColor); + } + + // Might put all of this in the constructor + const pointCount = max((TWO_PI * this.rMax) / MAX_POINT_DIST, 30); + const deltaA = this.aEnd - this.aStart; + const amp = this.amp; + + const rotation = frameCount * ROTATION_SPEED; + this.mAngle = (this.mAngle + this.mSpeed) % TWO_PI; + + /* Iterate through a full circle of angles to draw a blob */ + beginShape(); + for (let a = this.aStart; a <= this.aEnd; a += deltaA / pointCount) { + // Get coordinates in the perlin noise space + const xOff = map(cos(a + rotation), -1, 1, 0, amp); + const yOff = map(sin(a + rotation), -1, 1, 0, amp); + + const noiseValue = noise( + xOff, + yOff, + this.z + frameCount * this.animationSpeed + ); + + const adjustedNoiseValue = easeInOutCool(this.steepness, noiseValue); + const noisedRadius = map(adjustedNoiseValue, 0, 1, this.rMin, this.rMax); + + /* Compute the final x and y and set a vertex there for the shape */ + const x = noisedRadius * cos(a); + const y = noisedRadius * sin(a); + + if (!this.line) { + const mx = this.mrx * cos(this.mAngle); + const my = this.mry * sin(this.mAngle); + vertex(this.cx + mx + x, this.cy + my + y); + } else { + vertex(this.cx + x, this.cy + y); + } + } + + if (line) { + endShape(); + noStroke(); + } else { + endShape(CLOSE); + } + } +} + +function setupBlobs () { + BLOBS = [ + new Blob({ + z: 10, + cx: width * -0.1, + cy: height * 0.9, + rMin: vMin * 0.1, + rMax: vMin * 0.3, + fillColor: RANDOM_COLORS ? randomColor() : PALETTE.yellow, + }), + new Blob({ + z: 20, + cx: width * -0.1, + cy: height * 0.1, + rMin: vMin * 0.1, + rMax: vMin * 0.45, + fillColor: RANDOM_COLORS ? randomColor() : PALETTE.pink, + }), + new Blob({ + z: 30, + cx: 0, + cy: height * 0.5, + rMin: vMin * 0.1, + rMax: vMin * 0.2, + fillColor: RANDOM_COLORS ? randomColor() : PALETTE.dark, + }), + new Blob({ + z: 40, + cx: width * 0.9, + cy: height, + rMin: vMin * 0.1, + rMax: vMin * 0.3, + fillColor: RANDOM_COLORS ? randomColor() : PALETTE.white, + }), + new Blob({ + z: 50, + cx: width * 1, + cy: height * 0.75, + rMin: vMin * 0.1, + rMax: vMin * 0.3, + fillColor: RANDOM_COLORS ? randomColor() : PALETTE.yellow, + }), + new Blob({ + z: 60, + cx: width * 1.2, + cy: height * 0.5, + rMin: vMin * 0.2, + rMax: vMin * 0.4, + fillColor: RANDOM_COLORS ? randomColor() : PALETTE.teal, + }), + new Blob({ + z: 100, + cx: 0, + cy: 0, + rMin: vMin * 0.2, + rMax: vMin * 0.4, + aEnd: PI, + line: true, + amp: LINE_AMP, + steepness: LINE_EASE_STEEPNESS + }), + new Blob({ + z: 200, + cx: width, + cy: height, + rMin: vMin * 0.1, + rMax: vMin * 0.3, + aStart: PI, + aEnd: PI + HALF_PI, + line: true, + amp: LINE_AMP, + steepness: LINE_EASE_STEEPNESS + }), + new Blob({ + z: 300, + cx: width, + cy: height, + rMin: vMin * 0.15, + rMax: vMin * 0.35, + aStart: PI, + aEnd: PI + HALF_PI, + line: true, + amp: LINE_AMP, + steepness: LINE_EASE_STEEPNESS + }), + new Blob({ + z: 1000, + cx: width / 2, + cy: height / 2, + rMin: vMin * 0.15, + rMax: vMin * 0.3, + fillColor: RANDOM_COLORS ? randomColor() : PALETTE.white, + }), + new Blob({ + z: 2000, + cx: width / 2, + cy: height / 2, + rMin: vMin * 0.2, + rMax: vMin * 0.35, + fillColor: PALETTE.dark, + }), + ]; + + SPOTS = []; + const SPOT_RMAX = vMin * 0.015; + for (let i = 0; i < SPOT_COUNT; i++) { + SPOTS.push( + new Blob({ + z: i, + cx: + width * 0.2 + + random(-SPOT_RMAX * SPOT_X_SPREAD, SPOT_RMAX * SPOT_X_SPREAD) - + i * SPOT_SLANT, + cy: (i * SPOT_RMAX * SPOT_Y_SPREAD), + rMin: vMin * 0.005, + rMax: SPOT_RMAX, + amp: SPOT_AMP, + fillColor: RANDOM_COLORS ? randomColor() : PALETTE.blue, + animationSpeed: 0, + steepness: SPOT_EASE_STEEPNESS, + disappearTime: SPOT_DURATION, + }) + ); + SPOTS.push( + new Blob({ + z: i + SPOT_COUNT, + cx: + width * 0.8 + + random(-SPOT_RMAX * SPOT_X_SPREAD, SPOT_RMAX * SPOT_X_SPREAD) + + i * SPOT_SLANT, + cy: height - (i * SPOT_RMAX * SPOT_Y_SPREAD), + rMin: vMin * 0.005, + rMax: SPOT_RMAX, + amp: SPOT_AMP, + fillColor: RANDOM_COLORS ? randomColor() : PALETTE.blue, + animationSpeed: 0, + steepness: SPOT_EASE_STEEPNESS, + disappearTime: SPOT_DURATION, + }) + ); + } +} + +function windowResized() { + vMin = min(width, height); + vMax = max(width, height); + resizeCanvas(1080, 1080); + + setupBlobs(); + + // Intrinsically tied to the rMin of central blob + TEXT_SIZE = vMin * 0.075; + textSize(TEXT_SIZE); +} + +function setup() { + colorMode(HSL); + createCanvas(1080, 1080); + pixelDensity(1); + + PALETTE = { + bg: color("#fff0ac"), + dark: color("#1c2c3c"), + darkish: color("#1c2c3c"), + white: color("#fff"), + pink: color("#efb2ff"), + yellow: color("#fff001"), + teal: color("#02dfc9"), + blue: color("#293895"), + }; + PALETTE.darkish.setAlpha(0.75); + + BEKK_PALETTE = { + // sort: color("#0E0E0E"), + // hvit: color("#FFFFFF"), + soloppgang: color("#FFB88D"), + // soloppgang_kontrast: color("#FF8034"), + // regn: color("#BCCEDD"), + // regn_kontrast: color("#7E9CB9"), + skyfritt: color("#B1E8FF"), + // skyfritt_kontrast: color("#43CBFF"), + // overskyet: color("#E7E7E7"), + // overskyet_kontrast: color("#CECECE"), + solnedgang: color("#FF9999"), + // solnedgang_kontrast: color("#FF5B5B"), + // sol: color("#FFF2AD"), + // sol_kontrast: color("#FFF02B"), + kveld: color("#E5B1FF"), + // kveld_kontrast: color("#8E24C9"), + grønn: color("#A1F5E3"), + // grønn_kontrast: color("#16DBC4"), + // natt: color("#6D7ABB"), + // natt_kontrast: color("#162365"), + }; + BG = color(PALETTE.bg); + + windowResized(); + setupBlobs(); + + textAlign(CENTER); + textFont("Newzald"); + + strokeWeight(STROKE_WEIGHT); + noStroke(); + strokeCap(PROJECT); +} + +function draw() { + /* Home-made helper function to select background based on config */ + background(BG); + + for (let b = 0; b < BLOBS.length; b++) { + const blob = BLOBS[b]; + blob.draw(); + } + + for (let s = 0; s < SPOTS.length; s++) { + const spot = SPOTS[s]; + spot.draw(); + } + + fill(PALETTE.white); + text("Frontend", width / 2, height / 2); + text("til frokost", width / 2, height / 2 + TEXT_SIZE); +} diff --git a/fagdag/web.html b/fagdag/web.html new file mode 100644 index 0000000..a724a8e --- /dev/null +++ b/fagdag/web.html @@ -0,0 +1,34 @@ + + + + + + + fagdag/web + + + + + + diff --git a/fagdag/web.js b/fagdag/web.js new file mode 100644 index 0000000..5bde557 --- /dev/null +++ b/fagdag/web.js @@ -0,0 +1,384 @@ +let vMax, vMin, TEXT_SIZE, PALETTE, BEKK_PALETTE, BLOBS, SPOTS; + +// How spiky the blobs are +const BLOB_AMP = 0.5; +const LINE_AMP = 0.75; +const SPOT_AMP = 0.5; + +// How steep the easing curve is, tends to push blobs to their rMin or rMax +const BLOB_EASE_STEEPNESS = 4; +const SPOT_EASE_STEEPNESS = 5; +const LINE_EASE_STEEPNESS = 2; + +// The speed at which blobs grow and shrink +const BLOB_ANIMATION_SPEED = 0.002; + +// The speed at which the blob rotates in perlin noise space, made more noticable by more spiky blobs +const ROTATION_SPEED = 0.002; + +// A rough representation of the number of vertices that make up a blob, lower value = more points +const MAX_POINT_DIST = 15; + +// The thickness of lines +const STROKE_WEIGHT = 2; + +const RANDOM_COLORS = false; + +const SPOT_COUNT = 40; +const SPOT_X_SPREAD = 7; +const SPOT_Y_SPREAD = 0.5; +const SPOT_SLANT = 2; +const SPOT_APPEAR_NOISE = 0.005; +const SPOT_DURATION = 500; // 0 means the spots will always be visible + +const MOVE_SPEED = 0.1; +const MOVE_RADIUS = 100; + +/* + Config end +*/ + +function easeInOutCool(steepness, x) { + const mappedX = map(x, 0, 1, -1, 1); + return (1 + Math.tanh(steepness * mappedX)) / 2; +} + +function randomColor() { + const keys = Object.keys(BEKK_PALETTE); + return BEKK_PALETTE[keys[(keys.length * Math.random()) << 0]]; +} + +class Blob { + constructor({ + z, + cx, + cy, + mrx = 0, + mry = 0, + mSpeed = 0, + mAngle = random(TWO_PI), + rMin, + rMax, + amp = BLOB_AMP, + fillColor, + aStart = 0, + aEnd = TWO_PI, + line = false, + animationSpeed = BLOB_ANIMATION_SPEED, + steepness = BLOB_EASE_STEEPNESS, + disappearTime = 0, + }) { + this.z = z; + this.cx = cx; + this.cy = cy; + this.mrx = mrx; + this.mry = mry; + this.mSpeed = mSpeed; + this.mAngle = mAngle; + this.rMin = rMin; + this.rMax = rMax; + this.amp = amp; + this.fillColor = fillColor; + this.aStart = aStart; + this.aEnd = aEnd; + this.line = line; + this.animationSpeed = animationSpeed; + this.steepness = steepness; + this.disappearTime = disappearTime; + this.visible = this.disappearTime === 0; + this.disappearTick = + noise(cx * SPOT_APPEAR_NOISE, cy * SPOT_APPEAR_NOISE) * + this.disappearTime * + (1 - cy / height); + } + + draw() { + if (this.disappearTime !== 0) { + this.disappearTick++; + if (this.disappearTick >= this.disappearTime) { + this.visible = !this.visible; + this.disappearTick = 0; + } + } + + if (!this.visible) { + return; + } + + if (this.line) { + stroke(PALETTE.darkish); + noFill(); + } else { + fill(this.fillColor); + } + + // Might put all of this in the constructor + const pointCount = max((TWO_PI * this.rMax) / MAX_POINT_DIST, 30); + const deltaA = this.aEnd - this.aStart; + const amp = this.amp; + + const rotation = frameCount * ROTATION_SPEED; + this.mAngle = (this.mAngle + this.mSpeed) % TWO_PI; + + /* Iterate through a full circle of angles to draw a blob */ + beginShape(); + for (let a = this.aStart; a <= this.aEnd; a += deltaA / pointCount) { + // Get coordinates in the perlin noise space + const xOff = map(cos(a + rotation), -1, 1, 0, amp); + const yOff = map(sin(a + rotation), -1, 1, 0, amp); + + const noiseValue = noise( + xOff, + yOff, + this.z + frameCount * this.animationSpeed + ); + + const adjustedNoiseValue = easeInOutCool(this.steepness, noiseValue); + const noisedRadius = map(adjustedNoiseValue, 0, 1, this.rMin, this.rMax); + + /* Compute the final x and y and set a vertex there for the shape */ + const x = noisedRadius * cos(a); + const y = noisedRadius * sin(a); + + if (!this.line) { + const mx = this.mrx * cos(this.mAngle); + const my = this.mry * sin(this.mAngle); + vertex(this.cx + mx + x, this.cy + my + y); + } else { + vertex(this.cx + x, this.cy + y); + } + } + + if (line) { + endShape(); + noStroke(); + } else { + endShape(CLOSE); + } + } +} + +function setupBlobs () { + BLOBS = [ + new Blob({ + z: 10, + cx: 0, + cy: height * 0.9, + rMin: vMin * 0.1, + rMax: vMin * 0.4, + fillColor: RANDOM_COLORS ? randomColor() : PALETTE.yellow, + }), + new Blob({ + z: 20, + cx: width * 0.05, + cy: height * 0.2, + rMin: vMin * 0.25, + rMax: vMin * 0.5, + fillColor: RANDOM_COLORS ? randomColor() : PALETTE.pink, + }), + new Blob({ + z: 30, + cx: 0, + cy: height * 0.5, + rMin: vMin * 0.1, + rMax: vMin * 0.3, + fillColor: RANDOM_COLORS ? randomColor() : PALETTE.dark, + }), + new Blob({ + z: 40, + cx: width * 0.8, + cy: height, + rMin: vMin * 0.1, + rMax: vMin * 0.3, + fillColor: RANDOM_COLORS ? randomColor() : PALETTE.white, + }), + new Blob({ + z: 50, + cx: width * 0.9, + cy: height * 0.75, + rMin: vMin * 0.2, + rMax: vMin * 0.4, + fillColor: RANDOM_COLORS ? randomColor() : PALETTE.yellow, + }), + new Blob({ + z: 60, + cx: width * 1, + cy: height * 0.5, + rMin: vMin * 0.2, + rMax: vMin * 0.5, + fillColor: RANDOM_COLORS ? randomColor() : PALETTE.teal, + }), + new Blob({ + z: 100, + cx: 0, + cy: 0, + rMin: vMin * 0.2, + rMax: vMin * 0.8, + aEnd: PI, + line: true, + amp: LINE_AMP, + steepness: LINE_EASE_STEEPNESS + }), + new Blob({ + z: 200, + cx: width, + cy: height, + rMin: vMin * 0.25, + rMax: vMin * 0.45, + aStart: PI, + aEnd: PI + HALF_PI, + line: true, + amp: LINE_AMP, + steepness: LINE_EASE_STEEPNESS + }), + new Blob({ + z: 300, + cx: width, + cy: height, + rMin: vMin * 0.35, + rMax: vMin * 0.55, + aStart: PI, + aEnd: PI + HALF_PI, + line: true, + amp: LINE_AMP, + steepness: LINE_EASE_STEEPNESS + }), + new Blob({ + z: 1000, + cx: width / 2, + cy: height / 2, + rMin: vMin * 0.2, + rMax: vMin * 0.4, + fillColor: RANDOM_COLORS ? randomColor() : PALETTE.white, + }), + new Blob({ + z: 2000, + cx: width / 2, + cy: height / 2, + rMin: vMin * 0.25, + rMax: vMin * 0.45, + fillColor: PALETTE.dark, + }), + ]; + + SPOTS = []; + const SPOT_RMAX = vMin * 0.025; + for (let i = 0; i < SPOT_COUNT; i++) { + SPOTS.push( + new Blob({ + z: i, + cx: + width * 0.25 + + random(-SPOT_RMAX * SPOT_X_SPREAD, SPOT_RMAX * SPOT_X_SPREAD) - + i * SPOT_SLANT, + cy: (i * SPOT_RMAX * SPOT_Y_SPREAD), + rMin: vMin * 0.005, + rMax: SPOT_RMAX, + amp: SPOT_AMP, + fillColor: RANDOM_COLORS ? randomColor() : PALETTE.blue, + animationSpeed: 0, + steepness: SPOT_EASE_STEEPNESS, + disappearTime: SPOT_DURATION, + }) + ); + SPOTS.push( + new Blob({ + z: i + SPOT_COUNT, + cx: + width * 0.75 + + random(-SPOT_RMAX * SPOT_X_SPREAD, SPOT_RMAX * SPOT_X_SPREAD) + + i * SPOT_SLANT, + cy: height - (i * SPOT_RMAX * SPOT_Y_SPREAD), + rMin: vMin * 0.005, + rMax: SPOT_RMAX, + amp: SPOT_AMP, + fillColor: RANDOM_COLORS ? randomColor() : PALETTE.blue, + animationSpeed: 0, + steepness: SPOT_EASE_STEEPNESS, + disappearTime: SPOT_DURATION, + }) + ); + } +} + +function windowResized() { + vMin = min(width, height); + vMax = max(width, height); + resizeCanvas(windowWidth, round(windowWidth / 2.75)); + + setupBlobs(); + + // Intrinsically tied to the rMin of central blob + TEXT_SIZE = vMin * 0.1; + textSize(TEXT_SIZE); +} + +function setup() { + colorMode(HSL); + createCanvas(windowWidth, round(windowWidth / 2.75)); + + PALETTE = { + bg: color("#fff0ac"), + dark: color("#1c2c3c"), + darkish: color("#1c2c3c"), + white: color("#fff"), + pink: color("#efb2ff"), + yellow: color("#fff001"), + teal: color("#02dfc9"), + blue: color("#293895"), + }; + PALETTE.darkish.setAlpha(0.75); + + BEKK_PALETTE = { + // sort: color("#0E0E0E"), + // hvit: color("#FFFFFF"), + soloppgang: color("#FFB88D"), + // soloppgang_kontrast: color("#FF8034"), + // regn: color("#BCCEDD"), + // regn_kontrast: color("#7E9CB9"), + skyfritt: color("#B1E8FF"), + // skyfritt_kontrast: color("#43CBFF"), + // overskyet: color("#E7E7E7"), + // overskyet_kontrast: color("#CECECE"), + solnedgang: color("#FF9999"), + // solnedgang_kontrast: color("#FF5B5B"), + // sol: color("#FFF2AD"), + // sol_kontrast: color("#FFF02B"), + kveld: color("#E5B1FF"), + // kveld_kontrast: color("#8E24C9"), + grønn: color("#A1F5E3"), + // grønn_kontrast: color("#16DBC4"), + // natt: color("#6D7ABB"), + // natt_kontrast: color("#162365"), + }; + BG = color(PALETTE.bg); + + windowResized(); + setupBlobs(); + + textAlign(CENTER); + textFont("Newzald"); + + strokeWeight(STROKE_WEIGHT); + noStroke(); + strokeCap(PROJECT); +} + +function draw() { + /* Home-made helper function to select background based on config */ + background(BG); + + for (let b = 0; b < BLOBS.length; b++) { + const blob = BLOBS[b]; + blob.draw(); + } + + for (let s = 0; s < SPOTS.length; s++) { + const spot = SPOTS[s]; + spot.draw(); + } + + fill(PALETTE.white); + text("Frontend", width / 2, height / 2); + text("til frokost", width / 2, height / 2 + TEXT_SIZE); +} diff --git a/index.html b/index.html index a65179b..3d0f1ae 100644 --- a/index.html +++ b/index.html @@ -48,7 +48,7 @@

Big text

perlin
perlin
- + falsefalse