Skip to content

Commit

Permalink
fix: make nav title sticky + add more grabbale area for native (elk-z…
Browse files Browse the repository at this point in the history
  • Loading branch information
edimitchel authored Feb 5, 2023
1 parent 76bad72 commit 7380e24
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
6 changes: 3 additions & 3 deletions components/main/MainContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ const wideLayout = computed(() => route.meta.wideLayout ?? false)
border="b base" bg="[rgba(var(--rgb-bg-base),0.7)]"
class="native:lg:w-[calc(100vw-5rem)] native:xl:w-[calc(135%+(100vw-1200px)/2)]"
>
<div flex justify-between px5 py2 :class="{ 'xl:hidden': $route.name !== 'tag' }" data-tauri-drag-region class="native:xl:flex">
<div flex gap-3 items-center :overflow-hidden="!noOverflowHidden ? '' : false" py2 w-full class="native-mac:pl-14 native-mac:sm:pl-0">
<div flex justify-between px5 py2 :class="{ 'xl:hidden': $route.name !== 'tag' }" class="native:xl:flex">
<div flex gap-3 items-center :overflow-hidden="!noOverflowHidden ? '' : false" py2 w-full>
<NuxtLink
v-if="backOnSmallScreen || back" flex="~ gap1" items-center btn-text p-0 xl:hidden
:aria-label="$t('nav.back')"
@click="$router.go(-1)"
>
<div i-ri:arrow-left-line class="rtl-flip" />
</NuxtLink>
<div :truncate="!noOverflowHidden ? '' : false" w-full>
<div :truncate="!noOverflowHidden ? '' : false" flex w-full data-tauri-drag-region class="native-mac:justify-center native-mac:text-center native-mac:sm:justify-start">
<slot name="title" />
</div>
<div sm:hidden h-7 w-1px />
Expand Down
1 change: 0 additions & 1 deletion components/nav/NavSide.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const { notifications } = useNotifications()

<template>
<nav sm:px3 flex="~ col gap2" shrink text-size-base leading-normal md:text-lg h-full>
<div shrink hidden sm:block mt-4 />
<SearchWidget lg:ms-1 lg:me-5 hidden xl:block />
<NavSideItem :text="$t('nav.search')" :to="isHydrated ? `/${currentServer}/explore` : '/explore'" icon="i-ri:search-line" hidden sm:block xl:hidden :command="command" />

Expand Down
2 changes: 1 addition & 1 deletion components/nav/NavTitle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ router.afterEach(() => {
</script>

<template>
<div flex justify-between>
<div flex justify-between sticky top-0 bg-base z-1 py-4 native:py-7 data-tauri-drag-region>
<NuxtLink
flex items-end gap-3
py2 px-5
Expand Down
8 changes: 4 additions & 4 deletions layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ const isGrayscale = usePreferences('grayscaleMode')
</script>

<template>
<div h-full :data-mode="isHydrated && isGrayscale ? 'grayscale' : ''">
<div h-full :data-mode="isHydrated && isGrayscale ? 'grayscale' : ''" data-tauri-drag-region>
<main flex w-full mxa lg:max-w-80rem class="native:grid native:sm:grid-cols-[auto_1fr] native:lg:grid-cols-[auto_minmax(600px,2fr)_1fr]">
<aside class="native:w-auto w-1/8 md:w-1/6 lg:w-1/5 xl:w-1/4 zen-hide" hidden sm:flex justify-end xl:me-4 relative>
<aside class="native:w-auto w-1/8 md:w-1/6 lg:w-1/5 xl:w-1/4 zen-hide" hidden sm:flex justify-end xl:me-4 native:me-0 relative>
<div sticky top-0 w-20 xl:w-100 h-screen flex="~ col" lt-xl-items-center>
<slot name="left">
<div flex="~ col" overflow-y-auto justify-between h-full max-w-full pt-5 native:pt-7 overflow-x-hidden>
<div flex="~ col" overflow-y-auto justify-between h-full max-w-full overflow-x-hidden>
<NavTitle />
<NavSide command />
<div flex-auto />
Expand Down Expand Up @@ -59,7 +59,7 @@ const isGrayscale = usePreferences('grayscaleMode')
<NavBottom v-if="isHydrated" sm:hidden />
</div>
</div>
<aside v-if="isHydrated && !wideLayout" class="hidden w-1/4 sm:none lg:block zen-hide">
<aside v-if="isHydrated && !wideLayout" class="hidden lg:w-1/5 xl:w-1/4 sm:none xl:block native:w-full zen-hide">
<div sticky top-0 h-screen flex="~ col" gap-2 py3 ms-2>
<slot name="right">
<div flex-auto />
Expand Down

0 comments on commit 7380e24

Please sign in to comment.