Skip to content

Commit

Permalink
JAN11
Browse files Browse the repository at this point in the history
  • Loading branch information
ronikaufman committed Jan 11, 2023
1 parent f1e6de8 commit 140e4ea
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 1 deletion.
Binary file added JAN11-20/JAN11/JAN11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 57 additions & 0 deletions JAN11-20/JAN11/sketch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*
Genuary 2023
JAN.11 "Suprematism"
By Roni Kaufman
https://ronikaufman.github.io
*/

let m = 64, n = 32, sx, sy;

function setup() {
textSize(24);
textAlign(LEFT, TOP);
textFont("monospace")
sx = textWidth("█")*0.626, sy = sx*1.7;

createCanvas(sx*m, sy*n);
noLoop();
noStroke();
}

function draw() {
background("#fffbe6");
fill("#050505");

for (let x = 0; x < width; x += sx) {
for (let y = 0; y < height; y += sy) {
let c, offset = 0;
let theta = atan2(y-height/3, x-width/2)+4*PI/3;
if (theta > TAU - PI/6 || theta < PI/2) {
c = "▓";
if (random() < 1/6) {
c = "█";
}
} else if (theta < 7*PI/6) {
c = "▒";
} else {
c = "░";
if (random() < 1/6) {
c = "█";
}
}

theta = atan2(y-2*height/3, x-width/2)+PI/3;
if (theta > PI/2 && theta < 7*PI/6) c = "▒";

let d = max(abs(x-width/2), abs(y-height/3));
if (d < 8*sx) c = " ";
if (d < 5*sx) c = "█";

if (abs(x - 42*sx) < sx/10 && abs(y - 24*sy) < sy/10) {
c = "🪑";
offset = -sx/4;
}
text(c, x+offset+random([-1, 1])*0.2, y+sy*0.75+random([-1, 1])*0.2);
}
}
}
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ After Andreas Gysin (https://www.instagram.com/p/CUR2We3gc2I)
### JAN. 11
> Suprematism
<img src="./JAN11-20/JAN11/JAN11.png" width="66%"/>

Inspired by the photo of the ["0,10 Exhibition"](https://en.wikipedia.org/wiki/0,10_Exhibition)

### JAN. 12
> Tessellation
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<html>
<head>
<script src="./p5.min.js" type="text/javascript"></script>
<script src="JAN01-10/JAN10/sketch.js" type="text/javascript"></script>
<script src="JAN11-20/JAN11/sketch.js" type="text/javascript"></script>
</head>
<body style = "width: 100%; height: 100%; background-color: 0; margin: 0; display: flex; justify-content: center; align-items: center;">
</body>
Expand Down

0 comments on commit 140e4ea

Please sign in to comment.