S = Start // D = Stop // E = Translate to English // G = Translate to German // Arrow Up - Faster // Arrow Down - Slower ///// You can only stop if you're on the slowest level.
xxxxxxxxxx
var cover;
var yan;
var yanRegular;
var x;
var o; //orange
var r; //rot
var p; //pink
var b; //blau
var l; //lila
var value = 0;
var y00 = 0.2;
var y;
function preload() {
cover = loadImage("Anton_Stankowski_-_Motores.jpg");
yan = loadFont("Yantramanav-Medium.ttf");
yanRegular = loadFont("Yantramanav-Regular.ttf");
x = 0;
o = 0;
r = 0;
p = 0;
b = 0;
l = 0;
y = 0;
}
function setup() {
createCanvas(673, 950);
background(100);
//frameRate(15);
}
function keyTyped() {
if (key === 's') {
value = 1;
} else
if (key === 'd') {
if(y00 == 0.2){
value = 0;
}
}
}
function draw() {
//HINTERGRUND
image(cover, 0, 0);
fill(253, 149, 86);
noStroke();
rect(0,0, width, height);
textSize(32);
if(value == 1){
fill(255);
var y4 = y00*map(sin(millis()/100), -1, 1, 50, -50);
rect(y4+590, 50, 40, 5);
noFill();
}
else{
fill(255);
rect(590, 50, 40, 5);
noFill();
}
//ÜBERSCHRIFT
push();
fill(255);
textFont(yan);
textSize(70);
translate(width/2, 70);
if(keyIsDown(UP_ARROW)){
y00 += 0.01;
}
if(keyIsDown(DOWN_ARROW)){
y00 -= 0.01;
}
if(y00 >= 1.5){
y00 = 1.5;
}
if(y00 <= 0.2){
y00 = 0.2;
}
if(value == 1){
if(keyIsDown(71)){
var y0 = y00*map(sin(millis()/100), -1, 1, 50, -50);
text("Motoren", y0, 0);
var y1 = y00*map(sin(millis()/100), -1, 1, -50, 50);
text("Helfer", y1, 60);
var y2 = y00*map(sin(millis()/100), -1, 1, 50, -50);
text("des", y2, 120);
var y3 = y00*map(sin(millis()/100), -1, 1, -50, 50);
text("Menschen", y3, 180);
}
else{
if(keyIsDown(69)){
var y0 = y00*map(sin(millis()/100), -1, 1, 50, -50);
text("Motors", y0, 0);
var y1 = y00*map(sin(millis()/100), -1, 1, -50, 50);
text("Helper", y1, 60);
var y2 = y00*map(sin(millis()/100), -1, 1, 50, -50);
text("of the", y2, 120);
var y3 = y00*map(sin(millis()/100), -1, 1, -50, 50);
text("people", y3, 180);
}
else{
var y0 = y00*map(sin(millis()/100), -1, 1, 50, -50);
text("Motores", y0, 0);
var y1 = y00*map(sin(millis()/100), -1, 1, -50, 50);
text("ayudantes", y1, 60);
var y2 = y00*map(sin(millis()/100), -1, 1, 50, -50);
text("del", y2, 120);
var y3 = y00*map(sin(millis()/100), -1, 1, -50, 50);
text("hombre", y3, 180);
}
}
}
else{
if(keyIsDown(71)){
text("Motoren", 0, 0);
text("Helfer", 0, 60);
text("des", 0, 120);
text("Menschen", 0, 180);
}
else{
if(keyIsDown(69)){
text("Motors", 0, 0);
text("Helper", 0, 60);
text("of the", 0, 120);
text("people", 0, 180);
}
else{
text("Motores", 0, 0);
text("ayudantes", 0, 60);
text("del", 0, 120);
text("hombre", 0, 180);
}
}
}
pop();
//SATZ
push();
fill(0);
textFont(yanRegular);
textSize(17,5);
textAlign(CENTER, CENTER);
translate(width/2, 275);
if(keyIsDown(71)){
text("Eine deutsche Ausstellung zur Entwicklung von Verbrennungsmotoren", x, 0);
}
else{
if(keyIsDown(69)){
text("A German exhibition for the development of internal combustion engines", x, 0);
}
else{
text("Una exposisición alemana sobre el desarrollo de motores de combustión interna", x, 0);
}
}
pop();
strokeWeight(50);
strokeCap(SQUARE);
translate(width/2, 620);
if(value == 1){
x = random(y00*20);
}
else{
x = 0;
}
o = 240;
r = 210;
p = 195;
l = 130;
b = 0;
//5. KREIS
push();
rotate(PI*millis()/1000);
rotate(sin(millis()/1000)*tan(millis()/1000));
rotate(PI+960);
noFill();
stroke(o, 110, 70);
arc(x, x, 600, 600, 120, 240); //orange
stroke(r, 40, 85);
arc(x,x, 600, 600, 0, 120); //rot
stroke(p, 65, 140);
arc(x,x, 600, 600, -120, 0); //pink
stroke(l, 50, 150);
arc(x,x, 600, 600, -240, -120); //lila
stroke(b, 0, 185);
arc(x,x, 600, 600, -360, -240); //blau
pop();
//4. KREIS
push();
rotate(-PI*millis()/2000);
rotate(sin(millis()/1000)*tan(millis()/1000));
rotate(PI+720);
noFill();
stroke(o, 110, 70);
arc(x, x, 480, 480, 120, 240); //orange
stroke(r, 40, 85);
arc(x,x, 480, 480, 0, 120); //rot
stroke(p, 65, 140);
arc(x,x, 480, 480, -120, 0); //pink
stroke(l, 50, 150);
arc(x,x, 480, 480, -240, -120); //lila
stroke(b, 0, 185);
arc(x,x, 480, 480, -360, -240); //blau
pop();
//3. KREIS
push();
rotate(PI*millis()/3000);
rotate(sin(millis()/1000)*tan(millis()/1000));
rotate(PI+480);
noFill();
stroke(o, 110, 70);
arc(x,x, 360, 360, 120, 240); //orange
stroke(r, 40, 85);
arc(x,x, 360, 360, 0, 120); //rot
stroke(p, 65, 140);
arc(x,x, 360, 360, -120, 0); //pink
stroke(l, 50, 150);
arc(x,x, 360, 360, -240, -120); //lila
stroke(b, 0, 185);
arc(x,x, 360, 360, -360, -240); //blau
pop();
//2. KREIS
push();
rotate(-PI*millis()/4000);
rotate(sin(millis()/1000)*tan(millis()/1000));
rotate(PI+240);
noFill();
stroke(o, 110, 70);
arc(x,x, 240, 240, 120, 240); //orange
stroke(r, 40, 85);
arc(x,x, 240, 240, 0, 120); //rot
stroke(p, 65, 140);
arc(x,x, 240, 240, -120, 0); //pink
stroke(l, 50, 150);
arc(x,x, 240, 240, -240, -120); //lila
stroke(b, 0, 185);
arc(x,x, 240, 240, -360, -240); //blau
pop();
// 1. KREIS
push();
rotate(PI*millis()/5000);
rotate(sin(millis()/1000)*tan(millis()/1000));
rotate(PI);
noFill();
stroke(o, 110, 70);
arc(x,x, 120, 120, 120, 240); //orange
stroke(r, 40, 85);
arc(x,x, 120, 120, 0, 120); //rot
stroke(p, 65, 140);
arc(x,x, 120, 120, -120, 0); //pink
stroke(l, 50, 150);
arc(x,x, 120, 120, -240, -120); //lila
stroke(b, 0, 185);
arc(x,x, 120, 120, -360, -240); //blau
pop();
}