diff --git a/phpBB/styles/prosilver/template/ajax.js b/phpBB/styles/prosilver/template/ajax.js index 3fb6a88a87..93e8fcef80 100644 --- a/phpBB/styles/prosilver/template/ajax.js +++ b/phpBB/styles/prosilver/template/ajax.js @@ -392,6 +392,28 @@ $('#member_search').click(function () { return false; }); +/** + * Show to top button if available on page + */ +const $scrollTopButton = $('.to-top-button'); + +if ($scrollTopButton.length) { + // Show or hide the button based on scroll position + $(window).scroll(function () { + if ($(this).scrollTop() > 300) { + $scrollTopButton.fadeIn(); // Fade in the button + } else { + $scrollTopButton.fadeOut(); // Fade out the button + } + }); + + // Scroll smoothly to the top when the button is clicked + $scrollTopButton.click(function (e) { + e.preventDefault(); // Prevent the default anchor link behavior + $('html, body').animate({scrollTop: 0}, 500); // Smooth scroll to top + }); +} + /** * Automatically resize textarea */ diff --git a/phpBB/styles/prosilver/template/faq_body.html b/phpBB/styles/prosilver/template/faq_body.html index 4f925fa6a2..542e894c61 100644 --- a/phpBB/styles/prosilver/template/faq_body.html +++ b/phpBB/styles/prosilver/template/faq_body.html @@ -35,9 +35,6 @@
{faq_block.faq_row.FAQ_QUESTION}
{faq_block.faq_row.FAQ_ANSWER}
- - {{ Icon('font', 'circle-chevron-up', lang('BACK_TO_TOP'), false) }} -
@@ -46,5 +43,11 @@ +
+ + {{ Icon('font', 'chevron-up', '', false) }} + +
+ diff --git a/phpBB/styles/prosilver/theme/colours.css b/phpBB/styles/prosilver/theme/colours.css index 4af5c10fb9..c642adb22c 100644 --- a/phpBB/styles/prosilver/theme/colours.css +++ b/phpBB/styles/prosilver/theme/colours.css @@ -83,6 +83,15 @@ th a:hover { color: #9e9e9e; } +.to-top-button { + background-color: #0f4d8a; + opacity: 0.7; +} + +.to-top-button a { + color: #e6f7ff; +} + /* arrow links */ .arrow-left:hover, .arrow-right:hover { diff --git a/phpBB/styles/prosilver/theme/links.css b/phpBB/styles/prosilver/theme/links.css index 6f68463306..87359530f9 100644 --- a/phpBB/styles/prosilver/theme/links.css +++ b/phpBB/styles/prosilver/theme/links.css @@ -153,7 +153,22 @@ a.lastsubject:hover { .top { font-size: 14px; text-decoration: none; - margin-top: 10px; + margin-top: 12px; +} + +.to-top-button { + position: fixed; + right: 24px; + bottom: 24px; + inline-size: 48px; + block-size: 48px; + border-radius: 50%; + display: none; +} + +.to-top-button .o-icon { + font-size: 32px; + padding: 8px; } /* Back to top of page */