style(ui): update homepage styling and improve navigation cards

This commit is contained in:
sanbuphy
2026-03-16 00:53:29 +08:00
parent 57c662aa2f
commit 8cb13c70e3
4 changed files with 90 additions and 30 deletions
+68 -20
View File
@@ -50,29 +50,60 @@ defineProps({
text-decoration: none !important; text-decoration: none !important;
color: inherit !important; color: inherit !important;
display: block; display: block;
outline: none;
border-bottom: 0 !important;
}
.nav-card-link:focus,
.nav-card-link:focus-visible,
.nav-card-link:active {
outline: none !important;
box-shadow: none !important;
text-decoration: none !important;
border-bottom: 0 !important;
border-bottom-color: transparent !important;
}
.nav-card-link:hover,
.nav-card-link:visited {
text-decoration: none !important;
border-bottom: 0 !important;
border-bottom-color: transparent !important;
}
.nav-card-link:focus-visible .nav-card {
border-color: #0066cc;
box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.18);
} }
.nav-card { .nav-card {
border: 1px solid color-mix(in srgb, var(--vp-c-brand-1) 12%, var(--vp-c-divider)); border: 1px solid rgba(0, 0, 0, 0.04);
border-radius: 22px; border-radius: 24px;
padding: 20px 22px; padding: 20px 22px;
transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease; transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
background: background: #fff;
radial-gradient(circle at 100% -10%, color-mix(in srgb, var(--vp-c-brand-1) 12%, transparent), transparent 45%),
linear-gradient(165deg, color-mix(in srgb, var(--vp-c-brand-1) 6%, var(--vp-c-bg-soft)) 0%, var(--vp-c-bg-soft) 100%);
height: 100%; height: 100%;
min-height: 132px; min-height: 124px;
backdrop-filter: blur(10px); box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
position: relative;
overflow: hidden;
} }
.nav-card:hover { .nav-card:hover {
border-color: var(--vp-c-brand); transform: translateY(-4px);
transform: translateY(-4px) scale(1.01); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
box-shadow: 0 18px 40px rgba(0, 113, 227, 0.14); border-color: rgba(0, 0, 0, 0.08);
}
.dark .nav-card {
border-color: rgba(255, 255, 255, 0.08);
background: var(--vp-c-bg-mute);
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
} }
.dark .nav-card:hover { .dark .nav-card:hover {
box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34); border-color: rgba(255, 255, 255, 0.14);
box-shadow: 0 10px 24px rgba(0, 0, 0, 0.34);
} }
.card-top { .card-top {
@@ -84,9 +115,8 @@ defineProps({
.card-header { .card-header {
display: flex; display: flex;
align-items: center; align-items: flex-start;
gap: 8px; gap: 8px;
margin-bottom: 10px;
} }
.card-icon { .card-icon {
@@ -94,7 +124,7 @@ defineProps({
} }
.card-title { .card-title {
font-weight: 600; font-weight: 700;
color: var(--vp-c-text-1); color: var(--vp-c-text-1);
font-size: 17px; font-size: 17px;
line-height: 1.35; line-height: 1.35;
@@ -102,11 +132,12 @@ defineProps({
} }
.card-arrow { .card-arrow {
color: var(--vp-c-brand-1); color: #0066cc;
font-size: 15px; font-size: 16px;
font-weight: 700; font-weight: 600;
opacity: 0.8; opacity: 0.9;
transition: transform 0.25s ease, opacity 0.25s ease; transition: transform 0.25s ease, opacity 0.25s ease;
margin-top: 2px;
} }
.nav-card:hover .card-arrow { .nav-card:hover .card-arrow {
@@ -117,6 +148,23 @@ defineProps({
.card-desc { .card-desc {
color: var(--vp-c-text-2); color: var(--vp-c-text-2);
font-size: 14px; font-size: 14px;
line-height: 1.68; line-height: 1.6;
margin-top: 10px;
}
@media (max-width: 768px) {
.nav-card {
border-radius: 18px;
padding: 16px 18px;
min-height: 108px;
}
.card-title {
font-size: 16px;
}
.card-desc {
font-size: 13px;
}
} }
</style> </style>
+11 -5
View File
@@ -7,16 +7,22 @@
<style scoped> <style scoped>
.nav-grid { .nav-grid {
display: grid; display: grid;
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 18px; gap: 18px;
margin: 24px 0 28px; margin: 20px 0 26px;
} }
@media (max-width: 768px) { @media (min-width: 1400px) {
.nav-grid {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
}
@media (max-width: 900px) {
.nav-grid { .nav-grid {
grid-template-columns: 1fr; grid-template-columns: 1fr;
gap: 14px; gap: 12px;
margin: 18px 0 24px; margin: 16px 0 22px;
} }
} }
</style> </style>
+10 -4
View File
@@ -338,15 +338,21 @@
.VPHomeHero .action .VPButton.alt { .VPHomeHero .action .VPButton.alt {
border-radius: 999px; border-radius: 999px;
border-color: #d2d2d7; border: 1px solid #0071e3;
background-color: #fff; background-color: #fff;
color: #1d1d1f; color: #0071e3;
transition: transform 0.2s; font-weight: 500;
box-shadow: none;
transition:
transform 0.2s,
background-color 0.2s,
color 0.2s;
} }
.VPHomeHero .action .VPButton.alt:hover { .VPHomeHero .action .VPButton.alt:hover {
transform: scale(1.02); transform: scale(1.02);
background-color: #f5f5f7; background-color: rgba(0, 113, 227, 0.08);
color: #0066cc;
} }
/* HomeFeatures Sections Scroll Offset */ /* HomeFeatures Sections Scroll Offset */
+1 -1
View File
@@ -19,7 +19,7 @@ hero:
text: 开始学习 text: 开始学习
link: /zh-cn/stage-0/0.1-learning-map/ link: /zh-cn/stage-0/0.1-learning-map/
- theme: alt - theme: alt
text: ⭐️ GitHub 加速更新 text: GitHub 加速更新
link: https://github.com/datawhalechina/easy-vibe link: https://github.com/datawhalechina/easy-vibe
--- ---