Skip to content

Commit 96f8622

Browse files
Mitsuha MiyakeMitsuha Miyake
authored andcommitted
add an artwork
1 parent 63f812a commit 96f8622

File tree

11 files changed

+188
-0
lines changed

11 files changed

+188
-0
lines changed

works/20240609/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# memo
2+
Reference:
3+
4+
<img src="img/image01.png">

works/20240609/css/style.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
html, body {
2+
margin: 0;
3+
padding: 0;
4+
}
5+
canvas {
6+
display: block;
7+
}

works/20240609/index.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<html>
2+
<head>
3+
<script src="https://cdn.jsdelivr.net/npm/p5@1.6.0/lib/p5.js"></script>
4+
<script src="https://unpkg.com/p5.js-svg@1.5.1"></script>
5+
<script src="js/sketch.js"></script>
6+
</head>
7+
<body>
8+
</body>
9+
</html>

works/20240609/js/sketch.js

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
// カラーパレット
2+
let cp1 = ["#264653", "#2a9d8f", "#e9c46a", "#f4a261", "#e76f51"];
3+
let cp2 = ["#8ecae6", "#219ebc", "#023047", "#ffb703", "#fb8500"];
4+
let cp3 = ["#390099", "#9e0059", "#ff0054", "#ff5400", "#ffbd00"];
5+
let cp4 = ["#a31621", "#bfdbf7", "#053c5e", "#1f7a8c", "#db222a"];
6+
let colorPalette = [cp1, cp2, cp3, cp4];
7+
8+
let seed = 3000;
9+
let rSeed;
10+
11+
function setup() {
12+
// キャンバスサイズの設定
13+
let canvas = createCanvas(windowWidth, windowHeight);
14+
let colors = random(colorPalette);
15+
let bg = random(colors);
16+
background(bg);
17+
18+
rSeed = int(random(seed));
19+
console.log(rSeed);
20+
randomSeed(rSeed);
21+
noiseSeed(rSeed);
22+
angleMode(DEGREES);
23+
24+
noStroke();
25+
for (let i = 0; i < 10; i++) {
26+
fill(random(colors));
27+
ellipse(width / 2, height / 2, random(200, min(windowHeight, windowWidth)));
28+
}
29+
30+
strokeWeight(1);
31+
stroke(bg);
32+
33+
// 格子模様
34+
let n = 100;
35+
let w = width / n;
36+
let a = 120;
37+
for (let j = -n; j <= n; j++) {
38+
let sx = w * j;
39+
let sy = 0;
40+
let ex = width + w * j;
41+
let ey = height * sin(60);
42+
line(sx, sy, ex, ey);
43+
}
44+
for (let j = -n; j <= n; j++) {
45+
let sx = width + w * j;
46+
let sy = 0;
47+
let ex = w * j;
48+
let ey = height * sin(60);
49+
line(sx, sy, ex, ey);
50+
}
51+
}
52+
53+
function mouseClicked() {
54+
window.location.reload();
55+
}
56+
57+
function keyPressed() {
58+
if (key == "s") {
59+
var scripts = document.getElementsByTagName("sketch").src;
60+
console.log(scripts);
61+
// saveCanvas(canvas, 'image_'+rSeed, 'svg');
62+
save("image_" + rSeed + ".svg");
63+
}
64+
if (key == "p") {
65+
var scripts = document.getElementsByTagName("sketch").src;
66+
console.log(scripts);
67+
save("image_" + rSeed + ".png");
68+
}
69+
}

works/20240730/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# memo
2+
Reference:
3+
4+
<img src="img/image01.png">

works/20240730/css/style.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
html, body {
2+
margin: 0;
3+
padding: 0;
4+
}
5+
canvas {
6+
display: block;
7+
}

works/20240730/img/image_1275.png

106 KB
Loading

works/20240730/img/image_1361.png

108 KB
Loading

works/20240730/img/image_660.png

135 KB
Loading

works/20240730/index.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<html>
2+
<head>
3+
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.js"></script>
4+
<script src="js/sketch.js"></script>
5+
</head>
6+
<body>
7+
</body>
8+
</html>

0 commit comments

Comments
 (0)