-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5adc560
commit 5617c48
Showing
8 changed files
with
341 additions
and
352 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,84 +1,86 @@ | ||
<script setup> | ||
import { Touch } from 'vuetify/directives' | ||
import Toasts from '~/components/layout/Toasts.vue' | ||
const vTouch = Touch | ||
const appStatistics = useAppStatistics() | ||
const userSettings = useUserSettings() | ||
const { value: isMenuActive, toggle: toggleMenu } = useMenu() | ||
const { value: isSearchMenuActive, toggle: toggleSearchMenu } = useSearchMenu() | ||
function touchHandler(direction, event) { | ||
if (!userSettings.navigationTouchGestures) { | ||
console.debug('Gestures setting is disabled, skipping...') | ||
return | ||
} | ||
const touchThreshold = screen.availWidth * 0.25 | ||
// console.debug(touchThreshold, event) | ||
switch (direction) { | ||
case 'right': | ||
if (event.touchstartX > touchThreshold) { | ||
console.debug('Insufficient touch threshold') | ||
return | ||
} | ||
if (isSearchMenuActive) { | ||
toggleSearchMenu(false) | ||
// | ||
} else { | ||
toggleMenu(true) | ||
} | ||
break | ||
case 'left': | ||
if (event.touchstartX < screen.availWidth - touchThreshold) { | ||
console.debug('Insufficient touch threshold') | ||
return | ||
} | ||
if (!isSearchMenuActive) { | ||
toggleSearchMenu(true) | ||
// | ||
} else { | ||
toggleMenu(false) | ||
} | ||
break | ||
} | ||
} | ||
console.info( | ||
'%cWe ❤︎ open source!', | ||
'font-size:32px;font-weight:bold;letter-spacing:0.02em;color:hsl(205, 78%, 62%);background-color:white;padding:8px 16px;' | ||
) | ||
console.info( | ||
'%cContribute: https://redirect.r34.app/github\nJoin our discord: https://redirect.r34.app/discord', | ||
'background-color:hsl(0, 0%, 7%);padding:4px 8px;font-size:16px;color:white;' | ||
) | ||
import { Touch } from 'vuetify/directives' | ||
const vTouch = Touch | ||
const appStatistics = useAppStatistics() | ||
const userSettings = useUserSettings() | ||
const { value: isMenuActive, toggle: toggleMenu } = useMenu() | ||
const { value: isSearchMenuActive, toggle: toggleSearchMenu } = useSearchMenu() | ||
function touchHandler(direction, event) { | ||
if (!userSettings.navigationTouchGestures) { | ||
console.debug('Gestures setting is disabled, skipping...') | ||
return | ||
} | ||
const touchThreshold = screen.availWidth * 0.25 | ||
// console.debug(touchThreshold, event) | ||
switch (direction) { | ||
case 'right': | ||
if (event.touchstartX > touchThreshold) { | ||
console.debug('Insufficient touch threshold') | ||
return | ||
} | ||
if (isSearchMenuActive) { | ||
toggleSearchMenu(false) | ||
// | ||
} else { | ||
toggleMenu(true) | ||
} | ||
break | ||
case 'left': | ||
if (event.touchstartX < screen.availWidth - touchThreshold) { | ||
console.debug('Insufficient touch threshold') | ||
return | ||
} | ||
if (!isSearchMenuActive) { | ||
toggleSearchMenu(true) | ||
// | ||
} else { | ||
toggleMenu(false) | ||
} | ||
break | ||
} | ||
} | ||
console.info( | ||
'%cWe ❤︎ open source!', | ||
'font-size:32px;font-weight:bold;letter-spacing:0.02em;color:hsl(205, 78%, 62%);background-color:white;padding:8px 16px;' | ||
) | ||
console.info( | ||
'%cContribute: https://redirect.r34.app/github\nJoin our discord: https://redirect.r34.app/discord', | ||
'background-color:hsl(0, 0%, 7%);padding:4px 8px;font-size:16px;color:white;' | ||
) | ||
</script> | ||
|
||
<template> | ||
<!-- TODO: Fix not working when z-10 is used --> | ||
<div | ||
v-touch="{ | ||
left: (e) => touchHandler('left', e), | ||
right: (e) => touchHandler('right', e) | ||
}" | ||
> | ||
<!-- Notifications --> | ||
<Toasts /> | ||
|
||
<Sidebar /> | ||
|
||
<Navbar /> | ||
|
||
<!-- Layout content --> | ||
<!-- TODO: Create container component: https://tailwindui.com/components/application-ui/layout/containers --> | ||
<slot /> | ||
</div> | ||
<!-- TODO: Fix not working when z-10 is used --> | ||
<div | ||
v-touch="{ | ||
left: (e) => touchHandler('left', e), | ||
right: (e) => touchHandler('right', e) | ||
}" | ||
> | ||
<Toaster | ||
close-button | ||
position="top-center" | ||
theme="dark" | ||
/> | ||
|
||
<Sidebar /> | ||
|
||
<Navbar /> | ||
|
||
<!-- Layout content --> | ||
<!-- TODO: Create container component: https://tailwindui.com/components/application-ui/layout/containers --> | ||
<slot /> | ||
</div> | ||
</template> |
Oops, something went wrong.