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:
parent
a73050ace8
commit
21fd0ee53d
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue