use nannou::prelude::*;
fn main() {
nannou::sketch(view);
}
fn view(app: &App, frame: Frame) -> Frame {
let draw = app.draw();
draw.background().color(BLUE);
let win = app.window_rect();
draw.tri()
.points(win.bottom_left(), win.top_left(), win.top_right())
.color(DARK_PURPLE);
let t = app.time;
draw.ellipse()
.x_y(app.mouse.x * t.cos(), app.mouse.y)
.radius(win.w() * 0.125 * t.sin())
.color(RED);
draw.line()
.start(win.top_left() * t.sin())
.end(win.bottom_right() * t.cos())
.thickness(win.h() / (50.0 * t.sin()))
.caps_round()
.color(LIGHT_YELLOW);
draw.quad()
.x_y(-app.mouse.x, app.mouse.y)
.color(DARK_GREEN)
.rotate(t);
draw.rect()
.x_y(app.mouse.y, app.mouse.x)
.w(app.mouse.x * 0.25)
.hsv(t, 1.0, 1.0);
draw.to_frame(app, &frame).unwrap();
frame
}