mirror of
https://github.com/vinta/awesome-python.git
synced 2026-05-19 13:31:41 +08:00
feat(website): add entrance animations and CSS-based filter bar visibility
Replace hidden attribute on filter-bar with opacity/transform transition driven by a .visible class, allowing smooth fade-in/slide-down when a filter is active. Add staggered hero-in keyframe animations to the page title, subtitle, action buttons, and search box. Polish sortable table headers with color transition on hover and active states. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -100,10 +100,10 @@ function applyFilters() {
|
|||||||
// Filter bar
|
// Filter bar
|
||||||
if (filterBar) {
|
if (filterBar) {
|
||||||
if (activeFilter) {
|
if (activeFilter) {
|
||||||
filterBar.hidden = false;
|
filterBar.classList.add('visible');
|
||||||
if (filterValue) filterValue.textContent = activeFilter.value;
|
if (filterValue) filterValue.textContent = activeFilter.value;
|
||||||
} else {
|
} else {
|
||||||
filterBar.hidden = true;
|
filterBar.classList.remove('visible');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -60,12 +60,22 @@ a:hover { color: var(--accent-hover); text-decoration: underline; }
|
|||||||
.skip-link:focus { left: 0; }
|
.skip-link:focus { left: 0; }
|
||||||
|
|
||||||
/* === Hero === */
|
/* === Hero === */
|
||||||
|
@keyframes hero-in {
|
||||||
|
from { opacity: 0; transform: translateY(8px); }
|
||||||
|
to { opacity: 1; transform: translateY(0); }
|
||||||
|
}
|
||||||
|
|
||||||
.hero {
|
.hero {
|
||||||
max-width: 1400px;
|
max-width: 1400px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
padding: 3.5rem 2rem 1.5rem;
|
padding: 3.5rem 2rem 1.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.hero h1 { animation: hero-in 0.5s cubic-bezier(0.25, 1, 0.5, 1) both; }
|
||||||
|
.hero-sub { animation: hero-in 0.5s cubic-bezier(0.25, 1, 0.5, 1) 0.08s both; }
|
||||||
|
.hero-gh { animation: hero-in 0.5s cubic-bezier(0.25, 1, 0.5, 1) 0.16s both; }
|
||||||
|
.hero-submit { animation: hero-in 0.5s cubic-bezier(0.25, 1, 0.5, 1) 0.16s both; }
|
||||||
|
|
||||||
.hero-main {
|
.hero-main {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
@@ -142,6 +152,7 @@ a:hover { color: var(--accent-hover); text-decoration: underline; }
|
|||||||
.search-wrap {
|
.search-wrap {
|
||||||
position: relative;
|
position: relative;
|
||||||
margin-bottom: 0.75rem;
|
margin-bottom: 0.75rem;
|
||||||
|
animation: hero-in 0.5s cubic-bezier(0.25, 1, 0.5, 1) 0.24s both;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-icon {
|
.search-icon {
|
||||||
@@ -174,8 +185,6 @@ a:hover { color: var(--accent-hover); text-decoration: underline; }
|
|||||||
background: var(--bg);
|
background: var(--bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.filter-bar[hidden] { display: none; }
|
|
||||||
|
|
||||||
.filter-bar {
|
.filter-bar {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -183,6 +192,16 @@ a:hover { color: var(--accent-hover); text-decoration: underline; }
|
|||||||
padding: 0.5rem 0;
|
padding: 0.5rem 0;
|
||||||
font-size: var(--text-sm);
|
font-size: var(--text-sm);
|
||||||
color: var(--text-secondary);
|
color: var(--text-secondary);
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(-4px);
|
||||||
|
pointer-events: none;
|
||||||
|
transition: opacity 0.15s ease, transform 0.15s cubic-bezier(0.25, 1, 0.5, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.filter-bar.visible {
|
||||||
|
opacity: 1;
|
||||||
|
transform: translateY(0);
|
||||||
|
pointer-events: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.filter-bar strong {
|
.filter-bar strong {
|
||||||
@@ -297,10 +316,18 @@ th[data-sort] {
|
|||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
th[data-sort] {
|
||||||
|
transition: color 0.15s ease;
|
||||||
|
}
|
||||||
|
|
||||||
th[data-sort]:hover {
|
th[data-sort]:hover {
|
||||||
color: var(--accent);
|
color: var(--accent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
th[data-sort]:active {
|
||||||
|
color: var(--accent-hover);
|
||||||
|
}
|
||||||
|
|
||||||
th[data-sort]::after {
|
th[data-sort]::after {
|
||||||
content: " ▼";
|
content: " ▼";
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
aria-label="Search libraries"
|
aria-label="Search libraries"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="filter-bar" hidden>
|
<div class="filter-bar">
|
||||||
<span>Showing <strong class="filter-value"></strong></span>
|
<span>Showing <strong class="filter-value"></strong></span>
|
||||||
<button class="filter-clear" aria-label="Clear filter">
|
<button class="filter-clear" aria-label="Clear filter">
|
||||||
× Clear
|
× Clear
|
||||||
|
|||||||
Reference in New Issue
Block a user