-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJavaScript2.html
More file actions
76 lines (61 loc) · 2.76 KB
/
Copy pathJavaScript2.html
File metadata and controls
76 lines (61 loc) · 2.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<title>JavaScript Demo: Expressions - Property accessors</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://interactive-examples.mdn.mozilla.net/pages/js/../../css/codemirror-5-50-2.css" rel="stylesheet" />
<link href="https://interactive-examples.mdn.mozilla.net/pages/js/../../css/editor-js.css" rel="stylesheet" />
</head>
<body>
<section id="static">
<pre><code id="static-js" data-height="taller">
const ドキュメント = document;
// var cvs = ドキュメント.createElement('canvas');
// cvs = {
// id :'textcanvas',
// width :400,
// height :150,
// style :"border: 5pt solid orange; background-color:#CCC;"
// };
const 作業スペース = ドキュメント.getElementById('作業スペース');
作業スペース.innerHTML = "<div id='作業スペース'></div>"
+ "<canvas id='textcanvas' width=400 height='150' align='center' "
+ " style='border: 5pt solid orange; background-color:#CCC;'></canvas>";
function sta2canvas(){
var canvas = document.getElementById('textcanvas');
const ctx = canvas.getContext('2d');
ctx.clearRect(0,0,400,150);
const displaystrings =
document.getElementById('starts').innerHTML;
const textXpoint = 0;
var textYpoint = 10;
ctx.fillStyle ="green";
for(;
textYpoint<150;
textYpoint+=10)
ctx.fillText( displaystrings, textXpoint, textYpoint);
}
// sta2canvas();
</section>
<section id="live" class="live hidden">
<header class="output-header full-border">
<h4 class="output-heading">JavaScript 実行ページ:<br>(これは、<a href="https://developer.mozilla.org/ja/" target=_blank>MDN</a>
の
<a href="https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Operators/Property_Accessors" target=_blank>プロパティアクセッサページのTry It!のページ(iframeHTML/CSS/jsの殆ど)</a>を利用しています)</h4>
</header>
<div id="作業スペース"></div>
<div id="editor" class="editor"></div>
<div class="output-container">
<div class="buttons-container">
<button id="execute" class="button run" type="button">Run ›</button>
<button id="reset" type="button" class="button">Reset</button>
</div>
<div id="console" class="output"><code></code></div>
</div>
</section>
<script src="https://interactive-examples.mdn.mozilla.net/pages/js/../../js/codemirror-5-50-2.js"></script>
<script src="https://interactive-examples.mdn.mozilla.net/pages/js/../../js/editor-js.js"></script>
</body>
</html>