Lashtw commited on
Commit
eba471d
·
verified ·
1 Parent(s): 516c22f

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +47 -50
index.html CHANGED
@@ -24,7 +24,9 @@
24
  background-position: center;
25
  position: relative;
26
  width: 100%;
 
27
  aspect-ratio: 1 / 1;
 
28
  }
29
 
30
  /* 設置 Canvas 區域 */
@@ -35,6 +37,8 @@
35
  transform: translate(-50%, -50%);
36
  width: 40%;
37
  height: 40%;
 
 
38
  border-radius: 50%;
39
  overflow: hidden;
40
  }
@@ -103,8 +107,7 @@
103
 
104
  /* 全螢幕模式下的樣式修正 (使用 is-fullscreen class 主動控制) */
105
  #game-area.is-fullscreen {
106
- /* 1. 解除最大寬度限制,這是最關鍵的修正! */
107
- max-width: none !important;
108
  width: 100% !important;
109
  height: 100% !important;
110
  margin: 0 !important;
@@ -114,18 +117,15 @@
114
  align-items: center;
115
  background-color: #FFFBEB !important;
116
  }
117
-
118
- #game-area.is-fullscreen > #main-frame {
 
 
119
  background-color: transparent !important;
120
  box-shadow: none !important;
121
  padding: 0 !important;
122
  border-radius: 0 !important;
123
- /* 讓外框去適應內部內容的大小 */
124
- width: 95vmin;
125
- height: 95vmin;
126
  }
127
-
128
- /* 修正管理介面在全螢幕下的定位 */
129
  #game-area.is-fullscreen #manageModal {
130
  position: absolute;
131
  }
@@ -137,49 +137,45 @@
137
  <canvas id="confettiCanvas" class="absolute top-0 left-0 w-full h-full pointer-events-none z-50"></canvas>
138
 
139
  <div id="game-area" class="max-w-4xl w-full mx-auto relative">
140
- <!-- 裝飾外框 -->
141
- <div id="main-frame" class="shadow-2xl rounded-3xl p-4 bg-gray-200">
142
- <!-- 核心內容容器 -->
143
- <div id="mainContainer" class="spinner-container">
144
- <button id="manageButton" class="absolute top-4 left-4 text-gray-500 hover:text-gray-800 transition z-40">
145
- <i class="fas fa-cog text-2xl"></i>
146
- </button>
147
- <button id="fullscreenButton" class="absolute top-4 right-4 text-gray-500 hover:text-gray-800 transition z-40">
148
- <i class="fas fa-expand text-2xl"></i>
149
- </button>
150
-
151
- <div class="pointer">
152
- <i class="fas fa-paw"></i>
153
- </div>
154
-
155
- <canvas id="wheelCanvas"></canvas>
156
-
157
- <div id="wheelResultOverlay" class="absolute inset-0 flex items-center justify-center opacity-0 pointer-events-none transition-all duration-300 z-30">
158
- <div class="p-6 bg-white/95 backdrop-blur-sm rounded-2xl shadow-2xl text-center max-w-[80%] transform scale-90 transition-transform duration-500 flex flex-col items-center">
159
- <p class="text-xl font-bold text-gray-700 mb-2">✨ 恭喜抽中!最終結果 ✨</p>
160
- <div id="overlayResultBox" class="inline-block p-4 rounded-xl shadow-lg border-4 font-black text-3xl transition-colors duration-300"></div>
161
- <p id="overlayResultMessage" class="text-md text-gray-500 mt-3"></p>
162
- <button id="resetButton" class="mt-4 px-6 py-3 bg-pink-500 text-white font-bold text-lg rounded-full shadow-lg hover:bg-pink-600 transition duration-300 ease-in-out">
163
- 重新開始
164
- </button>
165
- </div>
166
  </div>
 
167
 
168
- <div id="powerControls" class="absolute bottom-36 right-2 flex flex-col items-center space-y-2 z-40">
169
- <span id="feedbackText" class="text-2xl font-black opacity-0" style="text-shadow: 1px 1px 2px rgba(0,0,0,0.5);"></span>
170
-
171
- <div class="w-48 h-6 bg-gray-200 rounded-full overflow-hidden shadow-inner relative">
172
- <div id="powerBar" class="h-full" style="width: 0%;"></div>
173
- <!-- 獎勵區間漸層 -->
174
- <div class="absolute top-0 h-full"
175
- style="left: 55%; width: 30%; background-image: linear-gradient(to right, rgba(59, 130, 246, 0.3) 0%, rgba(132, 204, 22, 0.4) 50%, rgba(59, 130, 246, 0.3) 100%);"
176
- title="獎勵區間"></div>
177
- </div>
178
-
179
- <button id="powerSpinButton" class="px-6 py-3 bg-amber-600 text-white font-bold text-lg rounded-full shadow-lg hover:bg-amber-700 transition duration-300 ease-in-out select-none disabled:bg-gray-400 disabled:cursor-not-allowed">
180
- 按我旋轉
181
- </button>
182
  </div>
 
 
 
 
183
  </div>
184
  </div>
185
 
@@ -581,7 +577,8 @@
581
  confettiCtx.translate(p.x, p.y);
582
  confettiCtx.rotate(p.angle * Math.PI / 180);
583
  confettiCtx.fillStyle = p.color;
