soiz1 commited on
Commit
bdd68cb
·
verified ·
1 Parent(s): 7d687c5

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +53 -1
index.html CHANGED
@@ -37,7 +37,59 @@ THE SOFTWARE.
37
 
38
  <link rel="stylesheet" href="scratch.css">
39
  <script type="module" src="squeak.js"></script>
40
- <script src="0.5.js"></script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
 
42
  </head>
43
  <body>
 
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 : "0.5"; // "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>