统一页面样式:节目画面页布局与 dark 模式、表单错误提示条

This commit is contained in:
2026-07-30 07:58:33 +08:00
parent 8914a2a609
commit 811d6d4dfd
5 changed files with 103 additions and 74 deletions
+74 -63
View File
@@ -1,75 +1,86 @@
<html lang="zh">
<head>
<meta charset="UTF-8">
<title>录播节目查询</title>
<title>{{$program->name}} - 录播节目查询</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="{{ mix('/css/app.css') }}" rel="stylesheet"/>
</head>
<body>
<body class="bg-gray-50 dark:bg-gray-900 min-h-screen flex flex-col text-gray-900 dark:text-gray-100">
@include("common.header")
<div class="border-2 lg:w-1/2 w-full">
<div class="text-lg font-bold">
<span title="节目">{{$program->name}}</span>
<span title="难度">{{$program->difficulty}}</span>
<span title="要求">{{$program->desc}}</span>
</div>
<div class="ml-2">
@foreach($program->appends as $append)
<x-append :append="$append"></x-append>
@endforeach
</div>
<div>
@foreach($videos as $video_pivot)
@if($video_pivot->video)
<a class="block text-blue-600" href="{{url("/video/".$video_pivot->video->id)}}">查看《{{$video_pivot->video->title}}》下所有的节目</a>
@else
<a class="block text-blue-600" href="https://www.bilibili.com/video/{{$video_pivot->video_bvid}}">查看录播</a>
@endif
@endforeach
</div>
</div>
<table class="table-auto border-collapse w-full lg:border lg:border-black">
<thead>
<tr class="border border-black sticky bg-white lg:static top-0 left-0 right-0">
<td class="border">节目开始时的画面</td>
<td class="border">节目结束时的画面</td>
</tr>
</thead>
<tbody>
@foreach($videos as $video_pivot)
<tr class="border">
<td class="border align-bottom">
<x-links.video_link :bvid="$video_pivot->video_bvid" :part="$video_pivot->start_part" :time="$video_pivot->start_time">
<div>{{$video_pivot->created_at}} P{{$video_pivot->start_part}}#{{$video_pivot->start_time}}</div>
@if($video_pivot->start_image)
<img loading="lazy" width="300" src="{{$video_pivot->start_image}}" alt="开始时的画面">
<main class="flex-grow container mx-auto px-4 sm:px-6 lg:px-8 py-8">
<div class="max-w-5xl mx-auto">
<div class="bg-white dark:bg-gray-800 rounded-xl shadow-sm border border-gray-100 dark:border-gray-700 p-6 mb-8">
<h1 class="text-xl font-bold text-gray-900 dark:text-white" title="节目">{{$program->name}}</h1>
<div class="mt-2 flex flex-wrap gap-x-6 gap-y-1 text-sm text-gray-500 dark:text-gray-400">
<span title="难度">难度:{{$program->difficulty}}</span>
<span title="要求">要求:{{$program->desc}}</span>
</div>
<div class="mt-4 space-y-1">
@foreach($program->appends as $append)
<x-append :append="$append"></x-append>
@endforeach
</div>
<div class="mt-4 border-t border-gray-100 dark:border-gray-700 pt-4 space-y-2">
@foreach($videos as $video_pivot)
@if($video_pivot->video)
<a class="block text-indigo-600 dark:text-indigo-400 hover:text-indigo-800 dark:hover:text-indigo-300 transition-colors" href="{{url("/video/".$video_pivot->video->id)}}">查看《{{$video_pivot->video->title}}》下所有的节目</a>
@else
节目开始位置
<a class="block text-indigo-600 dark:text-indigo-400 hover:text-indigo-800 dark:hover:text-indigo-300 transition-colors" href="https://www.bilibili.com/video/{{$video_pivot->video_bvid}}">查看录播</a>
@endif
</x-links.video_link>
@if($video_pivot->start_ocr)
<canvas class="mt-1 w-full max-w-[180px] bg-black rounded" data-ocr-frame="{{ json_encode($video_pivot->start_ocr, JSON_UNESCAPED_UNICODE) }}"></canvas>
<div class="text-xs text-gray-500">OCR @ {{ gmdate("H:i:s", (int)$video_pivot->start_ocr["ts"]) }}</div>
@endif
</td>
<td class="border align-bottom">
<x-links.video_link :bvid="$video_pivot->video_bvid" :part="$video_pivot->stop_part" :time="$video_pivot->stop_time">
<div>P{{$video_pivot->stop_part}}#{{$video_pivot->stop_time}}</div>
@if($video_pivot->start_image)
<img loading="lazy" width="300" src="{{$video_pivot->stop_image}}" alt="结束时的画面">
@else
节目结束位置
@endif
</x-links.video_link>
@if($video_pivot->stop_ocr)
<canvas class="mt-1 w-full max-w-[180px] bg-black rounded" data-ocr-frame="{{ json_encode($video_pivot->stop_ocr, JSON_UNESCAPED_UNICODE) }}"></canvas>
<div class="text-xs text-gray-500">OCR @ {{ gmdate("H:i:s", (int)$video_pivot->stop_ocr["ts"]) }}</div>
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
@endforeach
</div>
</div>
<div class="bg-white dark:bg-gray-800 shadow overflow-hidden rounded-lg">
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700">
<thead class="bg-gray-50 dark:bg-gray-700">
<tr>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">节目开始时的画面</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">节目结束时的画面</th>
</tr>
</thead>
<tbody class="bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700">
@foreach($videos as $video_pivot)
<tr class="hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors">
<td class="px-6 py-4 align-top text-sm">
<x-links.video_link :bvid="$video_pivot->video_bvid" :part="$video_pivot->start_part" :time="$video_pivot->start_time">
<div class="text-xs text-gray-500 dark:text-gray-400 mb-1">{{$video_pivot->created_at}} P{{$video_pivot->start_part}}#{{$video_pivot->start_time}}</div>
@if($video_pivot->start_image)
<img loading="lazy" width="300" class="rounded border border-gray-200 dark:border-gray-600" src="{{$video_pivot->start_image}}" alt="开始时的画面">
@else
<span class="text-xs text-gray-400 italic">节目开始位置</span>
@endif
</x-links.video_link>
@if($video_pivot->start_ocr)
<canvas class="mt-1 w-full max-w-[180px] bg-black rounded" data-ocr-frame="{{ json_encode($video_pivot->start_ocr, JSON_UNESCAPED_UNICODE) }}"></canvas>
<div class="text-xs text-gray-500 dark:text-gray-400">OCR @ {{ gmdate("H:i:s", (int)$video_pivot->start_ocr["ts"]) }}</div>
@endif
</td>
<td class="px-6 py-4 align-top text-sm">
<x-links.video_link :bvid="$video_pivot->video_bvid" :part="$video_pivot->stop_part" :time="$video_pivot->stop_time">
<div class="text-xs text-gray-500 dark:text-gray-400 mb-1">P{{$video_pivot->stop_part}}#{{$video_pivot->stop_time}}</div>
@if($video_pivot->start_image)
<img loading="lazy" width="300" class="rounded border border-gray-200 dark:border-gray-600" src="{{$video_pivot->stop_image}}" alt="结束时的画面">
@else
<span class="text-xs text-gray-400 italic">节目结束位置</span>
@endif
</x-links.video_link>
@if($video_pivot->stop_ocr)
<canvas class="mt-1 w-full max-w-[180px] bg-black rounded" data-ocr-frame="{{ json_encode($video_pivot->stop_ocr, JSON_UNESCAPED_UNICODE) }}"></canvas>
<div class="text-xs text-gray-500 dark:text-gray-400">OCR @ {{ gmdate("H:i:s", (int)$video_pivot->stop_ocr["ts"]) }}</div>
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</main>
<script src="{{ mix('/js/manifest.js') }}"></script>
<script src="{{ mix('/js/component/ocr_canvas.js') }}"></script>
<script>document.addEventListener("DOMContentLoaded", function () { OcrCanvas.initSnapshots(); });</script>