1
0
Fork 0
mirror of https://github.com/mat-1/matdoesdev.git synced 2025-08-02 14:46:04 +00:00

better transition direction picking

This commit is contained in:
mat 2023-08-13 00:46:53 -05:00
parent a73050ace8
commit 21fd0ee53d

View file

@ -15,7 +15,10 @@
previousPathname = currentPathName
currentPathName = data.pathname
if (currentPathName.startsWith(previousPathname))
// fly right if we're going forward, left if we're going back
if (previousPathname === '/')
flyDirection = 1
else if (previousPathname === '/blog' && currentPathName !== '/')
flyDirection = 1
else
flyDirection = -1