canvastage sketch
Last active
June 26, 2026 10:15
-
-
Save shinyaoguri/02e9f191ed7a8f1207a0430a2004b58e to your computer and use it in GitHub Desktop.
rosy-dust-vw5 — canvastage sketch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>sketch</title> | |
| <script src="https://cdn.jsdelivr.net/npm/p5@1/lib/p5.min.js"></script> | |
| <link rel="stylesheet" href="style.css"> | |
| </head> | |
| <body> | |
| <script src="sketch.js"></script> | |
| </body> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function setup() { | |
| createCanvas(windowWidth, windowHeight); | |
| noStroke(); | |
| } | |
| function draw() { | |
| background(20); | |
| let cols = 50, rows = 100; | |
| let w = width / cols, h = height / rows; | |
| for (let i = 0; i < cols; i++) { | |
| for (let j = 0; j < rows; j++) { | |
| let hue = (i * 25 + j * 25 + frameCount) % 360; | |
| fill(color(`hsl(${hue}, 70%, 60%)`)); | |
| rect(i * w, j * h, w - 2, h - 2, 4); | |
| } | |
| } | |
| } | |
| function windowResized() { | |
| resizeCanvas(windowWidth, windowHeight); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| * { | |
| margin: 0; | |
| padding: 0; | |
| box-sizing: border-box; | |
| } | |
| html, body { | |
| width: 100%; | |
| height: 100%; | |
| overflow: hidden; | |
| background: #000; | |
| } | |
| body { | |
| display: flex; | |
| justify-content: center; | |
| align-items: center; | |
| } | |
| canvas { | |
| display: block; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment