Files
ai-web/resources/views/public/tools/index.blade.php
jiangdong.cheng d35c397e8d 界面优化
2026-02-12 10:57:53 +08:00

629 lines
19 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@extends('layouts.site')
@section('page_class', 'page-tools')
@section('title', 'AI工具集 - AIWeb')
@section('meta_description', 'AI工具集首页按分类分块浏览工具左侧菜单可定位到对应区块。')
@section('canonical', route('tools.index'))
@section('head')
<style>
html {
scroll-behavior: smooth;
}
.tool-home {
display: grid;
grid-template-columns: 186px minmax(0, 1fr);
gap: .68rem;
align-items: start;
}
.tool-side {
position: sticky;
top: .72rem;
border: 1px solid #d8e1f1;
border-radius: 12px;
background: #fff;
box-shadow: 0 8px 18px rgba(40, 63, 120, .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 #e7edf8;
margin-bottom: .36rem;
font-family: "Outfit", "Noto Sans SC", sans-serif;
color: #131e44;
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;
}
.tool-side-link {
display: grid;
grid-template-columns: 1rem minmax(0, 1fr) auto;
align-items: center;
gap: .42rem;
border: 1px solid transparent;
border-radius: .58rem;
text-decoration: none;
color: #4e6189;
padding: .38rem .42rem;
font-size: .82rem;
transition: .16s ease;
}
.tool-side-link:hover,
.tool-side-link.active {
border-color: #d4ddf2;
background: #f4f7ff;
color: #21345f;
box-shadow: inset 2px 0 0 #5f72ff;
}
.tool-side-link i {
color: #687ba2;
text-align: center;
}
.tool-side-link small {
color: #97a9c8;
font-size: .7rem;
}
.tool-main {
min-width: 0;
display: grid;
gap: .62rem;
}
.tool-top {
display: flex;
align-items: center;
justify-content: space-between;
gap: .5rem;
border: 1px solid #d8e1f1;
border-radius: 12px;
background: #fff;
box-shadow: 0 8px 18px rgba(40, 63, 120, .08);
padding: .5rem .62rem;
}
.tool-top .channel-tab {
padding: .16rem .52rem;
font-size: .78rem;
}
.tool-status {
color: #7387ad;
font-size: .76rem;
white-space: nowrap;
}
.tool-status b {
color: #2c4172;
font-family: "Outfit", "Noto Sans SC", sans-serif;
font-size: .9rem;
}
.tool-hero {
border: 1px solid #d8e1f1;
border-radius: 12px;
background: linear-gradient(180deg, #f5f8ff 0, #eef3fb 100%);
box-shadow: 0 8px 18px rgba(40, 63, 120, .08);
padding: .95rem .95rem .82rem;
text-align: center;
}
.tool-chip {
display: inline-flex;
border: 1px solid #d8e0f0;
border-radius: 999px;
background: #fff;
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: #141f47;
}
.tool-sub {
margin: 0;
color: #66799f;
font-size: .84rem;
}
.tool-search {
margin: .62rem auto .38rem;
width: min(860px, 100%);
display: grid;
grid-template-columns: minmax(0, 1fr) auto;
gap: .38rem;
border: 1px solid #d4deef;
border-radius: 999px;
background: #fff;
padding: .3rem;
}
.tool-search input {
border: 0;
box-shadow: none;
height: 2.16rem;
padding: 0 .82rem;
background: transparent;
}
.tool-search button {
border-radius: 999px;
min-width: 90px;
height: 2.16rem;
font-size: .82rem;
}
.tool-kpis {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: .48rem;
}
.tool-kpi {
border: 1px solid #d7e0f1;
border-radius: 10px;
background: #fff;
padding: .56rem .6rem;
text-align: left;
}
.tool-kpi span {
font-size: .74rem;
color: #6d80a5;
}
.tool-kpi b {
display: block;
margin-top: .12rem;
font-family: "Outfit", "Noto Sans SC", sans-serif;
font-size: 1.08rem;
font-weight: 800;
color: #1c2d55;
}
.tool-channel {
border: 1px solid #d8e1f1;
border-radius: 12px;
background: #fff;
box-shadow: 0 8px 18px rgba(40, 63, 120, .08);
padding: .52rem;
display: grid;
grid-template-columns: 62px repeat(5, minmax(0, 1fr));
gap: .46rem;
}
.tool-channel-mini {
border: 1px solid #dee6f5;
border-radius: 10px;
background: #f8faff;
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 #dce4f3;
border-radius: 10px;
min-height: 94px;
display: flex;
align-items: center;
justify-content: center;
text-decoration: none;
font-family: "Outfit", "Noto Sans SC", sans-serif;
font-size: 1.8rem;
font-weight: 800;
color: #273a63;
}
.tool-channel-card.news { background: #dce8ff; }
.tool-channel-card.community { background: #dff3da; }
.tool-channel-card.project { background: #ede0fa; }
.tool-channel-card.tutorial { background: #d8f0ff; }
.tool-channel-card.ad { background: #f4f6ff; }
.tool-banner-row {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: .52rem;
}
.tool-banner {
border: 1px solid #d8e1f1;
border-radius: 10px;
background: linear-gradient(90deg, #e8f3ff, #e4f7ef);
min-height: 66px;
display: flex;
align-items: center;
justify-content: space-between;
gap: .52rem;
padding: .58rem .72rem;
}
.tool-banner.alt {
background: linear-gradient(90deg, #e6f6ff, #dff8dd);
}
.tool-banner b {
color: #1d3058;
font-size: 1.06rem;
font-family: "Outfit", "Noto Sans SC", sans-serif;
}
.tool-banner small {
border: 1px solid #d6def0;
border-radius: 999px;
background: #fff;
color: #5f749a;
font-size: .72rem;
padding: .14rem .48rem;
}
.tool-section {
border: 1px solid #d8e1f1;
border-radius: 12px;
background: #fff;
box-shadow: 0 8px 18px rgba(40, 63, 120, .08);
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: #20335d;
font-size: 1rem;
font-family: "Outfit", "Noto Sans SC", sans-serif;
font-weight: 700;
}
.tool-section-head a {
color: #4d63a4;
text-decoration: none;
font-size: .76rem;
font-weight: 600;
}
.tool-grid {
display: grid;
grid-template-columns: repeat(6, minmax(0, 1fr));
gap: .52rem;
}
.tool-card {
border: 1px solid #dbe3f2;
border-radius: 10px;
background: #fff;
padding: .52rem .56rem;
text-decoration: none;
color: #1f3157;
transition: .16s ease;
min-height: 88px;
display: grid;
align-content: start;
gap: .25rem;
}
.tool-card:hover {
border-color: #cdd9f0;
box-shadow: 0 12px 24px rgba(45, 66, 122, .12);
transform: translateY(-2px);
}
.tool-card-name {
font-size: .85rem;
font-weight: 700;
line-height: 1.3;
}
.tool-card-meta {
font-size: .72rem;
color: #7084a8;
line-height: 1.25;
}
.tool-card-tag {
display: inline-flex;
border: 1px solid #d6def0;
border-radius: 999px;
background: #f6f8ff;
color: #4f639b;
font-size: .68rem;
padding: .06rem .4rem;
}
.tool-mobile-cats {
display: none;
gap: .28rem;
flex-wrap: wrap;
border: 1px solid #d8e1f1;
border-radius: 12px;
background: #fff;
box-shadow: 0 8px 18px rgba(40, 63, 120, .08);
padding: .42rem;
}
.tool-mobile-cats .tool-side-link {
flex: 1 1 160px;
min-width: 144px;
}
@media (max-width: 1399.98px) {
.tool-grid {
grid-template-columns: repeat(4, minmax(0, 1fr));
}
}
@media (max-width: 991.98px) {
.tool-home {
grid-template-columns: 1fr;
}
.tool-side {
display: none;
}
.tool-mobile-cats {
display: flex;
}
.tool-top {
flex-direction: column;
align-items: stretch;
}
.tool-channel {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.tool-channel-mini {
grid-column: 1 / -1;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: .22rem;
}
.tool-grid {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
.tool-banner-row {
grid-template-columns: 1fr;
}
.tool-kpis {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
}
@media (max-width: 575.98px) {
.tool-grid {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.tool-kpis {
grid-template-columns: 1fr;
}
.tool-search {
grid-template-columns: 1fr;
border-radius: 12px;
}
.tool-search button {
width: 100%;
border-radius: 10px;
}
}
</style>
@endsection
@section('content')
@php
$icons = ['bi-stars', 'bi-pencil', 'bi-image', 'bi-camera-video', 'bi-briefcase', 'bi-cpu', 'bi-chat-dots', 'bi-code-slash', 'bi-kanban'];
@endphp
<div class="tool-home">
<aside class="tool-side" aria-label="工具分类侧边栏">
<div class="tool-side-logo"><span class="tool-side-logo-dot">AI</span>AI工具集</div>
<nav class="tool-side-links">
<a class="tool-side-link active" href="#section-hot">
<i class="bi bi-fire"></i>
<span>热门工具</span>
<small>{{ $hotTools->count() }}</small>
</a>
<a class="tool-side-link" href="#section-latest">
<i class="bi bi-clock-history"></i>
<span>最新收录</span>
<small>{{ $latestTools->count() }}</small>
</a>
@foreach($categorySections as $index => $section)
<a class="tool-side-link" href="#section-{{ $section['slug'] }}">
<i class="bi {{ $icons[$index % count($icons)] }}"></i>
<span>{{ $section['name'] }}</span>
<small>{{ $section['count'] }}</small>
</a>
@endforeach
</nav>
</aside>
<section class="tool-main">
<header class="tool-top">
<nav class="channel-tabs" aria-label="顶部频道导航">
<a class="channel-tab active" href="{{ route('tools.index') }}">AI工具集</a>
<a class="channel-tab" href="{{ route('models.index') }}">AI应用集</a>
<a class="channel-tab" href="{{ route('news.index') }}">每日AI资讯</a>
<a class="channel-tab" href="{{ route('guides.index') }}">AI教程资源</a>
</nav>
<div class="tool-status">收录工具 <b>{{ $toolStats['total'] ?? 0 }}</b></div>
</header>
<nav class="tool-mobile-cats" aria-label="移动分类导航">
<a class="tool-side-link" href="#section-hot"><i class="bi bi-fire"></i><span>热门</span><small>{{ $hotTools->count() }}</small></a>
<a class="tool-side-link" href="#section-latest"><i class="bi bi-clock-history"></i><span>最新</span><small>{{ $latestTools->count() }}</small></a>
@foreach($categorySections as $index => $section)
<a class="tool-side-link" href="#section-{{ $section['slug'] }}">
<i class="bi {{ $icons[$index % count($icons)] }}"></i>
<span>{{ $section['name'] }}</span>
<small>{{ $section['count'] }}</small>
</a>
@endforeach
</nav>
<section class="tool-hero">
<span class="tool-chip">AI-BOT.CN</span>
<h1 class="tool-title">AI工具集</h1>
<p class="tool-sub">左侧菜单点击后直接定位到对应工具区块,符合你要的交互方式。</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">
<button class="btn btn-primary" type="submit"><i class="bi bi-search"></i> 搜索</button>
</form>
<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>
@endforeach
</nav>
<section class="tool-kpis" aria-label="工具统计">
<article class="tool-kpi"><span>收录工具</span><b>{{ $toolStats['total'] ?? 0 }}</b></article>
<article class="tool-kpi"><span>支持 API</span><b>{{ $toolStats['api'] ?? 0 }}</b></article>
<article class="tool-kpi"><span>免费可用</span><b>{{ $toolStats['free'] ?? 0 }}</b></article>
<article class="tool-kpi"><span>7天更新</span><b>{{ $toolStats['updated_7d'] ?? 0 }}</b></article>
</section>
</section>
<section class="tool-channel" aria-label="频道入口">
<aside class="tool-channel-mini">
<a href="{{ route('news.index') }}"><i class="bi bi-newspaper"></i>AI资讯</a>
<a href="{{ route('models.index') }}"><i class="bi bi-box"></i>AI项目</a>
<a href="{{ route('guides.index') }}"><i class="bi bi-journal"></i>AI百科</a>
<a href="{{ route('home') }}"><i class="bi bi-house"></i>首页</a>
</aside>
<a class="tool-channel-card news" href="{{ route('news.index') }}">每日快讯</a>
<a class="tool-channel-card community" href="{{ route('guides.index') }}">免费社群</a>
<a class="tool-channel-card project" href="{{ route('models.index') }}">最新项目</a>
<a class="tool-channel-card tutorial" href="{{ route('guides.index') }}">热门教程</a>
<a class="tool-channel-card ad" href="{{ route('tools.list') }}">工具列表</a>
</section>
<section class="tool-banner-row" aria-label="横幅推荐">
<article class="tool-banner">
<b>超全图片视频模板一键复制</b>
<small>全球顶尖模型</small>
</article>
<article class="tool-banner alt">
<b>一站式 AI 创作平台</b>
<small>免费试用</small>
</article>
</section>
<section id="section-hot" class="tool-section" aria-label="热门工具">
<header class="tool-section-head">
<h2><i class="bi bi-fire text-danger"></i> 热门工具</h2>
<a href="{{ route('tools.list', ['tab' => 'recommended']) }}">查看更多</a>
</header>
<div class="tool-grid">
@foreach($hotTools as $tool)
<a class="tool-card" href="{{ route('tools.show', $tool->slug) }}">
<div class="tool-card-name">{{ $tool->name }}</div>
<div class="tool-card-meta">{{ $tool->category?->name ?? '未分类' }} · {{ $tool->pricing_type }}</div>
<span class="tool-card-tag">{{ $tool->has_api ? '支持 API' : '无 API' }}</span>
</a>
@endforeach
</div>
</section>
<section id="section-latest" class="tool-section" aria-label="最新收录">
<header class="tool-section-head">
<h2><i class="bi bi-clock-history text-primary"></i> 最新收录</h2>
<a href="{{ route('tools.list', ['tab' => 'latest']) }}">查看更多</a>
</header>
<div class="tool-grid">
@foreach($latestTools as $tool)
<a class="tool-card" href="{{ route('tools.show', $tool->slug) }}">
<div class="tool-card-name">{{ $tool->name }}</div>
<div class="tool-card-meta">{{ $tool->category?->name ?? '未分类' }} · {{ $tool->pricing_type }}</div>
<span class="tool-card-tag">{{ $tool->has_api ? '支持 API' : '无 API' }}</span>
</a>
@endforeach
</div>
</section>
@foreach($categorySections as $section)
<section id="section-{{ $section['slug'] }}" class="tool-section" aria-label="{{ $section['name'] }}工具">
<header class="tool-section-head">
<h2><i class="bi bi-grid-3x3-gap text-primary"></i> {{ $section['name'] }}</h2>
<a href="{{ route('tools.list', ['category' => $section['slug']]) }}">查看更多</a>
</header>
@if($section['tools']->isNotEmpty())
<div class="tool-grid">
@foreach($section['tools'] as $tool)
<a class="tool-card" href="{{ route('tools.show', $tool->slug) }}">
<div class="tool-card-name">{{ $tool->name }}</div>
<div class="tool-card-meta">{{ $tool->category?->name ?? '未分类' }} · {{ $tool->pricing_type }}</div>
<span class="tool-card-tag">{{ $tool->has_api ? '支持 API' : '无 API' }}</span>
</a>
@endforeach
</div>
@else
<p class="text-muted-soft mb-0">该分类暂未收录工具</p>
@endif
</section>
@endforeach
</section>
</div>
@endsection