soiz1 commited on
Commit
8d1b6b7
·
verified ·
1 Parent(s): 9a445fe

Create ui.html

Browse files
Files changed (1) hide show
  1. ui.html +104 -0
ui.html ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <!DOCTYPE html>
3
+ <html>
4
+ <head>
5
+ <meta charset="utf-8">
6
+ <title>ScratchJS</title>
7
+ <!--
8
+ Copyright (c) 2013-2020 Vanessa Freudenberg
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in
18
+ all copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26
+ THE SOFTWARE.
27
+ -->
28
+ <link rel="icon" type="image/png" href="scratch.png">
29
+ <link rel="apple-touch-icon" href="scratch.png" sizes="152x152">
30
+ <meta name="viewport" content="minimum-scale=1,maximum-scale=1,width=device-width">
31
+ <meta name="apple-mobile-web-app-capable" content="yes">
32
+ <meta name="msapplication-TileImage" content="scratch.png">
33
+
34
+ <link rel="stylesheet" href="lib/gh-fork-ribbon.css">
35
+ <link rel="stylesheet" href="lib/addtohomescreen.css">
36
+ <script src="lib/addtohomescreen.js"></script>
37
+
38
+ <link rel="stylesheet" href="scratch.css">
39
+ <script type="module" src="squeak.js"></script>
40
+ <script>
41
+ //0.5.js
42
+ /*
43
+ * Copyright (c) 2013-2020 Vanessa Freudenberg
44
+ *
45
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
46
+ * of this software and associated documentation files (the "Software"), to deal
47
+ * in the Software without restriction, including without limitation the rights
48
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
49
+ * copies of the Software, and to permit persons to whom the Software is
50
+ * furnished to do so, subject to the following conditions:
51
+ *
52
+ * The above copyright notice and this permission notice shall be included in
53
+ * all copies or substantial portions of the Software.
54
+ *
55
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
56
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
57
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
58
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
59
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
60
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
61
+ * THE SOFTWARE.
62
+ */
63
+
64
+ var fullscreen = navigator.standalone ||
65
+ window.matchMedia('(max-device-width: 800px) and (max-device-height: 800px)').matches;
66
+
67
+ window.onload = function() {
68
+ // URLのハッシュ部分を取得し、前後の#を取り除く
69
+ var hash = window.location.hash.substring(1); // 例: #0.5 → "0.5"
70
+
71
+ // デフォルト値を設定(ハッシュがない場合)
72
+ var imageName = hash ? hash : "1.4"; // "default" は任意の初期ファイル名
73
+ var url = "/images/" + imageName + ".image";
74
+
75
+ SqueakJS.runSqueak(url, sqCanvas, {
76
+ appName: "Scratch",
77
+ fullscreen: fullscreen,
78
+ header: sqHeader,
79
+ footer: sqFooter,
80
+ spinner: sqSpinner,
81
+ fullscreenCheckbox: sqFullscreen,
82
+ root: "/Scratchy",
83
+ templates: ["Projects", "Media", "Help", "locale"],
84
+ });
85
+ };
86
+
87
+ if (addToHomescreen.isStandalone)
88
+ fullscreen = true;
89
+ else addToHomescreen({
90
+ appID: 'squeakjs.scratch.add2home',
91
+ });
92
+ </script>
93
+
94
+ </head>
95
+ <body>
96
+ <div id="sqHeader" hidden>
97
+ <label title="Make Scratch as large as possible"><input id="sqFullscreen" type="checkbox">full screen</label>
98
+ </div>
99
+ <div id="sqFooter" hidden>
100
+ </div>
101
+ <canvas id="sqCanvas"></canvas>
102
+ <div id="sqSpinner"><div></div></div>
103
+ </body>
104
+ </html>