Lashtw commited on
Commit
af802e1
·
verified ·
1 Parent(s): 3a071c3

Upload 3 files

Browse files
Files changed (3) hide show
  1. function.html +18 -1
  2. index.html +2 -0
  3. sequence.html +11 -1
function.html CHANGED
@@ -41,6 +41,7 @@
41
  left: 0;
42
  width: 100vw;
43
  height: 100vh;
 
44
  background: rgba(15, 23, 42, 0.6);
45
  /* Semi-transparent Slate 900 */
46
  z-index: -1;
@@ -53,6 +54,7 @@
53
  left: 0;
54
  width: 100vw;
55
  height: 100vh;
 
56
  z-index: 0;
57
  }
58
 
@@ -368,6 +370,21 @@
368
  playSound('tick');
369
  }
370
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
371
  document.getElementById('start-overlay').classList.add('hidden');
372
  resize();
373
  window.addEventListener('resize', resize);
@@ -1284,7 +1301,7 @@
1284
  } else {
1285
  playSound('alarm');
1286
  // Use on-screen hint instead of alert
1287
- updateUI("驗算失敗!請檢查公式: y = 3(10) + 5 = ?");
1288
  }
1289
  }
1290
 
 
41
  left: 0;
42
  width: 100vw;
43
  height: 100vh;
44
+ height: 100dvh;
45
  background: rgba(15, 23, 42, 0.6);
46
  /* Semi-transparent Slate 900 */
47
  z-index: -1;
 
54
  left: 0;
55
  width: 100vw;
56
  height: 100vh;
57
+ height: 100dvh;
58
  z-index: 0;
59
  }
60
 
 
370
  playSound('tick');
371
  }
372
 
373
+ // Try to enter fullscreen
374
+ try {
375
+ if (document.documentElement.requestFullscreen) {
376
+ document.documentElement.requestFullscreen().catch(e => {
377
+ console.log("Fullscreen request failed (likely user denied):", e);
378
+ });
379
+ } else if (document.documentElement.webkitRequestFullscreen) { /* Safari */
380
+ document.documentElement.webkitRequestFullscreen();
381
+ } else if (document.documentElement.msRequestFullscreen) { /* IE11 */
382
+ document.documentElement.msRequestFullscreen();
383
+ }
384
+ } catch (err) {
385
+ console.log("Fullscreen not supported or allowed");
386
+ }
387
+
388
  document.getElementById('start-overlay').classList.add('hidden');
389
  resize();
390
  window.addEventListener('resize', resize);
 
1301
  } else {
1302
  playSound('alarm');
1303
  // Use on-screen hint instead of alert
1304
+ updateUI("驗算失敗!請檢查公式: y = 3×10 + 5 = ?");
1305
  }
1306
  }
1307
 
index.html CHANGED
@@ -33,6 +33,8 @@
33
  position: relative;
34
  width: 100vw;
35
  height: 100vh;
 
 
36
  background-image: url('Assets/index/indexbg.png');
37
  background-size: cover;
38
  background-position: center;
 
33
  position: relative;
34
  width: 100vw;
35
  height: 100vh;
36
+ height: 100dvh;
37
+ /* Fallback + Mobile fix */
38
  background-image: url('Assets/index/indexbg.png');
39
  background-size: cover;
40
  background-position: center;
sequence.html CHANGED
@@ -290,7 +290,7 @@
290
  </style>
291
  </head>
292
 
293
- <body class="w-full h-screen text-white bg-slate-900">
294
 
295
  <div id="game-container" class="relative w-full h-full">
296
  <canvas id="gameCanvas"></canvas>
@@ -780,6 +780,16 @@
780
 
781
  function selectDevice(type) {
782
  if (audioCtx.state === 'suspended') audioCtx.resume();
 
 
 
 
 
 
 
 
 
 
783
  controlType = type;
784
  document.getElementById('screen-start').classList.add('hidden');
785
  if (type === 'mobile') {
 
290
  </style>
291
  </head>
292
 
293
+ <body class="w-full h-screen h-[100dvh] text-white bg-slate-900">
294
 
295
  <div id="game-container" class="relative w-full h-full">
296
  <canvas id="gameCanvas"></canvas>
 
780
 
781
  function selectDevice(type) {
782
  if (audioCtx.state === 'suspended') audioCtx.resume();
783
+
784
+ // Try to enter fullscreen on interaction
785
+ try {
786
+ if (document.documentElement.requestFullscreen) {
787
+ document.documentElement.requestFullscreen().catch(e => console.log("Fullscreen blocked:", e));
788
+ } else if (document.documentElement.webkitRequestFullscreen) { /* Safari */
789
+ document.documentElement.webkitRequestFullscreen();
790
+ }
791
+ } catch (e) { console.log("Fullscreen error:", e); }
792
+
793
  controlType = type;
794
  document.getElementById('screen-start').classList.add('hidden');
795
  if (type === 'mobile') {