Fixed the start on top on reload

This commit is contained in:
Walusimbi Silver
2026-03-13 21:44:39 +03:00
parent ea33c4c2ef
commit c176ac000c

View File

@@ -268,7 +268,7 @@
<span class="link-arrow"></span> <span class="link-arrow"></span>
</a> </a>
<a href="https://silverwal.com" class="link" id="portfolio-link"> <a href="https://silverwal.com" target="_blank" rel="noopener" class="link" id="portfolio-link">
<svg class="link-icon" viewBox="0 0 24 24" fill="currentColor"> <svg class="link-icon" viewBox="0 0 24 24" fill="currentColor">
<path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm-1 2l5 5h-5V4zM6 20V4h5v7h7v9H6z"/> <path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm-1 2l5 5h-5V4zM6 20V4h5v7h7v9H6z"/>
</svg> </svg>
@@ -311,5 +311,17 @@
</p> </p>
</footer> </footer>
</div> </div>
<script>
if ('scrollRestoration' in history) {
history.scrollRestoration = 'manual';
}
const resetScroll = () => {
window.scrollTo(0, 0);
};
window.addEventListener('load', resetScroll);
window.addEventListener('pageshow', resetScroll);
</script>
</body> </body>
</html> </html>