Compare commits

...
26 changed files with 780 additions and 12 deletions

No files matched your search

+66
View File
@@ -0,0 +1,66 @@
<?php
namespace App\Services;
use App\Models\Articles;
final class ArticleRecommendations
{
public const SLOT = '<!-- fna-airport-recommendations -->';
public static function providers(): array
{
if (! config('airport_recommendations.enabled')) return [];
$providers = array_filter(config('airport_recommendations.providers', []), fn ($p) =>
($p['enabled'] ?? false) && filter_var($p['url'] ?? '', FILTER_VALIDATE_URL)
&& in_array(parse_url($p['url'], PHP_URL_SCHEME), ['https', 'http'], true));
uasort($providers, fn ($a, $b) => ($a['order'] ?? 0) <=> ($b['order'] ?? 0));
return $providers;
}
/** Presentation only: article storage, API receipts and subscription bytes stay intact. */
public static function prepare(Articles $article): array
{
$html = $article->sContent ?? '';
$category = $article->oCategory;
$slug = $category?->sSlug;
$scope = in_array($slug, ['freenode', 'shadowrocketids', 'advanced', 'client'], true)
|| $category?->oParent?->sSlug === 'client';
$enabled = $scope && self::providers() !== [];
if (! $enabled) return ['body' => $html, 'enabled' => false, 'inline' => false];
$inline = false;
if (in_array($slug, ['freenode', 'shadowrocketids'], true)) {
// Match the known legacy heading and its own Fuyun link, bounded by the next heading.
if (preg_match('~(?:<p\b[^>]*>\s*)?<h[2-6]\b[^>]*>\s*机场推荐\s*[-—-::]*\s*福云\s*[::]?\s*</h[2-6]>~u', $html, $head, PREG_OFFSET_CAPTURE)) {
$start = $head[0][1];$from = $start + strlen($head[0][0]);
$tail = substr($html, $from);
if (preg_match('~<h[1-6]\b~i', $tail, $next, PREG_OFFSET_CAPTURE)) $tail = substr($tail, 0, $next[0][1]);
preg_match_all('~<a\b[^>]*>.*?</a>~si', $tail, $links, PREG_OFFSET_CAPTURE);
foreach ($links[0] as [$link, $offset]) {
$text = html_entity_decode(strip_tags($link), ENT_QUOTES | ENT_HTML5, 'UTF-8');
if (! str_contains($text, '机场官网') || ! str_contains($text, '福云')) continue;
$end = $from + $offset + strlen($link);
if (preg_match('~\A(?:\s|</(?:b|strong|p)>)*~i', substr($html, $end), $closing)) $end += strlen($closing[0]);
$html = substr($html, 0, $start).self::SLOT.substr($html, $end);
$inline = true;
break;
}
}
}
if ($slug === 'advanced') {
$anchor = '#'.config('airport_recommendations.anchor');
if (! str_contains($html, $anchor)) {
$jump = '<p class="airport-recommendation-jump">如果需要更稳定的线路,可以从文末的<a href="'.e($anchor).'">机场推荐</a>中选择。</p>';
$inserted = false;
$html = preg_replace_callback('~<p\b[^>]*>.*?</p>~si', function ($m) use (&$inserted, $jump) {
if ($inserted || ! preg_match('/免费节点|订阅|稳定|机场|线路/u', strip_tags($m[0]))) return $m[0];
$inserted = true;
return $m[0].$jump;
}, $html);
if (! $inserted) $html .= $jump;
}
}
return ['body' => $html, 'enabled' => true, 'inline' => $inline];
}
}
+93
View File
@@ -0,0 +1,93 @@
<?php
namespace App\Services;
use DOMDocument;
use DOMElement;
/** Read-only adaptation of the legacy daily-node article into a task-oriented layout. */
final class FreeNodeArticleLayout
{
public static function prepare(string $html): ?array
{
if (!preg_match('~(?:<p\b[^>]*>\s*)?<h[2-6]\b[^>]*>\s*免费节点订阅链接\s*[::]?\s*</h[2-6]>(?:\s*</p>)?~u', $html, $heading, PREG_OFFSET_CAPTURE)) return null;
if (!preg_match('~<p\b[^>]*>\s*温馨提示\s*[::]?\s*</p>~u', $html, $help, PREG_OFFSET_CAPTURE, $heading[0][1])) return null;
$start = $heading[0][1];$from = $start + strlen($heading[0][0]);$end = $help[0][1];
$intro = self::fragment(str_replace(ArticleRecommendations::SLOT, '', substr($html, 0, $start)));
$subscriptions = self::fragment(substr($html, $from, $end - $from));
if (!$intro || !$subscriptions) return null;
$result = ['count' => null, 'speed' => null, 'regions' => [], 'community' => [], 'intro' => '', 'notes' => '', 'subscriptions' => [], 'usage' => substr($html, $end + strlen($help[0][0]))];
foreach (iterator_to_array($intro->childNodes) as $node) {
$text = self::text($node->textContent);
if ($text === '') continue;
if (preg_match('/^本次更新共\s*(\d+)\s*个可用节点[,,]\s*最高速度\s*([^。]+)[。]?$/u', $text, $m)) {
$result['count'] = (int)$m[1];$result['speed'] = trim($m[2]);continue;
}
if (preg_match('/^覆盖(.+?)等多个区域[。]?$/u', $text, $m)) {
$result['regions'] = array_values(array_unique(array_filter(array_map('trim', preg_split('/[、,,]/u', $m[1])))));continue;
}
if (str_starts_with($text, '复制下方订阅链接')) continue;
if ($node instanceof DOMElement && preg_match('/点击加入我们的tg频道|点击关注我们的github仓库/u', $text)) {
$recognized = false;
foreach ($node->getElementsByTagName('a') as $a) {
$url = $a->getAttribute('href');$host = strtolower(parse_url($url, PHP_URL_HOST) ?? '');
if (parse_url($url, PHP_URL_SCHEME) !== 'https' || !in_array($host, ['t.me', 'github.com'], true)) continue;
$result['community'][] = ['url' => $url, 'label' => $host === 't.me' ? 'Telegram 更新频道' : 'GitHub 项目仓库'];$recognized = true;
}
if ($recognized) continue;
}
$result['intro'] .= $intro->ownerDocument->saveHTML($node);
}
$urls = [];
foreach (iterator_to_array($subscriptions->getElementsByTagName('a')) as $a) {
if (!$a->hasAttribute('data-clipboard-text')) continue;
$url = $a->getAttribute('data-clipboard-text');
if (!filter_var($url, FILTER_VALIDATE_URL) || !in_array(parse_url($url, PHP_URL_SCHEME), ['http', 'https'], true)) return null;
$path = parse_url($url, PHP_URL_PATH) ?? '';
$type = match (true) {
(bool)preg_match('/-clash\.(yaml|yml)$/i', $path) => ['key'=>'clash', 'title'=>'Clash / Mihomo', 'format'=>'YAML', 'clients'=>'Clash Verge Rev、Mihomo 等客户端', 'symbol'=>'C'],
(bool)preg_match('/-singbox\.(txt|json)$/i', $path) => ['key'=>'singbox', 'title'=>'Sing-box / Hiddify', 'format'=>'SING-BOX', 'clients'=>'Sing-box、Hiddify 等客户端', 'symbol'=>'S'],
(bool)preg_match('/-v2ray\.txt$/i', $path) => ['key'=>'v2ray', 'title'=>'V2ray / Shadowrocket', 'format'=>'通用订阅', 'clients'=>'v2rayNG、Shadowrocket 等客户端', 'symbol'=>'V'],
default => null,
};
// Unknown formats keep the original article rather than dropping a subscription.
if (!$type || isset($result['subscriptions'][$type['key']])) return null;
$result['subscriptions'][$type['key']] = $type + ['url'=>$url];$urls[] = $url;
}
if ($result['subscriptions'] === []) return null;
// Keep every supplementary note while removing only labels/URLs now shown in cards.
foreach (iterator_to_array($subscriptions->childNodes) as $node) {
$text = self::text($node->textContent);
if ($text === '' || in_array($text, $urls, true) || preg_match('/订阅链接\s*[::]$/u', $text)) continue;
if ($node instanceof DOMElement && ($node->hasAttribute('data-clipboard-text') || $node->getElementsByTagName('a')->length)) {
foreach (iterator_to_array($node->getElementsByTagName('a')) as $link) {
if ($link->hasAttribute('data-clipboard-text')) $link->parentNode->removeChild($link);
}
if (self::text($node->textContent) === '' || in_array(self::text($node->textContent), $urls, true)) continue;
}
$result['notes'] .= $subscriptions->ownerDocument->saveHTML($node);
}
$order = ['clash'=>0, 'v2ray'=>1, 'singbox'=>2];
uasort($result['subscriptions'], fn ($a, $b) => $order[$a['key']] <=> $order[$b['key']]);
$result['subscriptions'] = array_values($result['subscriptions']);
return $result;
}
private static function text(string $text): string
{
return trim(preg_replace('/\s+/u', ' ', $text));
}
private static function fragment(string $html): ?DOMElement
{
$dom = new DOMDocument('1.0', 'UTF-8');$before = libxml_use_internal_errors(true);
try {
$dom->loadHTML('<?xml encoding="UTF-8"><html><body><div id="fn-root">'.$html.'</div></body></html>', LIBXML_NONET);
return $dom->getElementById('fn-root');
} catch (\Throwable) {
return null;
} finally {
libxml_clear_errors();libxml_use_internal_errors($before);
}
}
}
+33
View File
@@ -0,0 +1,33 @@
<?php
return [
'enabled' => env('AIRPORT_RECOMMENDATIONS_ENABLED', true),
'anchor' => 'airport-recommendations',
// User-supplied commercial copy. Edit here once, then clear config/response caches.
'providers' => [
'fuc' => [
'enabled' => true, 'order' => 10, 'name' => '福云', 'tagline' => '日常之选',
'url' => env('AIRPORT_FUC_URL', 'https://xn--123-9i9dj97q.com/'),
'price' => '18', 'period' => '元 / 月',
'features' => ['流媒体解锁', 'AI 解锁'],
'description' => '老牌机场,套餐性价比高,适合日常娱乐办公',
'coupon' => 'clashfreenode.com', 'discount' => '9 折',
],
'dpl' => [
'enabled' => true, 'order' => 20, 'name' => 'DP-LINK.NET', 'tagline' => '专线服务',
'url' => env('AIRPORT_DPL_URL', 'https://dp-link.net/'),
'price' => '26', 'period' => '元 / 月',
'features' => ['流媒体解锁', 'AI 解锁'],
'description' => '专线机场,适合对网络质量有要求的用户',
'coupon' => 'clashfreenode.com', 'discount' => '9 折',
],
'hn' => [
'enabled' => true, 'order' => 30, 'name' => 'hardnerd', 'tagline' => '灵活套餐',
'url' => env('AIRPORT_HN_URL', 'https://hardnerd.net/'),
'price' => '28', 'period' => '元 / 月',
'features' => ['流媒体解锁', 'AI 解锁'],
'description' => '专线机场,适合对网络质量有要求的用户,有一次性套餐',
'coupon' => null, 'discount' => null,
],
],
];
+30
View File
@@ -116,3 +116,33 @@ ## 单张随机广告(2026-10-31)
应用提交 `cb8cd8467a8a61ef09deaa9a24c78e4c4dbed3f4` 已Git推送 `codex/random-ad-20261031` 并正式检出;恢复点 VPS-003 `/root/backups/cfn-random-ad-20261031`。回滚只撤本批增量,可先将show模板切回独立HN组件;不得整库/整站回退覆盖并行更新。
本地真实Blade组件隔离页已在浏览器验收:桌面760×310、390视口342×140,无横向溢出;活动DOM始终单图,观察到HN→福云变化,CDP网络仅一次选中福云图片请求。3项脚本测试通过,覆盖三个抽样区间、bfcache恢复、单个/零候选。截图与证据见 `output/random-ad-20261031/`。56项生产服务器HTML/资源检查全部通过,回执 `verification.json`;已完成服务器侧验收,未做线上页面验收。文档后续部署不改变应用文件。
## TG图标协调(2026-10-31,仅本地)
用户反馈TG蓝色实心图标突兀,随后明确本次先只改本地。`components.telegram-link` 去掉固定蓝色、36px自定义尺寸,使用导航现有btn-link/btn-icon/btn-sm继承灰色及深色模式/交互样式;按后续要求使用18px实心纸飞机,包裹与其他按钮相同的居中span。链接与无障碍说明保留。
真实本地导航组件、现有构建CSS隔离验收:TG/GitHub/搜索均为rgb(141,143,150)、32×32,垂直中心35px一致;初版线框截图 `output/tg-icon-polish-20261031/local-preview.png`,后续实心版截图 `output/tg-icon-polish-20261031/solid-local-preview.png`。临时验收页用后删除。未提交、推送或部署,本次线上仍保留此前蓝色图标。准备的发布脚本未执行,不把线上只读核对当作发布。
## 广告高度(2026-10-31,仅本地)
用户要求广告高度调到原来三分之二。最初仅将单张随机广告组件的比例2.45改为3.675、object-fit改为contain。用户随后明确否定直接缩放旧图,要求按矮横幅重新设计;此初版已被下述三张重设计替代。保持原单张抽样、template延迟载入与noscript回退,不改候选、素材、跳转地址或JS。桌面718px宽约195.37px高(原293.06px),手机322px宽约87.62px高(原131.43px),均为66.7%;活动DOM仅1张图。未提交/推送或发布,生产仍沿前述原尺寸。
## 矮横幅重设计(2026-10-31,仅本地)
用户明确高度为原来三分之二,需重新设计而非等比缩旧图。内置image_gen分别生成DPL/HN/FUC新构图,文件为 `public/images/ads/{dpl,hn,fuc}-ad-compact-20261031.png`,完整提示词与原始尺寸清单在 `output/compact-ads-20261031/`。不覆盖旧文件。DPL改为横向三地区卡片与左右分区;HN保留眼镜H、Hardnerd和用户指定白字,重新协调留白;福云改为当前深紫星空/火箭及云形新Logo,撤掉旧浅紫大福字视觉。
FUC参考只读新版HEAD `4eff00023420175662792769d1d2ee1c16d9bb68` 的 `docs/maintenance/BRANDING.md`、官网离线桌面截图 `docs/maintenance/evidence/logo-2026-10-30/front-desktop.png` 及 `public/images/brand/fuc-mark-512.png`。未运行真实FUC Web配置或访问FUC线上;未改FUC源码、品牌源文件和业务数据。
实际广告位保持3.675:1,满宽约为原高度66.7%。生成图原始尺寸DPL2169×725、HN2021×778、FUC2142×734保留背景出血,cover仅从上下背景留白取景;字号与主要内容按横向构图重新布局,不再contain缩小整张/补两侧空白。福云取景center40%,保护顶部品牌与底部CTA;固定小“广告”标签保证出血裁切后仍可见。活动组件候选引用、真实图片尺寸与替代文字同步,随机JS、链接、缓存与单图加载机制未变。旧独立广告组件属于保留实现,不是当前随机位消费者。
真实Blade隔离页浏览器验收:桌面三张均718×195.37;390px视口三张均354×96.32,无横向溢出,图文与品牌显示完整。实际随机组件仅1张新版福云图片进入活动DOM并加载。桌面/手机截图与验收摘要见上述输出目录,临时Web验收页用后清理。未提交、推送或部署;线上仍为之前2.45:1旧素材随机位,本次实心TG图标同样仅本地。
2026-10-31用户纠正广告品牌字标为 `DP-LINK.NET`。内置image_gen定点替换原图左上DPL,现用 `public/images/ads/dpl-ad-compact-wordmark-20261031.png`,2169×725;原图保留。提示词 `output/compact-ads-20261031/dpl-wordmark-prompt.txt`。实际随机组件候选及alt同步为DP-LINK.NET,广告位比例、其他两图和链接不变,仅本地未发布。
2026-10-31按用户要求将HN品牌字放大、中文标语缩小并增加两行间距;追加要求首字母小写,最终字标为 `hardnerd`。内置image_gen定点编辑,当前素材 `public/images/ads/hn-ad-compact-lowercase-20261031.png`,2021×778;提示词 `output/compact-ads-20261031/hn-lowercase-prompt.txt`。本地随机组件引用、尺寸及alt同步,保留旧图,不改线上。
2026-10-31按用户指定文案将福云主标题改为“全球网络加速”、副标题改为“五年稳定运营”。内置image_gen只替换两行文字,保留新云形Logo/紫色火箭构图及开始使用按钮;当前素材 `public/images/ads/fuc-ad-compact-five-years-20261031.png`(2141×734),提示词 `output/compact-ads-20261031/fuc-copy-prompt.txt`。随机组件引用/尺寸/alt同步,仅本地未发布;文案为用户指定,不将本次设计视作独立运营年限核验。
## 本任务高度调整正式状态(2026-10-31)
[2026-10-31正式发布记录](UI_RELEASE_2026-10-31.md)已将正式广告位调整为3.675:1,并对生产原三张素材使用contain完整展示。此为页头/免费节点界面发布中的高度调整;compact重设计及其后续文案、cover取景仍为另一项本地任务,未随本批发布。生产article-ads模板、随机JS、广告配置及三张原图保持基线。各原图路线与本次精确SHA/恢复点以发布记录为准。
@@ -0,0 +1,35 @@
# 统一机场推荐模块
**已正式发布**:[2026-10-31正式发布记录](UI_RELEASE_2026-10-31.md)。以下为最初本地实施记录,当前正式数据保护及189篇覆盖验收以发布记录为准。
2026-10-31用户确认截图方案并要求“弄,先在本地”。仅FNA_V3本地生效,没有提交/推送、线上访问或生产部署。原整图广告区保留,本模块替换资源正文内旧福云文字推荐并补充教程末尾,不改变其他广告配置。
## 唯一资料入口
`config/airport_recommendations.php`集中维护开关、顺序、品牌名、地址、起售价/单位、解锁文案、场景说明、优惠码及折扣。初始三家与价格/优惠文案按用户截图:福云18元/月、DP-LINK.NET26元/月、hardnerd28元/月;前两家clashfreenode.com九折,HN无优惠码。该价格和营销说明为用户指定文案,不表示本次完成网络或套餐实测。
地址沿已登记/既有配置:FUC免翻墙入口`https://xn--123-9i9dj97q.com/`,DPL `https://dp-link.net/`,HN `https://hardnerd.net/`;未点击或访问落地页。可通过AIRPORT_FUC_URL、AIRPORT_DPL_URL、AIRPORT_HN_URL覆盖。使用独立展示配置避免本地HN广告使用hn.loc时污染公开推荐网址。未新建后台、数据库、DomainHub调用或TeleHub汇报;无新增公共服务需求,当前统一配置足够维护三个固定条目,后续后台接入另按明确需求设计。
修改资料后运行`php artisan config:clear`与`php artisan responsecache:clear`即可全站更新,无需逐篇改稿。禁用单家用enabled=false,排序用order;总开关AIRPORT_RECOMMENDATIONS_ENABLED=false。无可用条目时不插入推荐或跳转,旧正文原样显示。
## 渲染与边界
- `ArticleRecommendations::prepare`仅处理展示副本,不更新文章数据库、编辑版本、正文源、收录日期或点赞设置。
- freenode、shadowrocketids:识别旧“机场推荐 - 福云”标题及其同段“机场官网:福云”链接,在原位置替换共享组件。匹配不跨下一个标题;未匹配时保留正文并在末尾追加,不猜测删除范围。订阅/账号/复制数据原字节保留。
- client及其子栏目、advanced:正文后追加同一个模块。advanced在首个涉及订阅/节点/线路的段落后插入一次自然文案与文末锚点,无匹配时文末加入;已有该锚点链接不重复插入。
- 首页复用最新文章详情,自然包含一处推荐;栏目列表不增加模块,其他栏目不展示。
- 服务端输出table,桌面五列、767.98px及以下为三张纵向卡片。稳定锚点`#airport-recommendations`,不得在正文另建同名ID。CSS/JS独立同源静态文件,@once单次加载;不依赖JS获取推荐数据。
- 外链为sponsored/nofollow/noopener/noreferrer,新窗口访问;可复制优惠码并以状态文字反馈,HTTP本地使用用户点击触发的复制兼容路径,失败则选中文字供手动复制。不会读取用户原剪贴板。
- 不向正文源和AI写作稿重复写入价格/优惠码。本站文章API及其hash校验未改,不用SQL改文章;此模块与冻结的正文数据分离。
## 本地验收
5项专项测试/40断言通过:旧区替换与订阅/账号保留、未识别结构保护、入门子栏目/综合跳转、总开关与其他栏目、统一资料修改/单家关闭/推广链接。因项目既有CLI命令重复类,测试沿原约定使用`--process-isolation`,未改无关CLI代码。
全量只读遍历本地171篇公开目标文章:160篇资源文章均替换旧区,11篇教程统一追加,4篇综合教程含锚点跳转,171篇data-clipboard-text载荷完全一致,未识别旧推荐为0。数据库正文未写入。
本地浏览器1280px桌面表格、390px手机卡片无横向溢出;每页模块1处,文内链接实际滚动至距离顶部100px,复制优惠码显示“优惠码已复制”。图片、CSS/JS与原广告加载正常;没有点击服务商落地页。截图:[桌面](../../output/recommendations/desktop.png)、[手机](../../output/recommendations/mobile.png)。开发模式沿用,未运行build。完成检查后恢复浏览器默认视口。
本地预览:`http://fna-v3.loc/a/fn20261021.html#airport-recommendations`;入门`/a/clash-verge-rev-windows.html#airport-recommendations`;综合`/a/mihomo-dns-leak.html`可点击文内“机场推荐”跳转。
2026-10-31后续免费节点详情重设计仅将freenode页推荐区移至订阅及使用说明之后,仍使用本组件/配置;苹果ID维持原位置替换、教程文末维持不变。结构与验收见[免费节点内容页](FREENODE_ARTICLE_LAYOUT.md),均仅本地。
+37
View File
@@ -0,0 +1,37 @@
# CFN页头品牌标志(2026-10-31)
**已随[2026-10-31正式发布记录](UI_RELEASE_2026-10-31.md)上线**。以下标注“仅本地”的段落为当时实施历史;当前正式品牌、窄屏居中及侧栏TG/GitHub均已发布。
**当前字标已恢复文字**:用户试看风格化图片后要求改回ClashFreeNode文字。当前为统一深灰色的HTML字标,猫仍是独立SVG,下方文案保留;图片生成记录仅作历史。
用户要求尝试将现有猫转SVG,右侧显示clashfreenode,下行显示“每天分享免费节点”。已在FNA_V3本地接入,未提交/推送/部署;旧PNG与其他实例标志保留。
- SVG:`public/sites/cfn/images/logo/cat.svg`,从现有logo.png猫的紫色轮廓提取并简化为二次贝塞尔曲线,5个轮廓包含双眼与独立腿部,原色#764679。只有矢量path,不嵌入PNG、脚本、字体或外部资源;透明背景。
- 复现脚本:`output/branding/vectorize-cat.py`,使用桌面已带的Pillow/NumPy,无项目新增依赖;读取原PNG、不修改原图。svg约7.6KB。
- 文字:`components/cfn-brand.blade.php`使用可读HTML文字,避免把字做进图片;CSS位于`public/css/cfn-brand.css`,app-layout在cfn环境单次加载。品牌名保持用户要求的小写,文案“每天分享免费节点”。
- 接入:nav-bar仅对site_code_short=cfn使用新组件,其他实例沿原PNG轻/深色分支。菜单顺序、菜单当前状态、TG/GitHub/搜索功能未改。
- 适配:桌面猫44×44、品牌文字23px;手机猫38×38/21px;小于360px猫32×32/18px。深色文字有主题分支,不引入远程字体或JS。
本地1280、390及320视口检查:SVG正常加载、两行文案正确,无导航横向溢出;320px品牌块约158px宽。截图:[页头](../../output/branding/header-logo.png)。本地HTTP/SVG XML检查通过;未点击线上落地页,未build。
回退:cfn导航切回原logo.png,移除app-layout的cfn-brand.css引用;不用删原PNG或修改其他实例。保持其他并行导航改动。
2026-10-31用户将字标明确为ClashFreeNode并要求设计,已本地改为CamelCase:Clash深灰、FreeNode呼应猫的紫色;字重700/650、字距-.65px,微调图文和两行间距,下方文案不变。保留真实文字及原SVG,无新字体请求,桌面/手机复验后仅本地。
## 风格化图片字标(2026-10-31)
原稿`output/branding/wordmark/clashfreenode-generated.png`,2172×724真实透明通道;完整提示词见[生成提示词](../../output/branding/wordmark/prompt.txt),由内置image_gen生成,无CLI/API密钥。交付文件`public/sites/cfn/images/logo/wordmark-stylized.webp`约83KB,只做网页格式编码,不重画或合成;原PNG完整保留。CSS透明画布窗口去掉上下空白,不拉伸字形。
`cfn-brand.blade.php`已将普通字替换为带alt=ClashFreeNode的img,保留独立SVG猫与“每天分享免费节点”。桌面字标视窗182×25,手机160×22,320px小屏134×19;活动品牌块在320px宽约172px,无横向溢出、文字识别清楚。预览见[图片字标效果](../../output/branding/header-wordmark-image.png)。本次未改广告尺寸、正文、导航链接或其他实例标志,未build、提交/推送或上线。
2026-10-31按用户最新要求,已将图片字标恢复为文字ClashFreeNode及先前字重/配色/响应字号,页头不再请求wordmark-stylized.webp;图片及提示词保留归档。SVG猫、下方文案与广告高度不变,仍仅本地。
2026-10-31用户要求颜色与此前一致,已将ClashFreeNode字标统一为原PNG字标深灰#555555,取消FreeNode的紫色强调;猫的原紫色不变,深色模式字标统一继承浅色。仅本地。
## 窄屏导航对齐与GitHub(2026-10-31,仅本地)
用户反馈Logo位置不对并要求窄屏不隐藏GitHub。已为SVG品牌补回6px左侧视觉留白,菜单/Logo/Telegram/GitHub/搜索垂直中心保持一致。移动导航增设使用原config(path.url_github_href)的GitHub链接,沿用原灰色32px按钮与新窗口属性;桌面保留原GitHub,不重复显示。320px下将字标微调17px并禁止导航换行,5项中心均35px,搜索不掉到第二行,未溢出;390/499px也检查通过,最终恢复默认视口。页头预览见[窄屏导航](../../output/branding/mobile-nav-github.png)。不改变文字/猫颜色、落地页地址或菜单逻辑,未上线。
2026-10-31用户澄清原要求为“窄屏整个Logo居中”,上次补左侧留白的理解已纠正。现窄屏品牌相对导航容器绝对居中,不受左菜单/右侧三个按钮宽度差影响;按390/375/320宽度协调品牌及按钮尺寸,全部图标保留。390px品牌中心195px,320px中心160px,与视口中心一致,且不重叠;桌面品牌位置不改。仅本地。
2026-10-31按用户最新要求,窄屏Telegram和GitHub从顶部移到移动侧栏的栏目菜单下方,用分隔线与菜单区分;顶部保留左侧菜单、居中品牌和右侧搜索。桌面TG/GitHub/搜索保持原位,链接配置保持原样。窄屏品牌恢复38px猫/21px文字,无需此前为右侧三图标设置的小屏压缩规则;本地检查侧栏开关与品牌中心,未上线。
@@ -0,0 +1,61 @@
# 免费节点内容页重设计(2026-10-31)
**已正式发布**:[2026-10-31正式发布记录](UI_RELEASE_2026-10-31.md),应用7d564df7;原业务正文不变。以下本地实施历史中的“未上线”表示该步骤当时状态,最终版本已包含提示框移除。
用户要求重新设计“免费节点”内容页,沿当前任务仅本地实施。未提交、推送、部署或访问线上,免费苹果ID、教程和列表页不变。首页继续复用最新免费节点详情,因此自然采用同一新版布局;没有另建首页数据源或改菜单选中规则。
## 结构
- 顶部:简洁H1“月日免费节点订阅”、客户端提示与该文章已有猫图。原title/description/canonical等SEO元信息保持;不改数据库标题或URL。
- 概览:从原正文提取本篇节点数、原速度文字、地区;只对重复地区去重,不重估节点可用性、不换算速度单位。0节点如实显示,并给最新更新入口,不捏造数值。
- 页内导航:获取订阅、使用说明、机场推荐。各锚点scroll-margin防导航遮挡。
- 订阅区:Clash/Mihomo、V2ray/Shadowrocket、Sing-box/Hiddify按已有格式显示卡片,桌面与手机都明确显示原地址和复制按钮。早期只有两种格式就只显示两张,不添加推测URL。
- 使用说明:增加简短三步说明,保留订阅下载补充说明;原三段使用提示框按用户最终要求不再展示,附已有Windows、Android、入门栏目内链。
- 机场推荐:复用[统一推荐](AIRPORT_RECOMMENDATIONS.md),仅免费节点页移到订阅/使用说明之后,仍每页一处;其他栏目沿原维护规则。更新频道和仓库链接从正文读取后归并到末尾,未访问目标。
- 正文后既有整图广告、标签、点赞和分享保持。未创建或修改图片,顶部展示文章已有本地缩略图,保留文章原图片关联。
## 实现与保护
`app/Services/FreeNodeArticleLayout.php`只读解析已经过ArticleRecommendations处理的展示副本;没有更新文章数据库、编辑版本、正文源、创建时间、访问地址或点赞设置。新模板为`resources/views/pages/articles/freenode/header.blade.php`与`content.blade.php`,仅default/show中的freenode条件分支接入。样式`public/css/freenode-article.css`只在新版页面加载并以free-node-page/fn类限定,不影响其他页面。
原日更HTML含不规范的p/a嵌套,使用本地DOM解析属性和正文。识别明确的订阅区、提示区与已知URL格式,HTML实体还原后交给Blade重新转义;不请求订阅服务器,不验证节点。未知URL格式、重复格式、未知文章结构或解析失败时回退原内容页,避免静默遗漏内容。额外编辑说明和普通补充链接保留。
复制复用现有ClipboardJS的copy-permalink/data-clipboard-text机制,沿原成功反馈;不新增复制库、读取用户剪贴板或访问资源链接。侧栏保持原点赞活跃模块,只协调圆角和对齐。
## 本地验收
- 全量只读遍历78篇公开免费节点:78篇识别成功,订阅地址与原data-clipboard-text逐项一致;早期两格式和后期三格式均覆盖。
- 12项测试/61断言通过:非规范HTML、URL查询串与实体、0数值、去重地区、未知格式安全回退、两格式不补造、保留额外说明/链接,以及已有推荐和首页选择回归。
- HTTP核对首页、当前三格式、早期两格式、苹果ID、入门教程、免费节点列表均200;新版只出现在首页/免费节点详情,推荐模块仍单处,列表不出现。
- 浏览器1280桌面、390及320手机无横向溢出;逐个核对复制按钮边界在卡片内,没有被父级overflow遮住。真实复制显示“复制成功”,使用既有ClipboardJS。URL始终为原有值,未访问订阅/服务商/TG/GitHub落地页。
- dev模式沿用,未build。截图:[桌面](../../output/freenode-redesign/desktop.png)、[手机](../../output/freenode-redesign/mobile.png)。浏览器最终恢复默认视口。
预览:`http://fna-v3.loc/a/fn20261018.html`;最新首页`http://fna-v3.loc/`。本地最新10月21日及前两天原始记录为0,本次没有改成非零或制造线上新数据。
回退只移除show.blade.php的freeNodeLayout分支并恢复原共用渲染;无需回灌数据库、替换素材或修改推荐配置。保留其他本地/并行代码,本次没有执行Git清理或全量覆盖。
2026-10-31用户要求移除装饰性小字,已本地移除SUBSCRIPTIONS、QUICK START及共享推荐区“网络服务推荐”,保留中文主标题和功能,未上线。
2026-10-31用户进一步明确删除卡片内“免费节点 / 日期”小字,已移除fn-eyebrow整行,卡片外面包屑及日期主标题保留,仍仅本地。
2026-10-31按用户要求简化订阅卡片:移除C/V/S字母图标、客户端说明小字和格式小标签,主标题统一为“适用于:客户端名”;订阅原值及复制功能保留,仅本地。
2026-10-31按用户反馈同步收紧删字后的留白:标题行高1.3、说明上间距6px,桌面插画120×96、标题区下间距16px;手机插画68×76,说明间距6px;纯标题订阅卡头部下间距9px。不保留已删除眉题/图标的占位,仍仅本地。
2026-10-31按用户截图将标题下方两行说明合并为“支持 Clash / V2ray / Shadowrocket / Singbox / Hiddify”,移除原第二行,手机按宽度自然换行,仅本地。
2026-10-31按用户要求移除“按客户端选择格式”辅助文字,保留“获取免费订阅”标题及订阅卡片,仅本地。
2026-10-31对照用户指定clash-rule-global-direct教程的浏览器实际样式,修正免费节点页过小字号:桌面H1 32px/正文16px/二级标题22.72px,手机H1 26px/正文15px/二级标题19.5px,与参考页一致;卡片标题约18/17px、按钮14px、地址13/12px,概览/导航/步骤与辅助说明同步放大至可读层级。推荐表的字号覆盖限定free-node-page,参考教程和其他页面不改。清理已移除图标/装饰文字的孤立CSS,标题分组换行以防手机末尾孤字;390/320检查复制按钮边界、正文和推荐布局,默认视口恢复。本地生效,未上线。截图[字号对齐](../../output/freenode-redesign/typography.png)。
2026-10-31按用户截图仅缩小订阅地址与原使用提示:桌面地址12px、提示14px/1.8;手机地址11px、提示13px/1.8。正文主层级与标题保持,仅本地。
2026-10-31用户澄清使用提示框须恢复统一字号调整之前的版本,已仅恢复该框桌面/手机均11px、行高1.9、原文字色#786c84,原边框/背景/内边距不变;其他正文、标题和订阅地址保持,不是只缩小一档。仅本地。
2026-10-31用户随后要求提示框字号稍大,已仅将该框从11px调为12px(桌面/手机一致),行高、颜色和内边距保留,仅本地。
2026-10-31按用户最新截图要求,移除免费节点新布局里的整块原使用提示框(免费节点稳定性、DNS和全局模式三段说明)。不再渲染该容器,因此不保留空白占位;三步使用说明和教程入口保留。原文章正文及解析数据不改,仅本地展示调整,未上线。
2026-10-31用户反馈外层卡片圆角与其他页不一致,经浏览器核对参考教程正文/侧栏桌面与手机均4px,已移除免费节点正文卡片14px/手机10px及侧栏10px局部覆盖,沿网站共用4px圆角。仅本地。
2026-10-31用户再次反馈标题区留白不均,已将桌面标题/插画改为顶部对齐,标题行高1.3、说明上间距8px/行高1.6,插画112×80、概览前间距20px;手机沿其原独立尺寸和顶部对齐,不变更字号或文字。仅本地。
+6
View File
@@ -182,3 +182,9 @@ ## 小标题蓝线定点调整(2026-10-28)
## 本地样式服务恢复(2026-10-28)
用户反馈/advanced排版再次错乱。现场确认public/hot仍指向127.0.0.1:5187,但该端口无监听,导致Vite样式/脚本不可用,页面退化为原始HTML(双Logo及展开导航)。已按原配置恢复npm run dev,仅监听127.0.0.1:5187,Vite7.3.1启动成功;刷新后浏览器截图确认Logo、导航、栏目banner与文章卡片恢复,无横向溢出。未修改教程正文、数据库、模板、全局字号或生产环境。截图codex/output/advanced-styles-restored-20261028.png。恢复的是当前本地dev进程,不代表已配置登录自启或已核实此前进程退出原因。
## 综合教程列表移除图片横幅(2026-10-31,仅本地)
按用户要求,`/advanced`不再渲染列表顶部的猫图横幅及叠加数量;用户随后明确标题介绍卡也不要,现与免费节点列表一样直接显示文章列表。页面title与meta description仍保留栏目名称和简介。仅调整列表模板的展示条件,栏目配置和文章内容未改;入门教程与平台子栏目仍按原配置显示横幅。未上线。
2026-10-31综合教程列表去除横幅及介绍卡已随[2026-10-31正式发布记录](UI_RELEASE_2026-10-31.md)上线,入门和平台子栏目横幅保留;本次不发布新的教程正文。
+31
View File
@@ -0,0 +1,31 @@
# CFN界面与推荐模块发布(2026-10-31)
已正式发布到 `https://clashfreenode.com/`。应用提交 `7d564df7e9509cbf58d6096cfbe55ae339ee15dc`,分支 `codex/cfn-ui-20261031`,目标 VPS-003 `/www/wwwroot/clashfreenode-new.com`。本机经白色机SSH执行;没有本机访问线上网站、重新开设test入口或整库迁移。
## 本次范围
- [统一机场推荐](AIRPORT_RECOMMENDATIONS.md):集中配置福云、DP-LINK.NET、hardnerd,资源正文替换旧推荐,教程文末追加,综合教程增加文内锚点入口。价格和优惠由共享配置维护,不改文章正文源。
- [免费节点内容页](FREENODE_ARTICLE_LAYOUT.md):首页与免费节点详情复用新版标题、概览、订阅卡片、复制按钮及三步使用说明;按用户最终要求删除装饰小字、卡内栏目日期、图标与描述、原使用提示框,统一字号、圆角和间距。其他栏目不套此布局。
- [页头品牌](BRANDING.md):原紫色猫轮廓SVG、深灰ClashFreeNode文字、每天分享免费节点;窄屏品牌居中,TG与GitHub移入侧栏,顶部保留菜单和搜索。
- [综合教程列表](TUTORIALS.md#综合教程列表移除图片横幅2026-10-31仅本地):去掉大图及标题介绍卡,直接显示列表;入门教程及平台子栏目的横幅保留。title和meta description不变。
- 随机广告高度比例从2.45调整为3.675,即同宽高度为此前三分之二;沿本任务旧图方案使用contain完整展示。保留生产现有三张广告素材、候选/随机脚本、跳转配置和noscript回退。本地另一个任务制作的compact广告新图及其文案/裁切规则未发布,不能把本地当前广告候选当作本次正式候选。
基于现场正式HEAD `a7adfac04108c68b58bd02c550fe98fd80b2feeb` 创建隔离Git工作树,审核并提交20个文件,Git推送并核对远端SHA后正式检出。生产空侧栏广告组件的原include保留,未携带本地无关删除;未覆盖现有生成标签模板的并行修改、data.ms、public/images/editorial、私密.env、数据库、静态配图及定时任务。未更改Vite源或重建前端包,新增CSS/JS为同源公开文件并按filemtime刷新版本。
## 验收
- 本地12项测试、61条断言通过,覆盖推荐替换、未知结构回退、原复制值、两/三格式、零节点和首页选择;新增JS语法检查通过。桌面及320/390窄屏界面、菜单开关、复制反馈已在本地检查。
- 发布前在服务器只读事务遍历189篇目标文章,86篇免费节点全部识别;替换178篇旧推荐,原data-clipboard-text值逐项一致,0丢失、0回退。不请求节点订阅服务器。
- 正式切换后183项服务器侧检查全部通过、0失败:覆盖首页、最新及最早免费节点详情、苹果ID详情、Windows与TUN教程、三个栏目;原title/canonical/robots/description及复制值保留,推荐单次输出和作用范围、导航结构、综合教程移除横幅及介绍、入门横幅保留正确。
- 所有20个文件部署哈希一致,6个公开CSS/JS/SVG资源HTTPS完整SHA一致;nginx及PHP-FPM在运行。189篇文章完整原始行与分类行SHA与发布前一致,.env及并行生成标签模板SHA一致。随机广告模板/脚本/配置相对基线无差异。
- 已清理nginx身份的Blade及响应缓存。未做线上浏览器页面验收,没有点击服务商/TG/GitHub落地页或触发真实订阅/通知/文章发布。
回执和已审核候选:`output/ui-release-20261031/`,含preflight、prepared、manifest、只读audit-before、http-before、release及verification.json。它们不含真实凭据或业务正文导出。应用文件的完整权威哈希以manifest/verification为准。
## 恢复
VPS-003恢复点 `/root/backups/cfn-ui-20261031`(0700),保留原HEAD/status、Git bundle、tracked-before.patch、候选工作树/补丁、逐文件manifest及验收回执。因为本次无业务数据迁移,回退不需要恢复数据库;不得回灌本地库。
没有后续生产变更时,可经白色机将正式目录检回发布前 `a7adfac04108c68b58bd02c550fe98fd80b2feeb`,再以nginx身份清理 `view:clear` 和 `responsecache:clear` 并做服务器冒烟核验。有后续发布时,在其当前HEAD上只撤销本次应用增量,提交推送后再切换,不覆盖后续功能或并行未提交文件。保留原PNG、图片资产及Resource关联。
后续文档同步提交仅更新维护记录;应用差异、远端分支SHA与正式最终HEAD由同目录docs-release.json核实。
+27
View File
@@ -0,0 +1,27 @@
.airport-recommendations{margin:28px 0 24px;scroll-margin-top:100px;color:#424852;clear:both;font-size:14px;line-height:1.65}
.airport-recommendations__heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:15px}
.post-content .airport-recommendations__heading h2{font-size:21px;line-height:1.4;margin:0;padding:0;border:0;color:#29323d;font-weight:700}
.airport-recommendations__heading>span{font-size:11px;color:#8e98a5;letter-spacing:.06em}
.airport-recommendations__table-wrap{border:1px solid #e8edf2;border-radius:10px;overflow:hidden;background:#fff}
.post-content .airport-recommendations__table{width:100%;table-layout:fixed;border:0;border-collapse:collapse;margin:0;font-size:13px;line-height:1.65}
.post-content .airport-recommendations__table thead th{background:#f7f9fc;color:#7b8795;font-weight:500;font-size:12px;border:0;border-bottom:1px solid #e8edf2;padding:12px 11px;text-align:left}
.post-content .airport-recommendations__table thead th:nth-child(1){width:19%}.post-content .airport-recommendations__table thead th:nth-child(2){width:15%}.post-content .airport-recommendations__table thead th:nth-child(3){width:18%}.post-content .airport-recommendations__table thead th:nth-child(4){width:25%}.post-content .airport-recommendations__table thead th:nth-child(5){width:23%}
.post-content .airport-recommendations__table tbody th,.post-content .airport-recommendations__table tbody td{padding:18px 11px;border:0;border-bottom:1px solid #edf0f5;vertical-align:middle;background:transparent;text-align:left;overflow-wrap:anywhere}
.post-content .airport-recommendations__table tbody tr:last-child>*{border-bottom:0}
.post-content .airport-provider a{font-size:14px;font-weight:700;text-decoration:none;color:#2f4057;display:inline-flex;align-items:center;gap:5px;white-space:nowrap}
.post-content .airport-provider a:hover{color:#238dce}.airport-provider a>span{font-weight:400;color:#96a4b5;font-size:12px}.airport-provider__label{display:block;font-size:10px;color:#9ba6b3;font-weight:400;margin-top:4px}
.airport-price strong{font-size:22px;font-weight:650;color:#35465d;letter-spacing:-.6px;display:block;line-height:1.15}.airport-price>span{font-size:10px;color:#8b96a6;white-space:nowrap}
.airport-features{display:grid;gap:5px;font-size:12px;white-space:nowrap}.airport-features i{font-style:normal;color:#27a781;margin-right:4px}.airport-description{color:#76818e;font-size:12px}
.airport-coupon__discount{font-size:10px;color:#248cca;background:#edf7fd;border-radius:4px;padding:2px 6px;display:inline-block;margin-bottom:5px}
.airport-coupon__copy{display:flex;align-items:center;gap:4px;background:none;border:0;border-bottom:1px dashed #c9d5e1;padding:0 0 2px;font:inherit;font-size:11px;color:#53667f;text-align:left;cursor:pointer;max-width:100%;white-space:nowrap}.airport-coupon__copy svg{flex:none;color:#9aaabd}.airport-coupon__copy.is-copied{color:#19856a;border-color:#19856a}.airport-coupon__copy:focus-visible,.airport-provider a:focus-visible{outline:2px solid #319bc9;outline-offset:4px}.airport-coupon__none{font-size:12px;color:#a3aab5}
.post-content p.airport-recommendations__note{font-size:10px;color:#a0a8b4;margin:10px 0 0;line-height:1.6}.post-content p.airport-recommendation-jump{font-size:14px;color:#6f7d8c;margin:14px 0 20px}.airport-recommendation-jump a{color:#238dce;text-underline-offset:3px}
@media(max-width:767.98px){
.airport-recommendations{margin:25px 0}.post-content .airport-recommendations__heading h2{font-size:20px}.airport-recommendations__heading>span{font-size:10px}
.airport-recommendations__table-wrap{border:0;border-radius:0;overflow:visible;background:transparent}.post-content .airport-recommendations__table,.post-content .airport-recommendations__table tbody{display:block;width:100%}.airport-recommendations__table thead{display:none}
.post-content .airport-recommendations__table tbody tr{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:13px 12px;border:1px solid #e8edf2;border-radius:10px;padding:18px;margin-bottom:12px;background:#fff}
.post-content .airport-recommendations__table tbody th,.post-content .airport-recommendations__table tbody td{display:block;border:0;padding:0;min-width:0}.post-content .airport-provider a{font-size:16px}.airport-provider__label{font-size:11px}.airport-price{grid-column:2;grid-row:1;text-align:right!important}.airport-price strong{display:inline;font-size:25px}.airport-price>span{display:inline;margin-left:5px;font-size:10px}
.post-content .airport-recommendations__table tbody td.airport-description{grid-column:1/-1;grid-row:2;font-size:12px;line-height:1.75}.airport-features{display:flex;gap:12px;font-size:11px;flex-wrap:wrap}
.post-content .airport-recommendations__table tbody td.airport-coupon{grid-column:1/-1;border-top:1px solid #edf0f5;padding-top:11px;display:flex;align-items:center;gap:8px}.airport-coupon:before{content:attr(data-label);font-size:11px;color:#9aa4b0;margin-right:auto}.airport-coupon__discount{margin:0}.airport-coupon__copy{font-size:11px}.post-content p.airport-recommendations__note{font-size:10px}
}
.airport-copy-status{display:block;color:#24846f;font-size:11px;margin-top:8px}.airport-copy-status:empty{display:none}
+16
View File
@@ -0,0 +1,16 @@
.header .navbar-brand.cfn-brand{display:inline-flex;align-items:center;gap:10px;max-width:none;padding:0;line-height:1;text-decoration:none}
.header .navbar-brand.cfn-brand .cfn-brand__cat{display:block;width:44px;height:44px;max-height:none;flex:none;border-radius:0}
.cfn-brand__copy{display:flex;flex-direction:column;gap:5px;white-space:nowrap}
.cfn-brand__name{font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:23px;font-weight:700;letter-spacing:-.65px;color:#555555;line-height:1.08}
.cfn-brand__accent{color:inherit;font-weight:650}
.cfn-brand__tagline{font-size:11px;font-weight:400;letter-spacing:1.25px;color:#938798;line-height:1.25}
body.dark .cfn-brand__tagline{color:#b7acbc}body.dark .cfn-brand__name{color:#eeeaf1}
.mobile-sidebar-social-links{display:flex;align-items:center;gap:12px;margin:20px 24px 0;padding-top:16px;border-top:1px solid rgba(127,127,127,.16)}
@media(max-width:1199.98px){
.header #header>.container{position:relative;flex-wrap:nowrap;min-height:44px}
.header .navbar-brand.cfn-brand{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);gap:8px;margin:0;flex-shrink:0}
.header .navbar-brand.cfn-brand .cfn-brand__cat{width:38px;height:38px}
.cfn-brand__name{font-size:21px;letter-spacing:-.5px}
.cfn-brand__tagline{font-size:10px;letter-spacing:1px}
.header .navbar-toggler{flex-shrink:0}
}
+37
View File
@@ -0,0 +1,37 @@
.free-node-page{--fn-purple:#86608e;--fn-text:#303641;--fn-muted:#9299a5;--fn-line:#ececf1}.free-node-page .post.card{overflow:hidden}.free-node-page .post>.card-body{padding:28px}.free-node-page .breadcrumbs .current{max-width:540px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.fn-header{display:flex;gap:24px;align-items:flex-start;margin-bottom:20px}.fn-header__main{flex:1;min-width:0}.free-node-page .fn-header h1{font-size:32px;line-height:1.3;letter-spacing:-.45px;color:#30333c;margin:0;font-weight:700}.fn-header__lead{font-size:14px;color:#7c7a87;margin:8px 0 0;line-height:1.6}.fn-header__art{width:112px;height:80px;object-fit:cover;border-radius:10px;flex:none}
.fn-overview{border:1px solid var(--fn-line);border-radius:10px;display:flex;padding:14px 18px;gap:20px;background:#fbfafc;margin-bottom:20px}.fn-metric{flex:none;padding-right:22px;border-right:1px solid #e9e5ed}.fn-metric>span,.fn-overview__regions>span{display:block;font-size:14px;color:#756e7c;margin-bottom:7px}.fn-metric>div{display:flex;gap:5px;align-items:baseline}.fn-metric strong{font-size:23px;font-weight:650;color:#6d4e76;letter-spacing:-.5px;line-height:1.25}.fn-metric>div>span{font-size:13px;color:#a19aa6}.fn-overview__regions{min-width:0}.fn-overview__regions>div{display:flex;flex-wrap:wrap;gap:4px 10px;font-size:14px;color:#767181;line-height:1.8}
.fn-article-nav{display:flex;gap:8px;padding-bottom:18px;border-bottom:1px solid var(--fn-line);margin-bottom:22px}.fn-article-nav a{font-size:14px;color:#8c8794;background:#f7f6f9;padding:7px 14px;border-radius:6px;line-height:1.5;text-decoration:none}.fn-article-nav a:first-child{background:#ede6f1;color:#785282}.fn-article-nav a span{margin-left:20px}.fn-article-nav a:hover{color:#6e4d78;background:#eee7f2}
.free-node-page .post-content{font-size:16px;line-height:1.95}.fn-subscriptions,.fn-usage{scroll-margin-top:92px}.fn-section-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:10px;margin-bottom:14px}.free-node-page .post-content .fn-section-heading h2{font-size:22.72px;line-height:1.55;margin:0;padding:0;border:0;color:#38343e}.fn-subscription-list{display:grid;grid-template-columns:minmax(0,1fr);gap:11px}.fn-subscription{min-width:0;border:1px solid #e8e9ee;border-radius:10px;padding:17px 17px 14px;background:white}.fn-subscription__top{display:flex;gap:11px;align-items:center;margin-bottom:9px}.fn-subscription__name{flex:1;min-width:0}.free-node-page .post-content .fn-subscription__name h3{font-size:18.08px;line-height:1.5;color:#40404a;margin:0;font-weight:600}
.fn-subscription__address{display:flex;align-items:center;gap:12px;background:#f7f7fa;border:1px solid #f0eff4;padding:8px 9px 8px 11px;border-radius:6px}.free-node-page .post-content .fn-subscription__address code{color:#777180;background:none;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:12px;padding:0;display:block;min-width:0;flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.fn-copy{border:0;border-radius:5px;background:#86618f;color:white;padding:8px 12px;display:inline-flex;align-items:center;justify-content:center;gap:5px;font-size:14px;line-height:1.5;white-space:nowrap;flex:none;cursor:pointer;min-height:40px}.fn-copy:hover{background:#765280}.fn-copy:focus-visible,.fn-article-nav a:focus-visible{outline:2px solid #9572b0;outline-offset:3px}
.free-node-page .post-content .fn-subscription-note{font-size:14px;line-height:1.8;color:#7d7686;margin-top:13px}.free-node-page .post-content .fn-subscription-note p{margin:0!important}.fn-subscription-note span{color:inherit!important}.fn-subscription-note br{display:none}.fn-usage{margin:32px 0 0;padding-top:27px;border-top:1px solid var(--fn-line)}.fn-steps{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));list-style:none!important;padding:0!important;margin:0 0 18px!important;gap:15px}.fn-steps>li{display:flex;gap:9px;padding:0!important;margin:0!important}.fn-steps>li>span{font-size:14px;font-weight:600;color:#bca5c5;line-height:1.8}.fn-steps strong{font-size:16px;font-weight:500;color:#6a6271}.free-node-page .post-content .fn-steps p{font-size:14px;color:#807788;margin:3px 0 0;line-height:1.8}
.fn-original-help{background:#faf9fb;border:1px solid #efecf2;border-radius:8px;padding:13px 16px;color:#786c84;font-size:12px;line-height:1.9}.free-node-page .post-content .fn-original-help p{font-size:12px;line-height:1.9;margin:0 0 7px}.free-node-page .post-content .fn-original-help p:last-child{margin-bottom:0}.fn-original-help p:empty,.fn-original-help br{display:none}.fn-tutorial-links{display:flex;align-items:center;gap:15px;flex-wrap:wrap;margin-top:13px;font-size:14px;color:#b0a4b5}.fn-tutorial-links a{color:#8a6b95;text-decoration:none!important}.fn-community{margin:24px 0 0;border-top:1px solid var(--fn-line);padding-top:18px;font-size:14px;color:#7f7386;display:flex;align-items:center;justify-content:space-between;gap:10px}.fn-community>div{display:flex;gap:14px}.fn-community a{color:#8c7996;text-decoration:none!important}.fn-empty-note{font-size:14px!important;color:#a58a62!important;padding:9px 12px;background:#fdf9f1;border-radius:6px;margin:0 0 13px!important}.fn-empty-note a{color:inherit;text-decoration:underline}.fn-extra-intro{font-size:16px}.free-node-page .post-content>.airport-recommendations{border-top:1px solid var(--fn-line);padding-top:25px;margin-top:28px}.free-node-page .post-tags{border-top:1px solid var(--fn-line);padding-top:18px}.free-node-page .post-actions{margin-bottom:0!important}
@media(min-width:992px){.free-node-page .sidebar{top:0}}
@media(max-width:767.98px){.free-node-page .post>.card-body{padding:22px}.fn-header{gap:12px;align-items:flex-start;margin-bottom:16px}.fn-header__art{width:68px;height:76px;object-fit:cover;border-radius:8px}.free-node-page .fn-header h1{font-size:26px;line-height:1.35;letter-spacing:-.3px}.fn-header__lead{font-size:14px;line-height:1.7;margin-top:6px}.fn-overview{flex-wrap:wrap;padding:15px;gap:15px}.fn-metric{padding-right:17px}.fn-metric strong{font-size:22px}.fn-overview__regions{flex-basis:100%;border-top:1px solid #ebe6ef;padding-top:10px}.fn-overview__regions>span{margin-bottom:4px}.fn-article-nav{gap:6px;padding-bottom:20px;margin-bottom:23px}.fn-article-nav a{padding:8px 12px;font-size:14px}.fn-article-nav a span{margin-left:7px}.free-node-page .post-content .fn-section-heading h2{font-size:19.5px}.fn-subscription{padding:15px 13px 12px}.fn-subscription__top{gap:9px}.free-node-page .post-content .fn-subscription__name h3{font-size:17px}.fn-subscription__address{gap:8px;padding:7px}.fn-copy{font-size:14px;padding:8px 10px}.fn-copy svg{display:none}.fn-steps{grid-template-columns:1fr;gap:12px}.fn-steps>li>span{width:22px}.free-node-page .post-content .fn-steps p{margin-top:0}.fn-community{align-items:flex-start;flex-direction:column;gap:7px}.fn-tutorial-links{gap:8px 14px}.fn-original-help{padding:12px}.fn-usage{margin-top:26px;padding-top:22px}}
@media(prefers-reduced-motion:no-preference){html:has(.free-node-page){scroll-behavior:smooth}}
.free-node-page .post-content .fn-subscription h3::before{display:none}
/* Match the existing tutorial type scale; shared recommendation overrides stay local to this page. */
.free-node-page .post-content .airport-recommendations__heading h2{font-size:22.72px}
.free-node-page .post-content .airport-recommendations__table{font-size:14px}
.free-node-page .post-content .airport-recommendations__table thead th{font-size:13px}
.free-node-page .post-content .airport-provider a{font-size:14px}
.free-node-page .airport-provider__label,.free-node-page .airport-coupon__discount{font-size:12px}
.free-node-page .airport-features,.free-node-page .airport-description{font-size:14px}
.free-node-page .airport-coupon__copy,.free-node-page .airport-price>span{font-size:12px}
.free-node-page .post-content p.airport-recommendations__note{font-size:12px}
@media(max-width:600px){
.free-node-page .post-content{font-size:15px;line-height:1.95}
.free-node-page .post-content .fn-original-help p,.free-node-page .fn-original-help{font-size:12px;line-height:1.9}
.free-node-page .fn-extra-intro{font-size:15px;line-height:1.95}
.free-node-page .post-content .fn-subscription__address code{font-size:11px}
.free-node-page .post-content .airport-recommendations__heading h2{font-size:19.5px}
.fn-steps{grid-template-columns:1fr}
}
.fn-header h1>span{display:inline-block}
.fn-article-nav,.fn-community>div{flex-wrap:wrap}
.free-node-page .post-content .airport-recommendations__table tbody td.airport-description{font-size:14px}
@media(max-width:360px){.fn-article-nav a{padding-left:8px;padding-right:8px}}
+5 -2
View File
@@ -1,5 +1,8 @@
.random-article-ad { position: relative; min-width: 0; aspect-ratio: 2.45; margin: 20px 0; overflow: hidden; border-radius: 12px; background: #181b1e; }
.random-article-ad { position: relative; min-width: 0; aspect-ratio: 3.675; margin: 20px 0; overflow: hidden; border-radius: 12px; background: #181b1e; }
.random-article-ad[hidden] { display: none !important; }
.random-article-ad > a { display: block; position: absolute; inset: 0; }
.random-article-ad img { display: block; width: 100%; height: 100%; object-fit: cover; }
.random-article-ad img { display: block; width: 100%; height: 100%; object-fit: contain; }
.random-article-ad > a:focus-visible { outline: 3px solid #8ab4ff; outline-offset: -4px; }
.random-article-ad[data-ad-selected="dpl"] { background: #0a0f1a; }
.random-article-ad[data-ad-selected="fuc"] { background: #f8f8fc; }
+34
View File
@@ -0,0 +1,34 @@
document.addEventListener('click', async (event) => {
const button = event.target.closest('[data-airport-coupon]');
if (!button) return;
const status = button.closest('.airport-recommendations').querySelector('.airport-copy-status');
try {
let copied = false;
if (navigator.clipboard?.writeText) {
try { await navigator.clipboard.writeText(button.dataset.airportCoupon); copied = true; } catch { /* Try the user-activated fallback below. */ }
}
if (!copied) {
const field = document.createElement('textarea');
field.value = button.dataset.airportCoupon;
field.setAttribute('readonly', '');
field.style.cssText = 'position:fixed;left:-9999px;top:0';
document.body.append(field);
try { field.select(); copied = document.execCommand('copy'); }
finally { field.remove(); button.focus({preventScroll:true}); }
}
if (!copied) throw new Error('Copy unavailable');
status.textContent = '优惠码已复制';
button.classList.add('is-copied');
button.setAttribute('aria-label', '优惠码已复制');
window.setTimeout(() => {
button.classList.remove('is-copied');
button.setAttribute('aria-label', `复制优惠码 ${button.dataset.airportCoupon}`);
}, 2000);
} catch {
const selection = window.getSelection();
const range = document.createRange();
range.selectNodeContents(button.querySelector('span'));
selection.removeAllRanges(); selection.addRange(range);
status.textContent = '已选中优惠码,请长按或使用复制快捷键';
}
});
+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 220 220" fill="#764679"><path fill-rule="evenodd" d="M46 3.5 Q46 3 51.5 3 Q57 3 57 3.5 Q57 4 60 4 Q63 4 63 4.5 Q63 5 65 5 Q67 5 67 5.5 Q67 6 68 6 Q69 6 69 6.5 Q69 7 70.5 7 Q72 7 72 7.5 Q72 8 74 8.5 Q76 9 76.5 10 Q77 11 78 11 Q79 11 80.5 13 Q82 15 83 15 Q84 15 84.5 16.5 Q85 18 85.5 18 Q86 18 86 18.5 Q86 19 87.5 20 Q89 21 89 22 Q89 23 89.5 23 Q90 23 90 26 Q90 29 89.5 29 Q89 29 89 30 Q89 31 88.5 31 Q88 31 87.5 32 Q87 33 85.5 33 Q84 33 84 33.5 Q84 34 82.5 34 Q81 34 81 33.5 Q81 33 78.5 32.5 Q76 32 74 29.5 Q72 27 71 27 Q70 27 69.5 26 Q69 25 68 25 Q67 25 67 24.5 Q67 24 66 24 Q65 24 65 23.5 Q65 23 64 23 Q63 23 63 22.5 Q63 22 62 22 Q61 22 61 21.5 Q61 21 57.5 21 Q54 21 54 20.5 Q54 20 47 21 Q40 22 40 22.5 Q40 23 37 24 Q34 25 34 25.5 Q34 26 33.5 26 Q33 26 33 26.5 Q33 27 30 29.5 Q27 32 27 33 Q27 34 26.5 34 Q26 34 26 35 Q26 36 25.5 36 Q25 36 25 37 Q25 38 24.5 38 Q24 38 24 40 Q24 42 23.5 42 Q23 42 23 49 Q23 56 23.5 56 Q24 56 24.5 59 Q25 62 26 62.5 Q27 63 27.5 65 Q28 67 28.5 67 Q29 67 31.5 70 Q34 73 35 73 Q36 73 36.5 74 Q37 75 38 75 Q39 75 39 75.5 Q39 76 40 76 Q41 76 41 76.5 Q41 77 42.5 77 Q44 77 44 77.5 Q44 78 45.5 78 Q47 78 47 78.5 Q47 79 50.5 79 Q54 79 54 79.5 Q54 80 97 80 Q140 80 140 79.5 Q140 79 140.5 79 Q141 79 141 51.5 Q141 24 142.5 24 Q144 24 144 24.5 Q144 25 147 27.5 Q150 30 150 31 Q150 32 150.5 32 Q151 32 151 32.5 Q151 33 151.5 33 Q152 33 152 33.5 Q152 34 152.5 34 Q153 34 153 34.5 Q153 35 156 37.5 Q159 40 159 41 Q159 42 159.5 42 Q160 42 161 43.5 Q162 45 162.5 45 Q163 45 163 44.5 Q163 44 165 44 Q167 44 167 43.5 Q167 43 172 43 Q177 43 177 42.5 Q177 42 178 42 Q179 42 179 42.5 Q179 43 184 43 Q189 43 189 43.5 Q189 44 191.5 44 Q194 44 194 44.5 Q194 45 195 45 Q196 45 196.5 43.5 Q197 42 197.5 42 Q198 42 198 41.5 Q198 41 201 38.5 Q204 36 204 35 Q204 34 207 31.5 Q210 29 210 28 Q210 27 210.5 27 Q211 27 212 25.5 Q213 24 214.5 24 Q216 24 216 24.5 Q216 25 216.5 25 Q217 25 217 43 Q217 61 216.5 61 Q216 61 216 65.5 Q216 70 215.5 70 Q215 70 215 72.5 Q215 75 214.5 75 Q214 75 213.5 79 Q213 83 212.5 83 Q212 83 212 84 Q212 85 211.5 85 Q211 85 211 86.5 Q211 88 210.5 88 Q210 88 209.5 90.5 Q209 93 208.5 93 Q208 93 208 94 Q208 95 207 95.5 Q206 96 205.5 98 Q205 100 204 100.5 Q203 101 203 102 Q203 103 202 103.5 Q201 104 201 105 Q201 106 199.5 107 Q198 108 198 109 Q198 110 196 111.5 Q194 113 194 114 Q194 115 192.5 116 Q191 117 191 118 Q191 119 190.5 119 Q190 119 190 120 Q190 121 189.5 121 Q189 121 189 122 Q189 123 188.5 123 Q188 123 188 169.5 Q188 216 187.5 216 Q187 216 187 216.5 Q187 217 181 217 Q175 217 175 216.5 Q175 216 174 215.5 Q173 215 173 214 Q173 213 172.5 213 Q172 213 171.5 208 Q171 203 170.5 203 Q170 203 170 200 Q170 197 169.5 197 Q169 197 169 194 Q169 191 168.5 191 Q168 191 168 188 Q168 185 167.5 185 Q167 185 166.5 178.5 Q166 172 165.5 172 Q165 172 165 169 Q165 166 164.5 166 Q164 166 164 163 Q164 160 163.5 160 Q163 160 163 157 Q163 154 162.5 154 Q162 154 162 150.5 Q162 147 161.5 147 Q161 147 161 146 Q161 145 160.5 145 Q160 145 160 145.5 Q160 146 154.5 146 Q149 146 149 146.5 Q149 147 131 147 Q113 147 113 146.5 Q113 146 105.5 146 Q98 146 98 145.5 Q98 145 97 145 Q96 145 96 145.5 Q96 146 94.5 146.5 Q93 147 91.5 149 Q90 151 89 151 Q88 151 87 152.5 Q86 154 84 154.5 Q82 155 82 155.5 Q82 156 80.5 156.5 Q79 157 78.5 158 Q78 159 77 159 Q76 159 76 159.5 Q76 160 75 160 Q74 160 74 160.5 Q74 161 73 161 Q72 161 72 161.5 Q72 162 71 162 Q70 162 70 162.5 Q70 163 69 163 Q68 163 68 163.5 Q68 164 67 164 Q66 164 66 164.5 Q66 165 65 165 Q64 165 64 165.5 Q64 166 63 166 Q62 166 62 166.5 Q62 167 60.5 167 Q59 167 59 167.5 Q59 168 58 168 Q57 168 57 168.5 Q57 169 55.5 169 Q54 169 54 169.5 Q54 170 53 170 Q52 170 52 170.5 Q52 171 49.5 171.5 Q47 172 47 172.5 Q47 173 46 173.5 Q45 174 45 176 Q45 178 44.5 178 Q44 178 44 180 Q44 182 43.5 182 Q43 182 43 183.5 Q43 185 42.5 185 Q42 185 42 187 Q42 189 41.5 189 Q41 189 41 191 Q41 193 40.5 193 Q40 193 40 194.5 Q40 196 39.5 196 Q39 196 39 198 Q39 200 38.5 200 Q38 200 38 201.5 Q38 203 37.5 203 Q37 203 37 205 Q37 207 36.5 207 Q36 207 35.5 211 Q35 215 34.5 215 Q34 215 33.5 216 Q33 217 27 217 Q21 217 21 216.5 Q21 216 20.5 216 Q20 216 20 205.5 Q20 195 20.5 195 Q21 195 21 187 Q21 179 21.5 179 Q22 179 22 171 Q22 163 22.5 163 Q23 163 23 160.5 Q23 158 23.5 158 Q24 158 24 156.5 Q24 155 25 154.5 Q26 154 26.5 152 Q27 150 28 149.5 Q29 149 29 148 Q29 147 29.5 147 Q30 147 30 146.5 Q30 146 31 145.5 Q32 145 32 144 Q32 143 33 142.5 Q34 142 34 141 Q34 140 34.5 140 Q35 140 35 139 Q35 138 36 137.5 Q37 137 37.5 134.5 Q38 132 38.5 132 Q39 132 39 131 Q39 130 39.5 130 Q40 130 40 128.5 Q40 127 40.5 127 Q41 127 41 125.5 Q41 124 41.5 124 Q42 124 42 121.5 Q42 119 42.5 119 Q43 119 43.5 111 Q44 103 43.5 103 Q43 103 43 102.5 Q43 102 41.5 102 Q40 102 40 101.5 Q40 101 38.5 101 Q37 101 37 100.5 Q37 100 36 100 Q35 100 35 99.5 Q35 99 32 98 Q29 97 28.5 96 Q28 95 27 95 Q26 95 25.5 94 Q25 93 24 93 Q23 93 23 92.5 Q23 92 22.5 92 Q22 92 22 91.5 Q22 91 21.5 91 Q21 91 21 90.5 Q21 90 20.5 90 Q20 90 20 89.5 Q20 89 Line truncated

After

Width:  |  Height:  |  Size: 7.5 KiB

@@ -0,0 +1,42 @@
@php($providers = \App\Services\ArticleRecommendations::providers())
@if($providers)
@once
@push('styles')
<link rel="stylesheet" href="/css/airport-recommendations.css?v={{ filemtime(public_path('css/airport-recommendations.css')) }}">
@endpush
@push('scripts')
<script defer src="/js/airport-recommendations.js?v={{ filemtime(public_path('js/airport-recommendations.js')) }}"></script>
@endpush
@endonce
<section id="{{ config('airport_recommendations.anchor') }}" class="airport-recommendations" aria-labelledby="airport-recommendations-title">
<div class="airport-recommendations__heading">
<h2 id="airport-recommendations-title">机场推荐</h2>
</div>
<div class="airport-recommendations__table-wrap">
<table class="airport-recommendations__table">
<caption class="visually-hidden">机场套餐、解锁情况与优惠码对比</caption>
<thead><tr><th scope="col">机场名</th><th scope="col">套餐起售价</th><th scope="col">解锁情况</th><th scope="col">适合使用场景</th><th scope="col">优惠码</th></tr></thead>
<tbody>
@foreach($providers as $key => $provider)
<tr>
<th scope="row" class="airport-provider"><a href="{{ $provider['url'] }}" target="_blank" rel="sponsored nofollow noopener noreferrer">{{ $provider['name'] }}<span aria-hidden="true">↗</span></a><span class="airport-provider__label">{{ $provider['tagline'] ?? '' }}</span></th>
<td data-label="套餐起售价" class="airport-price"><strong>{{ $provider['price'] }}</strong><span>{{ $provider['period'] }}起</span></td>
<td data-label="解锁情况"><div class="airport-features">@foreach($provider['features'] as $feature)<span><i aria-hidden="true">✓</i>{{ $feature }}</span>@endforeach</div></td>
<td data-label="适合使用场景" class="airport-description">{{ $provider['description'] }}</td>
<td data-label="优惠码" class="airport-coupon">
@if($provider['coupon'])
<span class="airport-coupon__discount">{{ $provider['discount'] }}</span>
<button type="button" class="airport-coupon__copy" data-airport-coupon="{{ $provider['coupon'] }}" aria-label="复制{{ $provider['name'] }}优惠码 {{ $provider['coupon'] }}"><span>{{ $provider['coupon'] }}</span><svg width="13" height="13" viewBox="0 0 16 16" fill="none" aria-hidden="true"><rect x="5" y="5" width="8" height="9" rx="1" stroke="currentColor"/><path d="M3 11H2V2h8v1" stroke="currentColor"/></svg></button>
@else
<span class="airport-coupon__none">无</span>
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<p class="airport-recommendations__note">价格、套餐及优惠以服务商官网为准。</p>
<span class="airport-copy-status" role="status" aria-live="polite"></span>
</section>
@endif
@@ -69,6 +69,10 @@
@vite(['resources/css/app.css', "resources/sites/".config("app.site_code_short")."/css/app.css",'resources/js/app.js'])
@if(config('app.site_code_short') === 'cfn')
<link rel="stylesheet" href="/css/cfn-brand.css?v={{ filemtime(public_path('css/cfn-brand.css')) }}">
@endif
@stack('styles')
@if(app()->environment('production') && ! $bEditorialPreview && config('app.site_code_short') == 'cfn')
@@ -0,0 +1,2 @@
<img class="cfn-brand__cat" src="/sites/cfn/images/logo/cat.svg" width="44" height="44" alt="" aria-hidden="true">
<span class="cfn-brand__copy"><span class="cfn-brand__name"><span>Clash</span><span class="cfn-brand__accent">FreeNode</span></span><span class="cfn-brand__tagline">每天分享免费节点</span></span>
+13 -2
View File
@@ -1,19 +1,23 @@
<header class="header">
<nav class="navbar navbar-expand-xl shadow" id="header">
<div class="container">
<a href="/" rel="home" class="logo navbar-brand order-2 order-xl-1">
<a href="/" rel="home" class="logo navbar-brand order-2 order-xl-1{{ config('app.site_code_short') === 'cfn' ? ' cfn-brand' : '' }}">
@if(config('app.site_code_short') === 'cfn')
@include('components.cfn-brand')
@else
<img style="border-radius:8px;" src="/sites/{{ config('app.site_code_short') }}/images/logo/logo.png"
class="d-inline-block logo-light nc-no-lazy"
alt="{{ config('app.name') }}">
<img style="border-radius:8px;" src="/sites/{{ config('app.site_code_short') }}/images/logo/logo.png"
class="d-none logo-dark nc-no-lazy"
alt="{{ config('app.name') }}">
@endif
</a>
<button class="btn btn-link btn-icon btn-sm btn-rounded navbar-toggler order-1" type="button"
id="sidebarCollapse" aria-label="打开导航菜单" aria-controls="mobile-navigation" aria-expanded="false">
<span><i class="iconfont icon-menu"></i></span>
</button>
<div class="d-xl-none order-3 ms-auto me-2">@include('components.telegram-link')</div>
<button class="btn btn-link btn-icon btn-sm btn-rounded navbar-toggler nav-search order-3 collapsed"
data-bs-target="#navbar-search" data-bs-toggle="collapse" aria-expanded="false"
aria-controls="navbar-search">
@@ -100,6 +104,13 @@ class="d-none logo-dark nc-no-lazy"
@endforeach
</ul>
</div>
<div class="mobile-sidebar-social-links" role="navigation" aria-label="社区链接">
@include('components.telegram-link')
<a href="{{ config('path.url_github_href') }}" target="_blank" rel="noopener noreferrer"
class="btn btn-link btn-icon btn-sm btn-rounded mobile-github-link" aria-label="GitHub 项目仓库(新窗口打开)" title="GitHub 项目仓库">
<span><i class="iconfont icon-github-fill" aria-hidden="true"></i></span>
</a>
</div>
<div class="py-5"></div>
</div>
</div>
@@ -1,8 +1,9 @@
<a href="{{ config('community.telegram_url') }}" target="_blank" rel="noopener noreferrer"
class="btn btn-link btn-icon btn-sm btn-rounded community-telegram"
aria-label="加入 Telegram 频道(新窗口打开)" title="Telegram 频道"
style="display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;padding:8px;color:#229ed9">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true" focusable="false">
aria-label="加入 Telegram 频道(新窗口打开)" title="Telegram 频道">
<span>
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true" focusable="false">
<path d="M21.94 4.67 18.9 19c-.23 1.01-.83 1.26-1.67.79l-4.63-3.41-2.23 2.15c-.25.25-.46.46-.95.46l.33-4.71 8.58-7.75c.37-.33-.08-.52-.57-.19L7.15 13.02l-4.57-1.43c-.99-.31-1.01-.99.21-1.47L20.66 3.23c.83-.31 1.56.2 1.28 1.44Z"/>
</svg>
</span>
</a>
@@ -9,7 +9,7 @@
<div class="container">
@if (isset($oCategory) && in_array($oCategory->sSlug, ['client', 'advanced']))
<link rel="stylesheet" href="/css/tutorials.css">
@if (!isset($oCategory->aBanner) || count($oArticles) == 0)
@if ($oCategory->sSlug === 'client' && (!isset($oCategory->aBanner) || count($oArticles) == 0))
<section class="tutorial-category" aria-label="教程栏目介绍">
<h1>{{ $oCategory->sName }}</h1>
<p>{{ $oCategory->sDescription }}</p>
@@ -38,7 +38,7 @@
</div>
@endif
@isset($oCategory->aBanner)
@if (isset($oCategory->aBanner) && $oCategory->sSlug !== 'advanced')
@php
$sBannerPath = '/sites/' . config('app.site_code_short') . '/images/banner/' . $oCategory->aBanner['img_file'];
@endphp
@@ -53,7 +53,7 @@
<h1 class="cover-title">{{ in_array($oCategory->sSlug, ['client', 'advanced']) ? $oCategory->sName : $oCategory->sSlug }}<sup class="text-light mx-1">{{ $iArticleCount ?? count($oArticles) }}</sup></h1>
</div>
</div>
@endisset
@endif
<div class="list-home list-grid list-grid-padding">
@foreach ($oArticles as $oArticle)
@@ -1,6 +1,11 @@
@php
$bIsHome = $bIsHome ?? false;
$seo = $seo ?? \App\Services\Seo::articleMeta($oArticle);
$recommendations = \App\Services\ArticleRecommendations::prepare($oArticle);
$recommendations['body'] = \App\Services\ResourceArticlePresentation::body($recommendations['body'], $oArticle->oCategory?->sSlug);
$articleBodyParts = explode(\App\Services\ArticleRecommendations::SLOT, $recommendations['body'], 2);
$freeNodeLayout = $oArticle->oCategory?->sSlug === 'freenode'
? \App\Services\FreeNodeArticleLayout::prepare($recommendations['body']) : null;
@endphp
<x-app-layout
@@ -20,7 +25,7 @@
@section('sOgType', 'article')
--}}
<main class="site-main">
<main class="site-main{{ $freeNodeLayout ? ' free-node-page' : '' }}">
@if($bEditorialPreview ?? false)
<div class="container"><div class="alert alert-info">草稿预览 · 版本 {{ $editorialRevision }} · {{ ($editorialDraftStatus ?? 'draft') === 'published' ? '此版本已有发布记录' : '尚未发布' }}</div></div>
@endif
@@ -58,6 +63,9 @@
<div class="content-wrapper col-lg-8">
<div class="post card card-md">
<div class="card-body">
@if($freeNodeLayout)
@include('pages.articles.freenode.header')
@else
<div class="post-title mb-3">
<h1 class="mb-3">{{ $oArticle->sTitle }}</h1>
<div class="post-meta text-xs">
@@ -66,13 +74,24 @@
<time class="text-muted" datetime="{{ $oArticle->created_at?->toAtomString() }}">发布于 {{ $oArticle->sCreatedAtDiff }}</time>
</div>
</div>
@endif
<div class="post-content">
@if($freeNodeLayout)
@include('pages.articles.freenode.content')
@else
@if ($oArticle->bPageThumb && $oArticle->sThumb)
<p>
<img decoding="async" alt="" class="size-full wp-image-28 aligncenter" src="{{ $oArticle->sThumb }}" style="border-radius: 6px;">
</p>
@endif
{!! nl2br(\App\Services\Seo::body(\App\Services\ResourceArticlePresentation::body($oArticle->sContent ?? '', $oArticle->oCategory?->sSlug))) !!}
{!! nl2br(\App\Services\Seo::body($articleBodyParts[0])) !!}
@if($recommendations['inline'])
@include('components.airport-recommendations')
{!! nl2br(\App\Services\Seo::body($articleBodyParts[1])) !!}
@elseif($recommendations['enabled'])
@include('components.airport-recommendations')
@endif
@endif
</div>
@@ -0,0 +1,27 @@
@if($freeNodeLayout['intro'])<div class="fn-extra-intro">{!! nl2br(\App\Services\Seo::body($freeNodeLayout['intro'])) !!}</div>@endif
<section class="fn-subscriptions" id="node-subscriptions" aria-labelledby="node-subscriptions-title">
<div class="fn-section-heading"><div><h2 id="node-subscriptions-title">获取免费订阅</h2></div></div>
@if($freeNodeLayout['count'] === 0)
<p class="fn-empty-note">这篇更新记录的可用节点为 0,导入前可先<a href="/">查看最新更新</a>。</p>
@endif
<div class="fn-subscription-list">
@foreach($freeNodeLayout['subscriptions'] as $subscription)
<div class="fn-subscription fn-subscription--{{ $subscription['key'] }}">
<div class="fn-subscription__top"><div class="fn-subscription__name"><h3>适用于:{{ $subscription['title'] }}</h3></div></div>
<div class="fn-subscription__address"><code title="{{ $subscription['url'] }}">{{ $subscription['url'] }}</code><button type="button" class="fn-copy copy-permalink" data-clipboard-text="{{ $subscription['url'] }}" aria-label="复制 {{ $subscription['title'] }} 订阅"><svg width="15" height="15" viewBox="0 0 16 16" fill="none" aria-hidden="true"><rect x="5" y="5" width="8" height="9" rx="1" stroke="currentColor"/><path d="M3 11H2V2h8v1" stroke="currentColor"/></svg><span>复制订阅</span></button></div>
</div>
@endforeach
</div>
@if($freeNodeLayout['notes'])<div class="fn-subscription-note">{!! nl2br(\App\Services\Seo::body($freeNodeLayout['notes'])) !!}</div>@endif
</section>
<section class="fn-usage" id="node-usage" aria-labelledby="node-usage-title">
<div class="fn-section-heading"><div><h2 id="node-usage-title">从订阅到连接,只需三步</h2></div></div>
<ol class="fn-steps"><li><span>01</span><div><strong>复制订阅</strong><p>选择与客户端匹配的格式。</p></div></li><li><span>02</span><div><strong>导入客户端</strong><p>在订阅管理中粘贴链接并更新。</p></div></li><li><span>03</span><div><strong>选择节点</strong><p>开启连接,再检查访问是否正常。</p></div></li></ol>
<div class="fn-tutorial-links"><span>第一次使用?</span><a href="/a/clash-verge-rev-windows.html">Windows 入门 ↗</a><a href="/a/m169.html">Android 入门 ↗</a><a href="/client">全部教程 ↗</a></div>
</section>
@if($recommendations['enabled'])
@include('components.airport-recommendations')
@endif
@if($freeNodeLayout['community'])
<div class="fn-community"><span>收藏更新,不必反复寻找</span><div>@foreach($freeNodeLayout['community'] as $link)<a href="{{ $link['url'] }}" target="_blank" rel="noopener noreferrer">{{ $link['label'] }} ↗</a>@endforeach</div></div>
@endif
@@ -0,0 +1,24 @@
@once
@push('styles')
<link rel="stylesheet" href="/css/freenode-article.css?v={{ filemtime(public_path('css/freenode-article.css')) }}">
@endpush
@endonce
<header class="fn-header">
<div class="fn-header__main">
<h1><span>{{ $oArticle->created_at?->format('n月j日') }}</span><span>免费节点订阅</span></h1>
<p class="fn-header__lead">支持 Clash / V2ray / Shadowrocket / Singbox / Hiddify</p>
</div>
@if($oArticle->sThumb)
<img class="fn-header__art" src="{{ $oArticle->sThumb }}" width="192" height="160" alt="猫咪主题插画" decoding="async">
@endif
</header>
<div class="fn-overview">
@if($freeNodeLayout['count'] !== null)
<div class="fn-metric"><span>本篇收录</span><div><strong>{{ $freeNodeLayout['count'] }}</strong><span>个节点</span></div></div>
@endif
@if($freeNodeLayout['speed'])
<div class="fn-metric"><span>最高速度</span><div><strong>{{ $freeNodeLayout['speed'] }}</strong></div></div>
@endif
<div class="fn-overview__regions"><span>覆盖地区</span><div>@forelse($freeNodeLayout['regions'] as $region)<span>{{ $region }}</span>@empty<span>以订阅内容为准</span>@endforelse</div></div>
</div>
<nav class="fn-article-nav" aria-label="本页内容"><a href="#node-subscriptions">获取订阅<span>↗</span></a><a href="#node-usage">使用说明</a>@if($recommendations['enabled'])<a href="#{{ config('airport_recommendations.anchor') }}">机场推荐</a>@endif</nav>
@@ -0,0 +1,76 @@
<?php
namespace Tests\Feature;
use App\Models\Articles;
use App\Models\Categories;
use App\Services\ArticleRecommendations;
use Tests\TestCase;
class ArticleRecommendationsTest extends TestCase
{
private function article(string $slug, string $html, ?string $parent = null): Articles
{
$category = new Categories();$category->setRawAttributes(['sSlug' => $slug]);
$ancestor = new Categories();$ancestor->setRawAttributes(['sSlug' => $parent]);
$category->setRelation('oParent', $parent ? $ancestor : null);
$article = new Articles();$article->setRawAttributes(['sContent' => $html]);
$article->setRelation('oCategory', $category);
return $article;
}
public function test_legacy_promotion_is_replaced_without_touching_subscription_or_account_content(): void
{
foreach (['freenode', 'shadowrocketids'] as $category) {
$tail = '<p><h2>免费资源:</h2></p><p><a data-clipboard-text="https://example.invalid/private-sub">复制订阅</a></p><pre>account:example</pre>';
$html = '<p>文章开头</p><p><h2>机场推荐 - 福云:</h2></p><p>* 七折,折后8元</p><p><b><a target="__blank" href="https://fuuu.cloud">👉 点击进入机场官网:福云。</a></b></p>'.$tail;
$article = $this->article($category, $html);
$prepared = ArticleRecommendations::prepare($article);
$this->assertTrue($prepared['inline']);
$this->assertSame('<p>文章开头</p>'.ArticleRecommendations::SLOT.$tail, $prepared['body']);
$this->assertSame($html, $article->sContent);
}
}
public function test_no_promotion_link_means_no_destructive_guess_and_a_single_append(): void
{
$html = '<h2>机场推荐 - 福云:</h2><p>用户另写的内容</p><h2>订阅</h2><p>保留</p>';
$result = ArticleRecommendations::prepare($this->article('freenode', $html));
$this->assertTrue($result['enabled']);$this->assertFalse($result['inline']);
$this->assertSame($html, $result['body']);
}
public function test_all_intro_subcategories_append_and_advanced_articles_have_one_working_jump(): void
{
$html = '<div class="tutorial-body"><p>先配置订阅。</p><p>连接线路。</p></div>';
foreach (['windows','andorid','ios','mac','linux'] as $category) {
$result = ArticleRecommendations::prepare($this->article($category, $html, 'client'));
$this->assertTrue($result['enabled']);$this->assertFalse($result['inline']);$this->assertSame($html, $result['body']);
}
$article = $this->article('advanced', $html);
$first = ArticleRecommendations::prepare($article);
$this->assertSame(1, substr_count($first['body'], 'href="#airport-recommendations"'));
$again = ArticleRecommendations::prepare($this->article('advanced', $first['body']));
$this->assertSame($first['body'], $again['body']);
}
public function test_disable_and_unrelated_categories_leave_content_unchanged(): void
{
$this->assertFalse(ArticleRecommendations::prepare($this->article('news', '<p>正文</p>'))['enabled']);
config(['airport_recommendations.enabled' => false]);
$result = ArticleRecommendations::prepare($this->article('advanced', '<p>订阅</p>'));
$this->assertFalse($result['enabled']);$this->assertSame('<p>订阅</p>', $result['body']);
}
public function test_shared_view_outputs_configured_prices_coupon_and_sponsored_links_without_javascript(): void
{
$html = view('components.airport-recommendations')->render();
foreach (['福云', 'DP-LINK.NET', 'hardnerd', '>18<', '>26<', '>28<'] as $text) $this->assertStringContainsString($text, $html);
$this->assertSame(1, substr_count($html, '<section id="airport-recommendations"'));
$this->assertSame(3, substr_count($html, 'rel="sponsored nofollow noopener noreferrer"'));
$this->assertSame(2, substr_count($html, 'data-airport-coupon="clashfreenode.com"'));
config(['airport_recommendations.providers.fuc.price' => '20', 'airport_recommendations.providers.dpl.enabled' => false]);
$updated = view('components.airport-recommendations')->render();
$this->assertStringContainsString('>20<', $updated);$this->assertStringNotContainsString('DP-LINK.NET', $updated);
}
}
@@ -0,0 +1,52 @@
<?php
namespace Tests\Feature;
use App\Services\FreeNodeArticleLayout;
use Tests\TestCase;
class FreeNodeArticleLayoutTest extends TestCase
{
private function html(bool $singbox = true): string
{
$html = '<p>本次更新共<b>0</b>个可用节点,最高速度3M/S。</p><p>覆盖日本、日本、新加坡等多个区域。</p><p>复制下方订阅链接,添加至客户端即可正常使用。</p><!-- fna-airport-recommendations --><p><h2>免费节点订阅链接:</h2></p>';
foreach (['v2ray.txt','clash.yaml',...($singbox ? ['singbox.txt'] : [])] as $format) {
$url = 'https://example.invalid/cfn/20261031-'.$format.'?key=a&amp;b=2';
$html .= '<p><b>客户端订阅链接:</b></p><p><a data-clipboard-text="'.$url.'" href="javascript:;"></p><p><span>'.$url.'</span></a></p>';
}
return $html.'<p>下载文件后再导入客户端。</p><p>温馨提示:</p><p>保留原来的使用提示。</p>';
}
public function test_malformed_legacy_markup_keeps_exact_urls_zero_count_notes_and_region_order(): void
{
$r = FreeNodeArticleLayout::prepare($this->html());
$this->assertNotNull($r);$this->assertSame(0, $r['count']);$this->assertSame('3M/S', $r['speed']);
$this->assertSame(['日本','新加坡'], $r['regions']);
$this->assertSame(['clash','v2ray','singbox'], array_column($r['subscriptions'], 'key'));
$this->assertSame('https://example.invalid/cfn/20261031-clash.yaml?key=a&b=2', $r['subscriptions'][0]['url']);
$this->assertStringContainsString('下载文件后再导入客户端', $r['notes']);
$this->assertStringContainsString('保留原来的使用提示', $r['usage']);
$this->assertStringNotContainsString('data-clipboard-text', $r['notes']);
}
public function test_older_two_format_articles_never_invent_a_singbox_url(): void
{
$r = FreeNodeArticleLayout::prepare($this->html(false));
$this->assertSame(['clash','v2ray'], array_column($r['subscriptions'], 'key'));
}
public function test_unknown_format_or_structure_returns_original_view_fallback(): void
{
$this->assertNull(FreeNodeArticleLayout::prepare('<p>自定义正文</p>'));
$this->assertNull(FreeNodeArticleLayout::prepare(str_replace('clash.yaml', 'unknown.txt', $this->html())));
$this->assertNull(FreeNodeArticleLayout::prepare(str_replace('https://example.invalid', 'javascript:alert(1)', $this->html())));
}
public function test_unknown_intro_and_ordinary_supplementary_links_are_not_removed(): void
{
$html = '<p><em>保留新的编辑说明。</em></p>'.str_replace('<p>温馨提示:</p>', '<p><a href="/client">查看更多教程</a></p><p>温馨提示:</p>', $this->html());
$r = FreeNodeArticleLayout::prepare($html);
$this->assertStringContainsString('保留新的编辑说明', $r['intro']);
$this->assertStringContainsString('href="/client"', $r['notes']);
}
}