Skip to content

Commit 1e516ce

Browse files
authored
Merge branch 'master' into opsgenie_override
2 parents dfc7f6e + 4ceac57 commit 1e516ce

2 files changed

Lines changed: 55 additions & 0 deletions

File tree

docs/_static/custom.css

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,37 @@ h3 {
298298
margin-bottom: 20px !important;
299299
}
300300

301+
/* Back to Top Button */
302+
.back-to-top {
303+
position: fixed;
304+
bottom: 30px;
305+
right: 30px;
306+
width: 50px;
307+
height: 50px;
308+
background-color: var(--md-primary-fg-color);
309+
color: white;
310+
border-radius: 50%;
311+
text-align: center;
312+
line-height: 50px;
313+
font-size: 20px;
314+
text-decoration: none;
315+
opacity: 0;
316+
visibility: hidden;
317+
z-index: 1000;
318+
transition: opacity 0.3s, visibility 0.3s;
319+
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
320+
cursor: pointer;
321+
}
322+
323+
.back-to-top.visible {
324+
opacity: 0.7;
325+
visibility: visible;
326+
}
327+
328+
.back-to-top:hover {
329+
opacity: 1;
330+
}
331+
301332
.sd-sphinx-override p {
302333
margin-bottom: 0px;
303334
}

docs/_templates/base.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{% extends '!base.html' %}
22
{% block site_meta %}
33
{{ super() }}
4+
<!-- Back to Top Button -->
5+
<a href="#" class="back-to-top" aria-label="Back to top">
6+
<span></span>
7+
</a>
48
<!-- PostHog and Segment -->
59
<script>
610
!function(t,e){var o,n,p,r;e.__SV||(window.posthog=e,e._i=[],e.init=function(i,s,a){function g(t,e){var o=e.split(".");2==o.length&&(t=t[o[0]],e=o[1]),t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}}(p=t.createElement("script")).type="text/javascript",p.async=!0,p.src=s.api_host+"/static/array.js",(r=t.getElementsByTagName("script")[0]).parentNode.insertBefore(p,r);var u=e;for(void 0!==a?u=e[a]=[]:a="posthog",u.people=u.people||[],u.toString=function(t){var e="posthog";return"posthog"!==a&&(e+="."+a),t||(e+=" (stub)"),e},u.people.toString=function(){return u.toString(1)+".people (stub)"},o="capture identify alias people.set people.set_once set_config register register_once unregister opt_out_capturing has_opted_out_capturing opt_in_capturing reset isFeatureEnabled onFeatureFlags".split(" "),n=0;n<o.length;n++)g(u,o[n]);e._i.push([i,s,a])},e.__SV=1)}(document,window.posthog||[]);
@@ -27,6 +31,26 @@
2731
document.getElementById('__palette_1').onclick = () => refreshRobustaLogo(true);
2832
document.getElementById('__palette_2').onclick = () => refreshRobustaLogo(false);
2933

34+
// Back to top button functionality
35+
const backToTopButton = document.querySelector('.back-to-top');
36+
37+
// Show button when page is scrolled down
38+
window.addEventListener('scroll', function() {
39+
if (window.pageYOffset > 300) {
40+
backToTopButton.classList.add('visible');
41+
} else {
42+
backToTopButton.classList.remove('visible');
43+
}
44+
});
45+
46+
// Smooth scroll to top when button is clicked
47+
backToTopButton.addEventListener('click', function(e) {
48+
e.preventDefault();
49+
window.scrollTo({
50+
top: 0,
51+
behavior: 'smooth'
52+
});
53+
});
3054
}, false);
3155
</script>
3256
{% endblock %}

0 commit comments

Comments
 (0)