Skip to content

Commit

Permalink
Parse location hash to allow direct linking to profile visualizations
Browse files Browse the repository at this point in the history
  • Loading branch information
bwRavencl committed Aug 3, 2024
1 parent 3181cb2 commit 250186d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ <h2 class="project-tagline slide-in-left">{{ site.description | default: site.gi
closeProfileViewer();
}
function openProfileViewer(event, relative_path) {
event.stopPropagation();
if (event)
event.stopPropagation();
profileIframeContainer.classList.remove('fade-out');
profileIframeContainer.classList.toggle('fade-in', true);
profileIframe.setAttribute('src', relative_path);
Expand All @@ -73,6 +74,14 @@ <h2 class="project-tagline slide-in-left">{{ site.description | default: site.gi
}
</script>

<script type="text/javascript">
if (location.hash) {
const relative_path = location.hash.slice(1);
if (relative_path.match('^profiles\/\w+.html$'))
openProfileViewer(null, relative_path);
}
</script>

<script type="text/javascript" src="js/lightbox.js"></script>
<link rel="stylesheet" href="css/lightbox.css">
{% if site.google_analytics %}
Expand Down

0 comments on commit 250186d

Please sign in to comment.