external.html 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  6. <title>游戏下载页面</title>
  7. <!-- 引入jQuery -->
  8. <script type="text/javascript" src="__STATIC__/js/jquery_v3.3.1.js"></script>
  9. <style>
  10. html, body {
  11. margin: 0;
  12. padding: 0;
  13. height: 100%;
  14. overflow-x: hidden;
  15. overflow-y: auto;
  16. font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  17. background: linear-gradient(45deg, #f0f2f5, #e8ecef);
  18. }
  19. /* 背景图片容器 */
  20. .bg-image-container {
  21. position: fixed;
  22. top: 0;
  23. left: 0;
  24. width: 100vw;
  25. height: 100vh;
  26. z-index: 1;
  27. overflow: hidden;
  28. }
  29. .bg-image {
  30. width: 100%;
  31. height: 100%;
  32. object-fit: cover;
  33. object-position: center;
  34. opacity: 1;
  35. }
  36. .bg-text-container {
  37. position: fixed;
  38. top: -100%;
  39. left: -100%;
  40. width: 300vw;
  41. height: 300vh;
  42. transform: rotate(-30deg);
  43. pointer-events: none;
  44. z-index: 2;
  45. display: flex;
  46. flex-wrap: wrap;
  47. font-family: sans-serif;
  48. opacity: 1;
  49. }
  50. .bg-text {
  51. width: 200px;
  52. height: 80px;
  53. display: flex;
  54. align-items: center;
  55. justify-content: center;
  56. font-size: 24px;
  57. white-space: nowrap;
  58. color: #000;
  59. transition: transform 0.3s ease;
  60. }
  61. /* 主内容容器 */
  62. .main-content {
  63. position: relative;
  64. z-index: 10;
  65. display: flex;
  66. flex-direction: column;
  67. align-items: center;
  68. justify-content: center;
  69. min-height: 100vh;
  70. width: 100vw;
  71. text-align: center;
  72. padding: 20px;
  73. box-sizing: border-box;
  74. background: rgba(255, 255, 255, 0.1);
  75. /*backdrop-filter: blur(10px);*/
  76. }
  77. /* 游戏Logo样式 */
  78. .game-logo {
  79. width: 120px;
  80. height: 120px;
  81. border-radius: 50%;
  82. object-fit: cover;
  83. /*margin-bottom: 20px;*/
  84. box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  85. border: 4px solid rgba(255, 255, 255, 0.8);
  86. transition: all 0.3s ease;
  87. }
  88. .game-logo:hover {
  89. transform: scale(1.05);
  90. box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
  91. }
  92. /* 标题区域 */
  93. .title-section {
  94. margin-bottom: 40px;
  95. margin-top: 40px;
  96. }
  97. .game-title {
  98. font-size: 2.5rem;
  99. font-weight: bold;
  100. color: #333;
  101. margin-bottom: 20px;
  102. text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
  103. }
  104. .game-subtitle {
  105. font-size: 1.2rem;
  106. color: #666;
  107. margin-bottom: 30px;
  108. max-width: 60%;
  109. margin-left: auto;
  110. margin-right: auto;
  111. line-height: 1.6;
  112. text-align: left;
  113. background: rgb(190 181 181 / 80%);
  114. padding: 20px;
  115. border-radius: 15px;
  116. backdrop-filter: blur(10px);
  117. box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  118. }
  119. /* UEditor内容样式 */
  120. .game-subtitle img {
  121. max-width: 100%;
  122. height: auto;
  123. border-radius: 8px;
  124. margin: 10px 0;
  125. }
  126. .game-subtitle p {
  127. margin: 10px 0;
  128. text-align: left;
  129. }
  130. .game-subtitle ul, .game-subtitle ol {
  131. text-align: left;
  132. margin: 10px 0;
  133. padding-left: 20px;
  134. }
  135. .game-subtitle h1, .game-subtitle h2, .game-subtitle h3, .game-subtitle h4, .game-subtitle h5, .game-subtitle h6 {
  136. margin: 15px 0 10px 0;
  137. color: #333;
  138. }
  139. .game-subtitle table {
  140. width: 100%;
  141. border-collapse: collapse;
  142. margin: 15px 0;
  143. }
  144. .game-subtitle table th, .game-subtitle table td {
  145. border: 1px solid #ddd;
  146. padding: 8px;
  147. text-align: left;
  148. }
  149. .game-subtitle table th {
  150. background-color: #f2f2f2;
  151. }
  152. /* 下载按钮样式 */
  153. .download-btn {
  154. padding: 20px 40px;
  155. font-size: 20px;
  156. font-weight: bold;
  157. color: #fff;
  158. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  159. border: none;
  160. border-radius: 50px;
  161. cursor: pointer;
  162. box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
  163. transition: all 0.3s ease;
  164. outline: none;
  165. min-width: 250px;
  166. text-align: center;
  167. position: relative;
  168. overflow: hidden;
  169. }
  170. .download-btn:before {
  171. content: '';
  172. position: absolute;
  173. top: 0;
  174. left: -100%;
  175. width: 100%;
  176. height: 100%;
  177. background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  178. transition: left 0.5s;
  179. }
  180. .download-btn:hover:before {
  181. left: 100%;
  182. }
  183. .download-btn:hover {
  184. transform: translateY(-3px);
  185. box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
  186. background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  187. }
  188. .download-btn:active {
  189. transform: translateY(-1px);
  190. box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
  191. }
  192. /* 功能介绍区域 */
  193. .features {
  194. margin-top: 40px;
  195. margin-bottom: 40px;
  196. display: flex;
  197. justify-content: center;
  198. gap: 30px;
  199. flex-wrap: wrap;
  200. }
  201. .feature-item {
  202. background: rgba(255, 255, 255, 0.8);
  203. padding: 20px;
  204. border-radius: 15px;
  205. backdrop-filter: blur(10px);
  206. box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  207. min-width: 120px;
  208. text-align: center;
  209. cursor: pointer;
  210. transition: all 0.3s ease;
  211. position: relative;
  212. overflow: hidden;
  213. }
  214. .feature-item:before {
  215. content: '';
  216. position: absolute;
  217. top: 0;
  218. left: -100%;
  219. width: 100%;
  220. height: 100%;
  221. background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
  222. transition: left 0.5s;
  223. }
  224. .feature-item:hover:before {
  225. left: 100%;
  226. }
  227. .feature-item:hover {
  228. transform: translateY(-3px);
  229. box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  230. background: rgba(102, 126, 234, 0.1);
  231. }
  232. .feature-item:active {
  233. transform: translateY(-1px);
  234. box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  235. }
  236. /* 按钮点击特效 - 已移除所有loading相关样式 */
  237. .feature-item.clicked {
  238. pointer-events: none;
  239. opacity: 0.9;
  240. background: rgba(102, 126, 234, 0.2);
  241. }
  242. /* 所有loading相关的动画和样式已全部移除 */
  243. /* 加载动画 */
  244. .loading {
  245. display: inline-block;
  246. width: 20px;
  247. height: 20px;
  248. border: 3px solid rgba(255,255,255,.3);
  249. border-radius: 50%;
  250. border-top-color: #fff;
  251. animation: spin 1s ease-in-out infinite;
  252. margin-right: 10px;
  253. }
  254. @keyframes spin {
  255. to { transform: rotate(360deg); }
  256. }
  257. /* 弹框样式 */
  258. .modal {
  259. display: none;
  260. position: fixed;
  261. z-index: 1000;
  262. left: 0;
  263. top: 0;
  264. width: 100%;
  265. height: 100%;
  266. background-color: rgba(0, 0, 0, 0.6);
  267. backdrop-filter: blur(5px);
  268. }
  269. .modal-content {
  270. background-color: #fefefe;
  271. margin: 15% auto;
  272. padding: 25px;
  273. border: none;
  274. border-radius: 15px;
  275. width: 80%;
  276. max-width: 400px;
  277. text-align: center;
  278. box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  279. animation: modalSlideIn 0.3s ease-out;
  280. }
  281. @keyframes modalSlideIn {
  282. from {
  283. transform: translateY(-50px);
  284. opacity: 0;
  285. }
  286. to {
  287. transform: translateY(0);
  288. opacity: 1;
  289. }
  290. }
  291. .modal-content h3 {
  292. margin-top: 0;
  293. color: #333;
  294. font-size: 1.3rem;
  295. }
  296. .modal-content p {
  297. color: #666;
  298. margin: 15px 0;
  299. line-height: 1.5;
  300. }
  301. .close-btn {
  302. background-color: #f44336;
  303. color: white;
  304. padding: 12px 25px;
  305. border: none;
  306. border-radius: 8px;
  307. cursor: pointer;
  308. font-size: 14px;
  309. transition: background-color 0.3s ease;
  310. }
  311. .close-btn:hover {
  312. background-color: #da190b;
  313. }
  314. /* 手机端弹框适配 */
  315. @media (max-width: 767px) {
  316. .modal-content {
  317. margin: 25% auto;
  318. width: 90%;
  319. padding: 20px;
  320. }
  321. }
  322. /* 平板适配 */
  323. @media (min-width: 768px) and (max-width: 1024px) {
  324. .game-title {
  325. font-size: 2.2rem;
  326. }
  327. .game-subtitle {
  328. font-size: 1.1rem;
  329. max-width: 95%;
  330. padding: 18px;
  331. }
  332. .download-btn {
  333. padding: 18px 35px;
  334. font-size: 18px;
  335. min-width: 220px;
  336. }
  337. .features {
  338. gap: 25px;
  339. }
  340. }
  341. /* 手机端适配 */
  342. @media (max-width: 767px) {
  343. .main-content {
  344. padding: 15px;
  345. }
  346. .game-title {
  347. font-size: 1.8rem;
  348. margin-bottom: 15px;
  349. }
  350. .game-subtitle {
  351. font-size: 0.95rem;
  352. margin-bottom: 25px;
  353. max-width: 100%;
  354. padding: 15px;
  355. }
  356. .title-section {
  357. margin-bottom: 30px;
  358. margin-top: 20px;
  359. }
  360. .download-btn {
  361. padding: 15px 30px;
  362. font-size: 16px;
  363. min-width: 200px;
  364. }
  365. .features {
  366. margin-top: 30px;
  367. gap: 15px;
  368. }
  369. .feature-item {
  370. padding: 15px;
  371. min-width: 100px;
  372. }
  373. .feature-icon {
  374. font-size: 1.5rem;
  375. }
  376. .feature-text {
  377. font-size: 0.8rem;
  378. }
  379. }
  380. </style>
  381. </head>
  382. <body>
  383. <!-- 背景图片容器 -->
  384. <div class="bg-image-container">
  385. {if condition="$info.bg_image"}
  386. <img src="{$info.bg_image}" alt="背景图片" class="bg-image">
  387. {/if}
  388. </div>
  389. <div id="bgTextContainer" class="bg-text-container"></div>
  390. <!-- 主内容区域 -->
  391. <div class="main-content">
  392. <div class="title-section">
  393. {if condition="$info.logo_url"}
  394. <img src="{$info.logo_url}" alt="游戏Logo" class="game-logo">
  395. {/if}
  396. <h1 class="game-title" id="gameTitle">{$info.name}</h1>
  397. {if condition="$info.remarks"}
  398. <div class="game-subtitle" id="gameSubtitle" style="white-space: pre-wrap;">{$info.remarks}</div>
  399. {/if}
  400. </div>
  401. <div class="features">
  402. {if condition="$info.path_url"}
  403. <div class="feature-item" id="downloadGame" value="{$info.path_url}">
  404. <div class="feature-icon">🎮</div>
  405. <div class="feature-text">游戏包 下载</div>
  406. </div>
  407. {/if}
  408. {if condition="$info.material_url"}
  409. <div class="feature-item" id="downloadMaterial" value="{$info.material_url}">
  410. <div class="feature-icon">🚀</div>
  411. <div class="feature-text">物料 下载</div>
  412. </div>
  413. {/if}
  414. </div>
  415. </div>
  416. <!-- 弹框 -->
  417. <div id="errorModal" class="modal">
  418. <div class="modal-content">
  419. <h3>提示</h3>
  420. <p id="modalMessage">下载地址缺失,请联系管理员!</p>
  421. <button class="close-btn" id="closeModalBtn">确定</button>
  422. </div>
  423. </div>
  424. <script>
  425. $(document).ready(function() {
  426. // ========== 背景文字生成 ==========
  427. function generateBackground() {
  428. const text = "{$info.name}";
  429. const container = $('#bgTextContainer');
  430. container.empty();
  431. const vw = $(window).width() * 3;
  432. const vh = $(window).height() * 3;
  433. const blockWidth = 200;
  434. const blockHeight = 80;
  435. const cols = Math.ceil(vw / blockWidth);
  436. const rows = Math.ceil(vh / blockHeight);
  437. for (let row = 0; row < rows; row++) {
  438. const offset = Math.floor(Math.random() * 60) - 30;
  439. for (let col = 0; col < cols; col++) {
  440. const div = $('<div class="bg-text"></div>');
  441. div.text(text);
  442. const angle = (Math.random() * 10 - 5).toFixed(2);
  443. div.css('transform', `translateX(${offset}px) rotate(${angle}deg)`);
  444. container.append(div);
  445. }
  446. }
  447. }
  448. // ========== 下载功能 ==========
  449. function handleDownload(downloadUrl) {
  450. const $btn = $('#downloadBtn');
  451. const $btnText = $('#btnText');
  452. $btn.prop('disabled', true);
  453. $btnText.html('<span class="loading"></span>准备下载...');
  454. setTimeout(() => {
  455. if (downloadUrl && downloadUrl.trim() !== '') {
  456. window.open(downloadUrl, '_blank');
  457. showSuccessMessage('下载已开始,请查看浏览器下载页面');
  458. } else {
  459. showErrorModal('下载地址缺失,请联系管理员!');
  460. }
  461. $btn.prop('disabled', false);
  462. $btnText.text('立即下载');
  463. }, 1000);
  464. }
  465. // ========== 功能项下载功能 ==========
  466. function handleFeatureDownload($element, downloadUrl, itemName) {
  467. const $icon = $element.find('.feature-icon');
  468. const $text = $element.find('.feature-text');
  469. const originalText = $text.text();
  470. // 简化的点击效果,移除所有loading相关代码
  471. $element.addClass('clicked');
  472. $text.text('正在准备下载...');
  473. setTimeout(() => {
  474. if (downloadUrl && downloadUrl.trim() !== '') {
  475. window.open(downloadUrl, '_blank');
  476. showSuccessMessage(itemName + '下载已开始,请查看浏览器下载页面');
  477. } else {
  478. showErrorModal(itemName + '下载地址缺失,请联系管理员!');
  479. }
  480. $element.removeClass('clicked');
  481. $text.text(originalText);
  482. }, 1000);
  483. }
  484. // ========== 弹框控制 ==========
  485. function showErrorModal(message) {
  486. $('#modalMessage').text(message);
  487. $('#errorModal').fadeIn(300);
  488. }
  489. function closeModal() {
  490. $('#errorModal').fadeOut(300);
  491. }
  492. function showSuccessMessage(message) {
  493. const $successDiv = $('<div style="position:fixed;top:20px;left:50%;transform:translateX(-50%);background:#4CAF50;color:white;padding:10px 20px;border-radius:5px;z-index:9999;">' + message + '</div>');
  494. $('body').append($successDiv);
  495. setTimeout(() => {
  496. $successDiv.fadeOut(300, function() {
  497. $(this).remove();
  498. });
  499. }, 3000);
  500. }
  501. // ========== 设备适配检测 ==========
  502. function isMobile() {
  503. return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || $(window).width() <= 768;
  504. }
  505. // ========== 公共API函数 ==========
  506. window.GameDownloadPage = {
  507. triggerDownload: function() {
  508. handleDownload();
  509. }
  510. };
  511. // ========== 事件绑定 ==========
  512. $('#downloadBtn').on('click', handleDownload);
  513. $('#closeModalBtn').on('click', closeModal);
  514. $('#downloadGame').on('click', function() {
  515. const downloadUrl = $(this).attr('value');
  516. handleFeatureDownload($(this), downloadUrl, '游戏包');
  517. });
  518. $('#downloadMaterial').on('click', function() {
  519. const downloadUrl = $(this).attr('value');
  520. handleFeatureDownload($(this), downloadUrl, '物料');
  521. });
  522. $('#errorModal').on('click', function(e) {
  523. if (e.target === this) {
  524. closeModal();
  525. }
  526. });
  527. $(document).on('keyup', function(e) {
  528. if (e.keyCode === 27) {
  529. closeModal();
  530. }
  531. });
  532. $(window).on('resize', function() {
  533. // generateBackground();
  534. });
  535. // ========== 页面初始化 ==========
  536. // generateBackground();
  537. console.log('游戏下载页面已加载完成');
  538. console.log('可用API:', Object.keys(window.GameDownloadPage));
  539. });
  540. </script>
  541. </body>
  542. </html>