前端修改

This commit is contained in:
zhongjy001
2026-03-09 21:38:02 +08:00
parent 260460df03
commit 91b20b8aed
4 changed files with 123 additions and 39 deletions

View File

@@ -3,7 +3,10 @@
"name": "laravel/laravel",
"type": "project",
"description": "The skeleton application for the Laravel framework.",
"keywords": ["laravel", "framework"],
"keywords": [
"laravel",
"framework"
],
"license": "MIT",
"require": {
"php": "^8.2",
@@ -42,7 +45,7 @@
],
"dev": [
"Composer\\Config::disableProcessTimeout",
"npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1 --timeout=0\" \"php artisan pail --timeout=0\" \"npm run dev\" --names=server,queue,logs,vite --kill-others"
"npx concurrently -c \"#93c5fd,#c4b5fd,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1 --timeout=0\" \"npm run dev\" --names=server,queue,vite --kill-others"
],
"test": [
"@php artisan config:clear --ansi",
@@ -83,4 +86,4 @@
},
"minimum-stability": "stable",
"prefer-stable": true
}
}

View File

@@ -1,7 +1,9 @@
html { scroll-behavior: smooth; }
body { background: #ffffff !important; }
.tool-home { display: grid; grid-template-columns: 208px minmax(0, 1fr); gap: .72rem; align-items: start; }
.tool-side { position: sticky; top: .72rem; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-surface); box-shadow: var(--shadow-sm); padding: .6rem .48rem; max-height: calc(100vh - 1.44rem); overflow: auto; }
.tool-side { position: sticky; top: .72rem; border: 1px solid #e5e7eb; border-radius: 12px; background: #ffffff; box-shadow: 0 1px 3px rgba(0,0,0,0.08); padding: .6rem .48rem; max-height: calc(100vh - 1.44rem); overflow: auto; }
.tool-side-logo { display: flex; align-items: center; gap: .38rem; padding: .22rem .3rem .56rem; border-bottom: 1px solid var(--line); margin-bottom: .36rem; font-family: "Outfit", "Noto Sans SC", sans-serif; color: var(--text-main); font-size: 1.12rem; font-weight: 800; }
.tool-side-logo-dot { width: 1.35rem; height: 1.35rem; border-radius: .38rem; background: linear-gradient(135deg, #a777ff, #6e77ff); color: #fff; font-size: .68rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.tool-side-links { display: grid; gap: .16rem; }
@@ -12,46 +14,58 @@ html { scroll-behavior: smooth; }
.tool-main { min-width: 0; display: grid; gap: .62rem; }
.tool-hero { border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(180deg, #f5f8ff 0, #eef3fb 100%); box-shadow: var(--shadow-sm); padding: .95rem .95rem .82rem; text-align: center; }
.tool-chip { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--bg-surface); color: #6f81a7; font-size: .68rem; font-weight: 700; padding: .14rem .5rem; }
.tool-title { margin: .34rem 0 .18rem; font-family: "Outfit", "Noto Sans SC", sans-serif; font-size: clamp(1.6rem, 2.8vw, 2.45rem); font-weight: 800; color: var(--text-main); }
.tool-sub { margin: 0; color: var(--text-muted); font-size: .84rem; }
.tool-hero { border: 1px solid #e5e7eb; border-radius: 12px; background: #ffffff; box-shadow: 0 1px 3px rgba(0,0,0,0.08); padding: 1.2rem 1rem 1rem; text-align: center; }
.tool-chip { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--bg-surface); color: #6f81a7; font-size: .68rem; font-weight: 700; padding: .14rem .5rem; margin-bottom: .4rem; }
.tool-title { margin: 0 0 .24rem; font-family: "Outfit", "Noto Sans SC", sans-serif; font-size: clamp(1.8rem, 3vw, 2.8rem); font-weight: 800; color: var(--text-main); line-height: 1.1; }
.tool-sub { margin: 0 0 .7rem; color: var(--text-muted); font-size: .92rem; max-width: 600px; margin-left: auto; margin-right: auto; }
:root[data-theme="dark"] .tool-hero { background: linear-gradient(180deg, #1b2849 0, #16223f 100%); }
.tool-search { margin: .62rem auto .38rem; width: min(860px, 100%); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .38rem; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--bg-surface); padding: .3rem; }
.tool-search input { border: 0; box-shadow: none; height: 2.16rem; padding: 0 .82rem; background: transparent; color: var(--text-main); }
.tool-search button { border-radius: 999px; min-width: 90px; height: 2.16rem; font-size: .82rem; }
.tool-search { margin: 0 auto .8rem; width: min(860px, 100%); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .38rem; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--bg-surface); padding: .3rem; }
.tool-search input { border: 0; box-shadow: none; height: 2.4rem; padding: 0 1rem; background: transparent; color: var(--text-main); font-size: .9rem; }
.tool-search button { border-radius: 999px; min-width: 100px; height: 2.4rem; font-size: .88rem; font-weight: 600; }
.tool-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin-top: .52rem; }
.tool-kpi { border: 1px solid var(--line); border-radius: .7rem; background: var(--bg-surface); padding: .46rem .5rem; }
.tool-kpi .label { display: block; color: #7b8fb2; font-size: .72rem; }
.tool-kpi .value { margin-top: .12rem; font-family: "Outfit", "Noto Sans SC", sans-serif; font-size: 1.08rem; font-weight: 800; color: var(--text-main); }
.tool-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; margin-top: .8rem; margin-bottom: .6rem; }
.tool-kpi { border: 1px solid #e5e7eb; border-radius: .8rem; background: #ffffff; box-shadow: 0 1px 3px rgba(0,0,0,0.08); padding: .56rem .6rem; text-align: center; }
.tool-kpi .label { display: block; color: #7b8fb2; font-size: .76rem; margin-bottom: .2rem; }
.tool-kpi .value { font-family: "Outfit", "Noto Sans SC", sans-serif; font-size: 1.2rem; font-weight: 800; color: var(--text-main); line-height: 1.1; }
.tool-channel { border: 1px solid var(--line); border-radius: 12px; background: var(--bg-surface); box-shadow: var(--shadow-sm); padding: .52rem; display: grid; grid-template-columns: 62px repeat(5, minmax(0, 1fr)); gap: .46rem; }
.tool-channel-mini { border: 1px solid var(--line); border-radius: 10px; background: var(--bg-soft); display: grid; gap: .34rem; padding: .44rem .3rem; }
.tool-channel-mini a { text-decoration: none; color: #5f7399; font-size: .72rem; text-align: center; }
.tool-channel-card { border: 1px solid var(--line); border-radius: 10px; min-height: 104px; display: flex; align-items: flex-end; justify-content: flex-start; text-decoration: none; font-family: "Outfit", "Noto Sans SC", sans-serif; font-size: .92rem; font-weight: 700; color: #fff; background-size: cover; background-position: center; position: relative; overflow: hidden; padding: .52rem; }
.tool-channel { border: none; border-radius: 12px; background: transparent; padding: .6rem; display: grid; grid-template-columns: 70px repeat(4, minmax(0, 1fr)); gap: .5rem; }
.tool-channel-mini { border: 1px solid #e5e7eb; border-radius: 10px; background: #ffffff; box-shadow: 0 1px 3px rgba(0,0,0,0.08); display: grid; gap: .4rem; padding: .5rem .35rem; }
.tool-channel-mini a { text-decoration: none; color: #5f7399; font-size: .76rem; text-align: center; }
.tool-channel-mini a i { display: block; font-size: 1.1rem; margin-bottom: .2rem; color: var(--brand-strong); }
.tool-channel-card { border: 1px solid #e5e7eb; border-radius: 10px; min-height: 110px; display: flex; align-items: flex-end; justify-content: flex-start; text-decoration: none; font-family: "Outfit", "Noto Sans SC", sans-serif; font-size: .96rem; font-weight: 700; color: #fff; background-size: cover; background-position: center; position: relative; overflow: hidden; padding: .6rem; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.tool-channel-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,32,56,.08), rgba(20,32,56,.68)); }
.tool-channel-card span { position: relative; z-index: 1; }
.tool-banner-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .52rem; }
.tool-banner { border: 1px solid var(--line); border-radius: 10px; background: linear-gradient(90deg, #e8f3ff, #e4f7ef); min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: .52rem; padding: .58rem .72rem; text-decoration: none; }
.tool-banner.alt { background: linear-gradient(90deg, #e6f6ff, #dff8dd); }
.tool-banner b { color: var(--text-main); font-size: 1.06rem; font-family: "Outfit", "Noto Sans SC", sans-serif; }
.tool-banner small { border: 1px solid var(--line-strong); border-radius: 999px; background: var(--bg-surface); color: #5f749a; font-size: .72rem; padding: .14rem .48rem; }
.tool-banner-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.tool-banner { border: 1px solid #e5e7eb; border-radius: 10px; background: #ffffff; min-height: 80px; display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .65rem .8rem; text-decoration: none; transition: .16s ease; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.tool-banner:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.12); border-color: #d1d5db; }
.tool-banner.alt { background: #f9fafb; }
.tool-banner b { color: var(--text-main); font-size: 1.1rem; font-family: "Outfit", "Noto Sans SC", sans-serif; font-weight: 700; }
.tool-banner small { border: 1px solid var(--line-strong); border-radius: 999px; background: var(--bg-surface); color: #5f749a; font-size: .76rem; padding: .16rem .5rem; }
.tool-section { border: 1px solid var(--line); border-radius: 12px; background: var(--bg-surface); box-shadow: var(--shadow-sm); padding: .62rem; scroll-margin-top: 1rem; }
.tool-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .48rem; }
.tool-section-head h2 { margin: 0; color: var(--text-main); font-size: 1rem; font-family: "Outfit", "Noto Sans SC", sans-serif; font-weight: 700; }
.tool-section-head a { color: var(--brand-strong); text-decoration: none; font-size: .76rem; font-weight: 600; }
.tool-section { border: none; border-radius: 12px; background: transparent; padding: .7rem; scroll-margin-top: 1rem; }
.tool-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .56rem; }
.tool-section-head h2 { margin: 0; color: var(--text-main); font-size: 1.08rem; font-family: "Outfit", "Noto Sans SC", sans-serif; font-weight: 700; }
.tool-section-head a { color: var(--brand-strong); text-decoration: none; font-size: .8rem; font-weight: 600; transition: color .16s ease; }
.tool-section-head a:hover { color: var(--brand); }
.tool-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .52rem; }
.tool-card { border: 1px solid var(--line); border-radius: 10px; background: var(--bg-surface); box-shadow: var(--shadow-sm); padding: .56rem .62rem; text-decoration: none; transition: .16s ease; }
.tool-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: 0 12px 22px rgba(31,54,112,.14); }
.tool-card-name { color: var(--text-main); font-size: .92rem; line-height: 1.26; font-weight: 700; }
.tool-card-meta { margin-top: .2rem; color: var(--text-muted); font-size: .76rem; }
.tool-card-tag { margin-top: .42rem; display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: .13rem .48rem; color: var(--brand-strong); background: var(--brand-soft); font-size: .7rem; }
.tool-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; }
.tool-card { border: 1px solid #e5e7eb; border-radius: 10px; background: #ffffff; box-shadow: 0 1px 3px rgba(0,0,0,0.08); padding: .7rem .75rem; text-decoration: none; transition: .18s ease; position: relative; overflow: hidden; display: flex; flex-direction: column; height: 100%; }
.tool-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.12); border-color: #d1d5db; }
.tool-card-icon { width: 48px; height: 48px; border-radius: 10px; background: #f8fafc; display: flex; align-items: center; justify-content: center; margin-bottom: .5rem; flex-shrink: 0; overflow: hidden; }
.tool-card-icon img { width: 100%; height: 100%; object-fit: contain; }
.tool-card-name { color: var(--text-main); font-size: .96rem; line-height: 1.3; font-weight: 700; margin-bottom: .25rem; flex-shrink: 0; }
.tool-card-meta { color: var(--text-muted); font-size: .78rem; margin-bottom: .45rem; flex-shrink: 0; }
.tool-card-desc { color: var(--text-muted); font-size: .8rem; line-height: 1.4; margin: 0 0 .6rem; flex-grow: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tool-card-footer { display: flex; align-items: center; justify-content: space-between; gap: .4rem; margin-top: auto; flex-shrink: 0; }
.tool-card-tag { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: .14rem .5rem; color: var(--brand-strong); background: var(--brand-soft); font-size: .72rem; font-weight: 500; flex-shrink: 0; }
.tool-card-date { color: #97a9c8; font-size: .7rem; flex-shrink: 0; white-space: nowrap; }
.channel-tabs { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; justify-content: center; margin-top: .6rem; }
.channel-tab { border: 1px solid transparent; border-radius: 999px; padding: .24rem .65rem; color: #56698d; text-decoration: none; font-size: .82rem; white-space: nowrap; transition: .16s ease; font-weight: 500; }
.channel-tab.active, .channel-tab:hover { border-color: #d7dff1; background: #f4f7ff; color: #27406f; }
@media (max-width: 1199px) {
.tool-home { grid-template-columns: 1fr; }
@@ -59,6 +73,10 @@ html { scroll-behavior: smooth; }
.tool-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 991px) {
.tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
.tool-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@@ -66,4 +84,12 @@ html { scroll-behavior: smooth; }
.tool-search button { width: 100%; border-radius: 10px; }
.tool-channel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tool-banner-row { grid-template-columns: 1fr; }
.tool-hero { padding: 1rem .8rem; }
.tool-title { font-size: clamp(1.6rem, 6vw, 2.2rem); }
}
@media (max-width: 575px) {
.tool-grid { grid-template-columns: 1fr; }
.tool-kpis { grid-template-columns: 1fr; }
.tool-channel { grid-template-columns: 1fr; }
}

View File

@@ -9,9 +9,20 @@
<div class="tool-grid">
@foreach($tools as $tool)
<a class="{{ $cardClass }}" href="{{ route('tools.show', $tool->slug) }}">
@if($tool->logo_url)
<div class="tool-card-icon">
<img src="{{ $tool->logo_url }}" alt="{{ $tool->name }}" loading="lazy">
</div>
@endif
<div class="{{ $nameClass }}">{{ $tool->name }}</div>
<div class="{{ $metaClass }}">{{ $tool->category?->name ?? '未分类' }} · {{ $tool->pricing_type }}</div>
<span class="{{ $tagClass }}">{{ $tool->has_api ? '支持 API' : '无 API' }}</span>
@if($tool->summary)
<p class="tool-card-desc">{{ $tool->summary }}</p>
@endif
<div class="tool-card-footer">
<span class="{{ $tagClass }}">{{ $tool->has_api ? '支持 API' : '无 API' }}</span>
<span class="tool-card-date">{{ $tool->published_at?->format('Y-m-d') }}</span>
</div>
</a>
@endforeach
</div>

View File

@@ -73,16 +73,35 @@ $bannerItems = collect(data_get($bannerModule, 'items', []))->take((int) data_ge
<section class="tool-main">
<section class="tool-hero">
<span class="tool-chip">AI-BOT.CN</span>
<h1 class="tool-title">{{ data_get($hotModule, 'extra.side_title', 'AI工具集') }}</h1>
<p class="tool-sub">{{ data_get($hotModule, 'subtitle', '左侧菜单点击后可直接定位到对应工具区块。') }}</p>
<span class="tool-chip">AIBASE.CN</span>
<h1 class="tool-title">AI工具集</h1>
<p class="tool-sub">10000+精选AI工具集合涵盖写作、图像、视频、编程等多个领域</p>
<form class="tool-search" method="get" action="{{ route('tools.list') }}" role="search" aria-label="站内 AI 工具搜索">
<input type="hidden" name="tab" value="{{ $activeTab }}">
<input type="search" name="q" value="{{ $filters['q'] ?? '' }}" placeholder="站内 AI 工具搜索,如:写作、图像、自动化" autocomplete="off" spellcheck="false">
<input type="search" name="q" value="{{ $filters['q'] ?? '' }}" placeholder="输入关键词搜索AI工具写作、图像、自动化" autocomplete="off" spellcheck="false">
<button class="btn btn-primary" type="submit"><i class="bi bi-search"></i> 搜索</button>
</form>
<div class="tool-kpis">
<div class="tool-kpi">
<span class="label">工具总数</span>
<span class="value">{{ $toolStats['total'] }}</span>
</div>
<div class="tool-kpi">
<span class="label">API支持</span>
<span class="value">{{ $toolStats['api'] }}</span>
</div>
<div class="tool-kpi">
<span class="label">免费工具</span>
<span class="value">{{ $toolStats['free'] }}</span>
</div>
<div class="tool-kpi">
<span class="label">7日更新</span>
<span class="value">{{ $toolStats['updated_7d'] }}</span>
</div>
</div>
<nav class="channel-tabs justify-content-center" aria-label="筛选模式">
@foreach($tabOptions as $tab)
<a class="channel-tab @if($activeTab === $tab['key']) active @endif" href="{{ route('tools.index', array_filter(array_merge($filters, ['tab' => $tab['key']]))) }}">{{ $tab['label'] }}</a>
@@ -90,6 +109,31 @@ $bannerItems = collect(data_get($bannerModule, 'items', []))->take((int) data_ge
</nav>
</section>
@if(data_get($channelModule, 'enabled', true) === true)
<section id="section-channel" class="tool-section" aria-label="频道卡片">
<header class="tool-section-head">
<h2><i class="bi bi-grid text-primary"></i> {{ data_get($channelModule, 'title', '频道卡片') }}</h2>
</header>
<div class="tool-channel">
<div class="tool-channel-mini">
<a href="{{ route('home') }}"><i class="bi bi-house"></i><br>首页</a>
<a href="{{ route('tools.list') }}"><i class="bi bi-tools"></i><br>工具</a>
<a href="{{ route('models.index') }}"><i class="bi bi-cpu"></i><br>模型</a>
<a href="{{ route('news.index') }}"><i class="bi bi-newspaper"></i><br>资讯</a>
<a href="{{ route('guides.index') }}"><i class="bi bi-journal-code"></i><br>教程</a>
</div>
@forelse($channelItems as $channel)
<a class="tool-channel-card" href="{{ $channel['url'] ?: 'javascript:void(0)' }}" @if(!empty($channel['image_path'])) style="background-image:url('{{ $channel['image_path'] }}');" @endif>
<span>{{ $channel['title'] ?: '频道入口' }}</span>
</a>
@empty
<div class="tool-channel-card"><span>频道入口</span></div>
@endforelse
</div>
</section>
@endif
@foreach($moduleOrder as $moduleKey)
@if($moduleKey === 'promo_banners' && data_get($bannerModule, 'enabled', true) === true)
<section id="section-banner" class="tool-section" aria-label="横幅推荐">