Use button-based homepage section scrolling
Some checks failed
CodeQL / Analyze (javascript) (push) Failing after 28s
Some checks failed
CodeQL / Analyze (javascript) (push) Failing after 28s
This commit is contained in:
@@ -15,15 +15,15 @@
|
||||
</span>
|
||||
</div>
|
||||
<div class="hero-actions">
|
||||
<a class="btn btn-default home-scroll" href="#" data-target="#overview-getting-started">
|
||||
<button class="btn btn-default home-scroll" type="button" data-target="#overview-getting-started">
|
||||
<i data-lucide="rocket"></i> <span data-tkey="gettingStarted">Getting Started</span>
|
||||
</a>
|
||||
<a class="btn btn-primary home-scroll" href="#" data-target="#overview-pool-blocks">
|
||||
</button>
|
||||
<button class="btn btn-primary home-scroll" type="button" data-target="#overview-pool-blocks">
|
||||
<i data-lucide="blocks"></i> <span data-tkey="poolBlocks">Pool Blocks</span>
|
||||
</a>
|
||||
<a class="btn btn-primary home-scroll" href="#" data-target="#overview-faq">
|
||||
</button>
|
||||
<button class="btn btn-primary home-scroll" type="button" data-target="#overview-faq">
|
||||
<i data-lucide="messages-square"></i> FAQ
|
||||
</a>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@@ -720,7 +720,11 @@ $('.home-scroll').click(function(e) {
|
||||
let target = $(this).data('target');
|
||||
let el = document.querySelector(target);
|
||||
if (el) {
|
||||
el.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
||||
const nav = document.querySelector('.nav-side-menu');
|
||||
const topBar = document.getElementById('top-bar');
|
||||
const offset = (nav ? nav.offsetHeight : 0) + (topBar ? topBar.offsetHeight : 0) + 24;
|
||||
const top = window.pageYOffset + el.getBoundingClientRect().top - offset;
|
||||
window.scrollTo({ top: Math.max(0, top), behavior: 'smooth' });
|
||||
}
|
||||
});
|
||||
home_InitTemplate(lastStats)
|
||||
|
||||
Reference in New Issue
Block a user