Skip to content

Commit

Permalink
Updating Spline with background and no delay
Browse files Browse the repository at this point in the history
  • Loading branch information
davenichols-DHLS committed Dec 18, 2024
1 parent bfc3db8 commit 8aa90df
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions blocks/spline-viewer/spline-viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ export default async function decorate(block) {
const observer = new IntersectionObserver((entries) => {
if (entries.some((e) => e.isIntersecting)) {
observer.disconnect();
setTimeout(() => {
loadScript(fragmentHtml?.head?.firstElementChild?.src, { type: 'module' });
block.append(fragmentHtml?.body?.firstElementChild);
}, 2000);
loadScript(fragmentHtml?.head?.firstElementChild?.src, { type: 'module' });
block.append(fragmentHtml?.body?.firstElementChild);
}
});
observer.observe(block);
Expand Down
4 changes: 2 additions & 2 deletions fragments/spline.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<script type="module" src="https://unpkg.com/@splinetool/[email protected].37/build/spline-viewer.js"></script>
<spline-viewer url="https://prod.spline.design/UBAIdqMtOkuDExkL/scene.splinecode"></spline-viewer>
<script type="module" src="https://unpkg.com/@splinetool/[email protected].51/build/spline-viewer.js" async></script>
<spline-viewer loading-anim-type="spinner-small-light" url="https://prod.spline.design/UBAIdqMtOkuDExkL/scene.splinecode"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAA4CAYAAAALrl3YAAAAAXNSR0IArs4c6QAAFGpJREFUeF7VXIl2G0cSmyGV///YTWLLIof7CkcVekgnTuyNs/Kjh5JlHo0GUFdzfzwej+2nfNXTvrqdX8yuX6urbtvl669437atbvWV93/Ke/zzJ80VwEv+1wOC7RJgFCgGxFvJAJxB+D8DpN7OTwLkj9jxAG/667FvezPDDPE1fi9Z8QqYP9+sP+U3zivxEwB5BoMQDAwNSYFRyyRAAIzZ0teQKAORgJyB+inL/vpJ15Xg+/8HAZmnHwDqnoHwPX0vqdrx38gIAlIvujzEepR69cI//s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HhF7jkPU6YAuJZNeuHNihMgPFMSbVof5epA0cfOhh3jH2aCjydHQ+pFcujOn6dI0sghv1p5H/h0hTbOI7R+OW9pH8mP13Bmr166o7MGRC0dt2jPbOkDoUzvApCncFeLcwZEc0bM1AWIo6aoZU2kNZLVQ3UvPimopwb1CQ9L9y5CzmQEKrABRkdaiobSiGe7j0/MQaTxEJjr+atlS2WV08dsrHI1PREOF4r7ThJdlD0zRMcg/gsU7izHcSsLSgAAAABJRU5ErkJggg==" alt="Spline preview" style="width: 100%; height: 100%;"/></spline-viewer>

0 comments on commit 8aa90df

Please sign in to comment.