Skip to content

Commit

Permalink
Improve formatting of script tag content
Browse files Browse the repository at this point in the history
  • Loading branch information
bwRavencl committed Aug 3, 2024
1 parent 4dceba9 commit 3181cb2
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,23 @@ <h2 class="project-tagline slide-in-left">{{ site.description | default: site.gi
<script type="text/javascript">
const profileIframeContainer = document.getElementById('profile-iframe-container');
const profileIframe = document.getElementById('profile-iframe');
const documentClickListener = (e) => {if(e && e.target && e.target.className && !e.target.className.startsWith('carousel__')) closeProfileViewer();}
function openProfileViewer(event, relative_path){event.stopPropagation(); profileIframeContainer.classList.remove('fade-out'); profileIframeContainer.classList.toggle('fade-in', true); profileIframe.setAttribute('src', relative_path); document.addEventListener('click', documentClickListener);}
function closeProfileViewer(){document.removeEventListener('click', documentClickListener); profileIframe.removeAttribute('src'); profileIframeContainer.classList.remove('fade-in'); profileIframeContainer.classList.toggle('fade-out', true); }
const documentClickListener = (e) => {
if (e && e.target && e.target.className && !e.target.className.startsWith('carousel__'))
closeProfileViewer();
}
function openProfileViewer(event, relative_path) {
event.stopPropagation();
profileIframeContainer.classList.remove('fade-out');
profileIframeContainer.classList.toggle('fade-in', true);
profileIframe.setAttribute('src', relative_path);
document.addEventListener('click', documentClickListener);
}
function closeProfileViewer() {
document.removeEventListener('click', documentClickListener);
profileIframe.removeAttribute('src');
profileIframeContainer.classList.remove('fade-in');
profileIframeContainer.classList.toggle('fade-out', true);
}
</script>

<script type="text/javascript" src="js/lightbox.js"></script>
Expand Down

0 comments on commit 3181cb2

Please sign in to comment.