Skip to content

Commit 49fafd3

Browse files
vintaclaude
andcommitted
refactor(website): move back-to-top button into sticky table header
Replaces the fixed-position floating button with an inline button inside the last column of the sticky table header. Removes the hidden attribute toggle and float positioning in favour of opacity/pointer- events toggling, keeping the visibility logic intact. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 818950f commit 49fafd3

4 files changed

Lines changed: 12 additions & 30 deletions

File tree

website/static/main.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,6 @@ if (searchInput) {
282282
// Back to top
283283
var backToTop = document.querySelector('.back-to-top');
284284
if (backToTop) {
285-
backToTop.hidden = false;
286285
var scrollTicking = false;
287286
window.addEventListener('scroll', function () {
288287
if (!scrollTicking) {

website/static/style.css

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -545,50 +545,33 @@ th[data-sort].sort-asc::after {
545545

546546
/* === Back to Top === */
547547
.back-to-top {
548-
position: fixed;
549-
bottom: 2rem;
550-
left: 50%;
551-
margin-left: -2rem;
552-
background: var(--bg);
553-
border: 1px solid var(--border-strong);
554-
border-radius: 4px;
555-
padding: 0.4rem 0.75rem;
548+
background: none;
549+
border: none;
550+
padding: 0;
556551
font-family: var(--font-body);
557-
font-size: var(--text-xs);
552+
font-size: 0.8rem;
558553
font-weight: 600;
559-
color: var(--text-muted);
554+
color: var(--accent);
560555
cursor: pointer;
561556
opacity: 0;
562-
transform: translateY(0.5rem);
563-
transition: opacity 0.15s ease, transform 0.15s ease, border-color 0.15s, color 0.15s;
564-
z-index: 50;
557+
transition: opacity 0.15s ease, color 0.15s;
558+
pointer-events: none;
565559
}
566560

567-
.back-to-top[hidden] { display: none; }
568-
569561
.back-to-top.visible {
570562
opacity: 1;
571-
transform: translateY(0);
563+
pointer-events: auto;
572564
}
573565

574566
.back-to-top:hover {
575-
border-color: var(--accent);
576-
color: var(--accent);
577-
}
578-
579-
.back-to-top:active {
580-
transform: scale(0.95);
567+
color: var(--accent-hover);
581568
}
582569

583570
.back-to-top:focus-visible {
584571
outline: 2px solid var(--accent);
585572
outline-offset: 2px;
586573
}
587574

588-
@media (max-width: 640px) {
589-
.back-to-top { bottom: 1.25rem; }
590-
}
591-
592575
/* === Noscript === */
593576
.noscript-msg {
594577
text-align: center;

website/templates/base.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@
3737

3838
<main id="content">{% block content %}{% endblock %}</main>
3939

40-
<button class="back-to-top" aria-label="Back to top" hidden>&uarr; Top</button>
41-
4240
<footer class="footer">
4341
<span
4442
>Made by

website/templates/index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ <h2 class="sr-only">Results</h2>
7676
<th class="col-stars" data-sort="stars">GitHub Stars</th>
7777
<th class="col-commit" data-sort="commit-time">Last Commit</th>
7878
<th class="col-cat">Category</th>
79-
<th class="col-arrow"><span class="sr-only">Details</span></th>
79+
<th class="col-arrow">
80+
<button class="back-to-top" aria-label="Back to top">&uarr;</button>
81+
</th>
8082
</tr>
8183
</thead>
8284
<tbody>

0 commit comments

Comments
 (0)