1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2025-12-18 05:41:31 +00:00

perf(ui): improve hover effect for post preview cards

- home cards
- navigator buttons at the bottom post
This commit is contained in:
Cotes Chung
2023-03-21 09:52:15 +08:00
parent 34499f0c92
commit 7626e4d005
4 changed files with 52 additions and 35 deletions

View File

@@ -10,7 +10,7 @@
}
}
@mixin btn-post-nav {
%btn-post-nav {
width: 50%;
position: relative;
border-color: var(--btn-border-color);
@@ -172,27 +172,25 @@ h1 + .post-meta {
padding-bottom: 4rem;
.btn {
@include btn-post-nav;
@extend %btn-post-nav;
color: var(--link-color);
&:not(:hover) {
color: var(--link-color);
}
&:hover {
background: #2a408e;
color: #ffffff;
border-color: #2a408e;
&:not(.disabled)::before {
color: whitesmoke;
}
}
&.disabled {
@include btn-post-nav;
@extend %btn-post-nav;
pointer-events: auto;
cursor: not-allowed;
background: none;
color: gray;
&:hover {
border-color: none;
}
}
&.btn-outline-primary.disabled:focus {
@@ -207,14 +205,12 @@ h1 + .post-meta {
}
&:first-child {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
border-radius: $card-radius 0 0 $card-radius;
left: 0.5px;
}
&:last-child {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
border-radius: 0 $card-radius $card-radius 0;
right: 0.5px;
}
}
@@ -227,6 +223,15 @@ h1 + .post-meta {
}
} /* .post-navigation */
@media (hover: hover) {
.post-navigation {
.btn,
.btn::before {
transition: all 0.35s ease-in-out;
}
}
}
@-webkit-keyframes fade-up {
from {
opacity: 0;