Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6c7e7c8318 | ||
|
|
28ccc0e964 | ||
|
|
2022184583 | ||
|
|
f236c58935 | ||
|
|
7446b045a3 |
No files matched your search
@@ -1,10 +1,32 @@
|
||||
# Fuc:新版 FUC 用户主题适配
|
||||
|
||||
当前用户主题更新为 **0.12.0**:接入独立VIP模块,沿用原版会员卡片,显示累计、等级和升级差额;42项Node测试、原素材字节及原右侧IAB显示验收通过。VIP插件仅FUC两个本地测试实例开启,其他默认关闭;原生接口、并发、金额和恢复唯一见[VIP模块](FUC_VIP.md)。仅本地,无提交推送或上线;下文0.11.0为此前四季验收记录。
|
||||
当前版本 **0.12.4**,已沿Git发布到独立FUC-XB测试站。IAB桌面/手机页面、动态交互、钱包下单/VIP升级/取消退款及XB原版后台验收已完成;旧FUC、DPL/HN未切换。真实支付、邮件、节点/客户端联网仍后置,不能据此宣布正式营业。完整范围及回执见[FUC-XB测试站](FUC_XB_STAGING.md#2026-11-04-最终验收隔离测试范围通过)。
|
||||
|
||||
当前本地版本 **0.11.0**,四季配色及此前真实XB接口对接的验收范围见下文;本轮尚未提交、推送或生产部署。0.6.1已于2026-10-31随XB统一功能提交1ded402发布为可选主题,DPL/HN仍保持Stellar/EZ。0.7.0主题适配只修改Fuc独立主题及专属验收工具,未要求XB核心兼容改造;之后用户单独批准的找回密码会话安全修复见下文,管理员不变。FUC业务后端/数据不在范围,部署与恢复见[共用后端](UNIFIED_BACKEND.md)。
|
||||
## 0.12.4 隔离线上页面验收与修复(2026-11-04)
|
||||
|
||||
FUC现行业务用户迁移是独立事项,2026-11-03仅完成只读采集及离线研究,未导入XB。预购/自动续订等风险与后续关卡见[用户迁移研究](FUC_MIGRATION_STUDY.md)。
|
||||
本轮只调整Fuc主题及其专属测试;测试站独立vhost/MIME和额外门禁另见部署文档,未新增XB核心兼容改造,管理员仍用锁定原版资源。
|
||||
|
||||
- 0.12.2修正余额全额付款的商品金额展示,按XB原生历史价值口径包含钱包和折抵;分别显示钱包、旧套餐折抵、在线本金,已取消钱包标注已退回。结算仍由XB原订单决定。
|
||||
- 0.12.3修复模式切换重挂LINK导致Chromium卸载CSS、页面闪白/失去样式;公共样式留在原位,新模式样式有序加载成功后才提交页面。亮暗与公开/用户切换实际回归。
|
||||
- 0.12.4下单确认的最终金额改为下单后确认,避免把标价误称VIP后实际支付;文档分类mt-n1只去掉负边距,符合已批准的可用布局例外。原模板/CSS文件不修改。
|
||||
- 46项Node测试、19份原CSS/26模板/Pace及原UI库字节完整性、ZIP源码/CRC/ESM闭包通过。1280×720及390×844实际检查用户所有菜单、公开/认证/订单/内容详情、手机导航;Pace请求中3px进度、紫绿亮暗保存、绿色火箭290°/tada、弹窗取消/重入及FAQ展开/折叠/搜索通过。未宣称与旧FUC生产实时数据逐像素截图比对。
|
||||
- 原生钱包100元开通后VIP升9.2折;下一笔续费原生92元,取消返92,VIP累计/到期不变。测试夹具及会话精确清理,迁移用户资金全量复核无意外差异。
|
||||
|
||||
运行提交`28ccc0e964a9ff9ee917a15f99c6f0140174e7cf`。交付包`codex/output/fuc-theme/Fuc-0.12.4.zip`,SHA256 `1695853b5c3bb54aef5c783cf4f01d436fdf525cbc6791401c81f529ae69be21`;0.12.1配色恢复及旧版本记录保留如下。0.12.0本地VIP、0.11.0四季为历史状态;用户后来要求原紫/绿,不能按旧章节重新生成四季。
|
||||
|
||||
## 0.12.1 恢复原版配色(2026-11-04)
|
||||
|
||||
用户明确要求撤回四季主题及首页跟随变色。该轮本地主题为**0.12.1**,只保留原版亮色紫/绿、暗色紫及亮/暗/系统模式;公开首页恢复原版固定紫色,不受用户区配色影响。0.11.0四季方案为历史,不能按下文旧指令重新生成季节扩展。
|
||||
|
||||
- 保留当前0.12.0的VIP、客服、接口与既有菜单明暗归一修正,未以旧主题整目录覆盖。只移除季节选项/生成器/seasonal.css及加载路径,流量图恢复原来的紫/橙/红色。原CSS/素材未改。
|
||||
- 浏览器旧spring偏好归回原绿色cyan,summer/autumn/winter归回默认紫色;原purple/cyan保持。启动清理旧data-fuc-season/data-fuc-palette和--season-*覆盖,保留明暗及其他偏好。设置恢复原模板的“亮色主题选择”和“暗色主题选择”,保留序列化选中项修正。
|
||||
- 主题版本及自身ESM/模板/样式查询版本升为0.12.1,防止缓存混用。原0.12.0完整相关文件备份于codex/output/fuc-theme/palette-revert-20261104/before/;不回退其他聊天修改或XB核心。
|
||||
- 41项现有核心/DOM/交互/应用及旧偏好恢复测试通过;19份原CSS、26份惰性模板、Pace及原UI库字节完整性通过。
|
||||
- 内置浏览器在xb.loc隔离合成账号实际保存紫/绿及亮/暗,读回原style-purple/style-cyan与menu-light/menu-dark;设置仅紫/绿两项,原暗色紫选项保留。选择绿色后首页背景仍rgb(60,34,153)、blend normal;无季节CSS链接和root季节标记。未触及真实业务数据。
|
||||
|
||||
交付包Fuc-0.12.1.zip:642个文件、7,596,466字节、SHA256 `0d1025875a2e8fa4b469b8faa397de674ee7bf79ef15b37a02695bee156254e5`;CRC、源码逐字及ESM运行依赖闭包通过,包内无seasonal运行样式。回执、截图与仅本任务差异在codex/output/fuc-theme/palette-revert-20261104/。
|
||||
|
||||
本地及FUC-XB独立线上测试站均已恢复。用户明确批准同步后,Git提交`7446b045a3702b967cc40456040fdb4210bf19da`已推送测试分支并原子切换到独立release;真实Nginx/FPM及登记HTTPS反代的资源摘要、入口保护、缓存头和公共配置回读通过。已完成服务器侧验收,未做线上页面验收。旧版本0501711保留用于回退;DPL/HN及旧FUC未发布或切换。发布与回退见[FUC-XB测试站](FUC_XB_STAGING.md)。
|
||||
|
||||
## 0.11.0 按原绿色重做四季与火箭联动(2026-11-03)
|
||||
|
||||
@@ -181,14 +203,13 @@ node --test scripts/theme-fuc/core.test.mjs
|
||||
# DOM测试依赖仅装入忽略的验收工具目录,不修改共享锁文件
|
||||
npm install --prefix codex/output/fuc-theme/test-tools --no-audit --no-fund --ignore-scripts [email protected]
|
||||
node --test scripts/theme-fuc/dom.test.mjs scripts/theme-fuc/motion.test.mjs scripts/theme-fuc/app.test.mjs scripts/theme-fuc/palettes.test.mjs
|
||||
python3 scripts/theme-fuc/seasonal-css.py
|
||||
python3 scripts/theme-fuc/verify-native.py
|
||||
python3 scripts/theme-fuc/package.py
|
||||
```
|
||||
|
||||
原版素材重新导入只在确认参考源码更新后执行`import-native.php`、`vendor-native.py`与`reference.py`,不把导入当普通构建。`bundle-vendor.mjs`只重建Fuc自己的运行依赖,锁定现有esbuild/qrcode/marked/DOMPurify版本并输出版本、SHA256和许可证;不自动更新共享依赖。外部SDK依据[Turnstile官方文档](https://developers.cloudflare.com/turnstile/get-started/client-side-rendering/)、[reCAPTCHA文档](https://developers.google.com/recaptcha/docs/v3)、[Stripe token文档](https://docs.stripe.com/js/tokens/create_token?type=card)对接。
|
||||
|
||||
当前交付包`codex/output/fuc-theme/Fuc-0.11.0.zip`,643个运行文件,7601363字节,SHA256 `2eae7736bc6da9158b4ce2563aff049f2893a51a5b333ba25419b2dee0bf526f`。ZIP完整性、源码逐字匹配、ESM引用闭包及不含测试数据/私密配置/管理员文件检查通过。0.10.0、0.9.0及0.6.1包保留用于对照与回退。
|
||||
历史0.11.0交付包`codex/output/fuc-theme/Fuc-0.11.0.zip`,643个运行文件,7601363字节,SHA256 `2eae7736bc6da9158b4ce2563aff049f2893a51a5b333ba25419b2dee0bf526f`。ZIP完整性、源码逐字匹配、ESM引用闭包及不含测试数据/私密配置/管理员文件检查通过。0.10.0、0.9.0及0.6.1包保留用于对照与回退。
|
||||
|
||||
Fuc在XB中已是系统主题,不能声称通过后台“上传同名主题”升级成功。正式发布沿Git流程部署明确提交,只更新该主题并通过现有ThemeService发布资源;启用由目标实例配置决定,不自动切换DPL/HN。各ES模块引用已带0.11.0版本,避免升级后旧模块缓存混用。生产发布前保存目标主题版本和选择,回退只恢复Fuc主题及该实例主题选择,不恢复其他聊天或整库变更。
|
||||
|
||||
|
||||
@@ -0,0 +1,133 @@
|
||||
# FUC-XB 独立线上测试站
|
||||
|
||||
## 授权与当前状态(2026-11-04)
|
||||
|
||||
用户要求先建立独立线上测试站,验收后再单独决定正式切换。本次不切旧FUC,不发布DPL/HN。用户另外明确批准将本地已演练的11,542名旧FUC用户的邮箱、密码哈希、钱包、套餐权益和VIP期初上传至原FUC宿主的新私有目录并导入独立测试库;此前未明确具体敏感数据目的地的一次上传被自动审批拒绝,没有执行,取得精确批准后才上传。
|
||||
|
||||
**隔离测试范围的最终验收已完成:Fuc0.12.4(28ccc0e)已部署,服务器、迁移数据、真实内置浏览器页面/交互及XB原版后台通过。当前入口`https://fuc-xb-test.tomtojapan.online/stage-login`,使用原测试入口账号密码。未切正式站,真实支付、邮件、节点/客户端联网仍后置,不等同正式营业。**
|
||||
|
||||
| 项目 | 已核实值 |
|
||||
| --- | --- |
|
||||
| 本地代码 | `/Users/hellcat/Documents/GemCodes/xb` |
|
||||
| 本地域名 | 本实例不适用;`xb.loc`为另一个本地合成验收实例 |
|
||||
| 线上代码 | `site-jp01 -> /var/www/wwwroot/fuc-xb-test/current` |
|
||||
| 线上域名 | `https://fuc-xb-test.gemcook.net`,A记录45.8.112.190、DNS-only |
|
||||
| 反代域名 | `https://fuc-xb-test.tomtojapan.online/stage-login`,经白色机精确反代;原`/stage-access`保留 |
|
||||
| 发布 | `codex/fuc-xb-staging-20261104`,`28ccc0e964a9ff9ee917a15f99c6f0140174e7cf`,Fuc0.12.4 |
|
||||
| 后台资源 | 原XB子模块`ef5f43da335092cbff8fdf0ad7ff9b4d92d7d0d7` |
|
||||
| 实体目录 | `/var/www/wwwroot/fuc-xb-test/releases/28ccc0e964a9ff9ee917a15f99c6f0140174e7cf`;0501711、7446b04等旧release保留回退 |
|
||||
|
||||
代码由独立Git索引创建测试分支,经白色机既有Git中转推送,再由目标机从原仓库检出精确SHA。没有覆盖归档发布,没有提交本地实例、快照、凭据、客服/HN等其他任务改动。Composer按锁文件安装无dev依赖,不升级旧站PHP或依赖。
|
||||
|
||||
## 2026-11-04 配色恢复发布(历史0.12.1)
|
||||
|
||||
用户明确批准把本地已验收的原版配色恢复同步到本测试站。运行提交`7446b045a3702b967cc40456040fdb4210bf19da`,主题0.12.1;只包含Fuc配色、缓存版本及相关测试/主题说明,app/plugins/config/routes/composer.lock树均与原0501711相同,未运行迁移或升级依赖。保留VIP、入口保护及当前反代,不切旧FUC/DPL/HN。
|
||||
|
||||
本机以独立Git索引从0501711创建窄提交,不使用当前主分支或其他聊天的暂存区。Git bundle经已登记白色机中转导入并推送原测试分支,目标机按精确SHA创建新release、复用相同锁定依赖/后台版本并使用原ThemeService生成公开资源,最后原子切current链接;没有上传压缩包覆盖代码。旧release和shared实例配置保留。
|
||||
|
||||
服务器侧Nginx/FPM与登记的HTTPS反代均读回0.12.1;入口401、无访问Cookie404、noindex/no-store、公共配置及app/native/palettes/原样式SHA验证通过。季节CSS不再存在于新源码/公开目录;紫/绿原CSS保留。shared环境、专用Nginx/FPM配置摘要及旧FUC HEAD不变,无服务重启、数据库迁移或业务数据写入。本次未登录业务用户,也未做线上页面验收;本地桌面/390px保存切换与41项测试见[主题验收](FUC_THEME.md#0121-恢复原版配色2026-11-04)。
|
||||
|
||||
首次验收把重复Cache-Control头转成普通字典,只看到`no-cache, private`而误判no-store缺失,脚本自动回退到0501711。核对确认响应同时包含`private, no-store`,改为读取全部同名响应头后重新激活并通过,未为此改Nginx或放宽缓存策略。
|
||||
|
||||
回退:私有记录`/var/www/wwwroot/fuc-xb-test/private/palette-restore-20261104/rollback.json`保存旧/新精确目标;将current链接原子切回`releases/0501711267c859d834fbf5ff94484212c3bb3f69`并重新请求根HTML/资源验证即可。旧PHP/公开资源各自在原release内,shared环境和数据不回灌。首次自动回退已实际验证旧入口仍可用;该轮最终状态为7446b04/0.12.1,现已由下文0.12.4替代。脱敏回执、本地包、任务备份和发布脚本在`codex/output/fuc-theme/palette-revert-20261104/`。
|
||||
|
||||
## 实例隔离
|
||||
|
||||
- 运行用户`fucxbtest`、`XB_INSTANCE=fuc-xb-test`;私密环境、storage与框架缓存放`shared/`,发布目录的`instances/fuc-xb-test/`仅链接到本实例。
|
||||
- 新MySQL库/专用用户`fuc_xb_test`,只授予该库权限;新APP_KEY,没有复制旧站密钥。
|
||||
- 独立Redis:回环6388、专用密码、`fuc-xb-test-redis.service`、128MB上限,配置`/var/www/wwwroot/fuc-xb-test/etc/redis.conf`。旧6379不变。
|
||||
- 新FPM池`/etc/php/8.4/fpm/pool.d/fuc-xb-test.conf`、回环socket`/run/php/php8.4-fuc-xb-test.sock`,ondemand/4子进程。配置检查后只平滑重载FPM。
|
||||
- 新Nginx配置`/etc/nginx/conf.d/fuc-xb-test.conf`,内部验收监听`127.0.0.1:8766`。旧站虚拟主机未改;新域名80保留ACME,其余跳转HTTPS;443使用独立证书和额外入口保护。
|
||||
- 注册关闭;无真实支付方式/节点;邮件流程、Telegram、支付监测及订单/注册/邮件汇报关闭;没有配置cron、worker或Horizon。原生余额支付的订单开通仍使用XB的同步开通逻辑。
|
||||
- 主题Fuc0.12.4(沿用原紫/绿及固定首页;最新修复见最终验收);VIP仅本测试实例启用,其余实例配置未动。后台仍是XB原版。
|
||||
|
||||
## 额外测试入口保护
|
||||
|
||||
原入口为`/stage-access`,先用额外HTTP Basic密码换取1小时、Secure/HttpOnly/SameSite=Strict的测试Cookie,再进入应用。其余请求必须携带此Cookie;前台API仍独立验证XB Bearer令牌。不能把Basic强加到每个API请求,否则会与XB的Authorization头冲突。
|
||||
|
||||
用户明确批准后新增同账号同密码的`/stage-login`表单入口,解决IAB不支持HTTP Basic认证的问题。独立Git代码`scripts/fuc-xb-stage-gate/`,提交`cc3e26076cf1277455e4ab8216dca6d39227a37b`,运行于`/var/www/wwwroot/fuc-xb-stage-gate`。原Basic保留,XB登录与权限不变;签名CSRF及Cookie匹配、精确Origin校验、10次/分钟/IP(burst20)、安全Cookie、noindex/no-store/CSP均已实测。原密码仅验证其既有哈希,没有新增明文凭据或改库。部署检查实际FPM用户可读,Referrer-Policy使用same-origin以支持正常浏览器Origin。21项真实HTTPS保护检查通过,内置浏览器实际登录成功。回退按该目录README,仅撤新增表单位置/专用脚本,不关闭原门禁。
|
||||
|
||||
未认证入口返回401且不发Cookie;即使提交Bearer头也无法绕过测试Cookie。无Cookie请求返回404,私密路径始终403/404。访问日志关闭、全站noindex和private/no-store。Nginx中Cookie随机值属于私密配置,不复制到普通文档。密码只登记GemDocs专用凭据,详见[实例资源](/Users/hellcat/Documents/GemDocs/AI版/30-私有资源/资源/实例/INS-FUC-XB-TEST.md)。本机不因此获准访问项目线上网页。
|
||||
|
||||
## tomtojapan测试反代(2026-11-04)
|
||||
|
||||
用户明确要求测试站使用tomtojapan.online,单独覆盖本次新入口的默认IP加端口选型。访问入口为`https://fuc-xb-test.tomtojapan.online/stage-access`,白色机精确代理到原`fuc-xb-test.gemcook.net`;域名仍解析到登记白色机反代,不指向业务宿主。
|
||||
|
||||
复用当前橙云泛域DNS与Origin CA(SAN含一级泛域,有效至2041-10-09),没有改DNS、证书或共享map。独立代码`scripts/fuc-xb-test-proxy/`已推送`codex/fuc-xb-test-proxy-20261104`,白色机稀疏检出到`/var/www/wwwroot/fuc-xb-test-proxy`,运行提交`a1da019299a8a00794892c7c692df38adc98ce56`。专用`/etc/nginx/conf.d/fuc-xb-test-proxy.conf`链接到该Git目录的nginx.conf;原有配置摘要保持;最终Nginx/SSH active、22端口监听,已登记weiwei和gdog入口本次均HTTPS200/TLS0。
|
||||
|
||||
保留原额外密码、Secure/HttpOnly测试Cookie与XB Bearer权限;上游Host/SNI固定为源站并严格TLS验证。URL路径和查询、认证头及Cookie转发;只转换当前别名的Origin/Referer,跨站值不转换。Location、Cookie域和精确正文主机名重写覆盖JSON转义URL,品牌不替换;noindex/private/no-store保留,不写完整请求URL或令牌日志。源站APP_URL/业务代码不改,原测试入口密码与QA账号继续使用。源测试HTTPS vhost仅额外信任白色机104.168.30.40/32的X-Forwarded-For;受控IPv4实测由原白色机连接地址变为实际测试客户端45.8.112.190,伪造转发头及直接源站伪造均未生效,临时诊断路由已移除。原配置私密备份在源测试private/before-white-realip-v2.conf,回退仅移除本次三条real-IP指令(有后续修改时局部合并,不整份覆盖)。
|
||||
|
||||
26项服务器侧端到端验收通过(最新0.12.4已重跑):CF入口HTTPS、401无凭据Cookie、无访问门404、HTTP跳转仍在别名、额外密码、主机Cookie、前台/Pace/后台资源、敏感路径、JSON地址、QA原生POST登录、VIP/Bearer、匿名不泄露登录响应、套餐查询参数、订阅URL别名及普通用户后台403。只验证订阅接口返回地址,客户端真实导入/联网仍后置;真实WebSocket未握手测试;线上页面已按下文独立验收。临时QA令牌按实际令牌精确撤销,没有创建订单或调用支付。
|
||||
|
||||
白色机备份`/root/codex-backups/fuc-xb-test-proxy/20261104-071416`保存原文件摘要与本次新增映射记录。回退只移除专用链接,`nginx -t`后平滑reload;不撤源站、不删库、不运行其他反代部署器。首轮部署在写配置前因Python3.10不支持datetime.UTC停止;兼容修复后按Git新版本部署,未升级解释器或放宽安全设置。唯一跨项目登记见[PRX-FUC-XB-TEST](/Users/hellcat/Documents/GemDocs/AI版/30-私有资源/资源/反代/PRX-FUC-XB-TEST.md)。
|
||||
|
||||
## 迁移数据与例外
|
||||
|
||||
源为2026-11-03已演练的只读快照,不是正式切换数据。正式切换仍须刷新快照、处理冻结和最终差异,不以本次测试副本替换正式库。
|
||||
|
||||
- 11,542名旧用户、166个隐藏历史套餐、3个权限组,全字段规范化摘要在MySQL回读一致。
|
||||
- 旧用户钱包365,087分(含13笔预购退款322,868分),佣金1,632分;VIP期初11,542份按已确认净额导入并校验UUID/快照SHA。VIP导入没有改变钱包或创建旧订单。
|
||||
- 不继承旧管理员/员工标记;仅按ACC-005既定管理员约定,在测试实例核验既有密码后激活同一账号的管理员权限,没有改其密码。旧正式站账号未改。
|
||||
- 新增1名虚拟QA和1个标明“不提供线路”的测试套餐;总用户11,543。QA余额100,000分为合成测试数据,不算旧站迁移资金。测试套餐容量显式null,按XB原生规则表示不限制,避免缺省0被判售罄。
|
||||
- 原旧账仍为本地只读归档,没有插入本测试站原生订单/佣金表。测试完成后原生订单0,未新增真实付款、邮件或节点。
|
||||
|
||||
实现及既有业务边界见[VIP](FUC_VIP.md)、[迁移演练](FUC_MIGRATION_REHEARSAL.md)、[主题](FUC_THEME.md)。
|
||||
|
||||
## 首次部署验收(历史;当前最终结果见下节)
|
||||
|
||||
- 12项MySQL真实XB HTTP内核检查:100元期初享9.2折,300元套餐按276元开通,累计376元升级8.5折,下一单255元;重复开通不重复累计、取消返余额、退款资格冲回不擅自操作钱包。临时数据全部事务回滚。
|
||||
- 两独立PHP进程并发开通:MySQL只产生一条100元消费记录、原生折扣8%,测试临时行清理。宿主禁用PHP proc_open,保留该安全限制,由Python启动两个进程,没有放宽PHP设置。
|
||||
- 23项真实Nginx/FPM HTTP检查:测试入口、安全Cookie、私密路径、主题/Pace资源SHA、原生配置、注册关闭、QA及既定管理员登录、VIP、普通用户403、原生后台及锁定后台资源200。测试登录令牌已撤销。
|
||||
- 首次部署未做线上浏览器页面验收;当前页面验收见下节。真实支付、邮件或客户端联网仍是后置营业联调。
|
||||
- DNS已在内置CF新增并回读,现仅该测试A指向45.8.112.190;Let's Encrypt证书有效至2027-02-02 05:48:17 UTC,专用续期hook先检查再reload Nginx。目标机验证证书/SNI、401入口、无Cookie404及认证后前台/资源200;白色机从外部独立请求入口为401、TLS校验0。初次紧随异步reload的握手曾读到旧证书,重新验证通过,没有放宽证书校验。
|
||||
- 最终11,542旧用户钱包365,087分/佣金1,632分、原生订单0、VIP期初11,542、非期初记录0、测试令牌0;额外1虚拟QA。旧FUC HEAD、原vhost/FPM/cron文件摘要未变,原站HTTPS200/TLS0,六个相关服务active。
|
||||
- 测试入口/QA密码已按字段登记GemDocs唯一私有凭据,服务器临时JSON中的明文密码字段已移除,运行所需密码哈希、私密Cookie和身份ID保留。
|
||||
|
||||
脱敏回执、脚本和私有传输物位于本地忽略目录`codex/output/fuc-xb-staging-20261104/`;目标私有日志在测试站`private/`,目录700,数据不挂Web。
|
||||
|
||||
## 停用与恢复
|
||||
|
||||
测试站独立,可以先撤下其专用Nginx配置并`nginx -t`后reload,关闭仅`fuc-xb-test-redis.service`,撤下其专用FPM池并检查后reload。保留新库、shared、私有回执和Git版本用于复核,不自动删库/回灌旧库。恢复测试站时反向恢复这些专用文件和服务,不覆盖旧FUC的.env、数据库、客户端文件、vhost、cron或已有Redis。
|
||||
|
||||
原站基线(HEAD及原vhost/FPM/cron文件摘要)在测试站`private/old-site-baseline.json`。配置初始化时曾修正本实例目录私密umask造成的遍历权限,并把专用Redis配置放到本实例目录,不扩大旧`/etc/redis`权限;此后实际FPM及MySQL验收通过。
|
||||
|
||||
|
||||
## 2026-11-04 最终验收(隔离测试范围通过)
|
||||
|
||||
当前运行`28ccc0e964a9ff9ee917a15f99c6f0140174e7cf` / Fuc0.12.4。测试站代码、入口脚本及反代分别沿Git提交/推送/精确检出发布;旧FUC、DPL/HN未发布或切换。本轮没有新增XB核心、业务API、数据库结构或管理员资源修改。前端显示、独立测试vhost及门禁的修复不改变XB原有订单结算。
|
||||
|
||||
| 范围 | 本轮实际结果 |
|
||||
| --- | --- |
|
||||
| 全量迁移回读 | 页面测试清理后再次对3权限组、166历史套餐、11,542用户逐字段核对授权快照:意外差异0。仅既定管理员标志及该账号登录时间/更新时间变化;钱包365,087分、佣金1,632分,11,542份VIP期初/UUID/快照引用一致。 |
|
||||
| 期初幂等 | MySQL事务内重复执行全部11,542份期初,用户/VIP全行摘要及钱包不变;冲突金额拒绝,最终回滚。 |
|
||||
| 原生交易与并发 | 12项MySQL真实HTTP内核检查通过;100元期初→300元套餐实付276→累计376元→下一单255。两独立PHP进程开通只产生1笔100元累计、8%折扣,精确清理。PHP proc_open仍禁用。 |
|
||||
| 浏览器真实下单 | 合成QA钱包1000元→100元套餐钱包开通→余额900元、累计100元、小福9.2折、30天/100GB。再由“我的套餐”续费,原生订单92元;创建后钱包808元,二次确认取消后恢复900元,累计和到期时间不变。没有外部支付。 |
|
||||
| 桌面与手机 | IAB实际检查公开首页、登录/注册/找回及重置、用户中心、套餐、钱包、我的套餐、订单/详情、邀请、设置、工单/详情、节点、公告、文档/详情和FAQ。桌面1280×720、手机390×844;未见页面横向溢出/坏图。订单长表只在卡片内横向滚动。关闭工单无法回复,120字符长文本正常换行。 |
|
||||
| 动态交互与配色 | 原Pace请求中3px进度条实际显示;紫/绿保存、原绿色火箭hue-rotate(290deg)/tada、亮暗、菜单折叠/手机遮罩、点击空白关闭、购买/优惠码弹窗取消和重入、FAQ异步展开/折叠/搜索、公开手机导航均实际操作。原19份CSS/26模板/Pace/UI库字节完整性通过;未声称旧FUC生产实时数据截图逐像素一致。 |
|
||||
| XB原版后台 | 既定管理员实际登录;原主题管理显示Fuc0.12.4为当前主题;VIP插件开启,100/8、200/12、360/15配置原值保存后重新打开一致。桌面和390px导航可用、无横向溢出。QA管理API403、管理员200。后台锁定提交ef5f43d未改;队列异常/0进程是本隔离站有意不启动worker的状态,不是营业验收通过。 |
|
||||
| 自动回归 | 本地隔离内存库27项/92断言(VIP18、原生订单4、已批准密码重置修复5);当前主题46项Node测试、原素材核对及ZIP源码/CRC/ESM闭包通过。 |
|
||||
| 当前发布HTTP | 0.12.4真实Nginx/FPM23项、白色机端到端HTTPS26项通过,包含原生登录/VIP/RBAC/订阅URL别名、资源、缓存、私密路径。新增表单21项保护及10项MIME/无认证资源检查通过。所有本轮令牌精确撤销。 |
|
||||
| 配置与旧站 | 专用库权限、Redis6388、private700/.env640、debug关闭、注册/真实支付/节点/邮件/汇报关闭,无测试cron/worker。六个相关服务active;旧FUC HEAD和原vhost/FPM/cron摘要不变、HTTPS200/TLS0。白色机原配置及weiwei/gdog入口检查通过。 |
|
||||
| 恢复与收尾 | 测试库私有gzip备份恢复至同宿主临时独立库,41表行数/数据摘要一致;运行库未变,临时库移除。GUI两笔订单、1笔VIP消费/流量重置、2文档、1公告、1已关闭工单及消息、两条GUI会话均按ID/归属白名单清理并留私有恢复备份。QA完整基线恢复;最终原生订单0、佣金日志0、非期初VIP0、测试会话0。 |
|
||||
|
||||
实际发现并修复的问题:
|
||||
|
||||
1. 测试vhost未识别`.mjs`,200却返回application/octet-stream,浏览器拒绝ESM白屏。只在独立测试vhost设application/javascript,原认证门仍生效。
|
||||
2. 钱包全额付款后XB原生total_amount为0,主题误显示商品免费。显示金额改为XB原生历史套餐价值口径total_amount + balance_amount + surplus_amount - surplus_credit,并分别展示钱包/旧套餐折抵/在线本金;零外部待付显示“确认开通”。仅主题展示,结算不改。
|
||||
3. 模式切换反复挪动已加载LINK,Chromium临时卸载CSS造成闪白/无样式。保留已激活CSS,准备有序的新模式样式并加载完成后再提交页面;新增真实DOM样式节点保留/顺序回归。此前无样式截图保留为问题证据,不计为通过。
|
||||
4. 购买确认曾把未考虑VIP的标价叫“实际支付”。现保留标价并明确“下单后确认”,实际金额只读原生订单;不在主题再实现折扣/结算逻辑。
|
||||
5. 文档旧模板mt-n1负间距导致标题/分类重叠。仅bridge.css去掉该处负边距,桌面/手机分类间距0px,无重叠,符合用户已确认的可用布局例外。
|
||||
|
||||
发布链:0.12.2/f236c58→0.12.3/2022184→0.12.4/28ccc0e。当前ZIP `codex/output/fuc-theme/Fuc-0.12.4.zip`,SHA256 `1695853b5c3bb54aef5c783cf4f01d436fdf525cbc6791401c81f529ae69be21`。应用回退用private中对应发布rollback记录原子恢复上一个release,并验证根HTML/模块版本;不回灌shared数据。门禁/MIME回退独立,见scripts/fuc-xb-stage-gate/README.md及其私有备份。
|
||||
|
||||
用户先批准Windows路线,后明确批准本轮本机IAB只访问指定测试反代;属本次例外,不改变全局访问边界。HTTP Basic工具能力受限后,用户另行批准同账号同密码的表单入口;未注入Cookie或放宽认证。QA退出并确认受保护路由要求重新登录后,按账号切换规则更换日本/新加坡节点并在实际IAB核对出口不同,再登录管理员;管理员退出后恢复原节点,TUN与系统HTTP/HTTPS代理全部保持开启。
|
||||
|
||||
VirMach登录曾被自动审批拦截,未提交成功且后续未继续。收尾脚本读取全部会话元数据的查询也被自动审批拦截,已缩至本次QA/获准管理员的具体会话ID后通过。没有为验收扩大其他账号/网站访问。
|
||||
|
||||
回执/截图在本地忽略目录`codex/output/fuc-xb-staging-20261104/`:final-124-*-acceptance、final-data3、final-counts2、final-safety3、final-source2、ui-cleanup1及final-ui-records.json;原始凭据/备份仅private。真实支付、邮件、节点/客户端联网、真实WebSocket未验收;正式营业仍须独立完成相应配置和联调,以及新快照/冻结增量/切换决定。
|
||||
|
||||
## 最终验收主导与正式切换边界
|
||||
|
||||
用户本次明确指定由当前主程主导最终验收。此为当前FUC-XB任务安排,不改长期人事岗位、不授权正式切换。统一核对:迁移身份/权益/钱包/VIP守恒与重复导入、原生订单/折抵/返佣边界、前台桌面和移动端/动画、后台权限、反代全路径/缓存、恢复步骤及临时测试数据收尾,分别给出通过项与剩余问题。
|
||||
|
||||
真实支付、邮件、节点/客户端联网沿已确认的营业后置边界;正式迁移须另取新快照、核对冻结和增量,并由用户决定切换。不能将本次11月3日快照、服务器侧反代检查或测试站可访问写成正式营业全部通过。
|
||||
@@ -30,6 +30,8 @@ globalThis.fetch=async(url,options={})=>{
|
||||
};
|
||||
const append=document.head.append.bind(document.head);
|
||||
document.head.append=node=>{append(node);if(node.tagName==='SCRIPT')queueMicrotask(()=>{try{window.eval(requireFile(node.src));node.onload?.();}catch(error){node.onerror?.(error);}});if(node.tagName==='LINK')queueMicrotask(()=>node.onload?.());};
|
||||
const insertBefore=document.head.insertBefore.bind(document.head);
|
||||
document.head.insertBefore=(node,before)=>{const result=insertBefore(node,before);if(node.tagName==='LINK')queueMicrotask(()=>node.onload?.());return result;};
|
||||
const {readFileSync}=await import('node:fs');const requireFile=url=>readFileSync(new URL(url),'utf8');
|
||||
const until=async predicate=>{for(let n=0;n<200;n++){if(predicate())return;await new Promise(resolve=>setTimeout(resolve,10));}throw Error('DOM state did not settle');};
|
||||
const go=async route=>{location.hash='/'+route;await until(()=>document.body.dataset.nativePage===route);};
|
||||
|
||||
@@ -10,6 +10,62 @@ const {paymentForm,showPayment}=await import('../../theme/Fuc/assets/payments.mj
|
||||
const {richText}=await import('../../theme/Fuc/assets/content.mjs');
|
||||
const {copyText}=await import('../../theme/Fuc/assets/clipboard.mjs');
|
||||
const native=await import('../../theme/Fuc/assets/native.mjs');await native.nativeReady;
|
||||
test('user navigation keeps active shared CSS and its dark/bridge overrides attached',async()=>{
|
||||
const append=document.head.append.bind(document.head),insert=document.head.insertBefore.bind(document.head),moved=[];
|
||||
document.head.append=node=>{if(node.isConnected&&node.tagName==='LINK')moved.push(node);append(node);if(node.tagName==='LINK')queueMicrotask(()=>node.onload?.());};
|
||||
document.head.insertBefore=(node,before)=>{if(node.isConnected&&node.tagName==='LINK')moved.push(node);const result=insert(node,before);if(node.tagName==='LINK')queueMicrotask(()=>node.onload?.());return result;};
|
||||
globalThis.innerWidth=1280;
|
||||
try {
|
||||
await native.prepareNativeMode('user','plans');native.nativeMode('user','plans');
|
||||
const common=[...document.querySelectorAll('[data-fuc-native]')].filter(n=>!n.href.includes('/page/shop.css'));
|
||||
const dark=document.getElementById('native-dark'),bridge=document.getElementById('native-bridge');moved.length=0;
|
||||
await native.prepareNativeMode('user','wallet');native.nativeMode('user','wallet');
|
||||
assert.ok(common.length>5);assert.ok(common.every(n=>n.isConnected&&n.media==='all'));
|
||||
assert.equal(document.getElementById('native-dark'),dark);assert.equal(document.getElementById('native-bridge'),bridge);
|
||||
assert.deepEqual(moved,[],'reparenting loaded LINKs can unload CSS and flash an unstyled page');
|
||||
const before=[...document.querySelectorAll('[data-fuc-native]')];
|
||||
const changing=native.prepareNativeMode('auth','login');assert.ok(before.every(n=>n.isConnected&&n.media==='all'));
|
||||
await changing;native.nativeMode('auth','login');
|
||||
assert.ok(before.every(n=>!n.isConnected));
|
||||
const styles=JSON.parse(await fs.readFile(new URL('../../theme/Fuc/assets/native/styles.json',import.meta.url),'utf8'));
|
||||
assert.deepEqual([...document.querySelectorAll('[data-fuc-native]')].map(n=>n.href.split('/native/')[1].split('?')[0]),styles.login.map(p=>p.split('?')[0]));
|
||||
assert.equal([...document.querySelectorAll('link[rel=stylesheet]')].at(-1),bridge,'overrides keep their position after the native CSS');
|
||||
}finally{document.head.append=append;document.head.insertBefore=insert;}
|
||||
});
|
||||
test('wallet-funded checkout and history show package value instead of zero online remainder',()=>{
|
||||
const order={trade_no:'synthetic-wallet-order',status:3,total_amount:0,balance_amount:10000,surplus_amount:0,surplus_credit:0,period:'month_price',plan:{name:'Synthetic plan'},created_at:1};
|
||||
const context={user:{},sub:{},data:order,methods:[],config:{}};
|
||||
const detail=new DOMParser().parseFromString(native.nativeSecondary('checkout',context),'text/html');
|
||||
assert.equal(detail.querySelector('#invoice_content_table tbody td:last-child').textContent.trim(),'100.00');
|
||||
assert.match(detail.querySelector('[data-order-settlement]').textContent,/钱包抵扣:.*100\.00/);
|
||||
const history=new DOMParser().parseFromString(native.nativeSecondary('orders',{...context,data:[order]}),'text/html');
|
||||
assert.match(history.querySelector('tbody tr').textContent,/100\.00/);
|
||||
const myplan=new DOMParser().parseFromString(native.nativeSecondary('myplan',{...context,data:[order]}),'text/html');
|
||||
assert.match(myplan.querySelector('tbody tr').textContent,/100\.00/);
|
||||
});
|
||||
test('purchase preview keeps list price but leaves final VIP/coupon/balance settlement to native order',()=>{
|
||||
const html=native.nativeSecondary('purchase',{user:{vip:{enabled:true,name:'小福',discount_percent:8}},sub:{},data:{id:167,name:'Synthetic',month_price:10000},period:'month_price',config:{}});
|
||||
const view=new DOMParser().parseFromString(html,'text/html');
|
||||
assert.equal(view.querySelector('#product-buy-total').textContent,'下单后确认');
|
||||
assert.match(view.body.textContent,/100\.00/);assert.match(view.querySelector('[data-vip-price]').textContent,/9\.2 折/);
|
||||
assert.match(view.querySelector('[data-order-price-notice]').textContent,/取消未支付订单可退回已抵扣余额/);
|
||||
});
|
||||
test('zero online remainder needs no channel and cancelled wallet deduction is labelled returned',()=>{
|
||||
const context={user:{},sub:{},data:{trade_no:'synthetic',status:0,total_amount:0,balance_amount:9200,plan:{name:'Synthetic'},period:'month_price'},methods:[],config:{}};
|
||||
let view=new DOMParser().parseFromString(native.nativeSecondary('checkout',context),'text/html');
|
||||
assert.equal(view.querySelector('select[name=method]'),null);
|
||||
assert.equal(view.querySelector('[data-form=checkout] button[type=submit]').textContent,'确认开通');
|
||||
assert.equal(view.querySelector('[data-form=checkout] button[type=submit]').disabled,false);
|
||||
view=new DOMParser().parseFromString(native.nativeSecondary('checkout',{...context,data:{...context.data,status:2}}),'text/html');
|
||||
assert.match(view.querySelector('[data-order-settlement]').textContent,/原钱包抵扣(已退回)/);
|
||||
});
|
||||
test('package amount uses only consumed old-plan credit and displays channel fees separately',()=>{
|
||||
const context={user:{},sub:{},data:{trade_no:'synthetic',status:3,total_amount:2500,balance_amount:1000,surplus_amount:3000,surplus_credit:1500,handling_amount:125,plan:{name:'Synthetic'},period:'month_price'},methods:[],config:{}};
|
||||
const view=new DOMParser().parseFromString(native.nativeSecondary('checkout',context),'text/html');
|
||||
assert.equal(view.querySelector('#invoice_content_table tbody td:last-child').textContent.trim(),'50.00');
|
||||
const settlement=view.querySelector('[data-order-settlement]').textContent;
|
||||
assert.match(settlement,/旧套餐折抵:.*15\.00/);assert.match(settlement,/渠道手续费:.*1\.25/);assert.match(settlement,/折抵返余:.*15\.00/);
|
||||
});
|
||||
test('VIP uses the original dashboard card and displays cumulative, level and next discount',()=>{
|
||||
const user={email:'[email protected]',vip:{enabled:true,name:'小福',cumulative_cents:10000,discount_percent:8,next_level:{name:'中福'},remaining_cents:10000}};
|
||||
const host=document.createElement('div');host.innerHTML=native.nativeDashboard(user,{plan_id:1,plan:{name:'套餐'},transfer_enable:100,u:0,d:0,expired_at:2000000000},[],'福云',v=>v);
|
||||
@@ -62,9 +118,9 @@ test('community link comes from XB config and never inherits the FUC channel',()
|
||||
assert.equal(link(parse({telegram_discuss_link:'javascript:alert(1)'})).hasAttribute('href'),false);
|
||||
});
|
||||
test('panel settings retain saved palette, mode and collapsed menu after template serialization',()=>{
|
||||
localStorage.setItem('fuc_themeLight','winter');localStorage.setItem('fuc_themeMod','dark');localStorage.setItem('fuc_menuToggle','close');
|
||||
localStorage.setItem('fuc_themeLight','cyan');localStorage.setItem('fuc_themeMod','dark');localStorage.setItem('fuc_menuToggle','close');
|
||||
try{const view=new DOMParser().parseFromString(native.nativeHeader({},'QA','plans'),'text/html');
|
||||
assert.equal(view.querySelector('#themeLight').value,'winter');assert.equal(view.querySelector('#themeMod').value,'dark');assert.equal(view.querySelector('#menuToggle').value,'close');
|
||||
assert.equal(view.querySelector('#themeLight').value,'cyan');assert.deepEqual([...view.querySelector('#themeLight').options].map(o=>[o.value,o.textContent.trim()]),[['cyan','绿色'],['purple','紫色']]);assert.equal(view.querySelector('#themeDark').value,'purple');assert.equal(view.querySelector('.season-palette-options'),null);assert.equal(view.querySelector('#themeMod').value,'dark');assert.equal(view.querySelector('#menuToggle').value,'close');
|
||||
assert.ok(view.querySelector('.dropdown-user .dropdown-menu [data-target="#panel-option-modal"]'),'mobile users can open panel settings from their account menu');
|
||||
}finally{localStorage.clear();}
|
||||
});
|
||||
|
||||
@@ -1,39 +1,27 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import fs from 'node:fs';
|
||||
import {JSDOM} from '../../codex/output/fuc-theme/test-tools/node_modules/jsdom/lib/api.js';
|
||||
import {palettes,getPalette,nativePalette,applyPalette,paintPaletteOptions,chartColors,rotateColor} from '../../theme/Fuc/assets/palettes.mjs';
|
||||
const saturationAndLightness=hex=>{const rgb=hex.slice(1).match(/../g).map(c=>parseInt(c,16)/255),max=Math.max(...rgb),min=Math.min(...rgb),d=max-min,l=(max+min)/2;return [d?d/(1-Math.abs(2*l-1)):0,l];};
|
||||
test('spring is the original green; saved cyan migrates without recoloring its user area',()=>{
|
||||
import {getPalette,applyPalette} from '../../theme/Fuc/assets/palettes.mjs';
|
||||
|
||||
test('existing original preferences survive; retired seasons resolve to valid original preferences across reloads',()=>{
|
||||
const dom=new JSDOM('<html><body></body></html>',{url:'http://xb.loc/'}),storage=dom.window.localStorage;
|
||||
for(const id of ['cyan','spring']){
|
||||
storage.setItem('fuc_themeLight',id);assert.equal(getPalette(storage),'spring');assert.equal(nativePalette(storage),'cyan');
|
||||
applyPalette(dom.window.document,storage);assert.equal(dom.window.document.documentElement.dataset.fucPalette,'spring');assert.equal(dom.window.document.documentElement.dataset.fucSeason,undefined);
|
||||
assert.deepEqual(chartColors(storage),['#7D72F1','#FF9F43','#EA5455']);
|
||||
}
|
||||
storage.setItem('fuc_themeLight','summer');applyPalette(dom.window.document,storage);assert.equal(dom.window.document.documentElement.dataset.fucSeason,'summer');
|
||||
for(const id of ['purple','unexpected']){
|
||||
storage.setItem('fuc_themeLight',id);applyPalette(dom.window.document,storage);assert.equal(getPalette(storage),'purple');assert.equal(nativePalette(storage),'purple');assert.equal(dom.window.document.documentElement.dataset.fucSeason,undefined);assert.equal(dom.window.document.documentElement.style.getPropertyValue('--season-primary'),'');
|
||||
}
|
||||
dom.window.close();
|
||||
});
|
||||
test('season accents preserve original green saturation/lightness and rotate the rocket',()=>{
|
||||
const css=fs.readFileSync(new URL('../../theme/Fuc/assets/native/seasonal.css',import.meta.url),'utf8'),colors=new Set();
|
||||
for(const [id,p] of Object.entries(palettes).filter(([,p])=>p.rotation!==undefined)){
|
||||
colors.add(p.primary);
|
||||
const a=saturationAndLightness('#52cfbc'),b=saturationAndLightness(p.primary);a.forEach((v,i)=>assert.ok(Math.abs(v-b[i])<.005,id+' HSL tone'));
|
||||
if(id!=='spring'){
|
||||
const prefix=`html[data-fuc-season=${id}]`;
|
||||
assert.ok(css.includes(prefix+' .btn-primary{background-color:'+p.button),id+' native button tone');
|
||||
assert.ok(css.includes(prefix+' .offer-slider .slide .selling-slide .shop_img img{filter:hue-rotate('+((290+p.rotation)%360)+'deg)'),id+' rocket hue');
|
||||
try{
|
||||
for(const [saved,expected] of [['purple','purple'],['cyan','cyan'],['spring','cyan'],['summer','purple'],['autumn','purple'],['winter','purple']]){
|
||||
storage.setItem('fuc_themeLight',saved);applyPalette(dom.window.document,storage);
|
||||
assert.equal(storage.getItem('fuc_themeLight'),expected,saved+' saved migration');
|
||||
assert.equal(getPalette(storage),expected);assert.equal(applyPalette(dom.window.document,storage),expected,'repeat initialization remains stable');
|
||||
}
|
||||
}
|
||||
assert.equal(colors.size,4);assert.equal(rotateColor('#52cfbc',360),'#52cfbc');assert.equal(rotateColor('#f8f8f8',222),'#f8f8f8');
|
||||
storage.setItem('fuc_themeLight','unknown');assert.equal(getPalette(storage),'purple');
|
||||
}finally{dom.window.close();}
|
||||
});
|
||||
test('settings offer purple plus four seasons and retain saved aliases through serialization',()=>{
|
||||
const dom=new JSDOM('<div id="root"><div><select id="themeLight"></select></div><div class="form-group"><select id="themeDark"></select></div></div>',{url:'http://xb.loc/'});
|
||||
dom.window.localStorage.setItem('fuc_themeLight','cyan');paintPaletteOptions(dom.window.document.getElementById('root'),dom.window.localStorage);
|
||||
const select=dom.window.document.getElementById('themeLight');assert.equal(select.options.length,5);assert.equal(select.value,'spring');assert.equal(select.selectedOptions[0].textContent,'春 · 原版绿色');
|
||||
const roundTrip=new dom.window.DOMParser().parseFromString(dom.window.document.getElementById('root').innerHTML,'text/html');assert.equal(roundTrip.getElementById('themeLight').value,'spring');
|
||||
assert.equal(dom.window.document.getElementById('themeDark'),null);assert.equal(dom.window.document.querySelectorAll('.season-swatch').length,4);dom.window.close();
|
||||
|
||||
test('initialization removes stale seasonal root overrides without erasing unrelated mode or styles',()=>{
|
||||
const dom=new JSDOM('<html data-color="dark" data-fuc-palette="winter" data-fuc-season="winter" style="--season-primary:#525bcf;--season-logo:hue-rotate(355deg);--other:keep"><body></body></html>',{url:'http://xb.loc/'});
|
||||
try{
|
||||
dom.window.localStorage.setItem('fuc_themeLight','winter');applyPalette(dom.window.document,dom.window.localStorage);
|
||||
const root=dom.window.document.documentElement;
|
||||
assert.equal(root.dataset.fucPalette,undefined);assert.equal(root.dataset.fucSeason,undefined);
|
||||
assert.equal(root.style.getPropertyValue('--season-primary'),'');assert.equal(root.style.getPropertyValue('--season-logo'),'');
|
||||
assert.equal(root.dataset.color,'dark');assert.equal(root.style.getPropertyValue('--other'),'keep');
|
||||
}finally{dom.window.close();}
|
||||
});
|
||||
@@ -1,67 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Rotate the original green palette's hues; preserve every saturation/lightness step."""
|
||||
from pathlib import Path
|
||||
import colorsys,re
|
||||
ROOT=Path(__file__).resolve().parents[2]
|
||||
BASE=ROOT/'theme/Fuc/assets/native'
|
||||
source=(BASE/'theme/cool/assets/css/theme/style-cyan.css').read_text()
|
||||
SEASONS={'spring':0,'summer':30,'autumn':222,'winter':65}
|
||||
def recolor(match,rotation):
|
||||
text=match.group()
|
||||
if text.startswith('#'):
|
||||
raw=text[1:]
|
||||
if len(raw) in (3,4):raw=''.join(c*2 for c in raw)
|
||||
rgb=[int(raw[i:i+2],16) for i in (0,2,4)];alpha=int(raw[6:8],16)/255 if len(raw)==8 else None
|
||||
else:
|
||||
nums=[float(v) for v in re.findall(r'[\d.]+',text)]
|
||||
rgb=nums[:3];alpha=(nums[3]/100 if '%' in text else nums[3]) if len(nums)>3 else None
|
||||
h,l,s=colorsys.rgb_to_hls(*(v/255 for v in rgb))
|
||||
if s<.2:return text
|
||||
result=[int(c*255+.5) for c in colorsys.hls_to_rgb((h+rotation/360)%1,l,s)]
|
||||
if alpha is not None:return 'rgba('+','.join(map(str,result))+','+format(alpha,'.6g')+')'
|
||||
return '#'+''.join(f'{c:02x}' for c in result)
|
||||
def rules(css,season,rotation):
|
||||
prefix=f'html[data-fuc-season={season}]' if season!='spring' else 'html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout)'
|
||||
out=[];pos=0
|
||||
while True:
|
||||
start=css.find('{',pos)
|
||||
if start<0:break
|
||||
header=css[pos:start].strip();end=start+1;depth=1
|
||||
while depth:
|
||||
if css[end]=='{':depth+=1
|
||||
elif css[end]=='}':depth-=1
|
||||
end+=1
|
||||
body=css[start+1:end-1];pos=end
|
||||
if header.startswith('@'):
|
||||
inner=rules(body,season,rotation)
|
||||
if inner:out.append(header+'{'+inner+'}')
|
||||
continue
|
||||
declarations=[];changed=False
|
||||
for declaration in body.split(';'):
|
||||
if ':' not in declaration:continue
|
||||
key,value=map(str.strip,declaration.split(':',1))
|
||||
# Copy only accent declarations; neutral light/dark surfaces stay native.
|
||||
if re.search(r'#[0-9a-fA-F]{3,8}\b|rgba?\(',value):
|
||||
accent=re.sub(r'#[0-9a-fA-F]{3,8}\b|rgba?\([^)]*\)',lambda m:recolor(m,1),value)!=value
|
||||
if accent:
|
||||
declarations.append(key+':'+re.sub(r'#[0-9a-fA-F]{3,8}\b|rgba?\([^)]*\)',lambda m:recolor(m,rotation),value));changed=True
|
||||
elif key=='filter' and 'hue-rotate' in value:
|
||||
declarations.append('filter:'+re.sub(r'hue-rotate\(([\d.]+)deg\)',lambda m:f'hue-rotate({(float(m[1])+rotation)%360:g}deg)',value))
|
||||
if changed:
|
||||
white=re.search(r'(?:^|;)\s*color\s*:\s*(#[fF]{3,6})(\s*!important)?\s*(?:;|$)',body)
|
||||
if white:declarations.append('color:'+white[1]+(white[2] or ''))
|
||||
if declarations:
|
||||
selectors=[]
|
||||
for s in map(str.strip,header.split(',')):
|
||||
s=s.replace('.menu-light',':is(.menu-light,.menu-dark)')
|
||||
if s in ('a','a:hover'):
|
||||
selectors.append(prefix+' :where(a:not(.btn,.nav-link,.dropdown-item,.navbar-brand))'+(':hover' if s.endswith(':hover') else ''))
|
||||
elif s==':root':selectors.append(prefix)
|
||||
elif s.startswith('html '):selectors.append(prefix+s[4:])
|
||||
else:selectors.append(prefix+' '+s)
|
||||
out.append(',\n'.join(selectors)+'{'+ ';'.join(declarations)+';}')
|
||||
return '\n'.join(out)
|
||||
extra=(ROOT/'scripts/theme-fuc/seasonal-surfaces.css').read_text()
|
||||
css=re.sub(r'/\*.*?\*/','',source,flags=re.S)
|
||||
(BASE/'seasonal.css').write_text('/* Hue rotations of original FUC green; no native layout or animation declarations. */\n'+'\n'.join(rules(css,name,rotation) for name,rotation in SEASONS.items())+'\n'+extra)
|
||||
print('PASS: seasonal colors generated from original green; spring user area uses unchanged cyan CSS')
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
/* Preserve the original neutral surfaces and dark layout; only seasonal accents change. */
|
||||
html[data-fuc-season] .bg-gradient-primary{background:linear-gradient(118deg,var(--season-deep),var(--season-bright))!important;}
|
||||
html[data-fuc-season] .custom-control-input:focus~.custom-control-label:before{box-shadow:0 0 0 .2rem rgba(var(--season-rgb),.25);}
|
||||
html[data-fuc-season] .fuc-sidebar-mark,html[data-fuc-season] .fuc-auth-mark{filter:var(--season-logo);}
|
||||
html:is([data-fuc-season],[data-fuc-palette=spring]) .native-public .hero-1{background-color:var(--season-primary);background-blend-mode:luminosity;}
|
||||
html:is([data-fuc-season],[data-fuc-palette=spring]) .native-public .navbar-brand img{filter:var(--season-logo);}
|
||||
html:is([data-fuc-season],[data-fuc-palette=spring]) .native-public #navbar:not(.nav-sticky) .navbar-brand img{filter:brightness(0) invert(1);}
|
||||
html:is([data-fuc-season],[data-fuc-palette=spring]) .native-public .bg-light{background-color:var(--season-tint)!important;}
|
||||
html:is([data-fuc-season],[data-fuc-palette=spring]) .native-public .nav-sticky .nav-link.active,html:is([data-fuc-season],[data-fuc-palette=spring]) .native-public .nav-sticky .nav-link:hover{color:var(--season-primary);}
|
||||
html:is([data-fuc-season],[data-fuc-palette=spring]) .native-public .nav-btn{background-color:var(--season-primary);border-color:var(--season-primary);color:#fff;}
|
||||
html:is([data-fuc-season],[data-fuc-palette=spring]) .native-public .pricing [style*="color:#3c2299"]{color:var(--season-primary)!important;}
|
||||
html:is([data-fuc-season],[data-fuc-palette=spring]) .native-public .btn-light{color:var(--season-primary);}
|
||||
/* Brand ink must remain legible while cached light/dark styles are prepared. */
|
||||
html:is([data-fuc-season],[data-fuc-palette=spring]) .fuc-brand-wordmark{background-color:#5e5873;}
|
||||
html:is([data-fuc-season],[data-fuc-palette=spring]) .dark-layout .fuc-brand-wordmark{background-color:#e7e5f4;}
|
||||
.season-swatch{display:inline-block;width:10px;height:10px;border-radius:50%;margin-right:6px;}
|
||||
+10
-10
@@ -1,13 +1,13 @@
|
||||
import {applyPalette} from './palettes.mjs?v=0.12.0';
|
||||
import {subscriptionUrl as makeSubscriptionUrl,importUrl} from './subscription.mjs?v=0.12.0';
|
||||
import {interactionsReady,paintInteractions,disposeInteractions,showModal,hideModals,toggleCollapse,selectTab,toggleDropdown,notify,scrollTop,scrollSection,toggleMenu,updateMenu,paintScrollTop,authFeedback,confirmSubscriptionReset} from './interactions.mjs?v=0.12.0';
|
||||
import {richText} from './content.mjs?v=0.12.0';
|
||||
import {copyText} from './clipboard.mjs?v=0.12.0';
|
||||
import {createCaptcha} from './captcha.mjs?v=0.12.0';
|
||||
import {showPayment,mountCard} from './payments.mjs?v=0.12.0';
|
||||
import {beginPageProgress,finishPageProgress} from './progress.mjs?v=0.12.0';
|
||||
import {nativeReady,prepareNativeMode,nativeMode,fillPurchaseModal,nativeHeader,nativeFooter,nativeDashboard,nativeHome,nativeAuth,nativeSecondary,paintNativeChart,paintNativeHome} from './native.mjs?v=0.12.0';
|
||||
import {escape as e, money, bytes, date, list, groupedList, periods, orderStates, soldOut, safeUrl, createApi, routeFromHash,canPurchase} from './core.mjs?v=0.12.0';
|
||||
import {applyPalette} from './palettes.mjs?v=0.12.4';
|
||||
import {subscriptionUrl as makeSubscriptionUrl,importUrl} from './subscription.mjs?v=0.12.4';
|
||||
import {interactionsReady,paintInteractions,disposeInteractions,showModal,hideModals,toggleCollapse,selectTab,toggleDropdown,notify,scrollTop,scrollSection,toggleMenu,updateMenu,paintScrollTop,authFeedback,confirmSubscriptionReset} from './interactions.mjs?v=0.12.4';
|
||||
import {richText} from './content.mjs?v=0.12.4';
|
||||
import {copyText} from './clipboard.mjs?v=0.12.4';
|
||||
import {createCaptcha} from './captcha.mjs?v=0.12.4';
|
||||
import {showPayment,mountCard} from './payments.mjs?v=0.12.4';
|
||||
import {beginPageProgress,finishPageProgress} from './progress.mjs?v=0.12.4';
|
||||
import {nativeReady,prepareNativeMode,nativeMode,fillPurchaseModal,nativeHeader,nativeFooter,nativeDashboard,nativeHome,nativeAuth,nativeSecondary,paintNativeChart,paintNativeHome} from './native.mjs?v=0.12.4';
|
||||
import {escape as e, money, bytes, date, list, groupedList, periods, orderStates, soldOut, safeUrl, createApi, routeFromHash,canPurchase} from './core.mjs?v=0.12.4';
|
||||
const settings = window.fucSettings || {};
|
||||
const root = document.querySelector('#app');
|
||||
const preview = settings.preview === true;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {marked,DOMPurify} from './vendor/richtext.mjs?v=0.12.0';
|
||||
import {marked,DOMPurify} from './vendor/richtext.mjs?v=0.12.4';
|
||||
export function richText(value) {
|
||||
const html=marked.parse(String(value||''),{async:false});
|
||||
return '<div data-fuc-richtext>'+DOMPurify.sanitize(html,{ALLOWED_TAGS:['p','br','strong','b','em','i','ul','ol','li','h1','h2','h3','h4','h5','h6','blockquote','code','pre','a','img','table','thead','tbody','tr','th','td','hr','details','summary','div','span'],ALLOWED_ATTR:['href','src','alt','title','colspan','rowspan'],ALLOW_DATA_ATTR:false})+'</div>';
|
||||
|
||||
@@ -6,6 +6,8 @@ export const list = value => Array.isArray(value) ? value : Array.isArray(value?
|
||||
export const groupedList = value => Array.isArray(value) ? value : Object.values(value || {}).flatMap(list);
|
||||
export const periods = {month_price:'月付',quarter_price:'季付',half_year_price:'半年付',year_price:'年付',two_year_price:'两年付',three_year_price:'三年付',onetime_price:'一次性',reset_price:'流量重置'};
|
||||
export const orderStates = ['待支付','开通中','已取消','已完成','已折抵'];
|
||||
// Display XB's package amount before wallet/old-plan deductions; never a quote.
|
||||
export function orderAmount(order) { return Math.max(0,Number(order.total_amount||0)+Number(order.balance_amount||0)+Number(order.surplus_amount||0)-Number(order.surplus_credit||0)); }
|
||||
export function trafficSummary(sub,logs=null,now=new Date()) {
|
||||
const positive=value=>Number.isFinite(Number(value))?Math.max(0,Number(value)):0;
|
||||
const total=positive(sub.transfer_enable),used=positive(sub.u)+positive(sub.d);
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// FUC's original UI plugins, driven only by the XB theme's event bindings.
|
||||
import {loadScript} from './captcha.mjs?v=0.12.0';
|
||||
import {loadScript} from './captcha.mjs?v=0.12.4';
|
||||
const base=new URL('./native/',import.meta.url).href;
|
||||
let landingUI;
|
||||
export const interactionsReady=loadScript(base+'widgets.min.js?v=0.12.0').then(()=>loadScript(base+'sweetalert2.min.js?v=0.12.0')).then(()=>loadScript(base+'smooth-scroll.min.js?v=0.12.0')).then(async()=>{
|
||||
export const interactionsReady=loadScript(base+'widgets.min.js?v=0.12.4').then(()=>loadScript(base+'sweetalert2.min.js?v=0.12.4')).then(()=>loadScript(base+'smooth-scroll.min.js?v=0.12.4')).then(async()=>{
|
||||
const userUI=window.bootstrap;
|
||||
// The source landing page uses Bootstrap 5; keep its data APIs separate from user Bootstrap 4.
|
||||
document.body.setAttribute('data-bs-no-jquery','');
|
||||
try{await loadScript(base+'landing-bootstrap5.min.js?v=0.12.0');landingUI=window.bootstrap;}
|
||||
try{await loadScript(base+'landing-bootstrap5.min.js?v=0.12.4');landingUI=window.bootstrap;}
|
||||
finally{window.bootstrap=userUI;document.body.removeAttribute('data-bs-no-jquery');}
|
||||
// Delegated data APIs would duplicate the theme's explicit XB action handlers.
|
||||
window.jQuery(document).off('.bs.modal.data-api .bs.collapse.data-api .bs.tab.data-api .bs.dropdown.data-api');
|
||||
|
||||
+38
-21
@@ -1,27 +1,37 @@
|
||||
import {getPalette,nativePalette,applyPalette,paintPaletteOptions,chartColors} from './palettes.mjs?v=0.12.0';
|
||||
import {escape as e,money,bytes,date,safeUrl,soldOut,trafficSummary,canPurchase} from './core.mjs?v=0.12.0';
|
||||
import {getPalette,applyPalette} from './palettes.mjs?v=0.12.4';
|
||||
import {escape as e,money,bytes,date,safeUrl,soldOut,trafficSummary,canPurchase,orderAmount} from './core.mjs?v=0.12.4';
|
||||
const base = new URL('./native/',import.meta.url).href;
|
||||
let templates = {},sourceStyles={};
|
||||
const styleReady=fetch(base+'styles.json?v=0.12.0').then(r=>r.json()).then(v=>sourceStyles=v);
|
||||
export const nativeReady = Promise.all(['footer','header','index','home','login','register','forget','reset','plans','myplan','wallet','invite','profile','tickets','ticket','servers','notices','knowledge','article','faq','orders','purchase','checkout','planlog','walletlog','afflog'].map(async name=>{const r=await fetch(`${base}${name}.html?v=0.12.0`);if(!r.ok)throw Error('原版模板加载失败');templates[name]=await r.text();})).then(()=>styleReady);
|
||||
const styleReady=fetch(base+'styles.json?v=0.12.4').then(r=>r.json()).then(v=>sourceStyles=v);
|
||||
export const nativeReady = Promise.all(['footer','header','index','home','login','register','forget','reset','plans','myplan','wallet','invite','profile','tickets','ticket','servers','notices','knowledge','article','faq','orders','purchase','checkout','planlog','walletlog','afflog'].map(async name=>{const r=await fetch(`${base}${name}.html?v=0.12.4`);if(!r.ok)throw Error('原版模板加载失败');templates[name]=await r.text();})).then(()=>styleReady);
|
||||
let nativeSwiper=null,swiperLibrary=null;
|
||||
export async function paintNativeHome(){if(!document.querySelector('.native-public .swiper-container'))return;if(!window.Swiper){if(!swiperLibrary)swiperLibrary=new Promise((resolve,reject)=>{const s=document.createElement('script');s.src=base+'assets/cool/swiper.min.js';s.onload=resolve;s.onerror=reject;document.head.append(s);});await swiperLibrary;}const el=document.querySelector('.native-public .swiper-container');if(!el)return;if(nativeSwiper){try{nativeSwiper.destroy(true,true);}catch{}}el.querySelectorAll('.swiper-slide').forEach(n=>{n.style.removeProperty('display');n.style.removeProperty('width');});el.querySelector('.swiper-wrapper')?.removeAttribute('style');nativeSwiper=new window.Swiper(el,{direction:'horizontal',loop:true,autoplay:{delay:5000,disableOnInteraction:true},navigation:{nextEl:'.swiper-button-next',prevEl:'.swiper-button-prev'}});}
|
||||
let currentMode='',styleSequence=0,chartData=null,chartInstance=null,chartLibrary=null;
|
||||
export async function paintNativeChart(){if(!chartData||!document.getElementById('donut-chart')||document.getElementById('donut-chart').hidden)return;if(!window.ApexCharts){if(!chartLibrary)chartLibrary=new Promise((resolve,reject)=>{const s=document.createElement('script');s.src=base+'theme/cool/assets/vendors/js/charts/apexcharts.min.js';s.onload=resolve;s.onerror=reject;document.head.append(s);});await chartLibrary;}const target=document.getElementById('donut-chart');if(!target)return;if(chartInstance){try{chartInstance.destroy();}catch{}}target.innerHTML='';chartInstance=new window.ApexCharts(target,{chart:{height:350,type:'donut'},legend:{show:true,position:'bottom'},labels:['可用','历史使用',chartData.todayKnown?'今日使用':'今日使用(未提供)'],series:chartData.series,colors:chartColors(),dataLabels:{enabled:true,formatter:val=>parseInt(val)+'%'},plotOptions:{pie:{donut:{labels:{show:true,name:{fontSize:'2rem',fontFamily:'Nunito'},value:{fontSize:'1rem',fontFamily:'Nunito',formatter:val=>parseInt(val)+'%'}}}}}});await chartInstance.render();}
|
||||
let currentMode='',currentStyleMode='',styleSequence=0,chartData=null,chartInstance=null,chartLibrary=null;
|
||||
export async function paintNativeChart(){if(!chartData||!document.getElementById('donut-chart')||document.getElementById('donut-chart').hidden)return;if(!window.ApexCharts){if(!chartLibrary)chartLibrary=new Promise((resolve,reject)=>{const s=document.createElement('script');s.src=base+'theme/cool/assets/vendors/js/charts/apexcharts.min.js';s.onload=resolve;s.onerror=reject;document.head.append(s);});await chartLibrary;}const target=document.getElementById('donut-chart');if(!target)return;if(chartInstance){try{chartInstance.destroy();}catch{}}target.innerHTML='';chartInstance=new window.ApexCharts(target,{chart:{height:350,type:'donut'},legend:{show:true,position:'bottom'},labels:['可用','历史使用',chartData.todayKnown?'今日使用':'今日使用(未提供)'],series:chartData.series,colors:['#7D72F1','#FF9F43','#EA5455'],dataLabels:{enabled:true,formatter:val=>parseInt(val)+'%'},plotOptions:{pie:{donut:{labels:{show:true,name:{fontSize:'2rem',fontFamily:'Nunito'},value:{fontSize:'1rem',fontFamily:'Nunito',formatter:val=>parseInt(val)+'%'}}}}}});await chartInstance.render();}
|
||||
export async function prepareNativeMode(mode,page='') {
|
||||
const key=mode==='home'?'home':mode==='auth'?(page||'login'):(page||document.body.dataset.nativePage||'dashboard');
|
||||
const sourcePage=({dashboard:'index','knowledge-detail':'article'})[key]||key;
|
||||
const palette=getPalette(),signature=key+':'+palette;
|
||||
if(currentMode===signature)return;
|
||||
const seq=++styleSequence;
|
||||
const paths=(mode==='user'?[...sourceStyles.header,...(sourceStyles[sourcePage]||[])]:sourceStyles[sourcePage]||[]).map(p=>p.replace('theme/style-purple.css','theme/style-'+nativePalette()+'.css'));
|
||||
paths.push('seasonal.css');
|
||||
const existing=new Map([...document.querySelectorAll('[data-fuc-native]')].map(n=>[n.href,n]));
|
||||
const links=paths.map(path=>{const url=new URL(path,base);url.searchParams.set('theme_v','0.12.0');const href=url.href;if(existing.has(href))return existing.get(href);const n=document.createElement('link');n.rel='stylesheet';n.href=href;n.media='not all';n.dataset.fucNative='true';n.ready=new Promise((resolve,reject)=>{n.onload=resolve;n.onerror=()=>reject(Error('原版样式加载失败'));});document.head.append(n);return n;});
|
||||
await Promise.all(links.map(n=>n.ready));if(seq!==styleSequence)return;
|
||||
const overrides=[['native-dark','theme/cool/assets/css/theme/dark-layout.css'],['native-bridge','bridge.css?v=0.12.4']].map(([id,path])=>{
|
||||
let n=document.getElementById(id);if(n)return n;
|
||||
n=document.createElement('link');n.id=id;n.rel='stylesheet';n.href=base+path;n.media='not all';
|
||||
n.ready=new Promise((resolve,reject)=>{n.onload=resolve;n.onerror=()=>{n.remove();reject(Error('原版样式加载失败'));};});document.head.append(n);return n;
|
||||
});
|
||||
const paths=(mode==='user'?[...sourceStyles.header,...(sourceStyles[sourcePage]||[])]:sourceStyles[sourcePage]||[]).map(p=>p.replace('theme/style-purple.css','theme/style-'+palette+'.css'));
|
||||
const existing=new Map([...document.querySelectorAll('[data-fuc-native]')].filter(n=>n.media==='all').map(n=>[n.href,n]));
|
||||
// Moving an active link can unload its CSS in Chromium. Keep common user CSS
|
||||
// in place; mode changes load a fresh ordered set while the old page stays styled.
|
||||
const reuse=currentStyleMode===mode;
|
||||
const links=paths.map(path=>{const url=new URL(path,base);url.searchParams.set('theme_v','0.12.4');const href=url.href;if(reuse&&existing.has(href))return existing.get(href);const n=document.createElement('link');n.rel='stylesheet';n.href=href;n.media='not all';n.dataset.fucNative='true';n.ready=new Promise((resolve,reject)=>{n.onload=resolve;n.onerror=()=>{n.remove();reject(Error('原版样式加载失败'));};});document.head.insertBefore(n,document.getElementById('native-dark')||document.getElementById('native-bridge'));return n;});
|
||||
await Promise.all([...links,...overrides].map(n=>n.ready));if(seq!==styleSequence)return;
|
||||
const activating=[...links,...overrides].some(n=>n.media!=='all');
|
||||
[...links,...overrides].forEach(n=>{n.media='all';});
|
||||
if(activating)await new Promise(resolve=>window.requestAnimationFrame?window.requestAnimationFrame(resolve):setTimeout(resolve,0));
|
||||
if(seq!==styleSequence)return;
|
||||
document.querySelectorAll('[data-fuc-native]').forEach(n=>{if(!links.includes(n))n.remove();});
|
||||
links.forEach(n=>{n.media='all';document.head.append(n);});
|
||||
currentMode=signature;
|
||||
currentMode=signature;currentStyleMode=mode;
|
||||
}
|
||||
// Original app.js selects one menu/navbar scheme after the template's two classes.
|
||||
function syncNativeMenu(root){
|
||||
@@ -36,8 +46,8 @@ export function nativeMode(mode, page='') {
|
||||
if(mode!=='home'&&nativeSwiper){try{nativeSwiper.destroy(true,true);}catch{}nativeSwiper=null;}
|
||||
if((mode!=='user'||key!=='dashboard')&&chartInstance){try{chartInstance.destroy();}catch{}chartInstance=null;}
|
||||
if(currentMode!==key+':'+getPalette())void prepareNativeMode(mode,page);
|
||||
let dark=document.getElementById('native-dark');if(!dark){dark=document.createElement('link');dark.id='native-dark';dark.rel='stylesheet';dark.href=base+'theme/cool/assets/css/theme/dark-layout.css';document.head.append(dark);}dark.disabled=mode!=='user'||document.documentElement.dataset.color!=='dark';document.head.append(dark);
|
||||
let bridge=document.getElementById('native-bridge');if(!bridge){bridge=document.createElement('link');bridge.id='native-bridge';bridge.rel='stylesheet';bridge.href=base+'bridge.css?v=0.12.0';}document.head.append(bridge);const seasonal=document.querySelector('link[data-fuc-native][href*="/seasonal.css"]');if(seasonal)document.head.append(seasonal);
|
||||
let dark=document.getElementById('native-dark');if(!dark){dark=document.createElement('link');dark.id='native-dark';dark.rel='stylesheet';dark.href=base+'theme/cool/assets/css/theme/dark-layout.css';document.head.append(dark);}dark.disabled=mode!=='user'||document.documentElement.dataset.color!=='dark';
|
||||
let bridge=document.getElementById('native-bridge');if(!bridge){bridge=document.createElement('link');bridge.id='native-bridge';bridge.rel='stylesheet';bridge.href=base+'bridge.css?v=0.12.4';document.head.append(bridge);}
|
||||
document.body.className=mode==='home'?'native-public':mode==='auth'?'vertical-layout vertical-menu-modern 1-column navbar-floating footer-static bg-full-screen-image blank-page':`vertical-layout ${innerWidth>=1200?'vertical-menu-modern menu-expanded':'vertical-overlay-menu'} navbar-floating footer-static ${document.documentElement.dataset.color==='dark'?'dark-layout':''}`;
|
||||
if(mode==='user'&&innerWidth>=1200&&localStorage.getItem('fuc_menuToggle')==='close'){document.body.classList.remove('menu-expanded');document.body.classList.add('menu-collapsed');}document.body.dataset.nativeMode=mode;document.body.dataset.menu=innerWidth>=1200?'vertical-menu-modern':'vertical-overlay-menu';document.body.classList.add(window.Pace?.running?'pace-running':'pace-done');syncNativeMenu(document);
|
||||
}
|
||||
@@ -65,7 +75,7 @@ function fill(raw,data) {return raw.replace(/__([A-Z_0-9]+)__/g,(_,key)=>data[ke
|
||||
export function nativeFooter(brand){return sanitize(templates.footer).replace(/福云/g,e(brand)).replace('SSPANEL','XB').replace('type="button" style="margin-bottom: 2.5rem"','type="button" data-action="scroll-top" style="margin-bottom: 2.5rem"').replace('href="/staff.html"','href="#" data-action="native-unavailable"');}
|
||||
export function nativeHeader(user,brand,route,config={}) {
|
||||
const html=sanitize(fill(templates.header,{NAME:e((user.email||'').split('@')[0]),EMAIL:e(user.email),BRAND:e(brand)}));
|
||||
const host=document.createElement('div');host.innerHTML=html;syncNativeMenu(host);const community=[...host.querySelectorAll('a')].find(n=>n.textContent.includes('加入 Telegram'));if(community){const url=safeUrl(config.telegram_discuss_link||'');if(url){community.href=url;community.target='_blank';community.rel='noopener noreferrer';community.removeAttribute('data-action');community.removeAttribute('title');}else{community.dataset.reason='本站暂未配置社群入口';}}host.querySelectorAll('.icon-bell').forEach(i=>{const a=i.closest('a');if(a){a.href='#/notices';a.removeAttribute('data-action');}});host.querySelectorAll('a[href^="#/"]').forEach(a=>a.removeAttribute('target'));host.querySelectorAll('.navigation-main a').forEach(a=>a.parentElement.classList.toggle('active',a.getAttribute('href')===`#/${route}`));host.querySelectorAll('[data-toggle="modal"]').forEach(n=>{n.dataset.action='native-modal';n.dataset.target=n.getAttribute('data-target');});host.querySelectorAll('[data-dismiss="modal"]').forEach(n=>n.dataset.action='native-dismiss');const save=host.querySelector('#panel_option_save');if(save)save.dataset.action='native-settings';for(const id of ['themeMod','themeLight','menuToggle']){const n=host.querySelector('#'+id);if(n){n.value=localStorage.getItem('fuc_'+id)||({themeMod:'light',themeLight:'purple',menuToggle:'open'}[id]);for(const option of n.options)option.toggleAttribute('selected',option.value===n.value);}}const logout=host.querySelector('[data-action=logout]');if(logout)logout.insertAdjacentHTML('beforebegin','<a class="dropdown-item" href="#" data-action="native-modal" data-target="#panel-option-modal"><i class="feather icon-settings"></i> 面板设置</a>');paintPaletteOptions(host);return host.innerHTML;
|
||||
const host=document.createElement('div');host.innerHTML=html;syncNativeMenu(host);const community=[...host.querySelectorAll('a')].find(n=>n.textContent.includes('加入 Telegram'));if(community){const url=safeUrl(config.telegram_discuss_link||'');if(url){community.href=url;community.target='_blank';community.rel='noopener noreferrer';community.removeAttribute('data-action');community.removeAttribute('title');}else{community.dataset.reason='本站暂未配置社群入口';}}host.querySelectorAll('.icon-bell').forEach(i=>{const a=i.closest('a');if(a){a.href='#/notices';a.removeAttribute('data-action');}});host.querySelectorAll('a[href^="#/"]').forEach(a=>a.removeAttribute('target'));host.querySelectorAll('.navigation-main a').forEach(a=>a.parentElement.classList.toggle('active',a.getAttribute('href')===`#/${route}`));host.querySelectorAll('[data-toggle="modal"]').forEach(n=>{n.dataset.action='native-modal';n.dataset.target=n.getAttribute('data-target');});host.querySelectorAll('[data-dismiss="modal"]').forEach(n=>n.dataset.action='native-dismiss');const save=host.querySelector('#panel_option_save');if(save)save.dataset.action='native-settings';for(const id of ['themeMod','themeLight','menuToggle']){const n=host.querySelector('#'+id);if(n){n.value=id==='themeLight'?getPalette():localStorage.getItem('fuc_'+id)||({themeMod:'light',menuToggle:'open'}[id]);for(const option of n.options)option.toggleAttribute('selected',option.value===n.value);}}const logout=host.querySelector('[data-action=logout]');if(logout)logout.insertAdjacentHTML('beforebegin','<a class="dropdown-item" href="#" data-action="native-modal" data-target="#panel-option-modal"><i class="feather icon-settings"></i> 面板设置</a>');return host.innerHTML;
|
||||
}
|
||||
export function nativeDashboard(user,sub,notices,brand,richText,traffic=null) {
|
||||
const usage=trafficSummary(sub,traffic),[remain,pct,today]=usage.series;
|
||||
@@ -76,7 +86,7 @@ export function nativeDashboard(user,sub,notices,brand,richText,traffic=null) {
|
||||
const checkin=host.querySelector('#checkin,.float-right > button.btn.disabled');if(checkin){checkin.classList.remove('disabled');checkin.disabled=true;checkin.title='本站未开放签到';for(const n of checkin.childNodes)if(n.nodeType===3&&n.textContent.trim())n.textContent=' 每日签到';}
|
||||
const available=!!sub.plan_id&&(sub.expired_at==null||Number(sub.expired_at)>Date.now()/1000);
|
||||
host.querySelectorAll('.btn-sub,.btn-shadowrocket').forEach(n=>{if(!available){n.classList.add('disabled');n.dataset.action='subscription-unavailable';}});
|
||||
const seriesMarker=host.querySelector('.traffic-info .series-info i');if(seriesMarker)seriesMarker.style.color=chartColors()[0];
|
||||
const seriesMarker=host.querySelector('.traffic-info .series-info i');if(seriesMarker)seriesMarker.style.color='#7D72F1';
|
||||
chartData={series:usage.series,todayKnown:usage.today!==null};const chart=host.querySelector('#donut-chart');if(chart){chart.innerHTML='';chart.hidden=!available;if(!available){const empty=document.createElement('div');empty.textContent='无可用流量';chart.before(empty);}}
|
||||
return host.innerHTML;
|
||||
}
|
||||
@@ -148,7 +158,7 @@ export function nativeSecondary(name,ctx){
|
||||
}else if(name==='article')values={D_TITLE:e(data.title),D_BODY:richText(data.body)};
|
||||
else if(name==='purchase')values=pData(data,period);
|
||||
else if(name==='checkout'){
|
||||
values={...pData(data.plan||{},data.period),O_ID:e(data.trade_no),O_NAME:e(data.plan?.name||'—'),O_COUPON:e(data.coupon?.code||'—'),O_PRICE:(Number(data.total_amount||0)/100).toFixed(2),O_STATUS:orderStatus(data.status),O_DATE:date(data.created_at),O_UPDATE:data.updated_at?date(data.updated_at):'—',O_PAID:data.paid_at?date(data.paid_at):'—'};
|
||||
values={...pData(data.plan||{},data.period),O_ID:e(data.trade_no),O_NAME:e(data.plan?.name||'—'),O_COUPON:e(data.coupon?.code||'—'),O_PRICE:(orderAmount(data)/100).toFixed(2),O_STATUS:orderStatus(data.status),O_DATE:date(data.created_at),O_UPDATE:data.updated_at?date(data.updated_at):'—',O_PAID:data.paid_at?date(data.paid_at):'—'};
|
||||
repeats={invoice_content:[values]};
|
||||
}else if(name==='invite'){
|
||||
values={RATE:e(data.stat?.[3]??'—'),WITHDRAW_MIN:e(config.commission_withdraw_limit??'—'),INVITE_URL:e(inviteUrl(data.codes?.[0]?.code))};
|
||||
@@ -171,6 +181,8 @@ export function nativeSecondary(name,ctx){
|
||||
const confirm=host.querySelector('#pay-confirm');if(confirm){makeSubmit(host,'#pay-confirm','purchase',{});confirm.removeAttribute('data-dismiss');confirm.removeAttribute('data-action');const code=document.createElement('input');code.type='hidden';code.name='coupon_code';confirm.closest('form').append(code);}
|
||||
const renew=host.querySelector('#order_modal #autorenew');if(renew){renew.disabled=true;renew.title='本站未开放自动续订';}
|
||||
}else if(name==='purchase'){
|
||||
const total=host.querySelector('#product-buy-total');if(total)total.textContent='下单后确认';
|
||||
const priceNote=document.createElement('p');priceNote.className='font-small-3 text-muted';priceNote.dataset.orderPriceNotice='';priceNote.textContent='优惠和余额抵扣以创建后的订单明细为准;取消未支付订单可退回已抵扣余额。';host.querySelector('.page-body .container-xl')?.prepend(priceNote);
|
||||
if(user.vip?.enabled===true){const rate=Number(user.vip.discount_percent||0),notice=document.createElement('p');notice.className='font-small-3 text-muted';notice.dataset.vipPrice='true';notice.textContent=`${user.vip.name||'普通用户'}:${rate?`${((100-rate)/10).toFixed(1)} 折`:'原价'},本单完成后累计消费,升级优惠从下一单生效。`;host.querySelector('.page-body .container-xl')?.prepend(notice);}
|
||||
const b=host.querySelector('#create-order');if(b){const f=document.createElement('form');f.dataset.form='purchase';b.before(f);f.append(b);b.type='submit';}
|
||||
const coupon=host.querySelector('#coupon');if(coupon){coupon.name='coupon_code';coupon.setAttribute('form','purchase-form');host.querySelector('[data-form=purchase]').id='purchase-form';}
|
||||
@@ -178,11 +190,16 @@ export function nativeSecondary(name,ctx){
|
||||
}else if(name==='checkout'){
|
||||
host.querySelectorAll('a').forEach(a=>{if(a.textContent.includes('账单')){a.href='#/orders';a.removeAttribute('data-action');a.textContent='返回订单列表';a.removeAttribute('title');}});
|
||||
const area=host.querySelector('.page-body .container-xl')||host;
|
||||
if(data.status===0){const card=document.createElement('div');card.className='card my-3';card.innerHTML=`<div class="card-header"><h3 class="card-title">支付订单</h3></div><div class="card-body"><form data-form="checkout"><div class="form-group"><label for="method">支付方式</label><select class="form-control" id="method" name="method" ${data.total_amount>0?'required':''}><option value="">请选择支付方式</option>${(ctx.methods||[]).map(m=>`<option value="${e(m.id)}">${e(m.name)}${m.handling_fee_fixed||m.handling_fee_percent?'(手续费 '+money(m.handling_fee_fixed)+' + '+e(m.handling_fee_percent||0)+'%)':''}</option>`).join('')}</select></div><p>应付 ${money(data.total_amount)};所选渠道手续费另计。</p><div id="card-element" class="my-2"></div><button class="btn btn-primary" type="submit" ${ctx.methods?.length||data.total_amount<=0?'':'disabled'}>继续支付</button> <button type="button" class="btn btn-danger" data-action="cancel-order">取消订单</button></form><div id="payment-result" class="my-2" role="status"></div><button type="button" class="btn btn-outline-primary" data-action="refresh-payment">刷新订单状态</button></div>`;area.prepend(card);}
|
||||
const settlement=document.createElement('div');settlement.className='card my-3';settlement.dataset.orderSettlement='';
|
||||
settlement.innerHTML=`<div class="card-body"><p class="mb-1">订单金额:${money(orderAmount(data))}</p><p class="mb-1">${data.status===2?'原钱包抵扣(已退回)':'钱包抵扣'}:${money(data.balance_amount)} · 旧套餐折抵:${money(Math.max(0,Number(data.surplus_amount||0)-Number(data.surplus_credit||0)))}</p><p class="mb-0">${data.status===0?'外部待付':'在线支付本金'}:${money(data.total_amount)}${Number(data.handling_amount)>0?' · 渠道手续费:'+money(data.handling_amount):''}${Number(data.surplus_credit)>0?' · 折抵返余:'+money(data.surplus_credit):''}</p></div>`;area.prepend(settlement);
|
||||
if(data.status===0){const card=document.createElement('div');card.className='card my-3';
|
||||
const method=data.total_amount>0?`<div class="form-group"><label for="method">支付方式</label><select class="form-control" id="method" name="method" required><option value="">请选择支付方式</option>${(ctx.methods||[]).map(m=>`<option value="${e(m.id)}">${e(m.name)}${m.handling_fee_fixed||m.handling_fee_percent?'(手续费 '+money(m.handling_fee_fixed)+' + '+e(m.handling_fee_percent||0)+'%)':''}</option>`).join('')}</select></div><p>外部待付 ${money(data.total_amount)};所选渠道手续费另计。</p>`:'<p>该订单无需外部支付,请确认开通。</p>';
|
||||
card.innerHTML=`<div class="card-header"><h3 class="card-title">支付订单</h3></div><div class="card-body"><form data-form="checkout">${method}<div id="card-element" class="my-2"></div><button class="btn btn-primary" type="submit" ${ctx.methods?.length||data.total_amount<=0?'':'disabled'}>${data.total_amount>0?'继续支付':'确认开通'}</button> <button type="button" class="btn btn-danger" data-action="cancel-order">取消订单</button></form><div id="payment-result" class="my-2" role="status"></div><button type="button" class="btn btn-outline-primary" data-action="refresh-payment">刷新订单状态</button></div>`;area.prepend(card);}
|
||||
|
||||
}else if(name==='orders'){
|
||||
const table=host.querySelector('table');if(table){table.querySelector('thead tr').innerHTML=['订单号','套餐','金额','状态','创建时间','操作'].map(h=>`<th>${h}</th>`).join('');const body=document.createElement('tbody');body.innerHTML=data.map(o=>`<tr><td>${e(o.trade_no)}</td><td>${e(o.plan?.name||'—')}</td><td>${money(o.total_amount)}</td><td>${orderStatus(o.status)}</td><td>${date(o.created_at)}</td><td><a class="btn btn-primary btn-sm" href="#/checkout/${encodeURIComponent(o.trade_no)}">查看</a></td></tr>`).join('');table.append(body);table.parentElement.insertAdjacentHTML('afterend',pagination(page,data.length));}
|
||||
const table=host.querySelector('table');if(table){table.querySelector('thead tr').innerHTML=['订单号','套餐','金额','状态','创建时间','操作'].map(h=>`<th>${h}</th>`).join('');const body=document.createElement('tbody');body.innerHTML=data.map(o=>`<tr><td>${e(o.trade_no)}</td><td>${e(o.plan?.name||'—')}</td><td>${money(orderAmount(o))}</td><td>${orderStatus(o.status)}</td><td>${date(o.created_at)}</td><td><a class="btn btn-primary btn-sm" href="#/checkout/${encodeURIComponent(o.trade_no)}">查看</a></td></tr>`).join('');table.append(body);table.parentElement.insertAdjacentHTML('afterend',pagination(page,data.length));}
|
||||
}else if(name==='myplan'){
|
||||
const target=host.querySelector('.card-content .card-body');if(target){target.innerHTML=fragment('planlog',common,{oUserPlanRow:(data||[]).map(o=>({O_ID:e(o.trade_no),O_NAME:e(o.plan?.name||'—'),O_PRICE:money(o.total_amount),O_STATUS:orderStatus(o.status),O_DATE:date(o.created_at)}))});target.querySelectorAll('tbody tr').forEach((tr,i)=>{const a=tr.querySelector('a');if(a)a.href=`#/checkout/${encodeURIComponent(data[i].trade_no)}`;});target.insertAdjacentHTML('afterbegin',`<p>当前套餐:${e(sub.plan?.name||'未订阅')} · 到期:${date(sub.expired_at)} <a class="btn btn-primary btn-sm" href="#/orders">全部订单</a></p>`);target.insertAdjacentHTML('beforeend',pagination(page,data.length));}
|
||||
const target=host.querySelector('.card-content .card-body');if(target){target.innerHTML=fragment('planlog',common,{oUserPlanRow:(data||[]).map(o=>({O_ID:e(o.trade_no),O_NAME:e(o.plan?.name||'—'),O_PRICE:money(orderAmount(o)),O_STATUS:orderStatus(o.status),O_DATE:date(o.created_at)}))});target.querySelectorAll('tbody tr').forEach((tr,i)=>{const a=tr.querySelector('a');if(a)a.href=`#/checkout/${encodeURIComponent(data[i].trade_no)}`;});target.insertAdjacentHTML('afterbegin',`<p>当前套餐:${e(sub.plan?.name||'未订阅')} · 到期:${date(sub.expired_at)} <a class="btn btn-primary btn-sm" href="#/orders">全部订单</a></p>`);target.insertAdjacentHTML('beforeend',pagination(page,data.length));}
|
||||
const renewPlan=ctx.renewPlan;const header=host.querySelector('.card-header h4');if(header)header.textContent=sub.plan?.name||'未订阅';
|
||||
if(renewPlan){const periods=Object.keys(periodLabels).filter(k=>canPurchase(renewPlan,user,k));if(periods.length)host.querySelector('.card-header').insertAdjacentHTML('beforeend',`<div class="dropdown"><button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-action="native-dropdown" aria-haspopup="true" aria-expanded="false">续费 / 重置流量</button><div class="dropdown-menu dropdown-menu-right">${periods.map(k=>`<a class="dropdown-item" href="#/purchase/${encodeURIComponent(renewPlan.id)}?period=${encodeURIComponent(k)}">${e(periodLabels[k])} · ${money(renewPlan[k])}</a>`).join('')}</div></div>`);}
|
||||
unavailable(host.querySelector('#autorenew'),'XB 当前未提供套餐自动续订接口');
|
||||
|
||||
Vendored
+4
@@ -11,3 +11,7 @@ body[data-native-mode=auth] .form-control[readonly]{background-color:#fff;opacit
|
||||
/* Keep the approved legacy-page sidebar compensation in the original menu transition. */
|
||||
body[data-native-mode=user] .page-wrapper{transition:300ms ease all}
|
||||
@media(min-width:1200px){body[data-native-mode=user].menu-collapsed .page-wrapper{margin-left:80px}}
|
||||
|
||||
/* Tabler's small negative spacing maps to a much larger Cool utility. Keep
|
||||
document metadata on its own line within the approved usable legacy layout. */
|
||||
body[data-native-mode=user][data-native-page=knowledge] .list-group-item .mt-n1{margin-top:0!important}
|
||||
Vendored
-189
@@ -1,189 +0,0 @@
|
||||
/* Hue rotations of original FUC green; no native layout or animation declarations. */
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout){--primary-color:#52cfbc;}
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) .brand-logo-img{filter:hue-rotate(290deg) brightness(106%);}
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) .main-menu:is(.menu-light,.menu-dark) .navigation>li.active>a{background:linear-gradient(118deg, #47ccb7, #71d7c7);box-shadow:0 0 10px 1px #6fd7c7;color:#fff;}
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) .vs-checkbox-con input:checked~.vs-checkbox{border-color:#71d7c7;}
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) .vs-checkbox-con input:checked~.vs-checkbox .vs-checkbox--check{background-color:#82dcce;}
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) .horizontal-menu .header-navbar.navbar-horizontal ul#main-menu-navigation>li.active>a{background:linear-gradient(118deg, #47ccb7, #6fd7c7);box-shadow:0px 0px 6px 1px #6fd7c7;color:#fff;}
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) .bg-primary{background-color:#3dc9b3 !important;}
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) #dashboard-analytics .bg-analytics{background:linear-gradient(118deg, #49ccb8, #72d8c8);}
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) .btn-radio.active{background-color:#52cebb;color:#FFFFFF;}
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) .nav-pills .nav-link.active,
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) .nav-pills .show>.nav-link{background-color:#52cebb;box-shadow:0 4px 18px -4px rgba(82,206,187,0.6);color:#fff;}
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) .node-pills .nav-link{color:#66d5c3;box-shadow:0 4px 6px rgba(50,50,93,0.11), 0 1px 3px rgba(0, 0, 0, .08);}
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) .btn-outline-primary:hover{background-color:rgba(115,103,240,0.08);color:#6ed7c6;}
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) .btn-outline-primary{border:1px solid #6fd7c7;color:#50ceba;}
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) .btn-primary{background-color:#5ed2c0;border-color:#6ad6c5;color:#fff;}
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) .btn-primary:hover{background-color:#64d4c2;border-color:#6fd7c7;color:#fff;}
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) .btn-primary:focus,
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) .btn-primary.focus{background-color:#79daca;box-shadow:0 0 0 0.2rem rgba(136,126,242,0.5);}
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) .btn-primary.disabled,
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) .btn-primary:disabled{background-color:#50cebb;border-color:#6ed7c6;color:#fff;}
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) .btn-primary:not(:disabled):not(.disabled):active:focus,
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) .btn-primary:not(:disabled):not(.disabled).active:focus,
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) .show>.btn-primary.dropdown-toggle:focus{box-shadow:0 0 0 0.2rem rgba(136,126,242,0.5);}
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) .main-menu .navbar-header .navbar-brand .brand-text{color:#52cfbc;}
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) .text-primary{color:#5dd2bf !important;}
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) :where(a:not(.btn,.nav-link,.dropdown-item,.navbar-brand)){color:#50cebb;}
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) :where(a:not(.btn,.nav-link,.dropdown-item,.navbar-brand)):hover{color:#6cd6c6;}
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) .pace .pace-progress{background:#6dd7c6;}
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) .card.card-hero .card-header{background-image:linear-gradient(to bottom, #43bdaa, #82dcce);color:#fff;}
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) .card.card-hero .card-header .card-icon{color:#7dd9cb;}
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) .header-navbar .navbar-container ul.nav li.dropdown-user .dropdown-menu-right .dropdown-item:hover,
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) .header-navbar .navbar-container ul.nav li.dropdown-user .dropdown-menu-right .dropdown-item:active{background:#52cfbb;color:#fff !important;}
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) .pagination .page-item.active .page-link{background-color:#61d3c1;color:#fff;}
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) .offer-slider .slide .selling-slide .shop_img img{filter:hue-rotate(290deg);}
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) .b-primary{border:1px solid #3dc9b3 !important;}
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) .badge-primary{background-color:#51cfbc;color:#fff;}
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) .nav.nav-tabs .nav-item .nav-link.active:after{background:linear-gradient(30deg, #3dc9b3, rgba(108,205,190,0.490196)) !important;box-shadow:0 0 8px 0 rgba(61,201,179,0.529412) !important;}
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) .dropdown-list .dropdown-item:focus{background-color:#3ec9b3;}
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) .dropdown-item:hover,
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) .dropdown-item:focus{color:#3ec9b3;background-color:rgba(209,252,245,0.4);}
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) .dropdown-item.active,
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) .dropdown-item:active{background-color:#3ec9b3;color:#FFFFFF;}
|
||||
html[data-fuc-palette=spring] body:is(:not([data-native-mode=user]),.dark-layout) .custom-control-input:checked~.custom-control-label::before{border-color:rgba(91,201,184,0.4);background-color:#5bc9b8;color:#FFFFFF;}
|
||||
html[data-fuc-season=summer]{--primary-color:#52a4cf;}
|
||||
html[data-fuc-season=summer] .brand-logo-img{filter:hue-rotate(320deg) brightness(106%);}
|
||||
html[data-fuc-season=summer] .main-menu:is(.menu-light,.menu-dark) .navigation>li.active>a{background:linear-gradient(118deg, #479fcc, #71b4d7);box-shadow:0 0 10px 1px #6fb3d7;color:#fff;}
|
||||
html[data-fuc-season=summer] .vs-checkbox-con input:checked~.vs-checkbox{border-color:#71b4d7;}
|
||||
html[data-fuc-season=summer] .vs-checkbox-con input:checked~.vs-checkbox .vs-checkbox--check{background-color:#82bddc;}
|
||||
html[data-fuc-season=summer] .horizontal-menu .header-navbar.navbar-horizontal ul#main-menu-navigation>li.active>a{background:linear-gradient(118deg, #479fcc, #6fb3d7);box-shadow:0px 0px 6px 1px #6fb3d7;color:#fff;}
|
||||
html[data-fuc-season=summer] .bg-primary{background-color:#3d99c9 !important;}
|
||||
html[data-fuc-season=summer] #dashboard-analytics .bg-analytics{background:linear-gradient(118deg, #499fcc, #72b5d8);}
|
||||
html[data-fuc-season=summer] .btn-radio.active{background-color:#52a3ce;color:#FFFFFF;}
|
||||
html[data-fuc-season=summer] .nav-pills .nav-link.active,
|
||||
html[data-fuc-season=summer] .nav-pills .show>.nav-link{background-color:#52a3ce;box-shadow:0 4px 18px -4px rgba(82,163,206,0.6);color:#fff;}
|
||||
html[data-fuc-season=summer] .node-pills .nav-link{color:#66b0d5;box-shadow:0 4px 6px rgba(71,50,93,0.11), 0 1px 3px rgba(0, 0, 0, .08);}
|
||||
html[data-fuc-season=summer] .btn-outline-primary:hover{background-color:rgba(184,103,240,0.08);color:#6eb3d7;}
|
||||
html[data-fuc-season=summer] .btn-outline-primary{border:1px solid #6fb3d7;color:#50a3ce;}
|
||||
html[data-fuc-season=summer] .btn-primary{background-color:#5eaad2;border-color:#6ab1d6;color:#fff;}
|
||||
html[data-fuc-season=summer] .btn-primary:hover{background-color:#64aed4;border-color:#6fb3d7;color:#fff;}
|
||||
html[data-fuc-season=summer] .btn-primary:focus,
|
||||
html[data-fuc-season=summer] .btn-primary.focus{background-color:#79b9da;box-shadow:0 0 0 0.2rem rgba(194,126,242,0.5);}
|
||||
html[data-fuc-season=summer] .btn-primary.disabled,
|
||||
html[data-fuc-season=summer] .btn-primary:disabled{background-color:#50a2ce;border-color:#6eb3d7;color:#fff;}
|
||||
html[data-fuc-season=summer] .btn-primary:not(:disabled):not(.disabled):active:focus,
|
||||
html[data-fuc-season=summer] .btn-primary:not(:disabled):not(.disabled).active:focus,
|
||||
html[data-fuc-season=summer] .show>.btn-primary.dropdown-toggle:focus{box-shadow:0 0 0 0.2rem rgba(194,126,242,0.5);}
|
||||
html[data-fuc-season=summer] .main-menu .navbar-header .navbar-brand .brand-text{color:#52a4cf;}
|
||||
html[data-fuc-season=summer] .text-primary{color:#5daad2 !important;}
|
||||
html[data-fuc-season=summer] :where(a:not(.btn,.nav-link,.dropdown-item,.navbar-brand)){color:#50a2ce;}
|
||||
html[data-fuc-season=summer] :where(a:not(.btn,.nav-link,.dropdown-item,.navbar-brand)):hover{color:#6cb1d6;}
|
||||
html[data-fuc-season=summer] .pace .pace-progress{background:#6db3d7;}
|
||||
html[data-fuc-season=summer] .card.card-hero .card-header{background-image:linear-gradient(to bottom, #4393bd, #82bddc);color:#fff;}
|
||||
html[data-fuc-season=summer] .card.card-hero .card-header .card-icon{color:#7db9d9;}
|
||||
html[data-fuc-season=summer] .header-navbar .navbar-container ul.nav li.dropdown-user .dropdown-menu-right .dropdown-item:hover,
|
||||
html[data-fuc-season=summer] .header-navbar .navbar-container ul.nav li.dropdown-user .dropdown-menu-right .dropdown-item:active{background:#52a4cf;color:#fff !important;}
|
||||
html[data-fuc-season=summer] .pagination .page-item.active .page-link{background-color:#61acd3;color:#fff;}
|
||||
html[data-fuc-season=summer] .offer-slider .slide .selling-slide .shop_img img{filter:hue-rotate(320deg);}
|
||||
html[data-fuc-season=summer] .b-primary{border:1px solid #3d99c9 !important;}
|
||||
html[data-fuc-season=summer] .badge-primary{background-color:#51a3cf;color:#fff;}
|
||||
html[data-fuc-season=summer] .nav.nav-tabs .nav-item .nav-link.active:after{background:linear-gradient(30deg, #3d99c9, rgba(108,171,205,0.490196)) !important;box-shadow:0 0 8px 0 rgba(61,153,201,0.529412) !important;}
|
||||
html[data-fuc-season=summer] .dropdown-list .dropdown-item:focus{background-color:#3e99c9;}
|
||||
html[data-fuc-season=summer] .dropdown-item:hover,
|
||||
html[data-fuc-season=summer] .dropdown-item:focus{color:#3e99c9;background-color:rgba(209,238,252,0.4);}
|
||||
html[data-fuc-season=summer] .dropdown-item.active,
|
||||
html[data-fuc-season=summer] .dropdown-item:active{background-color:#3e99c9;color:#FFFFFF;}
|
||||
html[data-fuc-season=summer] .custom-control-input:checked~.custom-control-label::before{border-color:rgba(91,163,201,0.4);background-color:#5ba3c9;color:#FFFFFF;}
|
||||
html[data-fuc-season=autumn]{--primary-color:#cf9652;}
|
||||
html[data-fuc-season=autumn] .brand-logo-img{filter:hue-rotate(152deg) brightness(106%);}
|
||||
html[data-fuc-season=autumn] .main-menu:is(.menu-light,.menu-dark) .navigation>li.active>a{background:linear-gradient(118deg, #cc8f47, #d7a871);box-shadow:0 0 10px 1px #d7a86f;color:#fff;}
|
||||
html[data-fuc-season=autumn] .vs-checkbox-con input:checked~.vs-checkbox{border-color:#d7a871;}
|
||||
html[data-fuc-season=autumn] .vs-checkbox-con input:checked~.vs-checkbox .vs-checkbox--check{background-color:#dcb382;}
|
||||
html[data-fuc-season=autumn] .horizontal-menu .header-navbar.navbar-horizontal ul#main-menu-navigation>li.active>a{background:linear-gradient(118deg, #cc8f47, #d7a86f);box-shadow:0px 0px 6px 1px #d7a86f;color:#fff;}
|
||||
html[data-fuc-season=autumn] .bg-primary{background-color:#c9893d !important;}
|
||||
html[data-fuc-season=autumn] #dashboard-analytics .bg-analytics{background:linear-gradient(118deg, #cc9149, #d8a972);}
|
||||
html[data-fuc-season=autumn] .btn-radio.active{background-color:#ce9652;color:#FFFFFF;}
|
||||
html[data-fuc-season=autumn] .nav-pills .nav-link.active,
|
||||
html[data-fuc-season=autumn] .nav-pills .show>.nav-link{background-color:#ce9652;box-shadow:0 4px 18px -4px rgba(206,150,82,0.6);color:#fff;}
|
||||
html[data-fuc-season=autumn] .node-pills .nav-link{color:#d5a266;box-shadow:0 4px 6px rgba(63,93,50,0.11), 0 1px 3px rgba(0, 0, 0, .08);}
|
||||
html[data-fuc-season=autumn] .btn-outline-primary:hover{background-color:rgba(132,240,103,0.08);color:#d7a76e;}
|
||||
html[data-fuc-season=autumn] .btn-outline-primary{border:1px solid #d7a86f;color:#ce9450;}
|
||||
html[data-fuc-season=autumn] .btn-primary{background-color:#d29d5e;border-color:#d6a56a;color:#fff;}
|
||||
html[data-fuc-season=autumn] .btn-primary:hover{background-color:#d4a064;border-color:#d7a86f;color:#fff;}
|
||||
html[data-fuc-season=autumn] .btn-primary:focus,
|
||||
html[data-fuc-season=autumn] .btn-primary.focus{background-color:#daad79;box-shadow:0 0 0 0.2rem rgba(151,242,126,0.5);}
|
||||
html[data-fuc-season=autumn] .btn-primary.disabled,
|
||||
html[data-fuc-season=autumn] .btn-primary:disabled{background-color:#ce9550;border-color:#d7a76e;color:#fff;}
|
||||
html[data-fuc-season=autumn] .btn-primary:not(:disabled):not(.disabled):active:focus,
|
||||
html[data-fuc-season=autumn] .btn-primary:not(:disabled):not(.disabled).active:focus,
|
||||
html[data-fuc-season=autumn] .show>.btn-primary.dropdown-toggle:focus{box-shadow:0 0 0 0.2rem rgba(151,242,126,0.5);}
|
||||
html[data-fuc-season=autumn] .main-menu .navbar-header .navbar-brand .brand-text{color:#cf9652;}
|
||||
html[data-fuc-season=autumn] .text-primary{color:#d29c5d !important;}
|
||||
html[data-fuc-season=autumn] :where(a:not(.btn,.nav-link,.dropdown-item,.navbar-brand)){color:#ce9550;}
|
||||
html[data-fuc-season=autumn] :where(a:not(.btn,.nav-link,.dropdown-item,.navbar-brand)):hover{color:#d6a66c;}
|
||||
html[data-fuc-season=autumn] .pace .pace-progress{background:#d7a66d;}
|
||||
html[data-fuc-season=autumn] .card.card-hero .card-header{background-image:linear-gradient(to bottom, #bd8543, #dcb382);color:#fff;}
|
||||
html[data-fuc-season=autumn] .card.card-hero .card-header .card-icon{color:#d9af7d;}
|
||||
html[data-fuc-season=autumn] .header-navbar .navbar-container ul.nav li.dropdown-user .dropdown-menu-right .dropdown-item:hover,
|
||||
html[data-fuc-season=autumn] .header-navbar .navbar-container ul.nav li.dropdown-user .dropdown-menu-right .dropdown-item:active{background:#cf9652;color:#fff !important;}
|
||||
html[data-fuc-season=autumn] .pagination .page-item.active .page-link{background-color:#d39f61;color:#fff;}
|
||||
html[data-fuc-season=autumn] .offer-slider .slide .selling-slide .shop_img img{filter:hue-rotate(152deg);}
|
||||
html[data-fuc-season=autumn] .b-primary{border:1px solid #c9893d !important;}
|
||||
html[data-fuc-season=autumn] .badge-primary{background-color:#cf9651;color:#fff;}
|
||||
html[data-fuc-season=autumn] .nav.nav-tabs .nav-item .nav-link.active:after{background:linear-gradient(30deg, #c9893d, rgba(205,161,108,0.490196)) !important;box-shadow:0 0 8px 0 rgba(201,137,61,0.529412) !important;}
|
||||
html[data-fuc-season=autumn] .dropdown-list .dropdown-item:focus{background-color:#c9893e;}
|
||||
html[data-fuc-season=autumn] .dropdown-item:hover,
|
||||
html[data-fuc-season=autumn] .dropdown-item:focus{color:#c9893e;background-color:rgba(252,232,209,0.4);}
|
||||
html[data-fuc-season=autumn] .dropdown-item.active,
|
||||
html[data-fuc-season=autumn] .dropdown-item:active{background-color:#c9893e;color:#FFFFFF;}
|
||||
html[data-fuc-season=autumn] .custom-control-input:checked~.custom-control-label::before{border-color:rgba(201,151,91,0.4);background-color:#c9975b;color:#FFFFFF;}
|
||||
html[data-fuc-season=winter]{--primary-color:#525bcf;}
|
||||
html[data-fuc-season=winter] .brand-logo-img{filter:hue-rotate(355deg) brightness(106%);}
|
||||
html[data-fuc-season=winter] .main-menu:is(.menu-light,.menu-dark) .navigation>li.active>a{background:linear-gradient(118deg, #4751cc, #7178d7);box-shadow:0 0 10px 1px #6f76d7;color:#fff;}
|
||||
html[data-fuc-season=winter] .vs-checkbox-con input:checked~.vs-checkbox{border-color:#7178d7;}
|
||||
html[data-fuc-season=winter] .vs-checkbox-con input:checked~.vs-checkbox .vs-checkbox--check{background-color:#8288dc;}
|
||||
html[data-fuc-season=winter] .horizontal-menu .header-navbar.navbar-horizontal ul#main-menu-navigation>li.active>a{background:linear-gradient(118deg, #4751cc, #6f76d7);box-shadow:0px 0px 6px 1px #6f76d7;color:#fff;}
|
||||
html[data-fuc-season=winter] .bg-primary{background-color:#3d47c9 !important;}
|
||||
html[data-fuc-season=winter] #dashboard-analytics .bg-analytics{background:linear-gradient(118deg, #4952cc, #7279d8);}
|
||||
html[data-fuc-season=winter] .btn-radio.active{background-color:#525bce;color:#FFFFFF;}
|
||||
html[data-fuc-season=winter] .nav-pills .nav-link.active,
|
||||
html[data-fuc-season=winter] .nav-pills .show>.nav-link{background-color:#525bce;box-shadow:0 4px 18px -4px rgba(82,91,206,0.6);color:#fff;}
|
||||
html[data-fuc-season=winter] .node-pills .nav-link{color:#666fd5;box-shadow:0 4px 6px rgba(93,50,89,0.11), 0 1px 3px rgba(0, 0, 0, .08);}
|
||||
html[data-fuc-season=winter] .btn-outline-primary:hover{background-color:rgba(240,103,217,0.08);color:#6e76d7;}
|
||||
html[data-fuc-season=winter] .btn-outline-primary{border:1px solid #6f76d7;color:#505ace;}
|
||||
html[data-fuc-season=winter] .btn-primary{background-color:#5e66d2;border-color:#6a72d6;color:#fff;}
|
||||
html[data-fuc-season=winter] .btn-primary:hover{background-color:#646dd4;border-color:#6f76d7;color:#fff;}
|
||||
html[data-fuc-season=winter] .btn-primary:focus,
|
||||
html[data-fuc-season=winter] .btn-primary.focus{background-color:#7981da;box-shadow:0 0 0 0.2rem rgba(242,126,222,0.5);}
|
||||
html[data-fuc-season=winter] .btn-primary.disabled,
|
||||
html[data-fuc-season=winter] .btn-primary:disabled{background-color:#5059ce;border-color:#6e76d7;color:#fff;}
|
||||
html[data-fuc-season=winter] .btn-primary:not(:disabled):not(.disabled):active:focus,
|
||||
html[data-fuc-season=winter] .btn-primary:not(:disabled):not(.disabled).active:focus,
|
||||
html[data-fuc-season=winter] .show>.btn-primary.dropdown-toggle:focus{box-shadow:0 0 0 0.2rem rgba(242,126,222,0.5);}
|
||||
html[data-fuc-season=winter] .main-menu .navbar-header .navbar-brand .brand-text{color:#525bcf;}
|
||||
html[data-fuc-season=winter] .text-primary{color:#5d66d2 !important;}
|
||||
html[data-fuc-season=winter] :where(a:not(.btn,.nav-link,.dropdown-item,.navbar-brand)){color:#5059ce;}
|
||||
html[data-fuc-season=winter] :where(a:not(.btn,.nav-link,.dropdown-item,.navbar-brand)):hover{color:#6c73d6;}
|
||||
html[data-fuc-season=winter] .pace .pace-progress{background:#6d75d7;}
|
||||
html[data-fuc-season=winter] .card.card-hero .card-header{background-image:linear-gradient(to bottom, #434cbd, #8288dc);color:#fff;}
|
||||
html[data-fuc-season=winter] .card.card-hero .card-header .card-icon{color:#7d83d9;}
|
||||
html[data-fuc-season=winter] .header-navbar .navbar-container ul.nav li.dropdown-user .dropdown-menu-right .dropdown-item:hover,
|
||||
html[data-fuc-season=winter] .header-navbar .navbar-container ul.nav li.dropdown-user .dropdown-menu-right .dropdown-item:active{background:#525ccf;color:#fff !important;}
|
||||
html[data-fuc-season=winter] .pagination .page-item.active .page-link{background-color:#616ad3;color:#fff;}
|
||||
html[data-fuc-season=winter] .offer-slider .slide .selling-slide .shop_img img{filter:hue-rotate(355deg);}
|
||||
html[data-fuc-season=winter] .b-primary{border:1px solid #3d47c9 !important;}
|
||||
html[data-fuc-season=winter] .badge-primary{background-color:#5159cf;color:#fff;}
|
||||
html[data-fuc-season=winter] .nav.nav-tabs .nav-item .nav-link.active:after{background:linear-gradient(30deg, #3d47c9, rgba(108,115,205,0.490196)) !important;box-shadow:0 0 8px 0 rgba(61,71,201,0.529412) !important;}
|
||||
html[data-fuc-season=winter] .dropdown-list .dropdown-item:focus{background-color:#3e48c9;}
|
||||
html[data-fuc-season=winter] .dropdown-item:hover,
|
||||
html[data-fuc-season=winter] .dropdown-item:focus{color:#3e48c9;background-color:rgba(209,212,252,0.4);}
|
||||
html[data-fuc-season=winter] .dropdown-item.active,
|
||||
html[data-fuc-season=winter] .dropdown-item:active{background-color:#3e48c9;color:#FFFFFF;}
|
||||
html[data-fuc-season=winter] .custom-control-input:checked~.custom-control-label::before{border-color:rgba(91,99,201,0.4);background-color:#5b63c9;color:#FFFFFF;}
|
||||
/* Preserve the original neutral surfaces and dark layout; only seasonal accents change. */
|
||||
html[data-fuc-season] .bg-gradient-primary{background:linear-gradient(118deg,var(--season-deep),var(--season-bright))!important;}
|
||||
html[data-fuc-season] .custom-control-input:focus~.custom-control-label:before{box-shadow:0 0 0 .2rem rgba(var(--season-rgb),.25);}
|
||||
html[data-fuc-season] .fuc-sidebar-mark,html[data-fuc-season] .fuc-auth-mark{filter:var(--season-logo);}
|
||||
html:is([data-fuc-season],[data-fuc-palette=spring]) .native-public .hero-1{background-color:var(--season-primary);background-blend-mode:luminosity;}
|
||||
html:is([data-fuc-season],[data-fuc-palette=spring]) .native-public .navbar-brand img{filter:var(--season-logo);}
|
||||
html:is([data-fuc-season],[data-fuc-palette=spring]) .native-public #navbar:not(.nav-sticky) .navbar-brand img{filter:brightness(0) invert(1);}
|
||||
html:is([data-fuc-season],[data-fuc-palette=spring]) .native-public .bg-light{background-color:var(--season-tint)!important;}
|
||||
html:is([data-fuc-season],[data-fuc-palette=spring]) .native-public .nav-sticky .nav-link.active,html:is([data-fuc-season],[data-fuc-palette=spring]) .native-public .nav-sticky .nav-link:hover{color:var(--season-primary);}
|
||||
html:is([data-fuc-season],[data-fuc-palette=spring]) .native-public .nav-btn{background-color:var(--season-primary);border-color:var(--season-primary);color:#fff;}
|
||||
html:is([data-fuc-season],[data-fuc-palette=spring]) .native-public .pricing [style*="color:#3c2299"]{color:var(--season-primary)!important;}
|
||||
html:is([data-fuc-season],[data-fuc-palette=spring]) .native-public .btn-light{color:var(--season-primary);}
|
||||
/* Brand ink must remain legible while cached light/dark styles are prepared. */
|
||||
html:is([data-fuc-season],[data-fuc-palette=spring]) .fuc-brand-wordmark{background-color:#5e5873;}
|
||||
html:is([data-fuc-season],[data-fuc-palette=spring]) .dark-layout .fuc-brand-wordmark{background-color:#e7e5f4;}
|
||||
.season-swatch{display:inline-block;width:10px;height:10px;border-radius:50%;margin-right:6px;}
|
||||
@@ -1,39 +1,15 @@
|
||||
// Spring uses the original FUC cyan stylesheet; other seasons rotate its hues only.
|
||||
export function rotateColor(hex,degrees=0){
|
||||
const [r,g,b]=hex.slice(1).match(/../g).map(c=>parseInt(c,16)/255),max=Math.max(r,g,b),min=Math.min(r,g,b),d=max-min,l=(max+min)/2;
|
||||
if(!d)return hex;
|
||||
const s=d/(1-Math.abs(2*l-1));let h=max===r?((g-b)/d)%6:max===g?(b-r)/d+2:(r-g)/d+4;
|
||||
h=((h*60+degrees)%360+360)%360;const c=(1-Math.abs(2*l-1))*s,x=c*(1-Math.abs((h/60)%2-1)),m=l-c/2;
|
||||
const rgb=h<60?[c,x,0]:h<120?[x,c,0]:h<180?[0,c,x]:h<240?[0,x,c]:h<300?[x,0,c]:[c,0,x];
|
||||
return '#'+rgb.map(v=>Math.round((v+m)*255).toString(16).padStart(2,'0')).join('');
|
||||
// Original FUC user palettes. Public landing styles remain independent.
|
||||
export const palettes=Object.freeze({purple:{label:'紫色'},cyan:{label:'绿色'}});
|
||||
const retired=new Set(['spring','summer','autumn','winter']);
|
||||
export function getPalette(storage=localStorage){
|
||||
const id=storage.getItem('fuc_themeLight');
|
||||
return id==='cyan'||id==='spring'?'cyan':'purple';
|
||||
}
|
||||
const season=(label,rotation)=>({label,rotation,native:'cyan',primary:rotateColor('#52cfbc',rotation),button:rotateColor('#5ed2c0',rotation),deep:rotateColor('#47ccb7',rotation),bright:rotateColor('#71d7c7',rotation),tint:rotateColor('#ebfaf7',rotation),logo:`hue-rotate(${290+rotation}deg)`});
|
||||
export const palettes=Object.freeze({
|
||||
purple:{label:'紫色',primary:'#6200ee',native:'purple'},
|
||||
spring:season('春 · 原版绿色',0),
|
||||
summer:season('夏 · 晴空蓝',30),
|
||||
autumn:season('秋 · 杏叶橙',222),
|
||||
winter:season('冬 · 冰川蓝',65)
|
||||
});
|
||||
export function getPalette(storage=localStorage){const id=storage.getItem('fuc_themeLight');return id==='cyan'?'spring':Object.hasOwn(palettes,id)?id:'purple';}
|
||||
export function nativePalette(storage=localStorage){return palettes[getPalette(storage)].native;}
|
||||
export function applyPalette(doc=document,storage=localStorage){
|
||||
const id=getPalette(storage),palette=palettes[id],root=doc.documentElement;
|
||||
root.dataset.fucPalette=id;
|
||||
for(const key of Array.from(root.style))if(key.startsWith('--season-'))root.style.removeProperty(key);
|
||||
delete root.dataset.fucSeason;
|
||||
if(palette.rotation===undefined)return id;
|
||||
// The spring light user area keeps its original stylesheet; dark/public accents are extended.
|
||||
if(id!=='spring')root.dataset.fucSeason=id;
|
||||
for(const key of ['primary','deep','bright','tint','logo'])root.style.setProperty('--season-'+key,palette[key]);
|
||||
root.style.setProperty('--season-rgb',palette.primary.slice(1).match(/../g).map(c=>parseInt(c,16)).join(', '));
|
||||
return id;
|
||||
}
|
||||
export function chartColors(storage=localStorage){const id=getPalette(storage);return [id==='purple'||id==='spring'?'#7D72F1':palettes[id].primary,'#FF9F43','#EA5455'];}
|
||||
export function paintPaletteOptions(root,storage=localStorage){
|
||||
const select=root.querySelector('#themeLight');if(!select)return;
|
||||
select.innerHTML=Object.entries(palettes).map(([value,p])=>`<option value="${value}"${value===getPalette(storage)?' selected':''}>${p.label}</option>`).join('');select.value=getPalette(storage);
|
||||
const label=[...select.parentElement.childNodes].find(n=>n.nodeType===3&&n.textContent.trim());if(label)label.textContent='配色主题:';
|
||||
const oldDark=root.querySelector('#themeDark')?.closest('.form-group');
|
||||
if(oldDark){oldDark.classList.add('season-palette-options');oldDark.innerHTML='<p class="text-muted mb-1">春季沿用原版绿色,其余三季延续同样的清亮色阶。</p><div class="d-flex flex-wrap">'+Object.entries(palettes).filter(([,p])=>p.rotation!==undefined).map(([id,p])=>`<span class="mr-2 mb-1"><i class="season-swatch" style="background:${p.primary}" aria-hidden="true"></i>${p.label}</span>`).join('')+'</div>';}
|
||||
const id=getPalette(storage),root=doc.documentElement;
|
||||
if(retired.has(storage.getItem('fuc_themeLight')))storage.setItem('fuc_themeLight',id);
|
||||
delete root.dataset.fucPalette;
|
||||
delete root.dataset.fucSeason;
|
||||
for(const key of Array.from(root.style))if(key.startsWith('--season-'))root.style.removeProperty(key);
|
||||
return id;
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import {paymentResult,safeUrl} from './core.mjs?v=0.12.0';
|
||||
import QRCode from './vendor/qrcode.mjs?v=0.12.0';
|
||||
import {loadScript} from './captcha.mjs?v=0.12.0';
|
||||
import {paymentResult,safeUrl} from './core.mjs?v=0.12.4';
|
||||
import QRCode from './vendor/qrcode.mjs?v=0.12.4';
|
||||
import {loadScript} from './captcha.mjs?v=0.12.4';
|
||||
export async function mountCard(api,id,container) {
|
||||
const key=await api('user/comm/getStripePublicKey',{id});
|
||||
if(typeof key!=='string'||!key.startsWith('pk_'))throw Error('银行卡支付未配置有效公钥');
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {safeUrl} from './core.mjs?v=0.12.0';
|
||||
import {safeUrl} from './core.mjs?v=0.12.4';
|
||||
|
||||
// Use XB's public subscription filters; do not invent per-format backend routes.
|
||||
export function subscriptionUrl(raw,client='general') {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "Fuc",
|
||||
"description": "直接复用新版FUC原始用户模板、样式、图标及素材,接入XB接口;XB管理员后台保持原样。",
|
||||
"version": "0.12.0",
|
||||
"version": "0.12.4",
|
||||
"images": "",
|
||||
"configs": [
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script>window.fucSettings = @json(['title' => ($theme_config['brand_name'] ?? '') ?: $title, 'description' => $theme_config['tagline'] ?? $description]);</script>
|
||||
<script type="module" src="/theme/{{ $theme }}/assets/app.mjs?v=0.12.0"></script>
|
||||
<script type="module" src="/theme/{{ $theme }}/assets/app.mjs?v=0.12.4"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user