xxxxxxxxxx
151
let c;
let font1;
let font2;
let colorpicker1;
let colorpicker2;
let colorpicker3;
let slider;
let button1;
let button2;
let button3;
let button4;
function preload(){
font1 = loadFont('Orbitron Black.otf');
font2 = loadFont('Orbitron Medium.otf');
}
function setup() {
c = createCanvas(400, 400);
angleMode(DEGREES);
textSize(60);
textAlign(CENTER, CENTER);
colorPicker1 = createColorPicker('white');
colorPicker1.position(0, 0);
colorPicker2 = createColorPicker('grey');
colorPicker2.position(0, 30);
colorPicker3 = createColorPicker('lightgrey');
colorPicker3.position(0, 60);
button1 = createButton('SAVEPIC');
button1.position(0, 90);
button1.mousePressed(function () {
saveCanvas(c, 'mounteverest.jpeg')
});
button2 = createButton('SAVEGIF');
button2.position(0, 115);
button2.mousePressed(function () {
saveGif('mounteverest', 6)
});
button3 = createButton('PAUSE');
button3.position(0, 140);
button3.mousePressed(function () {
noLoop();
});
button4 = createButton('PLAY');
button4.position(0, 165);
button4.mousePressed(function () {
loop();
});
slider = createSlider(0, 10, 0.1);
slider.size(100);
slider.position(width - 102, 0);
}
function draw() {
background(0);
push()
strokeWeight(slider.value());
stroke(colorPicker3.value());
push()
fill(colorPicker1.value())
push()
let amplitude = 35;
let offset = sin(frameCount) * amplitude;
textFont(font2);
textSize(30 - (offset / 2));
text('R', 198, 190 + (offset * 7) / 2);
pop()
push()
textFont(font2);
textSize(60 - (offset / 2));
text('E', 100, 280 + (offset * 4) / 5);
pop()
push()
textFont(font2);
textSize(50 - (offset / 2));
text('V', 130, 250 + ((offset * 5.5) / 3));
pop()
push()
textFont(font2);
textSize(40 - (offset / 2));
text('E', 165, 210 + ((offset * 5) / 2));
pop()
push()
textFont(font2);
textSize(40 - (offset / 2));
text('E', 230, 210 + ((offset * 5) / 2));
pop()
push()
textFont(font2);
textSize(50 - (offset / 2));
text('S', 260, 250 + ((offset * 5.5) / 3));
pop()
push()
textFont(font2);
textSize(60 - (offset / 2));
text('T', 300, 280 + (offset * 4) / 5);
pop()
pop()
push()
noStroke();
fill(0);
rect(50, 285, 300, 60);
pop()
push()
fill(colorPicker2.value());
textFont(font1);
text('MOUNT', 200, 310);
pop()
pop()
}