|
195 | 195 | text-align: center; |
196 | 196 | } |
197 | 197 |
|
| 198 | + /* 公告弹窗样式 */ |
| 199 | + #announcement-modal { |
| 200 | + display: none; |
| 201 | + position: fixed; |
| 202 | + z-index: 9999; |
| 203 | + left: 0; |
| 204 | + top: 0; |
| 205 | + width: 100vw; |
| 206 | + height: 100vh; |
| 207 | + background: rgba(18, 18, 18, 0.75); |
| 208 | + justify-content: center; |
| 209 | + align-items: center; |
| 210 | + } |
| 211 | + |
| 212 | + #announcement-modal > div { |
| 213 | + background: #232a34; |
| 214 | + color: #e3f2fd; |
| 215 | + border-radius: 16px; |
| 216 | + max-width: 90vw; |
| 217 | + min-width: 320px; |
| 218 | + box-shadow: 0 4px 24px rgba(25, 118, 210, 0.18); |
| 219 | + padding: 32px 24px 16px 24px; |
| 220 | + position: relative; |
| 221 | + display: flex; |
| 222 | + flex-direction: column; |
| 223 | + align-items: center; |
| 224 | + } |
| 225 | + |
| 226 | + #announcement-modal h2 { |
| 227 | + font-size: 22px; |
| 228 | + font-weight: 500; |
| 229 | + margin-bottom: 12px; |
| 230 | + color: #90caf9; |
| 231 | + } |
| 232 | + |
| 233 | + #announcement-modal p { |
| 234 | + font-size: 16px; |
| 235 | + margin-bottom: 24px; |
| 236 | + text-align: center; |
| 237 | + } |
| 238 | + |
| 239 | + #announcement-close { |
| 240 | + background: #1976d2; |
| 241 | + color: #fff; |
| 242 | + border: none; |
| 243 | + border-radius: 8px; |
| 244 | + padding: 8px 24px; |
| 245 | + font-size: 15px; |
| 246 | + cursor: pointer; |
| 247 | + transition: background 0.2s; |
| 248 | + } |
| 249 | + |
| 250 | + #announcement-close:hover { |
| 251 | + background: #155a8a; |
| 252 | + |
198 | 253 | @keyframes floatY { |
199 | 254 | 0% { |
200 | 255 | transform: translateY(0); |
|
260 | 315 |
|
261 | 316 | <div class="copyright">© 2024-2025 ExamAware开发团队 版权所有</div> |
262 | 317 |
|
| 318 | + <!-- 公告弹窗 --> |
| 319 | + <div id="announcement-modal" style="display:none; position:fixed; z-index:9999; left:0; top:0; width:100vw; height:100vh; background:rgba(18,18,18,0.75); justify-content:center; align-items:center;"> |
| 320 | + <div style="background:#232a34; color:#e3f2fd; border-radius:16px; max-width:90vw; min-width:320px; box-shadow:0 4px 24px rgba(25,118,210,0.18); padding:32px 24px 16px 24px; position:relative; display:flex; flex-direction:column; align-items:center;"> |
| 321 | + <span style="font-size:22px; font-weight:500; margin-bottom:12px; color:#90caf9;">公告</span> |
| 322 | + <div id="announcement-content" style="font-size:16px; margin-bottom:24px; text-align:center;"></div> |
| 323 | + <button id="announcement-close" style="background:#1976d2; color:#fff; border:none; border-radius:8px; padding:8px 24px; font-size:15px; cursor:pointer; transition:background 0.2s;">关闭</button> |
| 324 | + </div> |
263 | 325 | <div class="poweredby-chuqiyun" style="width:100%;display:flex;justify-content:center;align-items:center;position:absolute;bottom:48px;left:0;z-index:10;"> |
264 | 326 | <a href="https://chuqiyun.com"> |
265 | 327 | <img src="https://chuqiyun.com/static/images/poweredby.svg" alt="Powered by 楚奇云"> |
266 | 328 | </a> |
| 329 | + |
267 | 330 | </div> |
268 | 331 |
|
269 | 332 | <script> |
|
275 | 338 | } |
276 | 339 | } |
277 | 340 | } |
278 | | - window.onload = checkAprilFools; |
| 341 | + window.onload = function() { |
| 342 | + checkAprilFools(); |
| 343 | + // 公告弹窗逻辑 |
| 344 | + fetch('./announcement.json') |
| 345 | + .then(res => { |
| 346 | + if (!res.ok) throw new Error('No announcement'); |
| 347 | + return res.json(); |
| 348 | + }) |
| 349 | + .then(data => { |
| 350 | + if (data && data.show && data.content) { |
| 351 | + document.getElementById('announcement-content').innerHTML = data.content; |
| 352 | + document.getElementById('announcement-modal').style.display = 'flex'; |
| 353 | + } |
| 354 | + }) |
| 355 | + .catch(() => {}); |
| 356 | + document.getElementById('announcement-close').onclick = function() { |
| 357 | + document.getElementById('announcement-modal').style.display = 'none'; |
| 358 | + }; |
| 359 | + }; |
279 | 360 | </script> |
280 | 361 | </body> |
281 | 362 |
|
|
0 commit comments