mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-04-21 03:17:28 +08:00
Merge pull request #1055 from immortal521/fix/theme-toggle-flicker
fix: theme-toggle-flicker
This commit is contained in:
@@ -93,9 +93,8 @@ function getCircle(event) {
|
|||||||
|
|
||||||
function withViewTransition(event, applyFn, direction = true) {
|
function withViewTransition(event, applyFn, direction = true) {
|
||||||
if (typeof document !== 'undefined' && document.startViewTransition) {
|
if (typeof document !== 'undefined' && document.startViewTransition) {
|
||||||
const transition = document.startViewTransition(async () => {
|
const transition = document.startViewTransition(() => {
|
||||||
applyFn()
|
applyFn()
|
||||||
await nextTick()
|
|
||||||
})
|
})
|
||||||
|
|
||||||
transition.ready
|
transition.ready
|
||||||
@@ -111,6 +110,7 @@ function withViewTransition(event, applyFn, direction = true) {
|
|||||||
{
|
{
|
||||||
duration: 400,
|
duration: 400,
|
||||||
easing: 'ease-in-out',
|
easing: 'ease-in-out',
|
||||||
|
fill: 'both',
|
||||||
pseudoElement: direction
|
pseudoElement: direction
|
||||||
? '::view-transition-new(root)'
|
? '::view-transition-new(root)'
|
||||||
: '::view-transition-old(root)',
|
: '::view-transition-old(root)',
|
||||||
|
|||||||
Reference in New Issue
Block a user