load.m.js 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024
  1. (function () {
  2. const res_path = "resources";
  3. // 默认主题配置(绿色主题)
  4. const defaultTheme = {
  5. // 主色调
  6. primaryColor: "#24EE89",
  7. secondaryColor: "#2CD97D",
  8. thirdColor: "#00AF78",
  9. fourthColor: "#046E55",
  10. fiveColor: "#10b981",
  11. highlightColor: "#23FD93", // 高亮绿色
  12. accentColor: "#08c974", // 强调色
  13. // 渐变背景
  14. backgroundColor: "linear-gradient(to right, #0BAA47, #057B52)",
  15. backgroundColor1: "linear-gradient(to right, #10B981, #059669)",
  16. backgroundColor2: "linear-gradient(180deg, rgba(12, 89, 70, 0.8), rgba(12, 89, 70, 0) 100%)",
  17. activityBgColor: "linear-gradient(180deg, rgb(14, 110, 67),rgb(5, 73, 45) 99.237%)",
  18. // 按钮颜色
  19. buttonColor: "#24EE89",
  20. buttonText: "#13171F",
  21. buttonGradient: "linear-gradient(90deg, #1FEB85 0%, #7FFE5A 100%)",
  22. buttonGray: "#464F50",
  23. warningButtonColor: "linear-gradient(to bottom, #f7c61d, #ef9a05)",
  24. disabledButtonColor: "linear-gradient(to bottom, #b3b3b3, #939393)",
  25. errorButtonColor: "linear-gradient(to bottom, #ff5a6d, #ce1126)",
  26. orangeButtonColor: "linear-gradient(179deg, #FEC412 20.1%, #FE871C 46.83%, #FFFB23 78.17%)",
  27. // 文字颜色
  28. textColor: "#E8ECF0",
  29. textGrayColor: "#849194",
  30. textGrayColor1: "#B3BEC1",
  31. textLightColor: "#f9f5ef", // 米白文字
  32. // 背景颜色
  33. mainBgColor: "#232626",
  34. darkColor: "#323738",
  35. darkColor1: "#3A4142",
  36. darkColor2: "#464F50",
  37. darkColor3: "#464F50",
  38. bodyBgColor: "#232626", // 最深背景
  39. pageTitleBg: "#292D2E",
  40. // 面板/卡片颜色
  41. popupBgColor: "#323738",
  42. popupGradientColor: "linear-gradient(150deg, rgba(36, 238, 137, 0.20) 0.05%, rgba(0, 0, 0, 0.00) 32.53%), #232626",
  43. inputBgColor: "#292D2E", // 输入框背景
  44. // 边框颜色
  45. selectBorderColor: "#24EE89",
  46. // 状态颜色
  47. positiveColor: "#7ED321",
  48. negativeColor: "#FF1B44",
  49. successColor: "#36EE85", // 成功色
  50. // 金币/警告颜色
  51. warningColor: "#F5D111",
  52. moneyColor: "#24EE89",
  53. goldColor: "#FFAD4D", // 金色
  54. coinColor: "#edc349", // 金币黄
  55. // 其他
  56. linkColor: "#c2ec9d", // 链接色
  57. scrollbarColor: "#c4c4c4", // 滚动条色
  58. moneyGradient: "linear-gradient(180deg, #30FDB8 17.92%, #00A369 91.51%)", //首冲礼包
  59. // 弹窗专用(新增)
  60. titleGradient: "linear-gradient(180deg, #FEC412 0%, #FFFB23 100%)", // WELCOME 标题渐变
  61. bonusGradient: "linear-gradient(179deg, #FEC412 20.1%, #FE871C 46.83%, #FFFB23 78.17%)", // Free $10 渐变
  62. popupBgFilter: "none", // 弹窗背景图滤镜
  63. tabIconFilter: "none", // Tab图标滤镜(默认绿色主题保持红色图标)
  64. gameMenuBg: "#232626", // 游戏菜单背景
  65. iconAccentColor: "#FF2400", // 图标强调色(双色图标的第二色)
  66. };
  67. // 蓝色主题
  68. const blueTheme = {
  69. ...defaultTheme,
  70. thirdColor: "#0078D4",
  71. fourthColor: "#004578",
  72. primaryColor: "#00A9FF",
  73. secondaryColor: "#0078D4",
  74. fiveColor: "#3B82F6",
  75. highlightColor: "#60A5FA",
  76. accentColor: "#3B82F6",
  77. negativeColor: "#2563EB", // 蓝色按钮
  78. moneyColor: "#60A5FA", // 蓝色金币文字
  79. linkColor: "#93C5FD", // 蓝色链接
  80. titleGradient: "linear-gradient(180deg, #60A5FA 0%, #2563EB 100%)",
  81. bonusGradient: "linear-gradient(179deg, #60A5FA 20.1%, #3B82F6 46.83%, #93C5FD 78.17%)",
  82. tabIconFilter: "hue-rotate(200deg) saturate(1.2)", // 红色转蓝色
  83. backgroundColor: "linear-gradient(to right, #1E40AF, #1E3A8A)",
  84. backgroundColor1: "linear-gradient(to right, #3B82F6, #2563EB)",
  85. buttonColor: "linear-gradient(to bottom, #60A5FA, #2563EB)",
  86. buttonGradient: "linear-gradient(90deg, #60A5FA 0%, #2563EB 100%)",
  87. activityBgColor: "linear-gradient(180deg, rgb(30, 64, 175),rgb(30, 58, 138) 99.237%)",
  88. backgroundColor2: "linear-gradient(180deg, rgba(30, 64, 175, 0.8), rgba(30, 64, 175, 0) 100%)",
  89. popupGradientColor: "#0a1929",
  90. selectBorderColor: "#60A5FA",
  91. gameMenuBg: "linear-gradient(180deg, rgba(30, 64, 175, 0.85) 0%, rgba(15, 32, 90, 0.92) 30%, rgba(0, 0, 0, 0.98) 100%)",
  92. iconAccentColor: "#2563EB",
  93. };
  94. // 紫色主题
  95. const purpleTheme = {
  96. ...defaultTheme,
  97. thirdColor: "#7C3AED",
  98. fourthColor: "#5B21B6",
  99. primaryColor: "#A78BFA",
  100. secondaryColor: "#8B5CF6",
  101. fiveColor: "#8B5CF6",
  102. highlightColor: "#A78BFA",
  103. accentColor: "#8B5CF6",
  104. negativeColor: "#7C3AED", // 紫色按钮
  105. moneyColor: "#A78BFA",
  106. linkColor: "#DDD6FE", // 紫色链接
  107. titleGradient: "linear-gradient(180deg, #A78BFA 0%, #7C3AED 100%)",
  108. bonusGradient: "linear-gradient(179deg, #C4B5FD 20.1%, #8B5CF6 46.83%, #DDD6FE 78.17%)",
  109. tabIconFilter: "hue-rotate(270deg) saturate(1.2)", // 红色转紫色
  110. backgroundColor: "linear-gradient(to right, #5B21B6, #4C1D95)",
  111. backgroundColor1: "linear-gradient(to right, #8B5CF6, #7C3AED)",
  112. buttonColor: "linear-gradient(to bottom, #A78BFA, #7C3AED)",
  113. buttonGradient: "linear-gradient(90deg, #A78BFA 0%, #7C3AED 100%)",
  114. activityBgColor: "linear-gradient(180deg, rgb(91, 33, 182),rgb(76, 29, 149) 99.237%)",
  115. backgroundColor2: "linear-gradient(180deg, rgba(91, 33, 182, 0.8), rgba(91, 33, 182, 0) 100%)",
  116. popupGradientColor: "#1a0a2e",
  117. selectBorderColor: "#A78BFA",
  118. gameMenuBg: "linear-gradient(180deg, rgba(91, 33, 182, 0.85) 0%, rgba(45, 16, 91, 0.92) 30%, rgba(0, 0, 0, 0.98) 100%)",
  119. iconAccentColor: "#7C3AED",
  120. };
  121. // 金色主题
  122. const goldTheme = {
  123. ...defaultTheme,
  124. thirdColor: "#D97706",
  125. fourthColor: "#B45309",
  126. primaryColor: "#FBBF24",
  127. secondaryColor: "#F59E0B",
  128. fiveColor: "#F59E0B",
  129. highlightColor: "#FBBF24",
  130. accentColor: "#F59E0B",
  131. negativeColor: "#D97706", // 金色按钮
  132. moneyColor: "#FBBF24",
  133. linkColor: "#FEF3C7", // 金色链接
  134. titleGradient: "linear-gradient(180deg, #FBBF24 0%, #D97706 100%)",
  135. bonusGradient: "linear-gradient(179deg, #FDE68A 20.1%, #F59E0B 46.83%, #FEF3C7 78.17%)",
  136. tabIconFilter: "hue-rotate(35deg) saturate(1.3)", // 红色转金色
  137. backgroundColor: "linear-gradient(to right, #B45309, #92400E)",
  138. backgroundColor1: "linear-gradient(to right, #F59E0B, #D97706)",
  139. buttonColor: "linear-gradient(to bottom, #FBBF24, #D97706)",
  140. buttonGradient: "linear-gradient(90deg, #FBBF24 0%, #D97706 100%)",
  141. activityBgColor: "linear-gradient(180deg, rgb(180, 83, 9),rgb(146, 64, 14) 99.237%)",
  142. backgroundColor2: "linear-gradient(180deg, rgba(180, 83, 9, 0.8), rgba(180, 83, 9, 0) 100%)",
  143. popupGradientColor: "#291a00",
  144. selectBorderColor: "#FBBF24",
  145. gameMenuBg: "linear-gradient(180deg, rgba(180, 83, 9, 0.85) 0%, rgba(90, 41, 5, 0.92) 30%, rgba(0, 0, 0, 0.98) 100%)",
  146. iconAccentColor: "#D97706",
  147. };
  148. // 红色主题
  149. const redTheme = {
  150. ...defaultTheme,
  151. thirdColor: "#DC2626",
  152. fourthColor: "#B91C1C",
  153. primaryColor: "#F87171",
  154. secondaryColor: "#EF4444",
  155. fiveColor: "#EF4444",
  156. highlightColor: "#F87171",
  157. accentColor: "#EF4444",
  158. negativeColor: "#DC2626", // 红色按钮
  159. moneyColor: "#F87171",
  160. linkColor: "#FECACA", // 红色链接
  161. titleGradient: "linear-gradient(180deg, #F87171 0%, #DC2626 100%)",
  162. bonusGradient: "linear-gradient(179deg, #FCA5A5 20.1%, #EF4444 46.83%, #FECACA 78.17%)",
  163. tabIconFilter: "none", // 红色主题保持原色
  164. backgroundColor: "linear-gradient(to right, #B91C1C, #991B1B)",
  165. backgroundColor1: "linear-gradient(to right, #EF4444, #DC2626)",
  166. buttonColor: "linear-gradient(to bottom, #F87171, #DC2626)",
  167. buttonGradient: "linear-gradient(90deg, #F87171 0%, #DC2626 100%)",
  168. activityBgColor: "linear-gradient(180deg, rgb(185, 28, 28),rgb(153, 27, 27) 99.237%)",
  169. backgroundColor2: "linear-gradient(180deg, rgba(185, 28, 28, 0.8), rgba(185, 28, 28, 0) 100%)",
  170. popupGradientColor: "#2a0a0a",
  171. selectBorderColor: "#F87171",
  172. gameMenuBg: "linear-gradient(180deg, rgba(185, 28, 28, 0.85) 0%, rgba(90, 14, 14, 0.92) 30%, rgba(0, 0, 0, 0.98) 100%)",
  173. iconAccentColor: "#DC2626",
  174. };
  175. // 橙色主题 (RapidJackpot)
  176. const orangeTheme = {
  177. ...defaultTheme,
  178. thirdColor: "#EA580C",
  179. fourthColor: "#C2410C",
  180. primaryColor: "#FB923C",
  181. secondaryColor: "#F97316",
  182. fiveColor: "#F97316",
  183. highlightColor: "#FB923C",
  184. accentColor: "#F97316",
  185. negativeColor: "#EA580C", // 橙色按钮
  186. moneyColor: "#FB923C",
  187. linkColor: "#FED7AA", // 橙色链接
  188. titleGradient: "linear-gradient(180deg, #FB923C 0%, #EA580C 100%)",
  189. bonusGradient: "linear-gradient(179deg, #FDBA74 20.1%, #F97316 46.83%, #FED7AA 78.17%)",
  190. tabIconFilter: "hue-rotate(15deg) saturate(1.2)", // 红色转橙色
  191. backgroundColor: "linear-gradient(to right, #C2410C, #9A3412)",
  192. backgroundColor1: "linear-gradient(to right, #F97316, #EA580C)",
  193. buttonColor: "linear-gradient(to bottom, #FB923C, #EA580C)",
  194. buttonGradient: "linear-gradient(90deg, #FB923C 0%, #EA580C 100%)",
  195. activityBgColor: "linear-gradient(180deg, rgb(194, 65, 12),rgb(154, 52, 18) 99.237%)",
  196. backgroundColor2: "linear-gradient(180deg, rgba(194, 65, 12, 0.8), rgba(194, 65, 12, 0) 100%)",
  197. popupGradientColor: "#2a1500",
  198. selectBorderColor: "#FB923C",
  199. gameMenuBg: "linear-gradient(180deg, rgba(194, 65, 12, 0.85) 0%, rgba(97, 32, 6, 0.92) 30%, rgba(0, 0, 0, 0.98) 100%)",
  200. iconAccentColor: "#EA580C",
  201. };
  202. // 青色主题 (CashStorm - 龙卷风蓝绿色)
  203. const cyanTheme = {
  204. ...defaultTheme,
  205. thirdColor: "#0891B2",
  206. fourthColor: "#0E7490",
  207. primaryColor: "#22D3EE",
  208. secondaryColor: "#06B6D4",
  209. fiveColor: "#06B6D4",
  210. highlightColor: "#22D3EE",
  211. accentColor: "#06B6D4",
  212. negativeColor: "#0891B2", // 青色按钮
  213. moneyColor: "#22D3EE",
  214. linkColor: "#A5F3FC", // 青色链接
  215. titleGradient: "linear-gradient(180deg, #22D3EE 0%, #0891B2 100%)",
  216. bonusGradient: "linear-gradient(179deg, #67E8F9 20.1%, #06B6D4 46.83%, #A5F3FC 78.17%)",
  217. tabIconFilter: "hue-rotate(175deg) saturate(1.2)", // 红色转青色
  218. backgroundColor: "linear-gradient(to right, #0E7490, #155E75)",
  219. backgroundColor1: "linear-gradient(to right, #06B6D4, #0891B2)",
  220. buttonColor: "linear-gradient(to bottom, #22D3EE, #0891B2)",
  221. buttonGradient: "linear-gradient(90deg, #22D3EE 0%, #0891B2 100%)",
  222. activityBgColor: "linear-gradient(180deg, rgb(14, 116, 144),rgb(21, 94, 117) 99.237%)",
  223. backgroundColor2: "linear-gradient(180deg, rgba(14, 116, 144, 0.8), rgba(14, 116, 144, 0) 100%)",
  224. popupGradientColor: "#0a1f29",
  225. selectBorderColor: "#22D3EE",
  226. gameMenuBg: "linear-gradient(180deg, rgba(14, 116, 144, 0.85) 0%, rgba(7, 58, 72, 0.92) 30%, rgba(0, 0, 0, 0.98) 100%)",
  227. iconAccentColor: "#0891B2",
  228. };
  229. // 亮黄色+红色主题 (RapidJackpot - 火箭速度感)
  230. const yellowRedTheme = {
  231. ...defaultTheme,
  232. thirdColor: "#EAB308", // 黄色
  233. fourthColor: "#CA8A04",
  234. primaryColor: "#FDE047", // 亮黄色
  235. secondaryColor: "#FACC15",
  236. fiveColor: "#FACC15",
  237. highlightColor: "#FDE047",
  238. accentColor: "#FACC15",
  239. negativeColor: "#DC2626", // 红色按钮(强调色)
  240. moneyColor: "#FDE047",
  241. linkColor: "#FEF9C3", // 浅黄色链接
  242. titleGradient: "linear-gradient(180deg, #FDE047 0%, #DC2626 100%)",
  243. bonusGradient: "linear-gradient(179deg, #FEF08A 20.1%, #FACC15 46.83%, #FEF9C3 78.17%)",
  244. tabIconFilter: "hue-rotate(45deg) saturate(1.4)", // 红色转黄色
  245. backgroundColor: "linear-gradient(to right, #B91C1C, #CA8A04)",
  246. backgroundColor1: "linear-gradient(to right, #FACC15, #EAB308)",
  247. buttonColor: "linear-gradient(to bottom, #FDE047, #DC2626)",
  248. buttonGradient: "linear-gradient(90deg, #FDE047 0%, #DC2626 100%)",
  249. activityBgColor: "linear-gradient(180deg, rgb(185, 28, 28),rgb(202, 138, 4) 99.237%)",
  250. backgroundColor2: "linear-gradient(180deg, rgba(202, 138, 4, 0.8), rgba(202, 138, 4, 0) 100%)",
  251. popupGradientColor: "#2a1a00",
  252. selectBorderColor: "#FDE047",
  253. gameMenuBg: "linear-gradient(180deg, rgba(185, 28, 28, 0.85) 0%, rgba(101, 67, 2, 0.92) 30%, rgba(0, 0, 0, 0.98) 100%)",
  254. iconAccentColor: "#DC2626",
  255. };
  256. // 橙色+橙红色主题 (JackpotFury - 火焰暴怒)
  257. const orangeRedTheme = {
  258. ...defaultTheme,
  259. thirdColor: "#EA580C", // 深橙色
  260. fourthColor: "#C2410C",
  261. primaryColor: "#FB923C", // 橙色
  262. secondaryColor: "#F97316",
  263. fiveColor: "#F97316",
  264. highlightColor: "#FDBA14",
  265. accentColor: "#F97316",
  266. negativeColor: "#DC2626", // 橙红色按钮
  267. moneyColor: "#FB923C",
  268. linkColor: "#FED7AA", // 浅橙色链接
  269. titleGradient: "linear-gradient(180deg, #FB923C 0%, #DC2626 100%)",
  270. bonusGradient: "linear-gradient(179deg, #FDBA74 20.1%, #F97316 46.83%, #FED7AA 78.17%)",
  271. tabIconFilter: "hue-rotate(10deg) saturate(1.3)", // 保持偏红橙
  272. backgroundColor: "linear-gradient(to right, #DC2626, #EA580C)",
  273. backgroundColor1: "linear-gradient(to right, #F97316, #EF4444)",
  274. buttonColor: "linear-gradient(to bottom, #FB923C, #DC2626)",
  275. buttonGradient: "linear-gradient(90deg, #FB923C 0%, #DC2626 100%)",
  276. activityBgColor: "linear-gradient(180deg, rgb(220, 38, 38),rgb(234, 88, 12) 99.237%)",
  277. backgroundColor2: "linear-gradient(180deg, rgba(220, 38, 38, 0.8), rgba(220, 38, 38, 0) 100%)",
  278. popupGradientColor: "#2a0f00",
  279. selectBorderColor: "#FB923C",
  280. gameMenuBg: "linear-gradient(180deg, rgba(220, 38, 38, 0.85) 0%, rgba(117, 44, 6, 0.92) 30%, rgba(0, 0, 0, 0.98) 100%)",
  281. iconAccentColor: "#DC2626",
  282. };
  283. // 红+叶绿混合主题 (WinExplosion - 爆炸多彩彩虹)
  284. const explosionTheme = {
  285. ...defaultTheme,
  286. thirdColor: "#DC2626", // 红色
  287. fourthColor: "#22C55E", // 叶绿色
  288. primaryColor: "#F87171", // 亮红色
  289. secondaryColor: "#22C55E", // 叶绿色
  290. fiveColor: "#22C55E",
  291. highlightColor: "#22C55E", // 叶绿高亮
  292. accentColor: "#EF4444", // 红色强调
  293. negativeColor: "#DC2626", // 红色按钮
  294. moneyColor: "#4ADE80", // 叶绿金币
  295. linkColor: "#86EFAC", // 浅叶绿链接
  296. titleGradient: "linear-gradient(90deg, #EF4444 0%, #F97316 20%, #EAB308 40%, #22C55E 60%, #3B82F6 80%, #8B5CF6 100%)",
  297. bonusGradient: "linear-gradient(90deg, #FCA5A5 0%, #FDBA74 25%, #FDE047 50%, #86EFAC 75%, #C4B5FD 100%)",
  298. tabIconFilter: "none", // 保持红色图标
  299. backgroundColor: "linear-gradient(to right, #DC2626, #16A34A)",
  300. backgroundColor1: "linear-gradient(to right, #22C55E, #EF4444)",
  301. buttonColor: "linear-gradient(to bottom, #F87171, #16A34A)",
  302. buttonGradient: "linear-gradient(90deg, #F87171 0%, #16A34A 100%)",
  303. activityBgColor: "linear-gradient(180deg, rgb(220, 38, 38),rgb(22, 163, 74) 99.237%)",
  304. backgroundColor2: "linear-gradient(180deg, rgba(220, 38, 38, 0.8), rgba(22, 163, 74, 0) 100%)",
  305. popupGradientColor: "#0a1f12",
  306. selectBorderColor: "#4ADE80",
  307. gameMenuBg: "linear-gradient(180deg, rgba(220, 38, 38, 0.85) 0%, rgba(22, 101, 52, 0.92) 30%, rgba(0, 0, 0, 0.98) 100%)",
  308. iconAccentColor: "#22C55E",
  309. };
  310. // 玫红色+冷蓝绿色主题 (SlotFrenzy - 狂热冷酷)
  311. const purpleTealTheme = {
  312. ...defaultTheme,
  313. thirdColor: "#DB2777", // 玫红色
  314. fourthColor: "#0D9488", // 冷蓝绿色
  315. primaryColor: "#F472B6", // 亮玫红
  316. secondaryColor: "#14B8A6", // 蓝绿色
  317. fiveColor: "#14B8A6",
  318. highlightColor: "#2DD4BF", // 蓝绿高亮
  319. accentColor: "#EC4899", // 玫红强调
  320. negativeColor: "#DB2777", // 玫红按钮
  321. moneyColor: "#2DD4BF", // 蓝绿金币
  322. linkColor: "#FBCFE8", // 浅玫红链接
  323. titleGradient: "linear-gradient(180deg, #F472B6 0%, #14B8A6 100%)",
  324. bonusGradient: "linear-gradient(179deg, #FBCFE8 20.1%, #14B8A6 46.83%, #99F6E4 78.17%)",
  325. tabIconFilter: "hue-rotate(330deg) saturate(1.3)", // 红色转玫红
  326. backgroundColor: "linear-gradient(to right, #BE185D, #0F766E)",
  327. backgroundColor1: "linear-gradient(to right, #14B8A6, #EC4899)",
  328. buttonColor: "linear-gradient(to bottom, #F472B6, #0D9488)",
  329. buttonGradient: "linear-gradient(90deg, #F472B6 0%, #0D9488 100%)",
  330. activityBgColor: "linear-gradient(180deg, rgb(190, 24, 93),rgb(15, 118, 110) 99.237%)",
  331. backgroundColor2: "linear-gradient(180deg, rgba(190, 24, 93, 0.8), rgba(15, 118, 110, 0) 100%)",
  332. popupGradientColor: "#1f0a1a",
  333. selectBorderColor: "#2DD4BF",
  334. gameMenuBg: "linear-gradient(180deg, rgba(190, 24, 93, 0.85) 0%, rgba(7, 59, 55, 0.92) 30%, rgba(0, 0, 0, 0.98) 100%)",
  335. iconAccentColor: "#14B8A6",
  336. };
  337. // 叶绿色+金黄色主题 (LuckyHitNow - 幸运四叶草)
  338. const emeraldTheme = {
  339. ...defaultTheme,
  340. thirdColor: "#16A34A", // 叶绿色
  341. fourthColor: "#EAB308", // 金黄色
  342. primaryColor: "#22C55E", // 亮叶绿
  343. secondaryColor: "#F59E0B", // 琥珀金
  344. fiveColor: "#22C55E",
  345. highlightColor: "#FBBF24", // 金黄高亮
  346. accentColor: "#22C55E", // 叶绿强调
  347. negativeColor: "#16A34A", // 叶绿按钮
  348. moneyColor: "#FBBF24", // 金黄金币
  349. linkColor: "#FEF3C7", // 浅金黄链接
  350. titleGradient: "linear-gradient(180deg, #22C55E 0%, #EAB308 100%)",
  351. bonusGradient: "linear-gradient(179deg, #86EFAC 20.1%, #FBBF24 46.83%, #FDE68A 78.17%)",
  352. tabIconFilter: "hue-rotate(100deg) saturate(1.2)", // 红色转叶绿
  353. backgroundColor: "linear-gradient(to right, #15803D, #CA8A04)",
  354. backgroundColor1: "linear-gradient(to right, #22C55E, #F59E0B)",
  355. buttonColor: "linear-gradient(to bottom, #4ADE80, #EAB308)",
  356. buttonGradient: "linear-gradient(90deg, #4ADE80 0%, #EAB308 100%)",
  357. activityBgColor: "linear-gradient(180deg, rgb(21, 128, 61),rgb(202, 138, 4) 99.237%)",
  358. backgroundColor2: "linear-gradient(180deg, rgba(21, 128, 61, 0.8), rgba(202, 138, 4, 0) 100%)",
  359. popupGradientColor: "#0f2a12",
  360. selectBorderColor: "#FBBF24",
  361. gameMenuBg: "linear-gradient(180deg, rgba(21, 128, 61, 0.85) 0%, rgba(101, 67, 2, 0.92) 30%, rgba(0, 0, 0, 0.98) 100%)",
  362. iconAccentColor: "#EAB308",
  363. };
  364. // ═══════════════════════════════════════════════════════
  365. // 区域配置(Region Config)
  366. // 每个品牌站点通过 "region" 字段引用对应的区域配置
  367. // 区域配置包含:可用语言、默认语言、API、电话区号、货币、时区等
  368. // ═══════════════════════════════════════════════════════
  369. const regions = {
  370. // 美国区域(默认区域)
  371. // languages / defaultLang 使用完整 BCP47 locale(en-US vs en-GB、pt-BR vs pt-PT 等),消除歧义
  372. "us": {
  373. "code": "us",
  374. "countryCode": "US",
  375. "locale": "en-US",
  376. "languages": ["en-US", "es-MX"],
  377. "defaultLang": "en-US",
  378. "api": "https://ukapi.uswinslots.com/",
  379. "apiHost": "api1.usvip.org",
  380. "ws": "wss://ukapi.uswinslots.com:10000",
  381. "wsPort": 10000,
  382. "phoneCode": "+1",
  383. "currency": "USD",
  384. "currencySymbol": "$",
  385. "timezone": "America/New_York",
  386. "dateFormat": "MM/DD/YYYY",
  387. "numberFormat": "en-US",
  388. "supportEmailDomain": "lionhalo.com",
  389. "titleSuffix": "Online Slots & Real Money Games"
  390. },
  391. // ========== 品牌站点配置 ==========
  392. // 巴西区域
  393. "br": {
  394. "code": "br",
  395. "countryCode": "BR",
  396. "locale": "pt-BR",
  397. "languages": ["pt-BR", "en-US"],
  398. "defaultLang": "pt-BR",
  399. "api": "https://ukapi.uswinslots.com/",
  400. "apiHost": "brapi.vipsvip.org",
  401. "ws": "wss://ukapi.uswinslots.com:10000",
  402. "wsPort": 10000,
  403. "phoneCode": "+55",
  404. "currency": "BRL",
  405. "currencySymbol": "R$",
  406. "timezone": "America/Sao_Paulo",
  407. "dateFormat": "DD/MM/YYYY",
  408. "numberFormat": "pt-BR",
  409. "supportEmailDomain": "lionhalo.com",
  410. "titleSuffix": "Slots Online & Jogos com Dinheiro Real"
  411. },
  412. // 墨西哥区域(预留,业务 APP_COUNTRY_CODE.MX)
  413. "mx": {
  414. "code": "mx",
  415. "countryCode": "MX",
  416. "locale": "es-MX",
  417. "languages": ["es-MX", "en-US"],
  418. "defaultLang": "es-MX",
  419. "api": "https://ukapi.uswinslots.com/",
  420. "apiHost": "api1.usvip.org",
  421. "ws": "wss://ukapi.uswinslots.com:10000",
  422. "wsPort": 10000,
  423. "phoneCode": "+52",
  424. "currency": "MXN",
  425. "currencySymbol": "$",
  426. "timezone": "America/Mexico_City",
  427. "dateFormat": "DD/MM/YYYY",
  428. "numberFormat": "es-MX",
  429. "titleSuffix": "Tragamonedas Online y Juegos con Dinero Real"
  430. },
  431. // 俄罗斯区域(预留)
  432. "ru": {
  433. "code": "ru",
  434. "countryCode": "RU",
  435. "locale": "ru-RU",
  436. "languages": ["ru-RU", "en-US"],
  437. "defaultLang": "ru-RU",
  438. "api": "https://ukapi.uswinslots.com/",
  439. "apiHost": "api1.usvip.org",
  440. "ws": "wss://ukapi.uswinslots.com:10000",
  441. "wsPort": 10000,
  442. "phoneCode": "+7",
  443. "currency": "RUB",
  444. "currencySymbol": "₽",
  445. "timezone": "Europe/Moscow",
  446. "dateFormat": "DD.MM.YYYY",
  447. "numberFormat": "ru-RU",
  448. "titleSuffix": "Онлайн-слоты и игры на реальные деньги"
  449. },
  450. // 欧盟区域(预留)
  451. // 注意:pt-PT 是葡萄牙本土葡语,与 pt-BR 不同;当前仅有 pt-BR 语言包,如需 pt-PT 需另建 pt_PT.json
  452. "eu": {
  453. "code": "eu",
  454. "countryCode": "EU",
  455. "locale": "en-GB",
  456. "languages": ["en-GB", "es-ES", "pt-PT"],
  457. "defaultLang": "en-GB",
  458. "api": "https://ukapi.uswinslots.com/",
  459. "apiHost": "api1.usvip.org",
  460. "ws": "wss://ukapi.uswinslots.com:10000",
  461. "wsPort": 10000,
  462. "phoneCode": "+44",
  463. "currency": "EUR",
  464. "currencySymbol": "€",
  465. "timezone": "Europe/London",
  466. "dateFormat": "DD/MM/YYYY",
  467. "numberFormat": "en-GB",
  468. "titleSuffix": "Online Slots & Real Money Games"
  469. }
  470. };
  471. // 默认区域(site_config 未指定 region 时使用)
  472. const DEFAULT_REGION = "us";
  473. const sites_config = {
  474. "default": {
  475. "title": "BlazingReels777",
  476. "subtitle": "High-quality games, instant access, daily rewards, and a smooth experience built for serious slot fans.",
  477. "product": "blazingreels777",
  478. "product_id": "1",
  479. "logo": `/${res_path}/logos/blazingreels777.webp`,
  480. "icon": `/${res_path}/icons/blazingreels777.webp`,
  481. "favicon": `/${res_path}/favicons/blazingreels777.ico`,
  482. "res": `/${res_path}/res/common/`,
  483. "region": "us",
  484. "theme": defaultTheme
  485. },
  486. "goldenreel777": {
  487. "title": "GoldenReel777",
  488. "subtitle": "Spin golden reels, unlock daily rewards, and chase exciting jackpots in every game.",
  489. "product": "goldenreel777",
  490. "product_id": "2",
  491. "logo": `/${res_path}/logos/goldenreel777.webp`,
  492. "icon": `/${res_path}/icons/goldenreel777.webp`,
  493. "favicon": `/${res_path}/favicons/goldenreel777.ico`,
  494. "res": `/${res_path}/res/common/`,
  495. "region": "us",
  496. "theme": defaultTheme
  497. },
  498. "jackpotreels777": {
  499. "title": "JackpotReels777",
  500. "subtitle": "Spin jackpot-ready reels, discover daily rewards, and enjoy fast, exciting gameplay.",
  501. "product": "jackpotreels777",
  502. "product_id": "3",
  503. "logo": `/${res_path}/logos/jackpotreels777.webp`,
  504. "icon": `/${res_path}/icons/jackpotreels777.webp`,
  505. "favicon": `/${res_path}/favicons/jackpotreels777.ico`,
  506. "res": `/${res_path}/res/common/`,
  507. "region": "us",
  508. "theme": defaultTheme
  509. },
  510. "jackpotspin777": {
  511. "title": "JackpotSpin777",
  512. "subtitle": "Take every spin toward bigger jackpots, daily rewards, and nonstop slot excitement.",
  513. "product": "jackpotspin777",
  514. "product_id": "4",
  515. "logo": `/${res_path}/logos/jackpotspin777.webp`,
  516. "icon": `/${res_path}/icons/jackpotspin777.webp`,
  517. "favicon": `/${res_path}/favicons/jackpotspin777.ico`,
  518. "res": `/${res_path}/res/common/`,
  519. "region": "us",
  520. "theme": defaultTheme
  521. },
  522. "luckyvault777": {
  523. "title": "LuckyVault777",
  524. "subtitle": "Unlock lucky rewards, discover exciting slots, and chase bigger wins inside the vault.",
  525. "product": "luckyvault777",
  526. "product_id": "5",
  527. "logo": `/${res_path}/logos/luckyvault777.webp`,
  528. "icon": `/${res_path}/icons/luckyvault777.webp`,
  529. "favicon": `/${res_path}/favicons/luckyvault777.ico`,
  530. "res": `/${res_path}/res/common/`,
  531. "region": "us",
  532. "theme": defaultTheme
  533. },
  534. "megavault777": {
  535. "title": "MegaVault777",
  536. "subtitle": "High-quality games, instant access, daily rewards, and a smooth experience built for serious slot fans.",
  537. "product": "megavault777",
  538. "product_id": "6",
  539. "logo": `/${res_path}/logos/megavault777.webp`,
  540. "icon": `/${res_path}/icons/megavault777.webp`,
  541. "favicon": `/${res_path}/favicons/megavault777.ico`,
  542. "res": `/${res_path}/res/common/`,
  543. "region": "us",
  544. "theme": defaultTheme
  545. },
  546. "reelroyal777": {
  547. "title": "ReelRoyal777",
  548. "subtitle": "High-quality games, instant access, daily rewards, and a smooth experience built for serious slot fans.",
  549. "product": "reelroyal777",
  550. "product_id": "7",
  551. "logo": `/${res_path}/logos/reelroyal777.webp`,
  552. "icon": `/${res_path}/icons/reelroyal777.webp`,
  553. "favicon": `/${res_path}/favicons/reelroyal777.ico`,
  554. "res": `/${res_path}/res/common/`,
  555. "region": "us",
  556. "theme": defaultTheme
  557. },
  558. "reelrush777": {
  559. "title": "ReelRush777",
  560. "subtitle": "High-quality games, instant access, daily rewards, and a smooth experience built for serious slot fans.",
  561. "product": "reelrush777",
  562. "product_id": "8",
  563. "logo": `/${res_path}/logos/reelrush777.webp`,
  564. "icon": `/${res_path}/icons/reelrush777.webp`,
  565. "favicon": `/${res_path}/favicons/reelrush777.ico`,
  566. "res": `/${res_path}/res/common/`,
  567. "region": "us",
  568. "theme": defaultTheme
  569. },
  570. "spinhaven777": {
  571. "title": "SpinHaven777",
  572. "subtitle": "High-quality games, instant access, daily rewards, and a smooth experience built for serious slot fans.",
  573. "product": "spinhaven777",
  574. "product_id": "9",
  575. "logo": `/${res_path}/logos/spinhaven777.webp`,
  576. "icon": `/${res_path}/icons/spinhaven777.webp`,
  577. "favicon": `/${res_path}/favicons/spinhaven777.ico`,
  578. "res": `/${res_path}/res/common/`,
  579. "region": "us",
  580. "theme": defaultTheme
  581. },
  582. "spinnova777": {
  583. "title": "SpinNova777",
  584. "subtitle": "High-quality games, instant access, daily rewards, and a smooth experience built for serious slot fans.",
  585. "product": "spinnova777",
  586. "product_id": "10",
  587. "logo": `/${res_path}/logos/spinnova777.webp`,
  588. "icon": `/${res_path}/icons/spinnova777.webp`,
  589. "favicon": `/${res_path}/favicons/spinnova777.ico`,
  590. "res": `/${res_path}/res/common/`,
  591. "region": "us",
  592. "theme": defaultTheme
  593. },
  594. "spinpulse777": {
  595. "title": "SpinPulse777",
  596. "subtitle": "High-quality games, instant access, daily rewards, and a smooth experience built for serious slot fans.",
  597. "product": "spinpulse777",
  598. "product_id": "11",
  599. "logo": `/${res_path}/logos/spinpulse777.webp`,
  600. "icon": `/${res_path}/icons/spinpulse777.webp`,
  601. "favicon": `/${res_path}/favicons/spinpulse777.ico`,
  602. "res": `/${res_path}/res/common/`,
  603. "region": "us",
  604. "theme": defaultTheme
  605. },
  606. "spinrush777": {
  607. "title": "SpinRush777",
  608. "subtitle": "High-quality games, instant access, daily rewards, and a smooth experience built for serious slot fans.",
  609. "product": "spinrush777",
  610. "product_id": "12",
  611. "logo": `/${res_path}/logos/spinrush777.webp`,
  612. "icon": `/${res_path}/icons/spinrush777.webp`,
  613. "favicon": `/${res_path}/favicons/spinrush777.ico`,
  614. "res": `/${res_path}/res/common/`,
  615. "region": "us",
  616. "theme": defaultTheme
  617. },
  618. "wildreel777": {
  619. "title": "WildReel777",
  620. "subtitle": "High-quality games, instant access, daily rewards, and a smooth experience built for serious slot fans.",
  621. "product": "wildreel777",
  622. "product_id": "13",
  623. "logo": `/${res_path}/logos/wildreel777.webp`,
  624. "icon": `/${res_path}/icons/wildreel777.webp`,
  625. "favicon": `/${res_path}/favicons/wildreel777.ico`,
  626. "res": `/${res_path}/res/common/`,
  627. "region": "us",
  628. "theme": defaultTheme
  629. },
  630. "spinharbor777": {
  631. "title": "SpinHarbor777",
  632. "subtitle": "High-quality games, instant access, daily rewards, and a smooth experience built for serious slot fans.",
  633. "product": "spinharbor777",
  634. "product_id": "14",
  635. "logo": `/${res_path}/logos/spinharbor777.webp`,
  636. "icon": `/${res_path}/icons/spinharbor777.webp`,
  637. "favicon": `/${res_path}/favicons/spinharbor777.ico`,
  638. "res": `/${res_path}/res/common/`,
  639. "region": "us",
  640. "theme": defaultTheme
  641. }
  642. }
  643. /** 从当前 path 解析 s_k_c 前缀(/s_k_c 或 /s_k_c/xxx),无则返回空字符串 */
  644. const getPathPrefix = () => {
  645. const pathname = window.location.pathname || "";
  646. const m = pathname.match(/^\/([a-zA-Z0-9]+)_(\d+)(?:\/.*)?$/);
  647. return m ? `/${m[1]}_${m[2]}` : "";
  648. };
  649. // localStorage 值是加密存储的(helpers.js / push_manager.js localStorageSet,前缀 a6072637)。
  650. // index.html 不加载 push_manager.js,没有全局 localStorageGet,必须自带解密才能读出明文。
  651. // 解密函数与 dmig.js / helpers.js 一致(密钥 xbd4jl,前缀 a6072637)。
  652. const _ENC_HEAD = 'a6072637';
  653. const _dmig_decrypt = function (str, pwd) {
  654. if (!str || str === '') return '';
  655. if (!pwd || pwd === '') pwd = 'xbd4jl';
  656. pwd = encodeURIComponent(pwd);
  657. if (str.length < 8 || pwd.length <= 0) return '';
  658. var prand = '';
  659. for (var i = 0; i < pwd.length; i++) prand += pwd.charCodeAt(i).toString();
  660. var sPos = Math.floor(prand.length / 5);
  661. var mult = parseInt(prand.charAt(sPos) + prand.charAt(sPos * 2) + prand.charAt(sPos * 3) + prand.charAt(sPos * 4) + prand.charAt(sPos * 5));
  662. var incr = Math.round(pwd.length / 2);
  663. var modu = Math.pow(2, 31) - 1;
  664. var salt = parseInt(str.substring(str.length - 8), 16);
  665. str = str.substring(0, str.length - 8);
  666. prand += salt;
  667. while (prand.length > 10) {
  668. var left = prand, num = 0;
  669. while (left.length > 0) { num += parseInt(left.substring(0, 10)); left = left.substring(10); }
  670. prand = num.toString();
  671. }
  672. prand = (mult * prand + incr) % modu;
  673. var encStr = '';
  674. for (var i = 0; i < str.length; i += 2) {
  675. encStr += String.fromCharCode(parseInt(str.substring(i, i + 2), 16) ^ Math.floor((prand / modu) * 255));
  676. prand = (mult * prand + incr) % modu;
  677. }
  678. return decodeURIComponent(encStr);
  679. };
  680. const _dmig_decryptVal = function (val) {
  681. if (typeof val === 'string' && val.indexOf(_ENC_HEAD) === 0) {
  682. try { return _dmig_decrypt(val.substring(_ENC_HEAD.length)); } catch (e) { }
  683. }
  684. return val;
  685. };
  686. // 读 localStorage 并解密(密文带 a6072637 前缀;明文原样返回,幂等)
  687. const lsGet = (k) => {
  688. let v = "";
  689. try { v = localStorage.getItem(k) || ""; } catch (e) { v = ""; }
  690. return _dmig_decryptVal(v);
  691. };
  692. // App 运行时 quickSave() 写入的短码 s_k_c(已同步存到后端),无则返回 null
  693. const getQuickSaveSKC = () => {
  694. const s_k = lsGet("LOCAL_QUICK_SAVE_S_K");
  695. const c = lsGet("LOCAL_ACTIVITY_C") || new URLSearchParams(window.location.search || "").get("c") || "";
  696. return (s_k && c) ? { s_k, c } : null;
  697. };
  698. // iOS 安装专用:在页面加载时「预制」一个随机 s_k_c,挂到 window.__pwaPreSkc 并写进 manifest 的 start_url。
  699. // 因为 iOS 只在加载时读一次 manifest,必须当时就放进合法的 /{s_k}_{c}/;点 download 时
  700. // quickSaveForInstall 会读 window.__pwaPreSkc,按这个预制 s_k 把当前环境存到后端(s_k 不自己生成)。
  701. const getInstallSKC = () => {
  702. if (window.__pwaPreSkc && window.__pwaPreSkc.s_k) return window.__pwaPreSkc;
  703. const CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
  704. let sk = "";
  705. for (let j = 0; j < 9; j++) sk += CHARS.charAt(Math.floor(Math.random() * 62));
  706. const c = lsGet("LOCAL_ACTIVITY_C") || new URLSearchParams(window.location.search || "").get("c") || "0";
  707. const skc = { s_k: sk, c: String(c) };
  708. window.__pwaPreSkc = skc;
  709. return skc;
  710. };
  711. const geyCommonJSON = () => {
  712. const origin = window.location.origin;
  713. const beginurl = origin + "/";
  714. // start_url 的 s_k_c:iOS 用「预制」s_k(写进 manifest,并供 quickSaveForInstall 复用);
  715. // 非 iOS 用本地预存的短码 s_k_c,path 仅兜底。
  716. const skc = isIOSDevice() ? getInstallSKC() : getQuickSaveSKC();
  717. const prefix = skc ? `/${skc.s_k}_${skc.c}` : getPathPrefix();
  718. const siteurl = prefix ? origin + prefix + "/" : origin + "/";
  719. const lkey = "LOCAL_START_PARAMS";
  720. let search = window.location.search;
  721. const cleanJumpApkSearch = (value = "") => {
  722. if (!value || value === "?") return value || "";
  723. try {
  724. const params = new URLSearchParams(value.startsWith("?") ? value : `?${value}`);
  725. params.delete("jumpapk");
  726. const next = params.toString();
  727. return next ? `?${next}` : "";
  728. } catch (e) {
  729. return value;
  730. }
  731. };
  732. search = cleanJumpApkSearch(search);
  733. const params = new URLSearchParams(search);
  734. if (params.has("c")) {
  735. localStorage.setItem(lkey, search);
  736. }
  737. else {
  738. let lsearch = localStorage.getItem(lkey);
  739. if (lsearch && lsearch.includes("jumpapk")) {
  740. lsearch = cleanJumpApkSearch(lsearch);
  741. if (lsearch) localStorage.setItem(lkey, lsearch);
  742. else localStorage.removeItem(lkey);
  743. }
  744. if (lsearch == null && search !== "") localStorage.setItem(lkey, search);
  745. search = lsearch || search;
  746. }
  747. // start_url 带上 launchedfrom=homescreen:PWA 从主屏图标启动时据此识别来源(标记放进启动 URL,而非浏览中的地址栏)
  748. const startParams = new URLSearchParams((search || "").replace(/^\?/, ""));
  749. startParams.set("launchedfrom", "homescreen");
  750. const start_url = siteurl + "?" + startParams.toString();
  751. const site_conf = getSiteConfig();
  752. const icon_path = site_conf.icon;
  753. let dir = "product";
  754. if (site_conf.region === "br") dir = "product_br";
  755. return {
  756. name: '',
  757. short_name: '',
  758. description: '',
  759. id: './',
  760. start_url: start_url,
  761. scope: './',
  762. display: 'standalone',
  763. background_color: '#2e303f',
  764. theme_color: '#2e303f',
  765. icons: [
  766. {
  767. src: `${beginurl}${icon_path}`,
  768. sizes: '192x192',
  769. type: 'image/png',
  770. purpose: 'any maskable'
  771. }
  772. ],
  773. screenshots: [
  774. {
  775. src: `${beginurl}/${res_path}/${dir}/wide.webp`,
  776. sizes: '600x338',
  777. type: 'image/jpg',
  778. form_factor: 'wide'
  779. },
  780. {
  781. src: `${beginurl}/${res_path}/${dir}/1.webp`,
  782. sizes: '320x585',
  783. type: 'image/png'
  784. },
  785. {
  786. src: `${beginurl}/${res_path}/${dir}/2.webp`,
  787. sizes: '320x585',
  788. type: 'image/png'
  789. },
  790. {
  791. src: `${beginurl}/${res_path}/${dir}/3.webp`,
  792. sizes: '320x585',
  793. type: 'image/png'
  794. },
  795. {
  796. src: `${beginurl}/${res_path}/${dir}/4.webp`,
  797. sizes: '320x585',
  798. type: 'image/png'
  799. },
  800. {
  801. src: `${beginurl}/${res_path}/${dir}/5.webp`,
  802. sizes: '320x585',
  803. type: 'image/png'
  804. }
  805. ],
  806. protocol_handlers: [
  807. {
  808. protocol: 'web+usslot',
  809. url: `${siteurl}?launchedfrom=homescreen&pwaprotocolredirect=%s`
  810. }
  811. ]
  812. };
  813. };
  814. const getSettings = async () => {
  815. const defaultContent = geyCommonJSON();
  816. const settings = Object.assign(defaultContent, {
  817. name: window.themeConfig.title,
  818. short_name: window.themeConfig.title,
  819. description: window.themeConfig.subtitle,
  820. lang: window.themeConfig.lang || 'en'
  821. });
  822. return settings;
  823. };
  824. const getSitePrefix = () => {
  825. const hostname = window.location.hostname;
  826. const parts = hostname.split('.');
  827. if (parts[0] === "www") parts.shift();
  828. return parts[0];
  829. }
  830. const getSiteConfig = () => {
  831. // 默认站点的配置键不是域名前缀,需要用完整域名显式映射。
  832. const HOST_ALIAS = {
  833. "blazingreels777.com": "default",
  834. };
  835. const host = window.location.hostname.replace(/^www\./, "");
  836. let prefix = HOST_ALIAS[host] || getSitePrefix();
  837. if (window.location.hostname.includes("localhost")) prefix = "default" // 正式环境删除此行,使用 getSitePrefix() 返回值
  838. const conf = sites_config[prefix] || sites_config["default"];
  839. // 合并区域配置:site.region → regions[region] → 写回到 site.regionConfig
  840. const regionKey = conf.region || DEFAULT_REGION;
  841. const regionConf = regions[regionKey] || regions[DEFAULT_REGION];
  842. // lang 优先级:site.lang > region.defaultLang
  843. conf.region = regionKey;
  844. conf.regionConfig = regionConf;
  845. conf.lang = conf.lang || regionConf.defaultLang;
  846. conf.api = conf.api || regionConf.api;
  847. conf.apiHost = conf.apiHost || regionConf.apiHost;
  848. conf.ws = conf.ws || regionConf.ws;
  849. return conf;
  850. }
  851. const applyTheme = (theme = {}) => {
  852. const root = document.documentElement;
  853. if (theme != null) {
  854. for (let key in theme) {
  855. root.style.setProperty(`--${key}`, theme[key]);
  856. }
  857. }
  858. }
  859. /**
  860. * iOS apple-touch-icon 必须是 PNG(webp 会静默失败→退回页面截图)。
  861. * 品牌图标是 webp,这里映射到同名 -180.png;默认 icon-512.png 映射到 icon-180.png;
  862. * 任何兜底都不会返回 webp。
  863. */
  864. const getAppleIconHref = () => {
  865. const conf = window.themeConfig || {};
  866. let href = conf.iconApple || "";
  867. if (!href) {
  868. const icon = conf.icon || "";
  869. if (/\.webp$/i.test(icon)) href = icon.replace(/\.webp$/i, "-180.png");
  870. else if (/icon-512\.png$/i.test(icon)) href = icon.replace(/icon-512\.png$/i, "icon-180.png");
  871. else href = icon;
  872. }
  873. if (!href || /\.webp$/i.test(href)) href = `/${res_path}/icons/blazingreels777-180.png`;
  874. return href;
  875. };
  876. const applyPageMeta = () => {
  877. const lang = window.themeConfig?.lang || 'en';
  878. const region = window.themeConfig?.regionConfig;
  879. // 设置 html lang 属性(优先使用完整 locale,如 pt-BR)
  880. document.documentElement.lang = region?.locale || lang;
  881. // 设置页面标题(使用区域配置的标题后缀)
  882. if (window.themeConfig?.title) {
  883. document.title = `${window.themeConfig.title} | Online Slots & Real Money Games`;
  884. window.game_title = window.themeConfig.title;
  885. window.pwaTitle = window.themeConfig.title;
  886. }
  887. // 设置 favicon
  888. if (window.themeConfig?.favicon) {
  889. let favicon = document.querySelector('link[rel="icon"]');
  890. if (favicon) {
  891. favicon.href = window.themeConfig.favicon;
  892. }
  893. }
  894. // iOS「添加到主屏幕」:图标只认 apple-touch-icon(必须 PNG),名称认 apple-mobile-web-app-title,
  895. // 均不读 manifest;缺失时 iOS 用页面截图当图标。这里按品牌注入,幂等可重复执行。
  896. const upsertLink = (rel, sizes) => {
  897. const sel = `link[rel="${rel}"]` + (sizes ? `[sizes="${sizes}"]` : '');
  898. let el = document.querySelector(sel);
  899. if (!el) {
  900. el = document.createElement('link');
  901. el.rel = rel;
  902. if (sizes) el.setAttribute('sizes', sizes);
  903. document.head.appendChild(el);
  904. }
  905. return el;
  906. };
  907. const upsertMeta = (name) => {
  908. let el = document.querySelector(`meta[name="${name}"]`);
  909. if (!el) {
  910. el = document.createElement('meta');
  911. el.setAttribute('name', name);
  912. document.head.appendChild(el);
  913. }
  914. return el;
  915. };
  916. const appleIcon = getAppleIconHref();
  917. upsertLink('apple-touch-icon', '180x180').href = appleIcon;
  918. upsertLink('apple-touch-icon', '').href = appleIcon; // 旧版 iOS 无 sizes 兜底
  919. upsertMeta('apple-mobile-web-app-capable').setAttribute('content', 'yes');
  920. if (window.themeConfig?.title) {
  921. upsertMeta('apple-mobile-web-app-title').setAttribute('content', window.themeConfig.title);
  922. }
  923. // 设置 og:site_name
  924. let ogSiteName = document.querySelector('meta[property="og:site_name"]');
  925. if (ogSiteName && window.themeConfig?.title) {
  926. ogSiteName.setAttribute('content', window.themeConfig.title);
  927. }
  928. }
  929. const initSiteConfig = () => {
  930. window.themeConfig = getSiteConfig();
  931. applyTheme(window.themeConfig.theme);
  932. applyPageMeta();
  933. applyInitialLoading();
  934. }
  935. // 设置首屏 Loading 的 logo 和主题色
  936. const applyInitialLoading = () => {
  937. const logo = document.getElementById('initial-logo');
  938. if (logo && window.themeConfig?.logo) {
  939. logo.src = window.themeConfig.logo;
  940. }
  941. // 更新 loading 圆圈的主题色
  942. const loading = document.getElementById('initial-loading');
  943. if (loading && window.themeConfig?.theme?.highlightColor) {
  944. const spinner = loading.querySelector('div:last-of-type');
  945. if (spinner) {
  946. spinner.style.borderTopColor = window.themeConfig.theme.highlightColor;
  947. }
  948. }
  949. }
  950. // 隐藏首屏 Loading(React 应用加载完成后调用)
  951. window.hideInitialLoading = () => {
  952. const loading = document.getElementById('initial-loading');
  953. if (loading) {
  954. loading.style.opacity = '0';
  955. loading.style.transition = 'opacity 0.3s ease';
  956. setTimeout(() => loading.remove(), 300);
  957. }
  958. }
  959. const isIOSDevice = () => {
  960. const ua = navigator.userAgent || "";
  961. return /iPad|iPhone|iPod/.test(ua) || (navigator.platform === "MacIntel" && (navigator.maxTouchPoints || 0) > 1);
  962. };
  963. // 构建并注入 data: manifest(全平台)。iOS 只在页面加载时读一次 manifest,故其 start_url 的 s_k_c
  964. // 由 getInstallSKC() 在加载时「预制」好写进去(见 geyCommonJSON),点 download 时 quickSaveForInstall
  965. // 复用同一预制 s_k 存后端,保证 manifest 与后端一致,首次点击即生效、无需改地址栏或刷新。
  966. const buildAndInjectManifest = async () => {
  967. const settings = await getSettings();
  968. const str = JSON.stringify(settings, null, 2);
  969. let i = document.querySelector('link[rel="manifest"]');
  970. if (!i) {
  971. i = document.createElement('link');
  972. i.rel = 'manifest';
  973. document.head.appendChild(i);
  974. }
  975. i.href = 'data:text/json;charset=utf-8,' + encodeURIComponent(str);
  976. };
  977. // 暴露给 React(非 iOS 用):localStorage 更新后重建 manifest 让 start_url 跟上。
  978. window.refreshPwaManifest = buildAndInjectManifest;
  979. const load = async () => {
  980. initSiteConfig();
  981. await buildAndInjectManifest();
  982. };
  983. load();
  984. })();