index.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0">
  6. <title>巨龙之戒-经典冒险主公闯关开局</title>
  7. <script src="./js/jquery.min.js"></script>
  8. <style>
  9. * {
  10. margin: 0;
  11. padding: 0;
  12. border: 0;
  13. box-sizing: border-box;
  14. }
  15. body {
  16. padding-top: 60px;
  17. background-color: #000;
  18. font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  19. }
  20. img {
  21. display: block;
  22. width: 100%;
  23. }
  24. a {
  25. text-decoration: none;
  26. }
  27. #content-wrapper {
  28. background-color: #fff;
  29. max-width: 750px;
  30. margin: 0 auto;
  31. overflow: hidden;
  32. }
  33. #top-banner {
  34. position: fixed;
  35. top: 0;
  36. width: 100%;
  37. height: 60px;
  38. background: rgba(0, 0, 0, 0.8);
  39. display: flex;
  40. align-items: center;
  41. justify-content: space-between;
  42. padding: 0 20px;
  43. max-width: 750px;
  44. z-index: 100;
  45. }
  46. .btn {
  47. display: inline-block;
  48. color: #fff;
  49. font-size: 20px;
  50. background-color: #f64e4e;
  51. border-radius: 15px;
  52. padding: 5px 20px;
  53. cursor: pointer;
  54. }
  55. /* Modal Styles */
  56. .modal-overlay {
  57. display: none;
  58. position: fixed;
  59. top: 0;
  60. left: 0;
  61. width: 100%;
  62. height: 100%;
  63. background: rgba(0, 0, 0, 0.6);
  64. backdrop-filter: blur(5px);
  65. z-index: 1000;
  66. align-items: center;
  67. justify-content: center;
  68. }
  69. .modal-content {
  70. width: 90%;
  71. max-width: 320px;
  72. background: #f5f7f8;
  73. border-radius: 20px;
  74. overflow: hidden;
  75. box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  76. animation: modalFadeIn 0.3s ease-out;
  77. }
  78. @keyframes modalFadeIn {
  79. from { opacity: 0; transform: scale(0.9); }
  80. to { opacity: 1; transform: scale(1); }
  81. }
  82. .modal-header {
  83. padding: 20px;
  84. text-align: center;
  85. border-bottom: 1px solid #eee;
  86. }
  87. .modal-header h2 {
  88. font-size: 20px;
  89. color: #333;
  90. }
  91. .modal-body {
  92. padding: 20px;
  93. }
  94. .form-group {
  95. margin-bottom: 15px;
  96. }
  97. .form-input {
  98. width: 100%;
  99. height: 45px;
  100. padding: 0 15px;
  101. border: 1px solid #ddd;
  102. border-radius: 10px;
  103. font-size: 14px;
  104. outline: none;
  105. }
  106. .form-input:focus {
  107. border-color: #f64e4e;
  108. }
  109. .captcha-group {
  110. display: flex;
  111. gap: 10px;
  112. }
  113. .btn-captcha {
  114. height: 45px;
  115. padding: 0 10px;
  116. background: #eee;
  117. border-radius: 10px;
  118. font-size: 13px;
  119. color: #666;
  120. cursor: pointer;
  121. white-space: nowrap;
  122. }
  123. .btn-login {
  124. width: 100%;
  125. height: 45px;
  126. background: #f64e4e;
  127. color: #fff;
  128. border-radius: 10px;
  129. font-size: 16px;
  130. font-weight: bold;
  131. cursor: pointer;
  132. margin-top: 10px;
  133. }
  134. .privacy-text {
  135. font-size: 10px;
  136. color: #999;
  137. text-align: center;
  138. margin-top: 15px;
  139. line-height: 1.4;
  140. }
  141. .close-btn {
  142. position: absolute;
  143. top: 10px;
  144. right: 15px;
  145. font-size: 24px;
  146. color: #999;
  147. cursor: pointer;
  148. }
  149. </style>
  150. </head>
  151. <body>
  152. <div id="content-wrapper">
  153. <div id="top-banner">
  154. <div style="display: flex;align-items: center;justify-content: center;">
  155. <img src="./assets/icon.png" style="width: 50px;">
  156. <span style="color: #fff;font-size: 25px;">巨龙之戒</span>
  157. </div>
  158. <a class="btn btn-download" style="justify-self: end;">开始游戏</a>
  159. </div>
  160. <a class="btn-download"><img src="./assets/1.gif"></a>
  161. <a class="btn-download"><img src="./assets/2.gif"></a>
  162. <a class="btn-download"><img src="./assets/3.gif"></a>
  163. </div>
  164. <!-- Login Modal -->
  165. <div id="loginModal" class="modal-overlay">
  166. <div class="modal-content" style="position: relative;">
  167. <span class="close-btn" onclick="closeModal()">&times;</span>
  168. <div class="modal-header">
  169. <h2>游戏登录</h2>
  170. </div>
  171. <div class="modal-body">
  172. <div class="form-group">
  173. <input type="tel" id="phone" class="form-input" placeholder="请输入手机号">
  174. </div>
  175. <div class="form-group captcha-group">
  176. <input type="text" id="captcha" class="form-input" placeholder="请输入验证码">
  177. <button type="button" class="btn-captcha" id="getCaptcha">获取验证码</button>
  178. </div>
  179. <button type="button" class="btn-login" id="loginBtn">登录并进入游戏</button>
  180. <p class="privacy-text">
  181. 登录即代表您已同意 <span style="color:#f64e4e">服务协议</span> 和 <span style="color:#f64e4e">隐私政策</span>
  182. </p>
  183. </div>
  184. </div>
  185. </div>
  186. <script src="./js/md5.min.js"></script>
  187. <script>
  188. function getUrlParam(name, defaultValue = '') {
  189. const urlParams = new URLSearchParams(window.location.search);
  190. return urlParams.get(name) || defaultValue;
  191. }
  192. const API_URL = 'https://app.hainanruiyu.cn/landingpage/index.php';
  193. const APP_ID = parseInt(getUrlParam('appid', ''));
  194. const APP_KEY = 'b995721db94fa9b206fab7ef687a13d3';
  195. const MEDIA_ID = getUrlParam('media_id', '');
  196. const modal = document.getElementById('loginModal');
  197. const loginBtn = document.getElementById('loginBtn');
  198. const getCaptchaBtn = document.getElementById('getCaptcha');
  199. let sessionId = '';
  200. function getOS() {
  201. const ua = navigator.userAgent;
  202. if (/iPad|iPhone|iPod/.test(ua)) return 'ios';
  203. if (/Android/.test(ua)) return 'android';
  204. return 'pc';
  205. }
  206. function makeSign(time) {
  207. return md5(APP_KEY + time);
  208. }
  209. function openModal() {
  210. modal.style.display = 'flex';
  211. }
  212. function closeModal() {
  213. modal.style.display = 'none';
  214. }
  215. // Intercept download clicks
  216. document.querySelectorAll('.btn-download').forEach(link => {
  217. link.addEventListener('click', function(e) {
  218. e.preventDefault();
  219. openModal();
  220. });
  221. });
  222. function sendVerificationCode() {
  223. const phone = document.getElementById('phone').value;
  224. const os = getOS() === 'ios' ? 'ios' : 'android';
  225. if (!/^1[3-9]\d{9}$/.test(phone)) {
  226. alert('请输入正确的手机号');
  227. return;
  228. }
  229. getCaptchaBtn.disabled = true;
  230. let count = 60;
  231. const originalText = getCaptchaBtn.innerText;
  232. getCaptchaBtn.innerText = count + 's';
  233. const timer = setInterval(() => {
  234. count--;
  235. if (count <= 0) {
  236. clearInterval(timer);
  237. getCaptchaBtn.disabled = false;
  238. getCaptchaBtn.innerText = '获取验证码';
  239. } else {
  240. getCaptchaBtn.innerText = count + 's';
  241. }
  242. }, 1000);
  243. const time = Math.floor(Date.now() / 1000);
  244. $.ajax({
  245. url: API_URL,
  246. type: 'POST',
  247. contentType: 'application/json',
  248. data: JSON.stringify({
  249. do: 'send_code',
  250. appid: APP_ID,
  251. time: time,
  252. sign: makeSign(time),
  253. phone: phone,
  254. media_id: MEDIA_ID,
  255. os: os
  256. }),
  257. success: function(res) {
  258. let result = typeof res === 'string' ? JSON.parse(res) : res;
  259. console.log(result)
  260. if (result && result.ret == 1) {
  261. sessionId = result.sessionid;
  262. alert('验证码已发送');
  263. } else {
  264. alert(result.msg || '发送失败,请稍后重试');
  265. clearInterval(timer);
  266. getCaptchaBtn.disabled = false;
  267. getCaptchaBtn.innerText = '获取验证码';
  268. }
  269. },
  270. error: function() {
  271. alert('发送失败,网络错误');
  272. clearInterval(timer);
  273. getCaptchaBtn.disabled = false;
  274. getCaptchaBtn.innerText = '获取验证码';
  275. }
  276. });
  277. }
  278. getCaptchaBtn.addEventListener('click', function() {
  279. sendVerificationCode();
  280. });
  281. function executeLogin() {
  282. const phone = document.getElementById('phone').value;
  283. const code = document.getElementById('captcha').value;
  284. const os = getOS() === 'ios' ? 'ios' : 'android';
  285. if (!phone || !code) {
  286. alert('请填写手机号和验证码');
  287. return;
  288. }
  289. loginBtn.innerText = '登录中...';
  290. loginBtn.disabled = true;
  291. const time = Math.floor(Date.now() / 1000);
  292. const url = sessionId ? `${API_URL}?phpsessid=${sessionId}` : API_URL;
  293. $.ajax({
  294. url: url,
  295. type: 'POST',
  296. contentType: 'application/json',
  297. data: JSON.stringify({
  298. do: 'register',
  299. appid: APP_ID,
  300. time: time,
  301. sign: makeSign(time),
  302. phone: phone,
  303. code: code,
  304. media_id: MEDIA_ID,
  305. os: os
  306. }),
  307. success: function(res) {
  308. let result = typeof res === 'string' ? JSON.parse(res) : res;
  309. console.log(result)
  310. if (result && result.ret == 1) {
  311. closeModal();
  312. window.location.href = 'download.html';
  313. } else {
  314. alert(result.msg || '登录失败,请重试');
  315. loginBtn.innerText = '登录并进入游戏';
  316. loginBtn.disabled = false;
  317. }
  318. },
  319. error: function() {
  320. alert('登录失败,网络错误');
  321. loginBtn.innerText = '登录并进入游戏';
  322. loginBtn.disabled = false;
  323. }
  324. });
  325. }
  326. loginBtn.addEventListener('click', function() {
  327. if (!this.disabled) {
  328. executeLogin();
  329. }
  330. });
  331. window.addEventListener('click', (e) => {
  332. if (e.target === modal) {
  333. closeModal();
  334. }
  335. });
  336. </script>
  337. </body>
  338. </html>