We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 76e2681 commit d0c9409Copy full SHA for d0c9409
script.js
@@ -0,0 +1,29 @@
1
+var canvas = document.getElementById("canvas");
2
+
3
+/* Component settings inside the canvas */
4
+var x;
5
+var y;
6
+var width;
7
+var height;
8
9
+var component1, component2;
10
11
+function draw_component1(){
12
+ x = 50, y = 25, width = 40, height = 40;
13
+ component1 = canvas.getContext("2d");
14
+ component1.fillRect(x, y, width, height);
15
+ canvas.setAttribute("onclick","draw_component2();");
16
+}
17
18
+function draw_component2(){
19
+ x = 50, y = 160, width = 40, height = 40;
20
+ component2 = canvas.getContext("2d");
21
+ component2.fillStyle = "green";
22
+ component2.fillRect(x, y, width, height);
23
+ canvas.setAttribute("onclick","clean();");
24
25
26
+function clean(){
27
+ canvas.width = canvas.width;
28
+ canvas.setAttribute("onclick","draw_component1();");
29
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments