xxxxxxxxxx
75
let count = 150;
let = speed = 1/999999
let frameCount = 1/999999
let button1;
let slider1;
let colorpicker1;
let brush;
var r = 0;
var y = 150;
var b = 255;
function setup() {
createCanvas(windowWidth, windowHeight);
angleMode(DEGREES);
textAlign(CENTER, CENTER)
fill("#2BB0F9")
textSize(60)
stroke("rgb(7,37,143)")
strokeWeight(6)
colorPicker1 = createColorPicker('#2BB0F9')
colorPicker1.position(width - 54,55)
slider1 = createSlider(1,50)
slider1.size(100)
slider1.position(width - 105,5)
button1= createButton("SAVE GIF");
button1.position(width - 80,30);
button1.mousePressed(function () {
saveGif("surf.gif", 6);
})
}
function draw() {
r = map(mouseY, 0, 350, 700, 255);
b = map(mouseY, 350, 0, 255, 0);
y = map(mouseX, 400, 0 ,300 ,0);
background(r,b,y);
for(let index = 0; index < count; index += 1){
let amplitude=80;
let waveOffset= map(index,10,count-1,0,mouseX);
let positionOffset = sin(frameCount + waveOffset) * amplitude;
let positionOffset2 = sin(frameCount) * 30;
let x = map(index, 10, count-1, -60 ,370);
let y = height/1.2 + positionOffset + positionOffset2;
text("SURF", x, y)
text("SURF", x, y - 150)
text("SURF", x, y - 300)
text("SURF", x, y - 450)
fill (colorPicker1.value())
push()
fill('white')
stroke('black')
strokeWeight(2)
circle(mouseX,mouseY,8)
pop()
frameCount = frameCount + speed / 800
speed = slider1.value();
}}