584
- confettiCtx.fillRect(-p.size / 2, -p-size / 2, p.size, p.size);
 
585
  }
586
  });
587
  if (confettiParticles.length > 0) requestAnimationFrame(animateConfetti);
 
24
  background-position: center;
25
  position: relative;
26
  width: 100%;
27
+ max-width: 650px;
28
  aspect-ratio: 1 / 1;
29
+ margin: auto;
30
  }
31
 
32
  /* 設置 Canvas 區域 */
 
37
  transform: translate(-50%, -50%);
38
  width: 40%;
39
  height: 40%;
40
+ max-width: 400px;
41
+ max-height: 400px;
42
  border-radius: 50%;
43
  overflow: hidden;
44
  }
 
107
 
108
  /* 全螢幕模式下的樣式修正 (使用 is-fullscreen class 主動控制) */
109
  #game-area.is-fullscreen {
110
+ max-width: none !important;
 
111
  width: 100% !important;
112
  height: 100% !important;
113
  margin: 0 !important;
 
117
  align-items: center;
118
  background-color: #FFFBEB !important;
119
  }
120
+ #game-area.is-fullscreen > #mainContainer {
121
+ width: 95vmin !important;
122
+ height: 95vmin !important;
123
+ max-width: none !important; /* 強制覆蓋 max-width */
124
  background-color: transparent !important;
125
  box-shadow: none !important;
126
  padding: 0 !important;
127
  border-radius: 0 !important;
 
 
 
128
  }
 
 
129
  #game-area.is-fullscreen #manageModal {
130
  position: absolute;
131
  }
 
137
  <canvas id="confettiCanvas" class="absolute top-0 left-0 w-full h-full pointer-events-none z-50"></canvas>
138
 
139
  <div id="game-area" class="max-w-4xl w-full mx-auto relative">
140
+ <div id="mainContainer" class="spinner-container shadow-2xl rounded-3xl p-4 bg-gray-200">
141
+ <button id="manageButton" class="absolute top-4 left-4 text-gray-500 hover:text-gray-800 transition z-40">
142
+ <i class="fas fa-cog text-2xl"></i>
143
+ </button>
144
+ <button id="fullscreenButton" class="absolute top-4 right-4 text-gray-500 hover:text-gray-800 transition z-40">
145
+ <i class="fas fa-expand text-2xl"></i>
146
+ </button>
147
+
148
+ <div class="pointer">
149
+ <i class="fas fa-paw"></i>
150
+ </div>
151
+
152
+ <canvas id="wheelCanvas"></canvas>
153
+
154
+ <div id="wheelResultOverlay" class="absolute inset-0 flex items-center justify-center opacity-0 pointer-events-none transition-all duration-300 z-30">
155
+ <div class="p-6 bg-white/95 backdrop-blur-sm rounded-2xl shadow-2xl text-center max-w-[80%] transform scale-90 transition-transform duration-500 flex flex-col items-center">
156
+ <p class="text-xl font-bold text-gray-700 mb-2">✨ 恭喜抽中!最終結果 ✨</p>
157
+ <div id="overlayResultBox" class="inline-block p-4 rounded-xl shadow-lg border-4 font-black text-3xl transition-colors duration-300"></div>
158
+ <p id="overlayResultMessage" class="text-md text-gray-500 mt-3"></p>
159
+ <button id="resetButton" class="mt-4 px-6 py-3 bg-pink-500 text-white font-bold text-lg rounded-full shadow-lg hover:bg-pink-600 transition duration-300 ease-in-out">
160
+ 重新開始
161
+ </button>
 
 
 
 
162
  </div>
163
+ </div>
164
 
165
+ <div id="powerControls" class="absolute bottom-36 right-2 flex flex-col items-center space-y-2 z-40">
166
+ <span id="feedbackText" class="text-2xl font-black opacity-0" style="text-shadow: 1px 1px 2px rgba(0,0,0,0.5);"></span>
167
+
168
+ <div class="w-48 h-6 bg-gray-200 rounded-full overflow-hidden shadow-inner relative">
169
+ <div id="powerBar" class="h-full" style="width: 0%;"></div>
170
+ <!-- 獎勵區間漸層 -->
171
+ <div class="absolute top-0 h-full"
172
+ style="left: 55%; width: 30%; background-image: linear-gradient(to right, rgba(59, 130, 246, 0.3) 0%, rgba(132, 204, 22, 0.4) 50%, rgba(59, 130, 246, 0.3) 100%);"
173
+ title="獎勵區間"></div>
 
 
 
 
 
174
  </div>
175
+
176
+ <button id="powerSpinButton" class="px-6 py-3 bg-amber-600 text-white font-bold text-lg rounded-full shadow-lg hover:bg-amber-700 transition duration-300 ease-in-out select-none disabled:bg-gray-400 disabled:cursor-not-allowed">
177
+ 按我旋轉
178
+ </button>
179
  </div>
180
  </div>
181
 
 
577
  confettiCtx.translate(p.x, p.y);
578
  confettiCtx.rotate(p.angle * Math.PI / 180);
579
  confettiCtx.fillStyle = p.color;
580
+ confettiCtx.fillRect(-p.size / 2, -p.size / 2, p.size, p.size);
581
+ confettiCtx.restore();
582
  }
583
  });
584
  if (confettiParticles.length > 0) requestAnimationFrame(animateConfetti);