xxxxxxxxxx
var cBlack = "#020202"; //variable for black
var cGrey = "#989795"; //variable for grey
var cPink = "#d3227d"; //variable for pink
var y1;
var y2;
var x1;
var x2;
var fontRama
//preload text
function preload() {
fontRama = loadFont("Rama Gothic M W03 SemiBold.ttf");
}
function setup() {
createCanvas(600, 882);
background(245,238,232,255);
noLoop();
}
function draw() {
background(245,238,232,255);
// Call text function
noStroke() //get rid of stroke
textFont(fontRama) //set font
textSize(70); // Set text font-size
fill(cBlack); // Set color black
text("MARCEL PROUST", 35, 75, 600); //text
text("AND DELIVERANCE FROM TIME", 35, 140, 600); //text
fill(cGrey); //set color grey
text("BY", 35, 205, 600); //text
fill(cPink); //set color pink
text("GERMAINE BRÈE", 105, 205, 600); //text
//draw rectangle
fill (cPink) //set color pink
noStroke() //remove stroke
rect(70, 620, 530, 262); //draw pink rectangle
fill (248,193,21,127) //set color yellow with %50 transparency
noStroke() //remove stroke
rect(160, 475, 225, 330); //draw yellow rectangle
stroke(cBlack); //set stroke to black
drawLinesTop();
drawLinesTop();
drawLinesBottom();
drawLinesBottom();
//arrow
stroke(cPink); //set stroke to pink
line(25, 595, 40, 610); //draw line
line(40, 610, 55, 595); //draw line
strokeWeight(2); //make thicker line with stroke weight
line(40, 585, 40, 610); //draw line
noStroke(); //get rid of stroke for text
fill (cBlack); //set text color
textSize(30); //set text size
text("$1.45", 23, 640, 600); //text
strokeWeight(1); //reset stroke weight from before
}
function drawLinesTop() {
y1 = 475; //set y position
y2 = 882; //set y2 position
x1 = random(70 , 300); //randomize x1 position
x2 = random(70 , 600); //randomize x2 position
/*for(var i=0; i<20; i=i+1) {
var chanceFac = random(0,1);
if(chanceFac < 0.9) {
line(x1+3*i, y1, x2+3*i, y2);
//rect(0,0, sz-10*i, sz-10*i);*/
for (let x = x1; x < width; x = x + 30) {
line(x, y1, x2, y2);
x2 = x2 + 5
}
}
function drawLinesBottom() {
y1 = 475;
y2 = 882;
x1 = random(70 , 300);
x2 = random(70 , 600);
for (let i = x2; i < width; i = i + 30) {
line(x1, y2, x2, y1);
x2 = x2 + 5;
x1 = x1 + 20;
}
}
function keyPressed () {
if(key == 'r' || key == 'R') {
draw();
}
if(key == 's' || key == 'S') {
saveCanvas("duygu_generative_poster_design.jpg")
}
}