diff --git a/pages/index.php b/pages/index.php index da64b90..0352cfb 100644 --- a/pages/index.php +++ b/pages/index.php @@ -211,7 +211,7 @@ if($reqPath === '/') {
- +
Projects
More
@@ -230,7 +230,7 @@ foreach($projInfo as $proj): $links[] = ['class' => 'forum', 'text' => 'Discussion', 'url' => $proj->forum]; ?>
- +
name;?>
summary;?>
@@ -249,7 +249,7 @@ foreach($projInfo as $proj):
- +
Contact
More
diff --git a/public/assets/2020v2.js b/public/assets/2020v2.js index 13ab044..9a4ecb1 100644 --- a/public/assets/2020v2.js +++ b/public/assets/2020v2.js @@ -108,6 +108,9 @@ window.fm = (function() { var dynload = document.querySelectorAll('[data-fm-dynload]'); for(var i = 0; i < dynload.length; ++i) (function(dc){ + var url = new URL(dc.href), + hash = url.hash.substring(1); + url.hash = ''; dc.removeAttribute('data-fm-dynload'); dc.addEventListener('click', function(ev) { ev.stopPropagation(); @@ -125,11 +128,22 @@ window.fm = (function() { var title = ((obj.components || {}).header || {}).title || ''; history.pushState(obj, title, dc.href); fm.dynloadApply(obj); + if(hash) { + var targetEl = document.getElementById(hash); + if(targetEl) { + setTimeout(function() { + window.scrollTo({ + top: targetEl.getBoundingClientRect().top, + behavior: 'smooth' + }); + }, 500); + } + } }; xhr.onerror = function(ev) { location.assign(dc.href); }; - xhr.open('GET', dc.href); + xhr.open('GET', url); xhr.setRequestHeader('Accept', 'application/x-fdynload+json'); xhr.send(); }, true);