| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034 |
- (function () {
- const res_path = "resources";
- // 默认主题配置(绿色主题)
- const defaultTheme = {
- // 主色调
- primaryColor: "#24EE89",
- secondaryColor: "#2CD97D",
- thirdColor: "#00AF78",
- fourthColor: "#046E55",
- fiveColor: "#10b981",
- highlightColor: "#23FD93", // 高亮绿色
- accentColor: "#08c974", // 强调色
- // 渐变背景
- backgroundColor: "linear-gradient(to right, #0BAA47, #057B52)",
- backgroundColor1: "linear-gradient(to right, #10B981, #059669)",
- backgroundColor2: "linear-gradient(180deg, rgba(12, 89, 70, 0.8), rgba(12, 89, 70, 0) 100%)",
- activityBgColor: "linear-gradient(180deg, rgb(14, 110, 67),rgb(5, 73, 45) 99.237%)",
- // 按钮颜色
- buttonColor: "#24EE89",
- buttonText: "#13171F",
- buttonGradient: "linear-gradient(90deg, #1FEB85 0%, #7FFE5A 100%)",
- buttonGray: "#464F50",
- warningButtonColor: "linear-gradient(to bottom, #f7c61d, #ef9a05)",
- disabledButtonColor: "linear-gradient(to bottom, #b3b3b3, #939393)",
- errorButtonColor: "linear-gradient(to bottom, #ff5a6d, #ce1126)",
- orangeButtonColor: "linear-gradient(179deg, #FEC412 20.1%, #FE871C 46.83%, #FFFB23 78.17%)",
- // 文字颜色
- textColor: "#E8ECF0",
- textGrayColor: "#849194",
- textGrayColor1: "#B3BEC1",
- textLightColor: "#f9f5ef", // 米白文字
- // 背景颜色
- mainBgColor: "#232626",
- darkColor: "#323738",
- darkColor1: "#3A4142",
- darkColor2: "#464F50",
- darkColor3: "#464F50",
- bodyBgColor: "#232626", // 最深背景
- pageTitleBg: "#292D2E",
- // 面板/卡片颜色
- popupBgColor: "#323738",
- popupGradientColor: "linear-gradient(150deg, rgba(36, 238, 137, 0.20) 0.05%, rgba(0, 0, 0, 0.00) 32.53%), #232626",
- inputBgColor: "#292D2E", // 输入框背景
- // 边框颜色
- selectBorderColor: "#24EE89",
- // 状态颜色
- positiveColor: "#7ED321",
- negativeColor: "#FF1B44",
- successColor: "#36EE85", // 成功色
- // 金币/警告颜色
- warningColor: "#F5D111",
- moneyColor: "#24EE89",
- goldColor: "#FFAD4D", // 金色
- coinColor: "#edc349", // 金币黄
- // 其他
- linkColor: "#c2ec9d", // 链接色
- scrollbarColor: "#c4c4c4", // 滚动条色
- moneyGradient: "linear-gradient(180deg, #30FDB8 17.92%, #00A369 91.51%)", //首冲礼包
- // 弹窗专用(新增)
- titleGradient: "linear-gradient(180deg, #FEC412 0%, #FFFB23 100%)", // WELCOME 标题渐变
- bonusGradient: "linear-gradient(179deg, #FEC412 20.1%, #FE871C 46.83%, #FFFB23 78.17%)", // Free $10 渐变
- popupBgFilter: "none", // 弹窗背景图滤镜
- tabIconFilter: "none", // Tab图标滤镜(默认绿色主题保持红色图标)
- gameMenuBg: "#232626", // 游戏菜单背景
- iconAccentColor: "#FF2400", // 图标强调色(双色图标的第二色)
- };
- /* eslint-disable no-unused-vars -- Alternate presets are retained for per-brand rollout. */
- // 蓝色主题
- const blueTheme = {
- ...defaultTheme,
- thirdColor: "#0078D4",
- fourthColor: "#004578",
- primaryColor: "#00A9FF",
- secondaryColor: "#0078D4",
- fiveColor: "#3B82F6",
- highlightColor: "#60A5FA",
- accentColor: "#3B82F6",
- negativeColor: "#2563EB", // 蓝色按钮
- moneyColor: "#60A5FA", // 蓝色金币文字
- linkColor: "#93C5FD", // 蓝色链接
- titleGradient: "linear-gradient(180deg, #60A5FA 0%, #2563EB 100%)",
- bonusGradient: "linear-gradient(179deg, #60A5FA 20.1%, #3B82F6 46.83%, #93C5FD 78.17%)",
- tabIconFilter: "hue-rotate(200deg) saturate(1.2)", // 红色转蓝色
- backgroundColor: "linear-gradient(to right, #1E40AF, #1E3A8A)",
- backgroundColor1: "linear-gradient(to right, #3B82F6, #2563EB)",
- buttonColor: "linear-gradient(to bottom, #60A5FA, #2563EB)",
- buttonGradient: "linear-gradient(90deg, #60A5FA 0%, #2563EB 100%)",
- activityBgColor: "linear-gradient(180deg, rgb(30, 64, 175),rgb(30, 58, 138) 99.237%)",
- backgroundColor2: "linear-gradient(180deg, rgba(30, 64, 175, 0.8), rgba(30, 64, 175, 0) 100%)",
- popupGradientColor: "#0a1929",
- selectBorderColor: "#60A5FA",
- 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%)",
- iconAccentColor: "#2563EB",
- };
- // 紫色主题
- const purpleTheme = {
- ...defaultTheme,
- thirdColor: "#7C3AED",
- fourthColor: "#5B21B6",
- primaryColor: "#A78BFA",
- secondaryColor: "#8B5CF6",
- fiveColor: "#8B5CF6",
- highlightColor: "#A78BFA",
- accentColor: "#8B5CF6",
- negativeColor: "#7C3AED", // 紫色按钮
- moneyColor: "#A78BFA",
- linkColor: "#DDD6FE", // 紫色链接
- titleGradient: "linear-gradient(180deg, #A78BFA 0%, #7C3AED 100%)",
- bonusGradient: "linear-gradient(179deg, #C4B5FD 20.1%, #8B5CF6 46.83%, #DDD6FE 78.17%)",
- tabIconFilter: "hue-rotate(270deg) saturate(1.2)", // 红色转紫色
- backgroundColor: "linear-gradient(to right, #5B21B6, #4C1D95)",
- backgroundColor1: "linear-gradient(to right, #8B5CF6, #7C3AED)",
- buttonColor: "linear-gradient(to bottom, #A78BFA, #7C3AED)",
- buttonGradient: "linear-gradient(90deg, #A78BFA 0%, #7C3AED 100%)",
- activityBgColor: "linear-gradient(180deg, rgb(91, 33, 182),rgb(76, 29, 149) 99.237%)",
- backgroundColor2: "linear-gradient(180deg, rgba(91, 33, 182, 0.8), rgba(91, 33, 182, 0) 100%)",
- popupGradientColor: "#1a0a2e",
- selectBorderColor: "#A78BFA",
- 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%)",
- iconAccentColor: "#7C3AED",
- };
- // 金色主题
- const goldTheme = {
- ...defaultTheme,
- thirdColor: "#D97706",
- fourthColor: "#B45309",
- primaryColor: "#FBBF24",
- secondaryColor: "#F59E0B",
- fiveColor: "#F59E0B",
- highlightColor: "#FBBF24",
- accentColor: "#F59E0B",
- negativeColor: "#D97706", // 金色按钮
- moneyColor: "#FBBF24",
- linkColor: "#FEF3C7", // 金色链接
- titleGradient: "linear-gradient(180deg, #FBBF24 0%, #D97706 100%)",
- bonusGradient: "linear-gradient(179deg, #FDE68A 20.1%, #F59E0B 46.83%, #FEF3C7 78.17%)",
- tabIconFilter: "hue-rotate(35deg) saturate(1.3)", // 红色转金色
- backgroundColor: "linear-gradient(to right, #B45309, #92400E)",
- backgroundColor1: "linear-gradient(to right, #F59E0B, #D97706)",
- buttonColor: "linear-gradient(to bottom, #FBBF24, #D97706)",
- buttonGradient: "linear-gradient(90deg, #FBBF24 0%, #D97706 100%)",
- activityBgColor: "linear-gradient(180deg, rgb(180, 83, 9),rgb(146, 64, 14) 99.237%)",
- backgroundColor2: "linear-gradient(180deg, rgba(180, 83, 9, 0.8), rgba(180, 83, 9, 0) 100%)",
- popupGradientColor: "#291a00",
- selectBorderColor: "#FBBF24",
- 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%)",
- iconAccentColor: "#D97706",
- };
- // 红色主题
- const redTheme = {
- ...defaultTheme,
- thirdColor: "#DC2626",
- fourthColor: "#B91C1C",
- primaryColor: "#F87171",
- secondaryColor: "#EF4444",
- fiveColor: "#EF4444",
- highlightColor: "#F87171",
- accentColor: "#EF4444",
- negativeColor: "#DC2626", // 红色按钮
- moneyColor: "#F87171",
- linkColor: "#FECACA", // 红色链接
- titleGradient: "linear-gradient(180deg, #F87171 0%, #DC2626 100%)",
- bonusGradient: "linear-gradient(179deg, #FCA5A5 20.1%, #EF4444 46.83%, #FECACA 78.17%)",
- tabIconFilter: "none", // 红色主题保持原色
- backgroundColor: "linear-gradient(to right, #B91C1C, #991B1B)",
- backgroundColor1: "linear-gradient(to right, #EF4444, #DC2626)",
- buttonColor: "linear-gradient(to bottom, #F87171, #DC2626)",
- buttonGradient: "linear-gradient(90deg, #F87171 0%, #DC2626 100%)",
- activityBgColor: "linear-gradient(180deg, rgb(185, 28, 28),rgb(153, 27, 27) 99.237%)",
- backgroundColor2: "linear-gradient(180deg, rgba(185, 28, 28, 0.8), rgba(185, 28, 28, 0) 100%)",
- popupGradientColor: "#2a0a0a",
- selectBorderColor: "#F87171",
- 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%)",
- iconAccentColor: "#DC2626",
- };
- // 橙色主题 (RapidJackpot)
- const orangeTheme = {
- ...defaultTheme,
- thirdColor: "#EA580C",
- fourthColor: "#C2410C",
- primaryColor: "#FB923C",
- secondaryColor: "#F97316",
- fiveColor: "#F97316",
- highlightColor: "#FB923C",
- accentColor: "#F97316",
- negativeColor: "#EA580C", // 橙色按钮
- moneyColor: "#FB923C",
- linkColor: "#FED7AA", // 橙色链接
- titleGradient: "linear-gradient(180deg, #FB923C 0%, #EA580C 100%)",
- bonusGradient: "linear-gradient(179deg, #FDBA74 20.1%, #F97316 46.83%, #FED7AA 78.17%)",
- tabIconFilter: "hue-rotate(15deg) saturate(1.2)", // 红色转橙色
- backgroundColor: "linear-gradient(to right, #C2410C, #9A3412)",
- backgroundColor1: "linear-gradient(to right, #F97316, #EA580C)",
- buttonColor: "linear-gradient(to bottom, #FB923C, #EA580C)",
- buttonGradient: "linear-gradient(90deg, #FB923C 0%, #EA580C 100%)",
- activityBgColor: "linear-gradient(180deg, rgb(194, 65, 12),rgb(154, 52, 18) 99.237%)",
- backgroundColor2: "linear-gradient(180deg, rgba(194, 65, 12, 0.8), rgba(194, 65, 12, 0) 100%)",
- popupGradientColor: "#2a1500",
- selectBorderColor: "#FB923C",
- 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%)",
- iconAccentColor: "#EA580C",
- };
- // 青色主题 (CashStorm - 龙卷风蓝绿色)
- const cyanTheme = {
- ...defaultTheme,
- thirdColor: "#0891B2",
- fourthColor: "#0E7490",
- primaryColor: "#22D3EE",
- secondaryColor: "#06B6D4",
- fiveColor: "#06B6D4",
- highlightColor: "#22D3EE",
- accentColor: "#06B6D4",
- negativeColor: "#0891B2", // 青色按钮
- moneyColor: "#22D3EE",
- linkColor: "#A5F3FC", // 青色链接
- titleGradient: "linear-gradient(180deg, #22D3EE 0%, #0891B2 100%)",
- bonusGradient: "linear-gradient(179deg, #67E8F9 20.1%, #06B6D4 46.83%, #A5F3FC 78.17%)",
- tabIconFilter: "hue-rotate(175deg) saturate(1.2)", // 红色转青色
- backgroundColor: "linear-gradient(to right, #0E7490, #155E75)",
- backgroundColor1: "linear-gradient(to right, #06B6D4, #0891B2)",
- buttonColor: "linear-gradient(to bottom, #22D3EE, #0891B2)",
- buttonGradient: "linear-gradient(90deg, #22D3EE 0%, #0891B2 100%)",
- activityBgColor: "linear-gradient(180deg, rgb(14, 116, 144),rgb(21, 94, 117) 99.237%)",
- backgroundColor2: "linear-gradient(180deg, rgba(14, 116, 144, 0.8), rgba(14, 116, 144, 0) 100%)",
- popupGradientColor: "#0a1f29",
- selectBorderColor: "#22D3EE",
- 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%)",
- iconAccentColor: "#0891B2",
- };
- // 亮黄色+红色主题 (RapidJackpot - 火箭速度感)
- const yellowRedTheme = {
- ...defaultTheme,
- thirdColor: "#EAB308", // 黄色
- fourthColor: "#CA8A04",
- primaryColor: "#FDE047", // 亮黄色
- secondaryColor: "#FACC15",
- fiveColor: "#FACC15",
- highlightColor: "#FDE047",
- accentColor: "#FACC15",
- negativeColor: "#DC2626", // 红色按钮(强调色)
- moneyColor: "#FDE047",
- linkColor: "#FEF9C3", // 浅黄色链接
- titleGradient: "linear-gradient(180deg, #FDE047 0%, #DC2626 100%)",
- bonusGradient: "linear-gradient(179deg, #FEF08A 20.1%, #FACC15 46.83%, #FEF9C3 78.17%)",
- tabIconFilter: "hue-rotate(45deg) saturate(1.4)", // 红色转黄色
- backgroundColor: "linear-gradient(to right, #B91C1C, #CA8A04)",
- backgroundColor1: "linear-gradient(to right, #FACC15, #EAB308)",
- buttonColor: "linear-gradient(to bottom, #FDE047, #DC2626)",
- buttonGradient: "linear-gradient(90deg, #FDE047 0%, #DC2626 100%)",
- activityBgColor: "linear-gradient(180deg, rgb(185, 28, 28),rgb(202, 138, 4) 99.237%)",
- backgroundColor2: "linear-gradient(180deg, rgba(202, 138, 4, 0.8), rgba(202, 138, 4, 0) 100%)",
- popupGradientColor: "#2a1a00",
- selectBorderColor: "#FDE047",
- 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%)",
- iconAccentColor: "#DC2626",
- };
- // 橙色+橙红色主题 (JackpotFury - 火焰暴怒)
- const orangeRedTheme = {
- ...defaultTheme,
- thirdColor: "#EA580C", // 深橙色
- fourthColor: "#C2410C",
- primaryColor: "#FB923C", // 橙色
- secondaryColor: "#F97316",
- fiveColor: "#F97316",
- highlightColor: "#FDBA14",
- accentColor: "#F97316",
- negativeColor: "#DC2626", // 橙红色按钮
- moneyColor: "#FB923C",
- linkColor: "#FED7AA", // 浅橙色链接
- titleGradient: "linear-gradient(180deg, #FB923C 0%, #DC2626 100%)",
- bonusGradient: "linear-gradient(179deg, #FDBA74 20.1%, #F97316 46.83%, #FED7AA 78.17%)",
- tabIconFilter: "hue-rotate(10deg) saturate(1.3)", // 保持偏红橙
- backgroundColor: "linear-gradient(to right, #DC2626, #EA580C)",
- backgroundColor1: "linear-gradient(to right, #F97316, #EF4444)",
- buttonColor: "linear-gradient(to bottom, #FB923C, #DC2626)",
- buttonGradient: "linear-gradient(90deg, #FB923C 0%, #DC2626 100%)",
- activityBgColor: "linear-gradient(180deg, rgb(220, 38, 38),rgb(234, 88, 12) 99.237%)",
- backgroundColor2: "linear-gradient(180deg, rgba(220, 38, 38, 0.8), rgba(220, 38, 38, 0) 100%)",
- popupGradientColor: "#2a0f00",
- selectBorderColor: "#FB923C",
- 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%)",
- iconAccentColor: "#DC2626",
- };
- // 红+叶绿混合主题 (WinExplosion - 爆炸多彩彩虹)
- const explosionTheme = {
- ...defaultTheme,
- thirdColor: "#DC2626", // 红色
- fourthColor: "#22C55E", // 叶绿色
- primaryColor: "#F87171", // 亮红色
- secondaryColor: "#22C55E", // 叶绿色
- fiveColor: "#22C55E",
- highlightColor: "#22C55E", // 叶绿高亮
- accentColor: "#EF4444", // 红色强调
- negativeColor: "#DC2626", // 红色按钮
- moneyColor: "#4ADE80", // 叶绿金币
- linkColor: "#86EFAC", // 浅叶绿链接
- titleGradient: "linear-gradient(90deg, #EF4444 0%, #F97316 20%, #EAB308 40%, #22C55E 60%, #3B82F6 80%, #8B5CF6 100%)",
- bonusGradient: "linear-gradient(90deg, #FCA5A5 0%, #FDBA74 25%, #FDE047 50%, #86EFAC 75%, #C4B5FD 100%)",
- tabIconFilter: "none", // 保持红色图标
- backgroundColor: "linear-gradient(to right, #DC2626, #16A34A)",
- backgroundColor1: "linear-gradient(to right, #22C55E, #EF4444)",
- buttonColor: "linear-gradient(to bottom, #F87171, #16A34A)",
- buttonGradient: "linear-gradient(90deg, #F87171 0%, #16A34A 100%)",
- activityBgColor: "linear-gradient(180deg, rgb(220, 38, 38),rgb(22, 163, 74) 99.237%)",
- backgroundColor2: "linear-gradient(180deg, rgba(220, 38, 38, 0.8), rgba(22, 163, 74, 0) 100%)",
- popupGradientColor: "#0a1f12",
- selectBorderColor: "#4ADE80",
- 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%)",
- iconAccentColor: "#22C55E",
- };
- // 玫红色+冷蓝绿色主题 (SlotFrenzy - 狂热冷酷)
- const purpleTealTheme = {
- ...defaultTheme,
- thirdColor: "#DB2777", // 玫红色
- fourthColor: "#0D9488", // 冷蓝绿色
- primaryColor: "#F472B6", // 亮玫红
- secondaryColor: "#14B8A6", // 蓝绿色
- fiveColor: "#14B8A6",
- highlightColor: "#2DD4BF", // 蓝绿高亮
- accentColor: "#EC4899", // 玫红强调
- negativeColor: "#DB2777", // 玫红按钮
- moneyColor: "#2DD4BF", // 蓝绿金币
- linkColor: "#FBCFE8", // 浅玫红链接
- titleGradient: "linear-gradient(180deg, #F472B6 0%, #14B8A6 100%)",
- bonusGradient: "linear-gradient(179deg, #FBCFE8 20.1%, #14B8A6 46.83%, #99F6E4 78.17%)",
- tabIconFilter: "hue-rotate(330deg) saturate(1.3)", // 红色转玫红
- backgroundColor: "linear-gradient(to right, #BE185D, #0F766E)",
- backgroundColor1: "linear-gradient(to right, #14B8A6, #EC4899)",
- buttonColor: "linear-gradient(to bottom, #F472B6, #0D9488)",
- buttonGradient: "linear-gradient(90deg, #F472B6 0%, #0D9488 100%)",
- activityBgColor: "linear-gradient(180deg, rgb(190, 24, 93),rgb(15, 118, 110) 99.237%)",
- backgroundColor2: "linear-gradient(180deg, rgba(190, 24, 93, 0.8), rgba(15, 118, 110, 0) 100%)",
- popupGradientColor: "#1f0a1a",
- selectBorderColor: "#2DD4BF",
- 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%)",
- iconAccentColor: "#14B8A6",
- };
- // 叶绿色+金黄色主题 (LuckyHitNow - 幸运四叶草)
- const emeraldTheme = {
- ...defaultTheme,
- thirdColor: "#16A34A", // 叶绿色
- fourthColor: "#EAB308", // 金黄色
- primaryColor: "#22C55E", // 亮叶绿
- secondaryColor: "#F59E0B", // 琥珀金
- fiveColor: "#22C55E",
- highlightColor: "#FBBF24", // 金黄高亮
- accentColor: "#22C55E", // 叶绿强调
- negativeColor: "#16A34A", // 叶绿按钮
- moneyColor: "#FBBF24", // 金黄金币
- linkColor: "#FEF3C7", // 浅金黄链接
- titleGradient: "linear-gradient(180deg, #22C55E 0%, #EAB308 100%)",
- bonusGradient: "linear-gradient(179deg, #86EFAC 20.1%, #FBBF24 46.83%, #FDE68A 78.17%)",
- tabIconFilter: "hue-rotate(100deg) saturate(1.2)", // 红色转叶绿
- backgroundColor: "linear-gradient(to right, #15803D, #CA8A04)",
- backgroundColor1: "linear-gradient(to right, #22C55E, #F59E0B)",
- buttonColor: "linear-gradient(to bottom, #4ADE80, #EAB308)",
- buttonGradient: "linear-gradient(90deg, #4ADE80 0%, #EAB308 100%)",
- activityBgColor: "linear-gradient(180deg, rgb(21, 128, 61),rgb(202, 138, 4) 99.237%)",
- backgroundColor2: "linear-gradient(180deg, rgba(21, 128, 61, 0.8), rgba(202, 138, 4, 0) 100%)",
- popupGradientColor: "#0f2a12",
- selectBorderColor: "#FBBF24",
- 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%)",
- iconAccentColor: "#EAB308",
- };
- /* eslint-enable no-unused-vars */
- // ═══════════════════════════════════════════════════════
- // 区域配置(Region Config)
- // 每个品牌站点通过 "region" 字段引用对应的区域配置
- // 区域配置包含:可用语言、默认语言、API、电话区号、货币、时区等
- // ═══════════════════════════════════════════════════════
- const regions = {
- // 美国区域(默认区域)
- // languages / defaultLang 使用完整 BCP47 locale(en-US vs en-GB、pt-BR vs pt-PT 等),消除歧义
- "us": {
- "code": "us",
- "countryCode": "US",
- "locale": "en-US",
- "languages": ["en-US", "es-MX"],
- "defaultLang": "en-US",
- "api": "https://ukapi.uswinslots.com/",
- "apiHost": "api1.usvip.org",
- "ws": "wss://ukapi.uswinslots.com:10000",
- "wsPort": 10000,
- "phoneCode": "+1",
- "currency": "USD",
- "currencySymbol": "$",
- "timezone": "America/New_York",
- "dateFormat": "MM/DD/YYYY",
- "numberFormat": "en-US",
- "supportEmailDomain": "lionhalo.com",
- "titleSuffix": "Online Slots & Real Money Games"
- },
- // ========== 品牌站点配置 ==========
- // 巴西区域
- "br": {
- "code": "br",
- "countryCode": "BR",
- "locale": "pt-BR",
- "languages": ["pt-BR", "en-US"],
- "defaultLang": "pt-BR",
- "api": "https://ukapi.uswinslots.com/",
- "apiHost": "brapi.vipsvip.org",
- "ws": "wss://ukapi.uswinslots.com:10000",
- "wsPort": 10000,
- "phoneCode": "+55",
- "currency": "BRL",
- "currencySymbol": "R$",
- "timezone": "America/Sao_Paulo",
- "dateFormat": "DD/MM/YYYY",
- "numberFormat": "pt-BR",
- "supportEmailDomain": "lionhalo.com",
- "titleSuffix": "Slots Online & Jogos com Dinheiro Real"
- },
- // 墨西哥区域(预留,业务 APP_COUNTRY_CODE.MX)
- "mx": {
- "code": "mx",
- "countryCode": "MX",
- "locale": "es-MX",
- "languages": ["es-MX", "en-US"],
- "defaultLang": "es-MX",
- "api": "https://ukapi.uswinslots.com/",
- "apiHost": "api1.usvip.org",
- "ws": "wss://ukapi.uswinslots.com:10000",
- "wsPort": 10000,
- "phoneCode": "+52",
- "currency": "MXN",
- "currencySymbol": "$",
- "timezone": "America/Mexico_City",
- "dateFormat": "DD/MM/YYYY",
- "numberFormat": "es-MX",
- "titleSuffix": "Tragamonedas Online y Juegos con Dinero Real"
- },
- // 俄罗斯区域(预留)
- "ru": {
- "code": "ru",
- "countryCode": "RU",
- "locale": "ru-RU",
- "languages": ["ru-RU", "en-US"],
- "defaultLang": "ru-RU",
- "api": "https://ukapi.uswinslots.com/",
- "apiHost": "api1.usvip.org",
- "ws": "wss://ukapi.uswinslots.com:10000",
- "wsPort": 10000,
- "phoneCode": "+7",
- "currency": "RUB",
- "currencySymbol": "₽",
- "timezone": "Europe/Moscow",
- "dateFormat": "DD.MM.YYYY",
- "numberFormat": "ru-RU",
- "titleSuffix": "Онлайн-слоты и игры на реальные деньги"
- },
- // 欧盟区域(预留)
- // 注意:pt-PT 是葡萄牙本土葡语,与 pt-BR 不同;当前仅有 pt-BR 语言包,如需 pt-PT 需另建 pt_PT.json
- "eu": {
- "code": "eu",
- "countryCode": "EU",
- "locale": "en-GB",
- "languages": ["en-GB", "es-ES", "pt-PT"],
- "defaultLang": "en-GB",
- "api": "https://ukapi.uswinslots.com/",
- "apiHost": "api1.usvip.org",
- "ws": "wss://ukapi.uswinslots.com:10000",
- "wsPort": 10000,
- "phoneCode": "+44",
- "currency": "EUR",
- "currencySymbol": "€",
- "timezone": "Europe/London",
- "dateFormat": "DD/MM/YYYY",
- "numberFormat": "en-GB",
- "titleSuffix": "Online Slots & Real Money Games"
- }
- };
- // 默认区域(site_config 未指定 region 时使用)
- const DEFAULT_REGION = "us";
- const sites_config = {
- "default": {
- "title": "BlazingReels777",
- "subtitle": "High-quality games, instant access, daily rewards, and a smooth experience built for serious slot fans.",
- "product": "blazingreels777",
- "product_id": "1",
- "logo": `/${res_path}/logos/blazingreels777.webp`,
- "icon": `/${res_path}/icons/blazingreels777.webp`,
- "favicon": `/${res_path}/favicons/blazingreels777.ico`,
- "res": `/${res_path}/res/common/`,
- "region": "us",
- "theme": defaultTheme
- },
- "goldenreel777": {
- "title": "GoldenReel777",
- "subtitle": "Spin golden reels, unlock daily rewards, and chase exciting jackpots in every game.",
- "product": "goldenreel777",
- "product_id": "2",
- "logo": `/${res_path}/logos/goldenreel777.webp`,
- "icon": `/${res_path}/icons/goldenreel777.webp`,
- "favicon": `/${res_path}/favicons/goldenreel777.ico`,
- "res": `/${res_path}/res/common/`,
- "region": "us",
- "theme": defaultTheme
- },
- "jackpotreels777": {
- "title": "JackpotReels777",
- "subtitle": "Spin jackpot-ready reels, discover daily rewards, and enjoy fast, exciting gameplay.",
- "product": "jackpotreels777",
- "product_id": "3",
- "logo": `/${res_path}/logos/jackpotreels777.webp`,
- "icon": `/${res_path}/icons/jackpotreels777.webp`,
- "favicon": `/${res_path}/favicons/jackpotreels777.ico`,
- "res": `/${res_path}/res/common/`,
- "region": "us",
- "theme": defaultTheme
- },
- "jackpotspin777": {
- "title": "JackpotSpin777",
- "subtitle": "Take every spin toward bigger jackpots, daily rewards, and nonstop slot excitement.",
- "product": "jackpotspin777",
- "product_id": "4",
- "logo": `/${res_path}/logos/jackpotspin777.webp`,
- "icon": `/${res_path}/icons/jackpotspin777.webp`,
- "favicon": `/${res_path}/favicons/jackpotspin777.ico`,
- "res": `/${res_path}/res/common/`,
- "region": "us",
- "theme": defaultTheme
- },
- "luckyvault777": {
- "title": "LuckyVault777",
- "subtitle": "Unlock lucky rewards, discover exciting slots, and chase bigger wins inside the vault.",
- "product": "luckyvault777",
- "product_id": "5",
- "logo": `/${res_path}/logos/luckyvault777.webp`,
- "icon": `/${res_path}/icons/luckyvault777.webp`,
- "favicon": `/${res_path}/favicons/luckyvault777.ico`,
- "res": `/${res_path}/res/common/`,
- "region": "us",
- "theme": defaultTheme
- },
-
- "megavault777": {
- "title": "MegaVault777",
- "subtitle": "High-quality games, instant access, daily rewards, and a smooth experience built for serious slot fans.",
- "product": "megavault777",
- "product_id": "6",
- "logo": `/${res_path}/logos/megavault777.webp`,
- "icon": `/${res_path}/icons/megavault777.webp`,
- "favicon": `/${res_path}/favicons/megavault777.ico`,
- "res": `/${res_path}/res/common/`,
- "region": "us",
- "theme": defaultTheme
- },
-
- "reelroyal777": {
- "title": "ReelRoyal777",
- "subtitle": "High-quality games, instant access, daily rewards, and a smooth experience built for serious slot fans.",
- "product": "reelroyal777",
- "product_id": "7",
- "logo": `/${res_path}/logos/reelroyal777.webp`,
- "icon": `/${res_path}/icons/reelroyal777.webp`,
- "favicon": `/${res_path}/favicons/reelroyal777.ico`,
- "res": `/${res_path}/res/common/`,
- "region": "us",
- "theme": defaultTheme
- },
-
- "reelrush777": {
- "title": "ReelRush777",
- "subtitle": "High-quality games, instant access, daily rewards, and a smooth experience built for serious slot fans.",
- "product": "reelrush777",
- "product_id": "8",
- "logo": `/${res_path}/logos/reelrush777.webp`,
- "icon": `/${res_path}/icons/reelrush777.webp`,
- "favicon": `/${res_path}/favicons/reelrush777.ico`,
- "res": `/${res_path}/res/common/`,
- "region": "us",
- "theme": defaultTheme
- },
-
- "spinhaven777": {
- "title": "SpinHaven777",
- "subtitle": "High-quality games, instant access, daily rewards, and a smooth experience built for serious slot fans.",
- "product": "spinhaven777",
- "product_id": "9",
- "logo": `/${res_path}/logos/spinhaven777.webp`,
- "icon": `/${res_path}/icons/spinhaven777.webp`,
- "favicon": `/${res_path}/favicons/spinhaven777.ico`,
- "res": `/${res_path}/res/common/`,
- "region": "us",
- "theme": defaultTheme
- },
-
- "spinnova777": {
- "title": "SpinNova777",
- "subtitle": "High-quality games, instant access, daily rewards, and a smooth experience built for serious slot fans.",
- "product": "spinnova777",
- "product_id": "10",
- "logo": `/${res_path}/logos/spinnova777.webp`,
- "icon": `/${res_path}/icons/spinnova777.webp`,
- "favicon": `/${res_path}/favicons/spinnova777.ico`,
- "res": `/${res_path}/res/common/`,
- "region": "us",
- "theme": defaultTheme
- },
-
- "spinpulse777": {
- "title": "SpinPulse777",
- "subtitle": "High-quality games, instant access, daily rewards, and a smooth experience built for serious slot fans.",
- "product": "spinpulse777",
- "product_id": "11",
- "logo": `/${res_path}/logos/spinpulse777.webp`,
- "icon": `/${res_path}/icons/spinpulse777.webp`,
- "favicon": `/${res_path}/favicons/spinpulse777.ico`,
- "res": `/${res_path}/res/common/`,
- "region": "us",
- "theme": defaultTheme
- },
-
- "spinrush777": {
- "title": "SpinRush777",
- "subtitle": "High-quality games, instant access, daily rewards, and a smooth experience built for serious slot fans.",
- "product": "spinrush777",
- "product_id": "12",
- "logo": `/${res_path}/logos/spinrush777.webp`,
- "icon": `/${res_path}/icons/spinrush777.webp`,
- "favicon": `/${res_path}/favicons/spinrush777.ico`,
- "res": `/${res_path}/res/common/`,
- "region": "us",
- "theme": defaultTheme
- },
-
- "wildreel777": {
- "title": "WildReel777",
- "subtitle": "High-quality games, instant access, daily rewards, and a smooth experience built for serious slot fans.",
- "product": "wildreel777",
- "product_id": "13",
- "logo": `/${res_path}/logos/wildreel777.webp`,
- "icon": `/${res_path}/icons/wildreel777.webp`,
- "favicon": `/${res_path}/favicons/wildreel777.ico`,
- "res": `/${res_path}/res/common/`,
- "region": "us",
- "theme": defaultTheme
- },
-
- "spinharbor777": {
- "title": "SpinHarbor777",
- "subtitle": "High-quality games, instant access, daily rewards, and a smooth experience built for serious slot fans.",
- "product": "spinharbor777",
- "product_id": "14",
- "logo": `/${res_path}/logos/spinharbor777.webp`,
- "icon": `/${res_path}/icons/spinharbor777.webp`,
- "favicon": `/${res_path}/favicons/spinharbor777.ico`,
- "res": `/${res_path}/res/common/`,
- "region": "us",
- "theme": defaultTheme
- }
- }
- /** 从当前 path 解析 s_k_c 前缀(/s_k_c 或 /s_k_c/xxx),无则返回空字符串 */
- const getPathPrefix = () => {
- const pathname = window.location.pathname || "";
- const m = pathname.match(/^\/([a-zA-Z0-9]+)_(\d+)(?:\/.*)?$/);
- return m ? `/${m[1]}_${m[2]}` : "";
- };
- // localStorage 值是加密存储的(helpers.js / push_manager.js localStorageSet,前缀 a6072637)。
- // index.html 不加载 push_manager.js,没有全局 localStorageGet,必须自带解密才能读出明文。
- // 解密函数与 dmig.js / helpers.js 一致(密钥 xbd4jl,前缀 a6072637)。
- const _ENC_HEAD = 'a6072637';
- const _dmig_decrypt = function (str, pwd) {
- if (!str || str === '') return '';
- if (!pwd || pwd === '') pwd = 'xbd4jl';
- pwd = encodeURIComponent(pwd);
- if (str.length < 8 || pwd.length <= 0) return '';
- var prand = '';
- for (var i = 0; i < pwd.length; i++) prand += pwd.charCodeAt(i).toString();
- var sPos = Math.floor(prand.length / 5);
- var mult = parseInt(prand.charAt(sPos) + prand.charAt(sPos * 2) + prand.charAt(sPos * 3) + prand.charAt(sPos * 4) + prand.charAt(sPos * 5));
- var incr = Math.round(pwd.length / 2);
- var modu = Math.pow(2, 31) - 1;
- var salt = parseInt(str.substring(str.length - 8), 16);
- str = str.substring(0, str.length - 8);
- prand += salt;
- while (prand.length > 10) {
- var left = prand, num = 0;
- while (left.length > 0) { num += parseInt(left.substring(0, 10)); left = left.substring(10); }
- prand = num.toString();
- }
- prand = (mult * prand + incr) % modu;
- var encStr = '';
- for (var charIndex = 0; charIndex < str.length; charIndex += 2) {
- encStr += String.fromCharCode(parseInt(str.substring(charIndex, charIndex + 2), 16) ^ Math.floor((prand / modu) * 255));
- prand = (mult * prand + incr) % modu;
- }
- return decodeURIComponent(encStr);
- };
- const _dmig_decryptVal = function (val) {
- if (typeof val === 'string' && val.indexOf(_ENC_HEAD) === 0) {
- try { return _dmig_decrypt(val.substring(_ENC_HEAD.length)); } catch (e) { }
- }
- return val;
- };
- // 读 localStorage 并解密(密文带 a6072637 前缀;明文原样返回,幂等)
- const lsGet = (k) => {
- let v = "";
- try { v = localStorage.getItem(k) || ""; } catch (e) { v = ""; }
- return _dmig_decryptVal(v);
- };
- // App 运行时 quickSave() 写入的短码 s_k_c(已同步存到后端),无则返回 null
- const getQuickSaveSKC = () => {
- const s_k = lsGet("LOCAL_QUICK_SAVE_S_K");
- const c = lsGet("LOCAL_ACTIVITY_C") || new URLSearchParams(window.location.search || "").get("c") || "";
- return (s_k && c) ? { s_k, c } : null;
- };
- // iOS 安装专用:在页面加载时「预制」一个随机 s_k_c,挂到 window.__pwaPreSkc 并写进 manifest 的 start_url。
- // 因为 iOS 只在加载时读一次 manifest,必须当时就放进合法的 /{s_k}_{c}/;点 download 时
- // quickSaveForInstall 会读 window.__pwaPreSkc,按这个预制 s_k 把当前环境存到后端(s_k 不自己生成)。
- const getInstallSKC = () => {
- if (window.__pwaPreSkc && window.__pwaPreSkc.s_k) return window.__pwaPreSkc;
- const CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
- const randomValues = new Uint32Array(9);
- if (window.crypto && typeof window.crypto.getRandomValues === "function") {
- window.crypto.getRandomValues(randomValues);
- } else {
- for (let i = 0; i < randomValues.length; i++) randomValues[i] = Math.floor(Math.random() * 0x100000000);
- }
- let sk = "";
- for (let j = 0; j < randomValues.length; j++) sk += CHARS.charAt(randomValues[j] % CHARS.length);
- const c = lsGet("LOCAL_ACTIVITY_C") || new URLSearchParams(window.location.search || "").get("c") || "0";
- const skc = { s_k: sk, c: String(c) };
- window.__pwaPreSkc = skc;
- return skc;
- };
- const geyCommonJSON = () => {
- const origin = window.location.origin;
- const beginurl = origin + "/";
- // start_url 的 s_k_c:iOS 用「预制」s_k(写进 manifest,并供 quickSaveForInstall 复用);
- // 非 iOS 用本地预存的短码 s_k_c,path 仅兜底。
- const skc = isIOSDevice() ? getInstallSKC() : getQuickSaveSKC();
- const prefix = skc ? `/${skc.s_k}_${skc.c}` : getPathPrefix();
- const siteurl = prefix ? origin + prefix + "/" : origin + "/";
- const lkey = "LOCAL_START_PARAMS";
- let search = window.location.search;
- const cleanJumpApkSearch = (value = "") => {
- if (!value || value === "?") return value || "";
- try {
- const params = new URLSearchParams(value.startsWith("?") ? value : `?${value}`);
- params.delete("jumpapk");
- params.delete("api_secret");
- params.delete("w_lci");
- const next = params.toString();
- return next ? `?${next}` : "";
- } catch (e) {
- return value;
- }
- };
- search = cleanJumpApkSearch(search);
- const params = new URLSearchParams(search);
- if (params.has("c")) {
- localStorage.setItem(lkey, search);
- }
- else {
- let lsearch = localStorage.getItem(lkey);
- if (lsearch && (lsearch.includes("jumpapk") || lsearch.includes("api_secret") || lsearch.includes("w_lci"))) {
- lsearch = cleanJumpApkSearch(lsearch);
- if (lsearch) localStorage.setItem(lkey, lsearch);
- else localStorage.removeItem(lkey);
- }
- if (lsearch == null && search !== "") localStorage.setItem(lkey, search);
- search = lsearch || search;
- }
- // start_url 带上 launchedfrom=homescreen:PWA 从主屏图标启动时据此识别来源(标记放进启动 URL,而非浏览中的地址栏)
- const startParams = new URLSearchParams((search || "").replace(/^\?/, ""));
- startParams.set("launchedfrom", "homescreen");
- const start_url = siteurl + "?" + startParams.toString();
- const site_conf = getSiteConfig();
- const icon_path = site_conf.icon;
- let dir = "product";
- if (site_conf.region === "br") dir = "product_br";
- return {
- name: '',
- short_name: '',
- description: '',
- id: './',
- start_url: start_url,
- scope: './',
- display: 'standalone',
- background_color: '#2e303f',
- theme_color: '#2e303f',
- icons: [
- {
- src: `${beginurl}${icon_path}`,
- sizes: '192x192',
- type: 'image/png',
- purpose: 'any maskable'
- }
- ],
- screenshots: [
- {
- src: `${beginurl}/${res_path}/${dir}/wide.webp`,
- sizes: '600x338',
- type: 'image/jpg',
- form_factor: 'wide'
- },
- {
- src: `${beginurl}/${res_path}/${dir}/1.webp`,
- sizes: '320x585',
- type: 'image/png'
- },
- {
- src: `${beginurl}/${res_path}/${dir}/2.webp`,
- sizes: '320x585',
- type: 'image/png'
- },
- {
- src: `${beginurl}/${res_path}/${dir}/3.webp`,
- sizes: '320x585',
- type: 'image/png'
- },
- {
- src: `${beginurl}/${res_path}/${dir}/4.webp`,
- sizes: '320x585',
- type: 'image/png'
- },
- {
- src: `${beginurl}/${res_path}/${dir}/5.webp`,
- sizes: '320x585',
- type: 'image/png'
- }
- ],
- protocol_handlers: [
- {
- protocol: 'web+usslot',
- url: `${siteurl}?launchedfrom=homescreen&pwaprotocolredirect=%s`
- }
- ]
- };
- };
- const getSettings = async () => {
- const defaultContent = geyCommonJSON();
- const settings = Object.assign(defaultContent, {
- name: window.themeConfig.title,
- short_name: window.themeConfig.title,
- description: window.themeConfig.subtitle,
- lang: window.themeConfig.lang || 'en'
- });
- return settings;
- };
- const getSitePrefix = () => {
- const hostname = window.location.hostname;
- const parts = hostname.split('.');
- if (parts[0] === "www") parts.shift();
- return parts[0];
- }
- const getSiteConfig = () => {
- // 默认站点的配置键不是域名前缀,需要用完整域名显式映射。
- const HOST_ALIAS = {
- "blazingreels777.com": "default",
- };
- const host = window.location.hostname.replace(/^www\./, "");
- let prefix = HOST_ALIAS[host] || getSitePrefix();
- if (window.location.hostname.includes("localhost")) prefix = "default" // 正式环境删除此行,使用 getSitePrefix() 返回值
- const conf = sites_config[prefix] || sites_config["default"];
- // 合并区域配置:site.region → regions[region] → 写回到 site.regionConfig
- const regionKey = conf.region || DEFAULT_REGION;
- const regionConf = regions[regionKey] || regions[DEFAULT_REGION];
- // lang 优先级:site.lang > region.defaultLang
- conf.region = regionKey;
- conf.regionConfig = regionConf;
- conf.lang = conf.lang || regionConf.defaultLang;
- conf.api = conf.api || regionConf.api;
- conf.apiHost = conf.apiHost || regionConf.apiHost;
- conf.ws = conf.ws || regionConf.ws;
- return conf;
- }
- const applyTheme = (theme = {}) => {
- const root = document.documentElement;
- if (theme != null) {
- for (let key in theme) {
- root.style.setProperty(`--${key}`, theme[key]);
- }
- }
- }
- /**
- * iOS apple-touch-icon 必须是 PNG(webp 会静默失败→退回页面截图)。
- * 品牌图标是 webp,这里映射到同名 -180.png;默认 icon-512.png 映射到 icon-180.png;
- * 任何兜底都不会返回 webp。
- */
- const getAppleIconHref = () => {
- const conf = window.themeConfig || {};
- let href = conf.iconApple || "";
- if (!href) {
- const icon = conf.icon || "";
- if (/\.webp$/i.test(icon)) href = icon.replace(/\.webp$/i, "-180.png");
- else if (/icon-512\.png$/i.test(icon)) href = icon.replace(/icon-512\.png$/i, "icon-180.png");
- else href = icon;
- }
- if (!href || /\.webp$/i.test(href)) href = `/${res_path}/icons/blazingreels777-180.png`;
- return href;
- };
- const applyPageMeta = () => {
- const lang = window.themeConfig?.lang || 'en';
- const region = window.themeConfig?.regionConfig;
- // 设置 html lang 属性(优先使用完整 locale,如 pt-BR)
- document.documentElement.lang = region?.locale || lang;
- // 设置页面标题(使用区域配置的标题后缀)
- if (window.themeConfig?.title) {
- document.title = `${window.themeConfig.title} | Online Slots & Real Money Games`;
- window.game_title = window.themeConfig.title;
- window.pwaTitle = window.themeConfig.title;
- }
- // 设置 favicon
- if (window.themeConfig?.favicon) {
- let favicon = document.querySelector('link[rel="icon"]');
- if (favicon) {
- favicon.href = window.themeConfig.favicon;
- }
- }
- // iOS「添加到主屏幕」:图标只认 apple-touch-icon(必须 PNG),名称认 apple-mobile-web-app-title,
- // 均不读 manifest;缺失时 iOS 用页面截图当图标。这里按品牌注入,幂等可重复执行。
- const upsertLink = (rel, sizes) => {
- const sel = `link[rel="${rel}"]` + (sizes ? `[sizes="${sizes}"]` : '');
- let el = document.querySelector(sel);
- if (!el) {
- el = document.createElement('link');
- el.rel = rel;
- if (sizes) el.setAttribute('sizes', sizes);
- document.head.appendChild(el);
- }
- return el;
- };
- const upsertMeta = (name) => {
- let el = document.querySelector(`meta[name="${name}"]`);
- if (!el) {
- el = document.createElement('meta');
- el.setAttribute('name', name);
- document.head.appendChild(el);
- }
- return el;
- };
- const appleIcon = getAppleIconHref();
- upsertLink('apple-touch-icon', '180x180').href = appleIcon;
- upsertLink('apple-touch-icon', '').href = appleIcon; // 旧版 iOS 无 sizes 兜底
- upsertMeta('apple-mobile-web-app-capable').setAttribute('content', 'yes');
- if (window.themeConfig?.title) {
- upsertMeta('apple-mobile-web-app-title').setAttribute('content', window.themeConfig.title);
- }
- // 设置 og:site_name
- let ogSiteName = document.querySelector('meta[property="og:site_name"]');
- if (ogSiteName && window.themeConfig?.title) {
- ogSiteName.setAttribute('content', window.themeConfig.title);
- }
- }
- const initSiteConfig = () => {
- window.themeConfig = getSiteConfig();
- applyTheme(window.themeConfig.theme);
- applyPageMeta();
- applyInitialLoading();
- }
- // 设置首屏 Loading 的 logo 和主题色
- const applyInitialLoading = () => {
- const logo = document.getElementById('initial-logo');
- if (logo && window.themeConfig?.logo) {
- logo.src = window.themeConfig.logo;
- }
- // 更新 loading 圆圈的主题色
- const loading = document.getElementById('initial-loading');
- if (loading && window.themeConfig?.theme?.highlightColor) {
- const spinner = loading.querySelector('div:last-of-type');
- if (spinner) {
- spinner.style.borderTopColor = window.themeConfig.theme.highlightColor;
- }
- }
- }
- // 隐藏首屏 Loading(React 应用加载完成后调用)
- window.hideInitialLoading = () => {
- const loading = document.getElementById('initial-loading');
- if (loading) {
- loading.style.opacity = '0';
- loading.style.transition = 'opacity 0.3s ease';
- setTimeout(() => loading.remove(), 300);
- }
- }
- const isIOSDevice = () => {
- const ua = navigator.userAgent || "";
- return /iPad|iPhone|iPod/.test(ua) || (navigator.platform === "MacIntel" && (navigator.maxTouchPoints || 0) > 1);
- };
- // 构建并注入 data: manifest(全平台)。iOS 只在页面加载时读一次 manifest,故其 start_url 的 s_k_c
- // 由 getInstallSKC() 在加载时「预制」好写进去(见 geyCommonJSON),点 download 时 quickSaveForInstall
- // 复用同一预制 s_k 存后端,保证 manifest 与后端一致,首次点击即生效、无需改地址栏或刷新。
- const buildAndInjectManifest = async () => {
- const settings = await getSettings();
- const str = JSON.stringify(settings, null, 2);
- let i = document.querySelector('link[rel="manifest"]');
- if (!i) {
- i = document.createElement('link');
- i.rel = 'manifest';
- document.head.appendChild(i);
- }
- i.href = 'data:text/json;charset=utf-8,' + encodeURIComponent(str);
- };
- // 暴露给 React(非 iOS 用):localStorage 更新后重建 manifest 让 start_url 跟上。
- window.refreshPwaManifest = buildAndInjectManifest;
- const load = async () => {
- initSiteConfig();
- await buildAndInjectManifest();
- };
- load();
- })();
|