From 1f7b4e328466c1cc886fd239cc8d57dc5883c370 Mon Sep 17 00:00:00 2001 From: Tony Lea Date: Thu, 6 Jun 2024 10:28:04 -0400 Subject: [PATCH] adding fixes for loader and pages --- assets/js/main.js | 9 +++++++++ content/docs/getting-started.md | 2 +- layouts/main.html | 13 ++++++++++--- pages/docs/[content].html | 2 +- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/assets/js/main.js b/assets/js/main.js index 7ae175d..1088990 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -26,9 +26,18 @@ document.addEventListener("DOMContentLoaded", function() { renderSmoothAnchorLinks(); window.dispatchEvent(new CustomEvent('set-route', { detail: { route: window.location.pathname } })); document.startViewTransition(() => updateTheDOMSomehow(data)); + + removeHTMXloadingStates(); }); +removeHTMXloadingStates = function(){ + const loadingElements = document.querySelectorAll('[data-loading]'); + loadingElements.forEach(element => { + element.style.display = 'none'; + }); +} + window.onbeforeunload = function(){ console.log('go'); }; diff --git a/content/docs/getting-started.md b/content/docs/getting-started.md index fdc4549..f6f5e69 100644 --- a/content/docs/getting-started.md +++ b/content/docs/getting-started.md @@ -41,7 +41,7 @@ Below are a few problems and solutions that this package aims to offer.

Solution: One Package to Rule Them All

-

Consolidate your authentication into a single, streamlined solution for effortless updates and consistent security across all apps.

+

Use a single authentication solution for effortless updates and consistent security.

diff --git a/layouts/main.html b/layouts/main.html index 788845e..d689fad 100644 --- a/layouts/main.html +++ b/layouts/main.html @@ -191,6 +191,9 @@ .prose h2{ font-size:25px; font-weight:800; +} +[data-loading] { + display: none; } @@ -200,11 +203,12 @@ } + {tailwindcss} - +
+ @set-route.window="route=event.detail.route" id="site" x-cloak data-loading-class-remove> -
+
+ +
+
{slot}
diff --git a/pages/docs/[content].html b/pages/docs/[content].html index e85764c..281fb81 100644 --- a/pages/docs/[content].html +++ b/pages/docs/[content].html @@ -1,4 +1,4 @@ - +