Replies: 1 comment 1 reply
|
I have it in a SvelteKit App and it works fine in Safari. Here is my Code of the root <script lang="ts">
import '../app.css';
import '$lib/fonts/fonts.css';
import {onNavigate} from "$app/navigation";
let { children } = $props();
onNavigate((navigation) => {
if (!document.startViewTransition) return;
return new Promise((resolve) => {
document.startViewTransition(async () => {
resolve();
await navigation.complete;
});
});
});
</script>
{@render children()}And here (part) of my @view-transition {
navigation: auto;
}
::view-transition-old(root) {
animation: fade-out 250ms ease forwards;
}
::view-transition-new(root) {
animation: fade-in 250ms ease forwards;
}
@keyframes fade-out { to { opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } } |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hello,
I'd like to know if anybody had any luck making view transitions work on Safari with SvelteKit. I am really implementing the basic example which you can find in most tutorials online and it works fine on Chrome but not on Safari. I know for sure my version of Safari (26)can have view transitions because I can test other examples online using view transitions and they work fine. So I suspect it is the way I trigger them inside SvelteKit that is not compatible with Safari.
For the sake of completeness, here is the javascript code I use :
And my CSS:
Anybody is having the same issue and/or knows how to make it work?
All reactions