Lashtw commited on
Commit
6871120
·
verified ·
1 Parent(s): 3775b38

Upload 6 files

Browse files
Files changed (6) hide show
  1. .gitattributes +1 -0
  2. palace.jpg +3 -0
  3. prologue.html +33 -0
  4. prologue.js +34 -0
  5. script.js +15 -3
  6. style.css +150 -17
.gitattributes CHANGED
@@ -34,3 +34,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
  Theme.jpg filter=lfs diff=lfs merge=lfs -text
 
 
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
  Theme.jpg filter=lfs diff=lfs merge=lfs -text
37
+ palace.jpg filter=lfs diff=lfs merge=lfs -text
palace.jpg ADDED

Git LFS Details

  • SHA256: 77ea5c74b30fc78fc86a6872183758a9bbc1c4f1cc81aa1967c195e0826146e8
  • Pointer size: 131 Bytes
  • Size of remote file: 667 kB
prologue.html ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="zh-TW">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>序章:勇者的召喚 - 數學魔法王國:平方之旅</title>
7
+ <link rel="stylesheet" href="style.css">
8
+ </head>
9
+ <body class="prologue-page">
10
+ <div class="game-container">
11
+ <div class="prologue-container">
12
+ <h1 class="prologue-title">序章:勇者的召喚</h1>
13
+
14
+ <div class="prologue-content">
15
+ <p>你被王國的智者召喚到王宮,得知自己是預言中的「數學勇者」。</p>
16
+
17
+ <p>智者解釋道:「平方之力分為三個層次:『直覺感知』、『轉換變化』和『展開融合』。你必須前往王國的三個神聖地點,通過試煉獲得這三種力量。」</p>
18
+
19
+ <p>智者給了你一張魔法地圖,上面標記著三個地點:「平方之泉」、「變換山谷」和「展開之塔」。</p>
20
+
21
+ <p>「記住,勇者,」智者嚴肅地說,「這不僅是一場考驗,更是一段成長之旅。每一關的力量都是下一關的基礎,你必須按順序完成試煉。」</p>
22
+ </div>
23
+
24
+ <div class="navigation-buttons">
25
+ <button id="back-to-home" class="nav-btn">返回首頁</button>
26
+ <button id="continue-journey" class="nav-btn">繼續旅程</button>
27
+ </div>
28
+ </div>
29
+ </div>
30
+
31
+ <script src="prologue.js"></script>
32
+ </body>
33
+ </html>
prologue.js ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ document.addEventListener('DOMContentLoaded', function() {
2
+ // 檢查是否有玩家資料
3
+ const currentPlayerId = localStorage.getItem('currentPlayerId');
4
+ const playerName = localStorage.getItem('playerName');
5
+ const playerProfession = localStorage.getItem('playerProfession');
6
+
7
+ // 如果沒有玩家資料,重定向到首頁
8
+ if (!currentPlayerId || !playerName || !playerProfession) {
9
+ alert('請先登入遊戲!');
10
+ window.location.href = 'index.html';
11
+ return;
12
+ }
13
+
14
+ // 獲取DOM元素
15
+ const backToHomeBtn = document.getElementById('back-to-home');
16
+ const continueJourneyBtn = document.getElementById('continue-journey');
17
+
18
+ // 返回首頁按鈕點擊事件
19
+ backToHomeBtn.addEventListener('click', function() {
20
+ window.location.href = 'index.html';
21
+ });
22
+
23
+ // 繼續旅程按鈕點擊事件
24
+ continueJourneyBtn.addEventListener('click', function() {
25
+ // 這裡將來會導向第一個試煉「平方之泉」
26
+ alert('即將前往第一個試煉:平方之泉(功能尚未實作)');
27
+
28
+ // 更新遊戲進度
29
+ const gameProgress = JSON.parse(localStorage.getItem(`gameProgress_${currentPlayerId}`));
30
+ gameProgress.currentLocation = "平方之泉";
31
+ gameProgress.lastSaved = new Date().toISOString();
32
+ localStorage.setItem(`gameProgress_${currentPlayerId}`, JSON.stringify(gameProgress));
33
+ });
34
+ });
script.js CHANGED
@@ -149,13 +149,25 @@ document.addEventListener('DOMContentLoaded', function() {
149
  // 開始冒險按鈕點擊事件(歡迎訊息後)
150
  startAdventureBtn.addEventListener('click', function() {
151
  welcomeModal.style.display = 'none';
152
- // 這裡可以添加跳轉到遊戲主頁面的代碼
153
- alert('冒險開始!(此處將跳轉到遊戲主頁面)');
154
  });
155
 
156
  // 讀取進度按鈕點擊事件
157
  loadBtn.addEventListener('click', function() {
158
- alert('讀取進度功能尚未實作');
 
 
 
 
 
 
 
 
 
 
 
 
159
  });
160
 
161
  // 遊戲結束按鈕點擊事件
 
149
  // 開始冒險按鈕點擊事件(歡迎訊息後)
150
  startAdventureBtn.addEventListener('click', function() {
151
  welcomeModal.style.display = 'none';
152
+ // 導向序章頁面
153
+ window.location.href = 'prologue.html';
154
  });
155
 
156
  // 讀取進度按鈕點擊事件
157
  loadBtn.addEventListener('click', function() {
158
+ // 檢查是否有存檔
159
+ const currentPlayerId = localStorage.getItem('currentPlayerId');
160
+ if (currentPlayerId) {
161
+ const playerName = localStorage.getItem('playerName');
162
+ const playerProfession = localStorage.getItem('playerProfession');
163
+
164
+ if (confirm(`檢測到 ${playerProfession}${playerName} 的存檔,是否繼續遊戲?`)) {
165
+ // 直接進入序章頁面
166
+ window.location.href = 'prologue.html';
167
+ }
168
+ } else {
169
+ alert('未找到存檔記錄,請先開始新遊戲。');
170
+ }
171
  });
172
 
173
  // 遊戲結束按鈕點擊事件
style.css CHANGED
@@ -6,15 +6,23 @@
6
  }
7
 
8
  body {
9
- background-image: url('Theme.jpg');
10
  background-size: cover;
11
  background-position: center;
12
  background-repeat: no-repeat;
13
- height: 100vh;
 
14
  display: flex;
15
  justify-content: center;
16
  align-items: center;
17
- overflow: hidden;
 
 
 
 
 
 
 
 
18
  }
19
 
20
  .game-container {
@@ -22,6 +30,7 @@ body {
22
  width: 100%;
23
  max-width: 800px;
24
  padding: 20px;
 
25
  }
26
 
27
  .game-title {
@@ -36,10 +45,11 @@ body {
36
 
37
  .menu-container {
38
  background-color: rgba(0, 0, 0, 0.6);
39
- border: 3px solid rgba(0, 200, 0, 0.7);
40
  border-radius: 10px;
41
  padding: 20px;
42
- width: 300px;
 
43
  margin: 0 auto;
44
  }
45
 
@@ -48,7 +58,7 @@ body {
48
  width: 100%;
49
  padding: 12px;
50
  margin: 10px 0;
51
- background-color: rgba(0, 150, 0, 0.8);
52
  color: white;
53
  border: none;
54
  border-radius: 5px;
@@ -59,9 +69,9 @@ body {
59
  }
60
 
61
  .menu-btn:hover {
62
- background-color: rgba(0, 200, 0, 0.9);
63
  transform: scale(1.05);
64
- box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
65
  }
66
 
67
  /* 彈窗樣式 */
@@ -74,18 +84,19 @@ body {
74
  width: 100%;
75
  height: 100%;
76
  background-color: rgba(0, 0, 0, 0.7);
 
77
  }
78
 
79
  .modal-content {
80
  background-color: rgba(0, 0, 0, 0.8);
81
  color: white;
82
- margin: 15% auto;
83
  padding: 20px;
84
- border: 2px solid rgba(0, 200, 0, 0.7);
85
  border-radius: 10px;
86
- width: 80%;
87
  max-width: 500px;
88
- box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
89
  animation: modalFadeIn 0.5s;
90
  }
91
 
@@ -109,7 +120,7 @@ body {
109
  .modal-content h2 {
110
  margin-bottom: 20px;
111
  text-align: center;
112
- color: rgba(0, 255, 0, 0.9);
113
  }
114
 
115
  #player-id {
@@ -122,11 +133,11 @@ body {
122
  font-size: 1rem;
123
  }
124
 
125
- #confirm-id, #start-adventure {
126
  display: block;
127
  width: 100%;
128
  padding: 10px;
129
- background-color: rgba(0, 150, 0, 0.8);
130
  color: white;
131
  border: none;
132
  border-radius: 5px;
@@ -136,8 +147,9 @@ body {
136
  margin-top: 10px;
137
  }
138
 
139
- #confirm-id:hover, #start-adventure:hover {
140
- background-color: rgba(0, 200, 0, 0.9);
 
141
  }
142
 
143
  .error-message {
@@ -169,3 +181,124 @@ body {
169
  font-size: 1.3rem;
170
  text-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
171
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  }
7
 
8
  body {
 
9
  background-size: cover;
10
  background-position: center;
11
  background-repeat: no-repeat;
12
+ background-attachment: fixed;
13
+ min-height: 100vh;
14
  display: flex;
15
  justify-content: center;
16
  align-items: center;
17
+ overflow-x: hidden;
18
+ }
19
+
20
+ body.home-page {
21
+ background-image: url('Theme.jpg');
22
+ }
23
+
24
+ body.prologue-page {
25
+ background-image: url('palace.jpg');
26
  }
27
 
28
  .game-container {
 
30
  width: 100%;
31
  max-width: 800px;
32
  padding: 20px;
33
+ margin: 20px;
34
  }
35
 
36
  .game-title {
 
45
 
46
  .menu-container {
47
  background-color: rgba(0, 0, 0, 0.6);
48
+ border: 3px solid rgba(255, 140, 0, 0.7); /* 橘色邊框 */
49
  border-radius: 10px;
50
  padding: 20px;
51
+ width: 100%;
52
+ max-width: 300px;
53
  margin: 0 auto;
54
  }
55
 
 
58
  width: 100%;
59
  padding: 12px;
60
  margin: 10px 0;
61
+ background-color: rgba(255, 140, 0, 0.8); /* 橘色按鈕 */
62
  color: white;
63
  border: none;
64
  border-radius: 5px;
 
69
  }
70
 
71
  .menu-btn:hover {
72
+ background-color: rgba(255, 165, 0, 0.9); /* 橘色按鈕懸停效果 */
73
  transform: scale(1.05);
74
+ box-shadow: 0 0 15px rgba(255, 165, 0, 0.5); /* 橘色光暈 */
75
  }
76
 
77
  /* 彈窗樣式 */
 
84
  width: 100%;
85
  height: 100%;
86
  background-color: rgba(0, 0, 0, 0.7);
87
+ overflow-y: auto;
88
  }
89
 
90
  .modal-content {
91
  background-color: rgba(0, 0, 0, 0.8);
92
  color: white;
93
+ margin: 10% auto;
94
  padding: 20px;
95
+ border: 2px solid rgba(255, 140, 0, 0.7); /* 橘色邊框 */
96
  border-radius: 10px;
97
+ width: 90%;
98
  max-width: 500px;
99
+ box-shadow: 0 0 20px rgba(255, 140, 0, 0.3); /* 橘色光暈 */
100
  animation: modalFadeIn 0.5s;
101
  }
102
 
 
120
  .modal-content h2 {
121
  margin-bottom: 20px;
122
  text-align: center;
123
+ color: rgba(255, 165, 0, 0.9); /* 橘色標題 */
124
  }
125
 
126
  #player-id {
 
133
  font-size: 1rem;
134
  }
135
 
136
+ #confirm-id, #start-adventure, .action-btn {
137
  display: block;
138
  width: 100%;
139
  padding: 10px;
140
+ background-color: rgba(255, 140, 0, 0.8); /* 橘色按鈕 */
141
  color: white;
142
  border: none;
143
  border-radius: 5px;
 
147
  margin-top: 10px;
148
  }
149
 
150
+ #confirm-id:hover, #start-adventure:hover, .action-btn:hover {
151
+ background-color: rgba(255, 165, 0, 0.9); /* 橘色按鈕懸停效果 */
152
+ box-shadow: 0 0 15px rgba(255, 165, 0, 0.5); /* 橘色光暈 */
153
  }
154
 
155
  .error-message {
 
181
  font-size: 1.3rem;
182
  text-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
183
  }
184
+
185
+ /* 序章頁面樣式 */
186
+ .prologue-container {
187
+ background-color: rgba(0, 0, 0, 0.7);
188
+ border: 3px solid rgba(255, 140, 0, 0.7); /* 橘色邊框 */
189
+ border-radius: 10px;
190
+ padding: 30px;
191
+ width: 90%;
192
+ max-width: 800px;
193
+ margin: 0 auto;
194
+ color: white;
195
+ }
196
+
197
+ .prologue-title {
198
+ color: rgba(255, 165, 0, 0.9); /* 橘色標題 */
199
+ font-size: 2rem;
200
+ margin-bottom: 30px;
201
+ text-align: center;
202
+ text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
203
+ }
204
+
205
+ .prologue-content {
206
+ line-height: 1.8;
207
+ font-size: 1.1rem;
208
+ margin-bottom: 30px;
209
+ text-align: justify;
210
+ }
211
+
212
+ .prologue-content p {
213
+ margin-bottom: 15px;
214
+ }
215
+
216
+ .map-image {
217
+ width: 100%;
218
+ max-width: 500px;
219
+ margin: 20px auto;
220
+ border-radius: 10px;
221
+ box-shadow: 0 0 20px rgba(255, 140, 0, 0.3); /* 橘色光暈 */
222
+ }
223
+
224
+ .navigation-buttons {
225
+ display: flex;
226
+ justify-content: space-between;
227
+ margin-top: 30px;
228
+ }
229
+
230
+ .nav-btn {
231
+ padding: 10px 20px;
232
+ background-color: rgba(255, 140, 0, 0.8); /* 橘色按鈕 */
233
+ color: white;
234
+ border: none;
235
+ border-radius: 5px;
236
+ font-size: 1rem;
237
+ cursor: pointer;
238
+ transition: all 0.3s;
239
+ }
240
+
241
+ .nav-btn:hover {
242
+ background-color: rgba(255, 165, 0, 0.9); /* 橘色按鈕懸停效果 */
243
+ box-shadow: 0 0 15px rgba(255, 165, 0, 0.5); /* 橘色光暈 */
244
+ }
245
+
246
+ /* 響應式設計 */
247
+ @media (max-width: 768px) {
248
+ .game-title {
249
+ font-size: 2rem;
250
+ margin-bottom: 30px;
251
+ }
252
+
253
+ .modal-content {
254
+ margin: 20% auto;
255
+ width: 95%;
256
+ padding: 15px;
257
+ }
258
+
259
+ .prologue-container {
260
+ padding: 20px;
261
+ }
262
+
263
+ .prologue-title {
264
+ font-size: 1.8rem;
265
+ }
266
+
267
+ .prologue-content {
268
+ font-size: 1rem;
269
+ }
270
+ }
271
+
272
+ @media (max-width: 480px) {
273
+ .game-title {
274
+ font-size: 1.8rem;
275
+ margin-bottom: 20px;
276
+ }
277
+
278
+ .menu-container {
279
+ padding: 15px;
280
+ }
281
+
282
+ .menu-btn {
283
+ padding: 10px;
284
+ font-size: 1rem;
285
+ }
286
+
287
+ .modal-content {
288
+ margin: 30% auto;
289
+ padding: 15px;
290
+ }
291
+
292
+ .prologue-title {
293
+ font-size: 1.5rem;
294
+ }
295
+
296
+ .navigation-buttons {
297
+ flex-direction: column;
298
+ gap: 10px;
299
+ }
300
+
301
+ .nav-btn {
302
+ width: 100%;
303
+ }
304
+ }