You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want the theme to load without refreshing. I tried Turbo and combined it with CSS animations, which worked well, but there were some flickering issues. Does anyone have better solutions? Below is my code (placed in layouts/partial/head/custom.html)
<scripttype="module">import*asTurbofrom"https://cdn.jsdelivr.net/npm/@hotwired/turbo@7.3.0/+esm"</script><style>/* Turbo gradient transition — Fallback solution: handwritten CSS transition */body.turbo-fade-out{opacity:0;transition: opacity 0.15s ease-in-out;}body{opacity:1;transition: opacity 0.15s ease-in-out;}/* Turbo Gradient Transitions — Modern Browser Solution: View Transitions API */::view-transition-old(root){animation: turbo-fade-out 0.2s ease-in-out;}::view-transition-new(root){animation: turbo-fade-in 0.2s ease-in-out;}@keyframes turbo-fade-out {to{opacity:0;}}@keyframes turbo-fade-in {from{opacity:0;}}</style><script>document.addEventListener('turbo:before-render',(event)=>{if(document.startViewTransition){/* Modern browsers: Use the View Transitions API for a smoother experience */event.preventDefault();document.startViewTransition(()=>{event.detail.resume();});}});document.addEventListener('turbo:render',()=>{/* The new content has been replaced by the DOM, and the class is removed to trigger fade-in */requestAnimationFrame(()=>{document.body.classList.remove('turbo-fade-out');});});</script>
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I want the theme to load without refreshing. I tried
Turboand combined it with CSS animations, which worked well, but there were some flickering issues. Does anyone have better solutions? Below is my code (placed inlayouts/partial/head/custom.html)All reactions