Skip to content

Commit 80872fd

Browse files
committed
优化:调整模型列表中NSFW标记按钮的显示逻辑,增强用户交互体验
1 parent 99146bc commit 80872fd

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

frontend/src/components/ModelList.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<div v-if="!loading && models.length > 0" class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-5 pb-8">
2424
<div v-for="model in filteredModels" :key="model.id">
2525
<div
26-
class="rounded-lg shadow-sm hover:shadow-md transition-all duration-200 transform hover:-translate-y-1 cursor-pointer h-full flex flex-col bg-base-100 border border-base-200"
26+
class="rounded-lg shadow-sm hover:shadow-md transition-all duration-200 transform hover:-translate-y-1 cursor-pointer h-full flex flex-col bg-base-100 border border-base-200 group"
2727
>
2828
<div
2929
class="relative pt-[125%] cursor-pointer overflow-hidden rounded-t-lg"
@@ -49,10 +49,13 @@
4949
>NSFW</div>
5050

5151
<!-- NSFW标记按钮 - 只在非原始NSFW模型上显示 -->
52+
<!-- 已标记的始终显示,未标记的仅在鼠标悬浮时显示 -->
5253
<button
5354
v-if="!model.original_nsfw"
54-
class="absolute top-2 left-2 z-10 btn btn-circle btn-xs"
55-
:class="[model.custom_nsfw ? 'btn-warning' : 'btn-outline btn-neutral']"
55+
class="absolute top-2 left-2 z-10 btn btn-circle btn-xs transition-opacity duration-200"
56+
:class="[
57+
model.custom_nsfw ? 'btn-warning opacity-100' : 'btn-neutral opacity-0 group-hover:opacity-100'
58+
]"
5659
title="标记/取消标记为NSFW内容"
5760
@click.stop="toggleNsfw(model)"
5861
>

0 commit comments

Comments
 (0)