mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-01-08 11:02:50 +00:00
@@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {fly} from "svelte/transition"
|
import {fly} from "svelte/transition"
|
||||||
import {afterNavigate, beforeNavigate} from "$app/navigation"
|
import {afterNavigate, beforeNavigate} from "$app/navigation"
|
||||||
import {expoIn, expoOut, quadIn, quadOut} from "svelte/easing"
|
import {expoIn, expoOut} from "svelte/easing"
|
||||||
|
|
||||||
let inDirection = 0
|
let inDirection = 0
|
||||||
let outDirection = 0
|
let outDirection = 0
|
||||||
@@ -20,15 +20,14 @@
|
|||||||
if (!(from && to && routeOrder.includes(from) && routeOrder.includes(to))) {
|
if (!(from && to && routeOrder.includes(from) && routeOrder.includes(to))) {
|
||||||
inDirection = 0
|
inDirection = 0
|
||||||
outDirection = 0
|
outDirection = 0
|
||||||
return
|
} else {
|
||||||
|
const fromIndex = routeOrder.indexOf(from)
|
||||||
|
const toIndex = routeOrder.indexOf(to)
|
||||||
|
|
||||||
|
inDirection = fromIndex > toIndex ? -1 : 1
|
||||||
|
outDirection = fromIndex > toIndex ? 1 : -1
|
||||||
}
|
}
|
||||||
|
|
||||||
const fromIndex = routeOrder.indexOf(from)
|
|
||||||
const toIndex = routeOrder.indexOf(to)
|
|
||||||
|
|
||||||
inDirection = fromIndex > toIndex ? -1 : 1
|
|
||||||
outDirection = fromIndex > toIndex ? 1 : -1
|
|
||||||
|
|
||||||
animationDone = new Promise(resolve => {
|
animationDone = new Promise(resolve => {
|
||||||
outroEnd = resolve
|
outroEnd = resolve
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user