diff --git a/.changeset/tame-roses-occur.md b/.changeset/tame-roses-occur.md new file mode 100644 index 0000000..022511e --- /dev/null +++ b/.changeset/tame-roses-occur.md @@ -0,0 +1,5 @@ +--- +'@vtbag/cam-shaft': patch +--- + +Implements a workaround for a bug in Webkit where user agent animation have wrong names diff --git a/src/index.ts b/src/index.ts index 6dbf09b..abfc928 100644 --- a/src/index.ts +++ b/src/index.ts @@ -44,7 +44,10 @@ addEventListener('pagereveal', async (e) => { document.documentElement, `::view-transition-group(${vtn})` ); - const groupAnimationName = groupStyle.animationName; + let groupAnimationName = groupStyle.animationName; + if (groupAnimationName.startsWith('"')) { + groupAnimationName = groupAnimationName.slice(1, -1); + } if (groupAnimationName === `-ua-view-transition-group-anim-${vtn}`) { const ms = (s: string) => { const res = parseFloat(s);