feat: add more hover effects for better UX

This commit is contained in:
keyboardreamer 2024-01-03 21:21:27 +08:00 committed by Bnyro
parent aaeddb3903
commit 03f43d525e
4 changed files with 49 additions and 21 deletions

View File

@ -206,7 +206,7 @@ b {
} }
.btn { .btn {
@apply py-2 lt-md:px-2 md:px-4 rounded cursor-pointer inline-block; @apply py-2 lt-md:px-2 md:px-4 rounded cursor-pointer inline-block hover:bg-gray-500 hover:text-white;
} }
.reset { .reset {
@ -238,8 +238,12 @@ b {
@apply text-gray-400 bg-dark-400; @apply text-gray-400 bg-dark-400;
} }
.dark .btn {
@apply hover:bg-dark-300;
}
.input { .input {
@apply px-2.5; @apply px-2.5 rounded-md;
} }
.input:focus { .input:focus {
@ -275,15 +279,15 @@ h2 {
} }
.link { .link {
@apply hover:(text-dark-300 underline underline-dark-300); @apply focus:text-red-500 hover:text-red-500;
} }
.link-secondary { .link-secondary {
@apply hover:(text-dark-400 underline underline-dark-400); @apply hover:text-dark-400 focus:text-dark-400 underline underline-dark-400;
} }
.dark .link { .dark .link {
@apply hover:(text-gray-300 underline underline-gray-300); @apply focus:text-red-400 hover:text-red-400;
} }
.dark .link-secondary { .dark .link-secondary {

View File

@ -2,27 +2,27 @@
<footer class="mt-10 w-full rounded-xl py-4 text-center children:(mx-3)"> <footer class="mt-10 w-full rounded-xl py-4 text-center children:(mx-3)">
<a aria-label="GitHub" href="https://github.com/TeamPiped/Piped" target="_blank"> <a aria-label="GitHub" href="https://github.com/TeamPiped/Piped" target="_blank">
<i class="i-fa6-brands:github" /> <i class="i-fa6-brands:github" />
<span v-t="'actions.source_code'" class="ml-2" /> <span v-t="'actions.source_code'" class="ml-2 hover:underline" />
</a> </a>
<a href="https://docs.piped.video/" target="_blank"> <a href="https://docs.piped.video/" target="_blank">
<i class="i-fa6-solid:book" /> <i class="i-fa6-solid:book" />
<span v-t="'actions.documentation'" class="ml-2" /> <span v-t="'actions.documentation'" class="ml-2 hover:underline" />
</a> </a>
<a href="https://github.com/TeamPiped/Piped#donations" target="_blank"> <a href="https://github.com/TeamPiped/Piped#donations" target="_blank">
<i class="i-fa6-brands:bitcoin" /> <i class="i-fa6-brands:bitcoin" />
<span v-t="'actions.donations'" class="ml-2" /> <span v-t="'actions.donations'" class="ml-2 hover:underline" />
</a> </a>
<a v-if="statusPageHref" :href="statusPageHref"> <a v-if="statusPageHref" :href="statusPageHref">
<i class="i-fa6-solid:server" /> <i class="i-fa6-solid:server" />
<span v-t="'actions.status_page'" class="ml-2" /> <span v-t="'actions.status_page'" class="ml-2 hover:underline" />
</a> </a>
<a v-if="donationHref" :href="donationHref"> <a v-if="donationHref" :href="donationHref">
<i class="i-fa6-solid:money-check" /> <i class="i-fa6-solid:money-check" />
<span v-t="'actions.instance_donations'" class="ml-2" /> <span v-t="'actions.instance_donations'" class="ml-2 hover:underline" />
</a> </a>
<a v-if="privacyPolicyHref" :href="privacyPolicyHref" target="_blank"> <a v-if="privacyPolicyHref" :href="privacyPolicyHref" target="_blank">
<i class="i-fa6-solid:eye" /> <i class="i-fa6-solid:eye" />
<span v-t="'actions.instance_privacy_policy'" class="ml-2" /> <span v-t="'actions.instance_privacy_policy'" class="ml-2 hover:underline" />
</a> </a>
</footer> </footer>
</template> </template>

View File

@ -39,25 +39,25 @@
<!-- navigation bar for large screen devices --> <!-- navigation bar for large screen devices -->
<ul class="md:text-1xl hidden md:(flex flex flex-1 justify-end children:pl-3)"> <ul class="md:text-1xl hidden md:(flex flex flex-1 justify-end children:pl-3)">
<li v-if="shouldShowTrending"> <li v-if="shouldShowTrending">
<router-link v-t="'titles.trending'" to="/trending" /> <router-link v-t="'titles.trending'" to="/trending" class="nav-link" />
</li> </li>
<li> <li>
<router-link v-t="'titles.preferences'" to="/preferences" /> <router-link v-t="'titles.preferences'" to="/preferences" class="nav-link" />
</li> </li>
<li v-if="shouldShowLogin"> <li v-if="shouldShowLogin">
<router-link v-t="'titles.login'" to="/login" /> <router-link v-t="'titles.login'" to="/login" class="nav-link" />
</li> </li>
<li v-if="shouldShowRegister"> <li v-if="shouldShowRegister">
<router-link v-t="'titles.register'" to="/register" /> <router-link v-t="'titles.register'" to="/register" class="nav-link" />
</li> </li>
<li v-if="shouldShowHistory"> <li v-if="shouldShowHistory">
<router-link v-t="'titles.history'" to="/history" /> <router-link v-t="'titles.history'" to="/history" class="nav-link" />
</li> </li>
<li> <li>
<router-link v-t="'titles.playlists'" to="/playlists" /> <router-link v-t="'titles.playlists'" to="/playlists" class="nav-link" />
</li> </li>
<li v-if="!shouldShowTrending"> <li v-if="!shouldShowTrending">
<router-link v-t="'titles.feed'" to="/feed" /> <router-link v-t="'titles.feed'" to="/feed" class="nav-link" />
</li> </li>
</ul> </ul>
</nav> </nav>
@ -233,6 +233,22 @@ export default {
@apply mx-1; @apply mx-1;
} }
#search-btn:hover {
@apply bg-red-400;
}
.dark #search-btn:hover {
@apply bg-dark-100;
}
.nav-link {
@apply hover:text-red-500;
}
.dark .nav-link {
@apply hover:text-red-400;
}
@media screen and (max-width: 848px) { @media screen and (max-width: 848px) {
#search-btn { #search-btn {
display: none; display: none;

View File

@ -1,7 +1,7 @@
<template> <template>
<div v-if="showVideo" class="flex flex-col flex-justify-between"> <div v-if="showVideo" class="flex flex-col flex-justify-between">
<router-link <router-link
class="inline-block w-full focus:underline hover:underline" class="inline-block w-full focus:text-red-400 hover:text-red-400"
:to="{ :to="{
path: '/watch', path: '/watch',
query: { query: {
@ -15,7 +15,7 @@
<div class="w-full"> <div class="w-full">
<img <img
loading="lazy" loading="lazy"
class="aspect-video w-full object-contain" class="aspect-video w-full rounded-md object-contain"
:src="thumbnail" :src="thumbnail"
:alt="title" :alt="title"
:class="{ 'shorts-img': item.isShort, 'opacity-75': item.watched }" :class="{ 'shorts-img': item.isShort, 'opacity-75': item.watched }"
@ -82,7 +82,7 @@
<i v-if="item.uploaderVerified" class="i-fa6-solid:check ml-1.5" /> <i v-if="item.uploaderVerified" class="i-fa6-solid:check ml-1.5" />
</router-link> </router-link>
<div v-if="item.views >= 0 || item.uploadedDate" class="mt-1 text-xs text-gray-300 font-normal"> <div v-if="item.views >= 0 || item.uploadedDate" class="video-info">
<span v-if="item.views >= 0"> <span v-if="item.views >= 0">
<i class="i-fa6-solid:eye" /> <i class="i-fa6-solid:eye" />
<span class="pl-1" v-text="`${numberFormat(item.views)} `" /> <span class="pl-1" v-text="`${numberFormat(item.views)} `" />
@ -271,4 +271,12 @@ export default {
.shorts-img { .shorts-img {
@apply w-full object-contain; @apply w-full object-contain;
} }
.video-info {
@apply mt-1 text-xs text-gray-600 font-normal;
}
.dark .video-info {
@apply text-gray-400;
}
</style> </style>