使用Mix,Tailwind,更改对应样式

This commit is contained in:
Jerry Yan 2022-07-14 13:07:10 +08:00
parent 23dfef114e
commit eab7f1f3aa
20 changed files with 5483 additions and 145 deletions

View File

@ -19,7 +19,7 @@ class CommentQueryController extends BaseController
}
}
}
$comments = $query->limit(20)->get();
$comments = $query->paginate(10);
return view("index", [
"keyword" => $keyword,
"comments" => $comments,

View File

@ -11,7 +11,7 @@ class DanmakuQueryController extends BaseController
{
public function index()
{
$video_list = Videos::query()->withCount("danmakus")->orderByDesc("created_at")->limit(20)->get();
$video_list = Videos::query()->withCount("danmakus")->orderByDesc("created_at")->paginate(10);
return view("danmaku.index", [
"video_list" => $video_list,
]);
@ -21,8 +21,8 @@ class DanmakuQueryController extends BaseController
{
$video = Videos::query()->withCount("danmakus")->where("bvid", "=", $bvid)->firstOrFail();
$keyword = $request->get("keyword", "");
$query = VideoDanmakus::query()->where("video_bvid", "=", $bvid);
if ($keyword) {
$query = VideoDanmakus::query()->where("video_bvid", "=", $bvid);
$keyword_split = explode(" ", $keyword);
foreach ($keyword_split as $_keyword) {
if (mb_strlen(trim($_keyword)) > 0) {
@ -31,10 +31,8 @@ class DanmakuQueryController extends BaseController
});
}
}
$danmakus = $query->orderBy("created_at", "asc")->get();
} else {
$danmakus = [];
}
$danmakus = $query->orderBy("created_at", "asc")->paginate(20);
return view("danmaku.search_index", [
"keyword" => $keyword,
"video" => $video,

View File

@ -13,6 +13,7 @@
"axios": "^0.21",
"laravel-mix": "^6.0.6",
"lodash": "^4.17.19",
"postcss": "^8.1.14"
"postcss": "^8.1.14",
"tailwindcss": "^3.1.6"
}
}

1
public/css/app.css Normal file

File diff suppressed because one or more lines are too long

2
public/js/app.js Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,8 @@
/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/

4
public/mix-manifest.json Normal file
View File

@ -0,0 +1,4 @@
{
"/js/app.js": "/js/app.js",
"/css/app.css": "/css/app.css"
}

View File

@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

View File

@ -0,0 +1,16 @@
<div class="mt-2">
<span>其他链接:</span>
<a class="text-blue-600" href="https://space.bilibili.com/328013928" target="_blank">永恒de草薙的B站主页</a>
<a class="text-blue-600" href="https://live.bilibili.com/24048885" target="_blank">永恒de草薙的直播间</a>
<a class="text-blue-600" href="https://space.bilibili.com/4847925" target="_blank">开心鄢的B站主页</a>
<a class="text-blue-600" href="https://space.bilibili.com/176444156" target="_blank">神鬼传奇课代表的B站主页</a>
<a class="text-blue-600" href="https://pan.baidu.com/s/1ECnwiHnsm-3dSXNJGWlR2g?pwd=ddxt" target="_blank">近期的录播文件提取码ddxt</a>
<a class="text-blue-600" href="https://www.aliyundrive.com/s/2moBpEUqDTG" target="_blank">2022年的录播文件</a>
<a class="text-blue-600" href="https://www.aliyundrive.com/s/AAAMXjagZ79" target="_blank">2021年的录播文件</a>
<a class="text-blue-600" href="https://www.aliyundrive.com/s/hpYfF518yH7" target="_blank">2020年的录播文件</a>
<a class="text-blue-600" href="https://www.aliyundrive.com/s/GuyUChZ27Fy" target="_blank">2019年的录播文件</a>
<a class="text-blue-600" href="http://render.home.jerryyan.top" target="_blank">压制机器状态</a>
</div>
<div class="mt-2 text-center">
<a class="text-blue-600 underline" href="http://beian.miit.gov.cn" target="_blank">赣ICP备18004555号-1</a>
</div>

View File

@ -0,0 +1,10 @@
<div>
<h1 class="text-2xl font-bold">非专业人士,制作不易,请大家多多谅解</h1>
<div class="text-l font-bold">有任何意见或建议可以直接联系我</div>
<div>
导航:
<a class="text-blue-600 underline" href="/">节目单查询</a>
<a class="text-blue-600 underline" href="/danmakus">直播弹幕查询</a>
<a class="text-gray-50" href="/programs" style="color: gray" title="数据不全,待补充">节目查询</a>
</div>
</div>

View File

@ -4,8 +4,8 @@
<title>正在建设中</title>
</head>
<body>
@include("header")
<h1>正在建设中</h1>
@include("footer")
@include("common.header")
<h1>正在建设中</h1>
@include("common.footer")
</body>
</html>

View File

@ -2,33 +2,42 @@
<head>
<meta charset="UTF-8">
<title>录播节目单查询</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="{{ asset('css/app.css') }}" rel="stylesheet"/>
</head>
<body>
@include("header")
<table border>
@include("common.header")
<table class="table-auto border-collapse w-full border border-black">
<thead>
<tr>
<td>视频标题</td>
<td>弹幕条数</td>
<td>操作</td>
<tr class="border border-black">
<th class="border border-black">视频标题</th>
<th class="border border-black">弹幕条数</th>
<th class="border border-black hidden lg:table-cell">操作</th>
</tr>
</thead>
<tbody>
@foreach($video_list as $video)
<tr>
<td>{{$video->title}}</td>
<td>{{$video->danmakus_count}}</td>
<td>
@if($video->danmakus_count > 0)
<a href="/danmakus/{{$video->bvid}}">详情</a>
@else
无弹幕
@endif
</td>
</tr>
<tr>
<td class="border text-sm lg:text-current">
@if($video->danmakus_count > 0)
<a class="text-blue-600 lg:text-current underline lg:no-underline break-all" href="/danmakus/{{$video->bvid}}">{{$video->title}}</a>
@else
{{$video->title}}
@endif
</td>
<td class="border">{{$video->danmakus_count}}</td>
<td class="border hidden lg:table-cell">
@if($video->danmakus_count > 0)
<a class="text-blue-600 underline" href="/danmakus/{{$video->bvid}}">详情</a>
@else
无弹幕
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
@include("footer")
{{$video_list->links()}}
@include("common.footer")
</body>
</html>

View File

@ -2,52 +2,53 @@
<head>
<meta charset="UTF-8">
<title>录播节目单查询</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="{{ asset('css/app.css') }}" rel="stylesheet"/>
</head>
<body>
@include("header")
<div>
<h3>{{$video->title}}</h3>
<h4>弹幕数:{{$video->danmakus_count}}</h4>
</div>
<form action="">
<label for="keyword">查找弹幕关键词,支持搜索用户名,空格隔开查找多个关键词</label>
<input type="text" name="keyword" id="keyword" value="{{$keyword}}">
<input type="submit">
</form>
@if($keyword)
<table border>
<thead>
<tr>
<td>发送人</td>
<td>弹幕内容</td>
<td>发送时间</td>
</tr>
</thead>
<tbody>
@foreach($danmakus as $danmaku)
<tr>
<td>
@switch($danmaku->platform_id)
@case(1)
<img src="https://cdn.jerryyan.net/luboimg/bilibili.ico" alt="B站" style="width: 1em; height: 1em;">
<a href="https://space.bilibili.com/{{$danmaku->from_mid}}" target="_blank">{{$danmaku->from}}</a>
@break(1)
@case(2)
<img src="https://cdn.jerryyan.net/luboimg/ixigua.ico" alt="西瓜视频" style="width: 1em; height: 1em;">
<a href="https://www.ixigua.com/home/{{$danmaku->from_mid}}/" target="_blank">{{$danmaku->from}}</a>
@break(2)
@default
{{$danmaku->from}}
@break(2)
@endswitch
</td>
<td>{{$danmaku->content}}</td>
<td>{{$danmaku->created_at}}</td>
</tr>
@endforeach
</tbody>
</table>
@endif
@include("footer")
@include("common.header")
<div>
<h3 class="text-2xl font-bold">{{$video->title}}</h3>
<h4 class="text-lg">弹幕数:{{$video->danmakus_count}}</h4>
</div>
<form action="">
<label for="keyword">查找弹幕关键词,支持搜索用户名,空格隔开查找多个关键词</label>
<input class="border border-black" type="text" name="keyword" id="keyword" value="{{$keyword}}">
<input class="border border-black" type="submit">
</form>
<table class="table-auto border-collapse w-full border border-black">
<thead>
<tr class="border border-black">
<th class="border border-black">发送人</th>
<th class="border border-black">弹幕内容</th>
<th class="border border-black">发送时间</th>
</tr>
</thead>
<tbody>
@foreach($danmakus as $danmaku)
<tr>
<td class="border">
@switch($danmaku->platform_id)
@case(1)
<img class="w-4 h-4 inline-block" src="https://cdn.jerryyan.net/luboimg/bilibili.ico" alt="B站">
<a class="underline" href="https://space.bilibili.com/{{$danmaku->from_mid}}" target="_blank">{{$danmaku->from}}</a>
@break
@case(2)
<img class="w-4 h-4 inline-block" src="https://cdn.jerryyan.net/luboimg/ixigua.ico" alt="西瓜视频">
<a class="underline" href="https://www.ixigua.com/home/{{$danmaku->from_mid}}/" target="_blank">{{$danmaku->from}}</a>
@break
@default
{{$danmaku->from}}
@break
@endswitch
</td>
<td class="border">{{$danmaku->content}}</td>
<td class="border text-sm">{{$danmaku->created_at}}</td>
</tr>
@endforeach
</tbody>
</table>
{{$danmakus->links()}}
@include("common.footer")
</body>
</html>

View File

@ -1,16 +0,0 @@
<div>
<span>其他链接:</span>
<a href="https://space.bilibili.com/328013928" target="_blank">永恒de草薙的B站主页</a>
<a href="https://live.bilibili.com/24048885" target="_blank">永恒de草薙的直播间</a>
<a href="https://space.bilibili.com/4847925" target="_blank">开心鄢的B站主页</a>
<a href="https://space.bilibili.com/176444156" target="_blank">神鬼传奇课代表的B站主页</a>
<a href="https://pan.baidu.com/s/1ECnwiHnsm-3dSXNJGWlR2g?pwd=ddxt" target="_blank">近期的录播文件提取码ddxt</a>
<a href="https://www.aliyundrive.com/s/2moBpEUqDTG" target="_blank">2022年的录播文件</a>
<a href="https://www.aliyundrive.com/s/AAAMXjagZ79" target="_blank">2021年的录播文件</a>
<a href="https://www.aliyundrive.com/s/hpYfF518yH7" target="_blank">2020年的录播文件</a>
<a href="https://www.aliyundrive.com/s/GuyUChZ27Fy" target="_blank">2019年的录播文件</a>
<a href="http://render.home.jerryyan.top" target="_blank">压制机器状态</a>
</div>
<div style="text-align: center">
<a href="http://beian.miit.gov.cn" target="_blank">赣ICP备18004555号-1</a>
</div>

View File

@ -1,10 +0,0 @@
<div>
<h1>非专业人士,制作不易,请大家多多谅解</h1>
<div>有任何意见或建议可以直接联系我</div>
<div>
导航:
<a href="/">节目单查询</a>
<a href="/danmakus">直播弹幕查询</a>
<a href="/programs" style="color: gray" title="数据不全,待补充">节目查询</a>
</div>
</div>

View File

@ -2,34 +2,47 @@
<head>
<meta charset="UTF-8">
<title>录播节目单查询</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="{{ asset('css/app.css') }}" rel="stylesheet"/>
</head>
<body>
@include("header")
<form action="">
<label for="keyword">查找节目单关键词,空格隔开查找多个关键词</label>
<input type="text" name="keyword" id="keyword" value="{{$keyword}}">
<input type="submit">
</form>
<table border>
<thead>
@include("common.header")
<form action="">
<label for="keyword">查找节目单关键词,空格隔开查找多个关键词</label>
<input class="border border-black" type="text" name="keyword" id="keyword" value="{{$keyword}}">
<input class="border border-black" type="submit">
</form>
<table class="table-auto border-collapse w-full border border-black">
<thead>
<tr class="border-black">
<th class="border border-black">视频标题</th>
<th class="border border-black">置顶评论</th>
<th class="border border-black">本期课代表</th>
<th class="border border-black hidden lg:table-cell">链接</th>
</tr>
</thead>
<tbody>
@foreach($comments as $comment)
<tr>
<td>视频标题</td>
<td>置顶评论</td>
<td>本期课代表</td>
<td>链接</td>
<td class="border text-center text-base lg:text-lg">
<a class="text-blue-600 lg:text-current underline lg:no-underline break-all" target="_blank" href="https://www.bilibili.com/video/{{$comment->video->bvid}}">
{{$comment->video->title}}
</a>
</td>
<td class="border leading-normal" style="white-space: pre-wrap;">{{$comment->content}}</td>
<td class="border text-center">
<a class="text-blue-600 underline" target="_blank" href="https://space.bilibili.com/{{$comment->mid}}">B站主页</a>
</td>
<td class="border text-center hidden lg:table-cell">
<a class="text-blue-600 underline break-all" target="_blank" href="https://www.bilibili.com/video/{{$comment->video->bvid}}">
{{$comment->video->bvid}}
</a>
</td>
</tr>
</thead>
<tbody>
@foreach($comments as $comment)
<tr>
<td>{{$comment->video->title}}</td>
<td style="white-space: pre-wrap;">{{$comment->content}}</td>
<td><a target="_blank" href="https://space.bilibili.com/{{$comment->mid}}">B站主页</a></td>
<td><a target="_blank" href="https://www.bilibili.com/video/{{$comment->video->bvid}}">{{$comment->video->bvid}}</a></td>
</tr>
@endforeach
</tbody>
</table>
@include("footer")
@endforeach
</tbody>
</table>
{{$comments->links()}}
@include("common.footer")
</body>
</html>

View File

@ -2,26 +2,28 @@
<head>
<meta charset="UTF-8">
<title>录播节目查询</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="{{ asset('css/app.css') }}" rel="stylesheet"/>
</head>
<body>
@include("header")
<h3>搜索功能待开放,数据待补充完整</h3>
<!--<form action="">
@include("common.header")
<h3>搜索功能待开放,数据待补充完整</h3>
<!--<form action="">
<label for="keyword">查找节目关键词,空格隔开查找多个关键词</label>
<input type="text" name="keyword" id="keyword" value="{{$keyword}}">
<input type="submit">
</form>-->
<table border>
<thead>
<tr>
<td>节目名称</td>
<td>点播及追加</td>
<td>视频地址及位置</td>
<td>结束时的画面</td>
</tr>
</thead>
<tbody>
@foreach($programs as $program)
<table border>
<thead>
<tr>
<td>节目名称</td>
<td>点播及追加</td>
<td>视频地址及位置</td>
<td>结束时的画面</td>
</tr>
</thead>
<tbody>
@foreach($programs as $program)
<tr>
<td>{{$program->name}}</td>
<td>
@ -29,7 +31,8 @@
@if($append->is_original)
<div>
@if($append->from_mid)
<a target="_blank" href="https://space.bilibili.com/{{$append->from_mid}}">{{$append->from}}</a>
<a target="_blank"
href="https://space.bilibili.com/{{$append->from_mid}}">{{$append->from}}</a>
@else
{{$append->from}}
@endif
@ -42,7 +45,8 @@
@else
<div>
@if($append->from_mid)
<a target="_blank" href="https://space.bilibili.com/{{$append->from_mid}}">{{$append->from}}</a>
<a target="_blank"
href="https://space.bilibili.com/{{$append->from_mid}}">{{$append->from}}</a>
@else
{{$append->from}}
@endif
@ -76,9 +80,9 @@
@endforeach
</td>
</tr>
@endforeach
</tbody>
</table>
@include("footer")
@endforeach
</tbody>
</table>
@include("common.footer")
</body>
</html>

13
tailwind.config.js Normal file
View File

@ -0,0 +1,13 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
purge: [
'./resources/**/*.blade.php',
'./resources/**/*.js',
'./resources/**/*.vue',
],
content: [],
theme: {
extend: {},
},
plugins: [],
}

View File

@ -13,5 +13,5 @@ const mix = require('laravel-mix');
mix.js('resources/js/app.js', 'public/js')
.postCss('resources/css/app.css', 'public/css', [
//
require('tailwindcss')
]);

5281
yarn.lock Normal file

File diff suppressed because it is too large Load Diff