UNPKG

framer-motion

Version:

A simple and powerful JavaScript animation library

1 lines 1.06 kB
{"version":3,"file":"use-reset-view-transitions.mjs","sources":["../../../../../src/components/AnimateView/hooks/use-reset-view-transitions.ts"],"sourcesContent":["import { useInsertionEffect } from \"react\"\n\nlet hasInsertedTransitionResetStyle = false\n\nexport function useResetViewTransitions(): void {\n useInsertionEffect(() => {\n if (hasInsertedTransitionResetStyle) return\n hasInsertedTransitionResetStyle = true\n const style = document.createElement(\"style\")\n style.textContent = `\n ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) {\n animation-timing-function: linear !important;\n }\n `\n document.head.appendChild(style)\n }, [])\n}\n"],"names":[],"mappings":";;AAEA,IAAI,+BAA+B,GAAG,KAAK;SAE3B,uBAAuB,GAAA;IACnC,kBAAkB,CAAC,MAAK;AACpB,QAAA,IAAI,+BAA+B;YAAE;QACrC,+BAA+B,GAAG,IAAI;QACtC,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC;QAC7C,KAAK,CAAC,WAAW,GAAG;;;;KAIvB;AACG,QAAA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;IACpC,CAAC,EAAE,EAAE,CAAC;AACV;;;;"}