Skip to content

Commit 7d4553f

Browse files
committed
site
1 parent 4499874 commit 7d4553f

3 files changed

Lines changed: 58 additions & 1 deletion

File tree

.github/workflows/jekyll-gh-pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
git config user.name "github-actions[bot]"
5050
git config user.email "github-actions[bot]@users.noreply.github.com"
5151
git add VERSION
52-
git diff --staged --quiet || git commit -m "Bump version to ${{ steps.version.outputs.VERSION }} [skip ci]"
52+
git diff --staged --quiet || git commit -m "Bump version to ${{ steps.version.outputs.VERSION }}"
5353
git push
5454
5555
- name: Add version and build date to config

github-pages/_layouts/default.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@
8181
</article>
8282
</main>
8383

84+
<button class="back-to-top" id="back-to-top" aria-label="Back to top">
85+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
86+
<polyline points="18 15 12 9 6 15"></polyline>
87+
</svg>
88+
</button>
89+
8490
<footer class="footer">
8591
<div class="footer-container">
8692
<p>{{ site.title }} &copy; {{ 'now' | date: '%Y' }} <a href="https://managed-code.com">ManagedCode</a></p>
@@ -90,6 +96,7 @@
9096
</footer>
9197

9298
<script>
99+
// TOC navigation
93100
document.querySelectorAll('.toc a').forEach(link => {
94101
link.addEventListener('click', function(e) {
95102
e.preventDefault();
@@ -103,6 +110,19 @@
103110
}
104111
});
105112
});
113+
114+
// Back to top
115+
const backToTop = document.getElementById('back-to-top');
116+
window.addEventListener('scroll', () => {
117+
if (window.scrollY > 400) {
118+
backToTop.classList.add('visible');
119+
} else {
120+
backToTop.classList.remove('visible');
121+
}
122+
});
123+
backToTop.addEventListener('click', () => {
124+
window.scrollTo({ top: 0, behavior: 'smooth' });
125+
});
106126
</script>
107127
</body>
108128
</html>

github-pages/assets/css/style.css

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,43 @@ hr {
446446
text-decoration: underline;
447447
}
448448

449+
/* Back to top button */
450+
.back-to-top {
451+
position: fixed;
452+
bottom: 32px;
453+
right: 32px;
454+
width: 44px;
455+
height: 44px;
456+
background: #27232A;
457+
color: white;
458+
border: none;
459+
border-radius: 50%;
460+
cursor: pointer;
461+
display: flex;
462+
align-items: center;
463+
justify-content: center;
464+
opacity: 0;
465+
visibility: hidden;
466+
transition: all 0.3s ease;
467+
box-shadow: 0 2px 8px rgba(39, 35, 42, 0.15);
468+
z-index: 99;
469+
}
470+
471+
.back-to-top.visible {
472+
opacity: 1;
473+
visibility: visible;
474+
}
475+
476+
.back-to-top:hover {
477+
background: #785D8F;
478+
transform: translateY(-2px);
479+
}
480+
481+
.back-to-top svg {
482+
width: 18px;
483+
height: 18px;
484+
}
485+
449486
/* Responsive */
450487
@media (max-width: 768px) {
451488
.nav {

0 commit comments

Comments
 (0)