Apache or nginx would be way overkill It's a super simple embedded webserver. I'll check whether I can add support for hash urls there.
For now it would be easy to get this working with Java Script and URL parameters instead (e.g. http://localhost:1234///cheaters-master/cheaters/index_local.html?scrollTo=freeForm )
Something like this should work:
<!DOCTYPE html>
<html lang="en">
<head>
<script>
document.addEventListener("DOMContentLoaded", function() {
// Function to get the value of a specific query parameter
function getQueryParam(param) {
const urlParams = new URLSearchParams(window.location.search);
return urlParams.get(param);
}
// Get the scrollTo parameter from the URL
const scrollToId = getQueryParam('scrollTo');
// Check if scrollToId has a value and the element exists
if (scrollToId) {
const elementToScroll = document.getElementById(scrollToId);
if (elementToScroll) {
// Scroll to the element
elementToScroll.scrollIntoView({ behavior: 'smooth' });
} else {
console.warn('Element with ID:', scrollToId, 'not found.');
}
} else {
console.warn('No scrollTo parameter found in the URL.');
}
});
</script>
</head>
<body>
<div id="test1" style="width:200px;height:200px;">1</div>
<div id="test2" style="width:200px;height:200px;">2</div>
<div id="test3" style="width:200px;height:200px;">3</div>
<div id="test4" style="width:200px;height:200px;">4</div>
<div id="test5" style="width:200px;height:200px;">5</div>
<div id="test6" style="width:200px;height:200px;">6</div>
<div id="test7" style="width:200px;height:200px;">7</div>
<div id="test8" style="width:200px;height:200px;">8</div>
</body>
</html>