smooth things out

This commit is contained in:
prospect
2024-01-19 10:41:25 -05:00
parent 9ee2bd992c
commit 672b1e6d4a
3 changed files with 12 additions and 33 deletions

View File

@@ -119,7 +119,7 @@ class PageTransitions {
}); });
} else if (this.isExternalLink(link)) { } else if (this.isExternalLink(link)) {
link.setAttribute('target', '_blank'); link.setAttribute('target', '_blank');
window.open(link, '_system'); window.open(link.href, '_system');
} }
}); });
}); });
@@ -177,6 +177,12 @@ class PageTransitions {
this.updateContent(data, elementId); this.updateContent(data, elementId);
history.pushState(null, null, targetUrl); history.pushState(null, null, targetUrl);
// Trigger removal of transition class after fetching data
const contentContainer = document.getElementById(elementId);
setTimeout(() => {
this.removeTransitionClass(contentContainer);
}, 300);
// Update the page title // Update the page title
const newTitle = parsedData.querySelector('title'); const newTitle = parsedData.querySelector('title');
if (newTitle) { if (newTitle) {
@@ -187,12 +193,6 @@ class PageTransitions {
this.collapsePanel = new _CollapsePanel__WEBPACK_IMPORTED_MODULE_0__["default"](); this.collapsePanel = new _CollapsePanel__WEBPACK_IMPORTED_MODULE_0__["default"]();
this.collapsePanel.addToggleCollapseListener('#content-container .accordion-toggle'); this.collapsePanel.addToggleCollapseListener('#content-container .accordion-toggle');
this.addLinkClickListener('#content-container a'); this.addLinkClickListener('#content-container a');
// Trigger removal of transition class after fetching data
const contentContainer = document.getElementById(elementId);
setTimeout(() => {
this.removeTransitionClass(contentContainer);
}, 300);
}).catch(error => console.error('Error submitting form:', error)); }).catch(error => console.error('Error submitting form:', error));
} }
updateContent(data, elementId) { updateContent(data, elementId) {
@@ -203,7 +203,9 @@ class PageTransitions {
const newContent = targetElement.innerHTML; const newContent = targetElement.innerHTML;
// Update the content container // Update the content container
contentContainer.innerHTML = newContent; contentContainer.innerHTML = newContent;
// Trigger removal of transition class after fetching data // Trigger removal of transition class after fetching data
setTimeout(() => { setTimeout(() => {
this.removeTransitionClass(contentContainer); this.removeTransitionClass(contentContainer);

File diff suppressed because one or more lines are too long

View File

@@ -125,35 +125,12 @@
</section> </section>
<!-- Splash Screen Content--> <!-- Splash Screen Content-->
<section id="splash-screen" class="hidden absolute w-full bottom-0 flex flex-col h-screen items-center justify-center"> <section id="splash-screen" class="hidden absolute w-full bottom-0 h-screen items-center justify-center">
<div class="space-y-8 px-4 text-white flex flex-col justify-center items-center"> <div class="space-y-8 px-4 text-white flex flex-col h-screen justify-center items-center">
<img class="w-56" src="<?php echo get_template_directory_uri(); ?>/assets/images/logos/logo-white.png" alt="Splash Logo"> <img class="w-56" src="<?php echo get_template_directory_uri(); ?>/assets/images/logos/logo-white.png" alt="Splash Logo">
<h1 class="uppercase text-center font-bold text-xl">A student handbook for post secondary transitions</h1> <h1 class="uppercase text-center font-bold text-xl">A student handbook for post secondary transitions</h1>
<button id="app-enter" class="bg-blue-800 shadow-sm shadow-gray-50 px-12 py-4 rounded-md"><i class="bi bi-box-arrow-in-right pr-4"></i>Enter</button> <button id="app-enter" class="bg-blue-800 shadow-sm shadow-gray-50 px-12 py-4 rounded-md"><i class="bi bi-box-arrow-in-right pr-4"></i>Enter</button>
</div> </div>
</section> </section>
<?php
/**
// Check if a flag is set in the session to indicate that the code has already run
if (!isset($_SESSION['splash_shown'])) {
$_SESSION['splash_shown'] = true; ?>
<!-- Splash Screen Content-->
<section id="splash-screen" class="absolute w-full bottom-0 flex flex-col h-screen items-center justify-center">
<div class="space-y-8 px-4 text-white flex flex-col justify-center items-center">
<img class="w-56" src="<?php echo get_template_directory_uri(); ?>/assets/images/logos/logo-white.png" alt="Splash Logo">
<h1 class="uppercase text-center font-bold text-xl">A student handbook for post secondary transitions</h1>
<button id="app-enter" class="bg-blue-800 shadow-sm shadow-gray-50 px-12 py-4 rounded-md"><i class="bi bi-box-arrow-in-right pr-4"></i>Enter</button>
</div>
</section>
<?php } ?>
*/