xxxxxxxxxx
let colors=["#271f17","#014e68","#8497a8","#c5cecf","#b8ad38","#978c0e"]
let weaveWidth=30
let texture
let cChooser
let bgColor
function preload(){
font= loadFont('FamiljenGrotesk-VariableFont_wght.ttf')
}
function setup() {
createCanvas(400, 400);
background('#f4f1de')
texture= createGraphics(280, 280)
for(let x=0; x<280; x+=3){
for(let y=0; y<280; y+=3){
let angle= noise(x/5, y/5)*PI
texture.stroke(0, 30)
texture.strokeWeight(1)
texture.line(x, y, x+cos(angle)*5, y+sin(angle)*5)
}
}
strokeCap(PROJECT)
let bgIndex= floor(random(colors.length))
bgColor= colors[bgIndex]
fill(bgColor)
rect(60, 60, 320, 320)
colors.splice(bgIndex, 1)
cChooser=0
for(let x=-weaveWidth*2.5; x<width+(weaveWidth*2.5); x+=weaveWidth*0.75){
weave(x, weaveWidth*0.5)
cChooser++
}
image(texture,60, 60)
fill('#f4f1de')
noStroke()
rect(0, 0, width, 60)
rect(0, 0, 60, height)
rect(340, 0, 60, height)
rect(0, 340, width, 60)
noFill()
stroke(100)
textFont(font)
fill(100)
strokeWeight(1)
stroke(100)
text('1.15', 20, 380)
}
function weave(x, s){
push()
translate(x, 50)
rotate(-QUARTER_PI)
noFill()
let strokeC= colors[cChooser%colors.length]
stroke(strokeC)
strokeWeight(s*0.2)
beginShape()
for(let y=0; y<460; y++){
let xoff= sin(y/15)*s
vertex(x+xoff, y)
}
endShape()
let gap1=47
for(let y=0; y<460; y++){
push()
fill(bgColor)
if(y==gap1){
noStroke()
rectMode(CENTER)
rect(x, gap1+0.5, s*0.75, s*0.5+0.5)
gap1+=94
}
pop()
}
beginShape()
for(let y=0; y<460; y++){
let xoff= sin(y/15+PI)*s
vertex(x+xoff, y)
}
endShape()
let gap2=94
for(let y=0; y<460; y++){
push()
fill(bgColor)
if(y==gap2){
noStroke()
rectMode(CENTER)
rect(x, gap2, s*0.75, s*0.4)
stroke(strokeC)
strokeWeight(s*0.2)
line(x-s*0.21, y-s*0.2+0.5, x+s*0.21, y+s*0.2+0.5)
gap2+=94
}
pop()
}
pop()
}