From 8a80bcdfdc2b70a61e379a5a2c6ba1e7cf2946f1 Mon Sep 17 00:00:00 2001 From: XiaoLFeng Date: Sun, 9 Jul 2023 12:01:03 +0800 Subject: [PATCH] =?UTF-8?q?AddFeature=EF=BC=9A=E5=8F=8B=E9=93=BE=E9=A2=9C?= =?UTF-8?q?=E8=89=B2=E6=98=BE=E7=A4=BA=E5=92=8CTooltips=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加了对于暗色的支持模式 添加了编辑界面颜色标记 添加了编辑窗口的颜色显示 Signed-off-by: XiaoLFeng --- app/Http/Controllers/Console/Link.php | 15 ++++- .../views/console/friends-link/edit.blade.php | 55 +++++++++++++++---- .../views/console/friends-link/list.blade.php | 31 ++++++++--- resources/views/function/link.blade.php | 5 +- 4 files changed, 82 insertions(+), 24 deletions(-) diff --git a/app/Http/Controllers/Console/Link.php b/app/Http/Controllers/Console/Link.php index c3f8fc2..130fb5a 100644 --- a/app/Http/Controllers/Console/Link.php +++ b/app/Http/Controllers/Console/Link.php @@ -39,10 +39,14 @@ public function ViewEdit(Request $request, $userId): Application|Factory|View|Re ->orderBy('sort') ->get() ->toArray(); - $this->data['blogColor'] = DB::table('blog_color') + $blogColor = DB::table('blog_color') ->orderBy('id') ->get() ->toArray(); + for ($i = 0; !empty($blogColor[$i]->id); $i++) { + $blogColor[$i]->colorDarkType = str_replace('dark:', '', $blogColor[$i]->colorDarkType); + } + $this->data['blogColor'] = $blogColor; // 没有查询到执行删除 if ($this->data['blog'][0] == null) return Response::redirectTo(route('console.friends-link.list')); return view('console.friends-link.edit', $this->data); @@ -86,6 +90,15 @@ protected function ViewList(Request $request): Factory|View|Application|Redirect $this->data['blog'] = DB::select("SELECT * FROM xf_index.blog_link WHERE blogName LIKE '%$request->search%' OR blogUrl LIKE '%$request->search%' ORDER BY id"); } $this->data = array_merge($this->data, $dataMarge); + $blogColor = DB::table('blog_color') + ->orderBy('id') + ->get() + ->toArray(); + for ($i = 0; !empty($blogColor[$i]->id); $i++) { + $blogColor[$i]->colorLightType = str_replace('border-', 'ring-', $blogColor[$i]->colorLightType); + $blogColor[$i]->colorDarkType = str_replace('border-', 'ring-', $blogColor[$i]->colorDarkType); + } + $this->data['blogColor'] = $blogColor; return view('console.friends-link.list', $this->data); } diff --git a/resources/views/console/friends-link/edit.blade.php b/resources/views/console/friends-link/edit.blade.php index 20a5b82..35602de 100644 --- a/resources/views/console/friends-link/edit.blade.php +++ b/resources/views/console/friends-link/edit.blade.php @@ -33,9 +33,28 @@ class="inline-flex items-center p-2 mt-2 ml-3 text-sm text-gray-500 rounded-lg s
-

当前友链

-

超级友链

-

待审友链

+

当前友链

+

超级友链

+

待审友链

+
+
+
+
+
+ + +
@@ -186,26 +205,34 @@ class="w-16 h-16 p-1 rounded-full ring-2 ring-gray-300 dark:ring-gray-500 me-2 s
-
- -
-
+
参考样式
-
+
+
+ class="flex p-2 hover:bg-gray-100 bg-white border-2 {{ $blogColor[$blog[0]->blogSetColor-1]->colorLightType }} rounded-lg + shadow-lg sm:p-4 grid-cols-2 m-1"> Bordered avatar @@ -215,9 +242,15 @@ class="w-16 h-16 p-1 rounded-full ring-2 ring-gray-300 dark:ring-gray-500 me-2 s
-
+
+
+ class="flex p-2 hover:bg-gray-700 border-2 rounded-lg shadow-lg sm:p-4 bg-gray-800 + {{ $blogColor[$blog[0]->blogSetColor-1]->colorDarkType }} grid-cols-2 m-1"> Bordered avatar diff --git a/resources/views/console/friends-link/list.blade.php b/resources/views/console/friends-link/list.blade.php index ab90e90..7cc41f9 100644 --- a/resources/views/console/friends-link/list.blade.php +++ b/resources/views/console/friends-link/list.blade.php @@ -33,20 +33,27 @@ class="inline-flex items-center p-2 mt-2 ml-3 text-sm text-gray-500 rounded-lg s
-

当前友链 {{ $blogFriendsTotal }}

-

超级友链 {{ $blogFriendsBest }}

-

待审友链 {{ $blogFriendsCheck }}

+

当前友链 {{ $blogFriendsTotal }}

+

超级友链 {{ $blogFriendsBest }}

+

待审友链 {{ $blogFriendsCheck }}

@if(!empty($blog) && empty($request->search))
    - @foreach($blog as $blogValue) + @foreach($blog as $blogValue)
  • - Neil image + Bordered avatar

    @@ -57,21 +64,27 @@ class="inline-flex items-center p-2 mt-2 ml-3 text-sm text-gray-500 rounded-lg s

    - + 编辑
  • - @endforeach + @endforeach