valaxy-theme-press 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/components/PressAlgoliaSearch.vue +208 -0
  2. package/components/PressArticle.vue +12 -6
  3. package/components/PressAside.vue +23 -11
  4. package/components/PressBackdrop.vue +1 -1
  5. package/components/PressCategories.vue +2 -2
  6. package/components/PressCategory.vue +13 -11
  7. package/components/PressFeatures.vue +1 -1
  8. package/components/PressFooter.vue +1 -1
  9. package/components/PressHome.vue +1 -1
  10. package/components/PressHomeFeatures.vue +1 -0
  11. package/components/PressHomeHero.vue +7 -8
  12. package/components/PressLocalNav.vue +9 -9
  13. package/components/PressNav.vue +30 -5
  14. package/components/PressNavBar.vue +94 -0
  15. package/components/PressNavBarAppearance.vue +5 -0
  16. package/components/PressNavBarHamburger.vue +79 -0
  17. package/components/PressNavBarMenu.vue +14 -0
  18. package/components/PressNavBarSearch.vue +40 -0
  19. package/components/PressNavBarSocialLinks.vue +26 -0
  20. package/components/PressNavBarTranslations.vue +5 -0
  21. package/components/{nav/PressNavItemGroup.vue → PressNavItemGroup.vue} +2 -2
  22. package/components/{nav/PressNavItemLink.vue → PressNavItemLink.vue} +2 -1
  23. package/components/PressNavScreen.vue +95 -0
  24. package/components/PressNavScreenAppearance.vue +32 -0
  25. package/components/PressNavScreenMenu.vue +22 -0
  26. package/components/PressNavScreenMenuGroup.vue +115 -0
  27. package/components/PressNavScreenMenuGroupLink.vue +32 -0
  28. package/components/PressNavScreenMenuGroupSection.vue +37 -0
  29. package/components/PressNavScreenMenuLink.vue +33 -0
  30. package/components/PressNavScreenSocialLinks.vue +13 -0
  31. package/components/PressNavScreenTranslations.vue +7 -0
  32. package/components/PressOutline.vue +1 -0
  33. package/components/PressPostList.vue +3 -3
  34. package/components/PressSidebar.vue +10 -9
  35. package/components/PressSocialLink.vue +40 -0
  36. package/components/PressSocialLinks.vue +26 -0
  37. package/components/ValaxyMain.vue +46 -33
  38. package/composables/nav.ts +37 -0
  39. package/config/index.ts +5 -0
  40. package/layouts/layout.vue +0 -1
  41. package/package.json +3 -3
  42. package/pages/[..all].vue +1 -0
  43. package/setup/main.ts +5 -3
  44. package/styles/css-vars.scss +11 -6
  45. package/styles/markdown.scss +10 -9
  46. package/types/index.d.ts +17 -1
  47. package/utils/index.ts +9 -0
  48. package/valaxy.config.ts +5 -0
  49. package/components/DocsBoard.vue +0 -24
  50. package/components/nav/PressNavBar.vue +0 -111
  51. /package/components/{nav/PressSwitchAppearance.vue → PressSwitchAppearance.vue} +0 -0
@@ -0,0 +1,208 @@
1
+ <script lang="ts" setup>
2
+ import { useI18n } from 'vue-i18n'
3
+ import { useAddonAlgolia } from 'valaxy-addon-algolia'
4
+
5
+ const { t } = useI18n()
6
+
7
+ const { loaded, load, metaKey } = useAddonAlgolia()
8
+ </script>
9
+
10
+ <template>
11
+ <div>
12
+ <AlgoliaSearchBox v-if="loaded" />
13
+
14
+ <div v-else id="docsearch" @click="load">
15
+ <button
16
+ class="DocSearch DocSearch-Button"
17
+ aria-label="Search"
18
+ >
19
+ <span class="DocSearch-Button-Container">
20
+ <svg
21
+ class="DocSearch-Search-Icon"
22
+ width="20"
23
+ height="20"
24
+ viewBox="0 0 20 20"
25
+ >
26
+ <path
27
+ d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z"
28
+ stroke="currentColor"
29
+ fill="none"
30
+ fill-rule="evenodd"
31
+ stroke-linecap="round"
32
+ stroke-linejoin="round"
33
+ />
34
+ </svg>
35
+ <span class="DocSearch-Button-Placeholder">{{ t('search.placeholder') }}</span>
36
+ </span>
37
+ <span class="DocSearch-Button-Keys">
38
+ <kbd class="DocSearch-Button-Key" />
39
+ <kbd class="DocSearch-Button-Key">K</kbd>
40
+ </span>
41
+ </button>
42
+ </div>
43
+ </div>
44
+ </template>
45
+
46
+ <style>
47
+ .DocSearch-Button {
48
+ display: flex;
49
+ justify-content: center;
50
+ align-items: center;
51
+ margin: 0;
52
+ padding: 0;
53
+ width: 32px;
54
+ height: 55px;
55
+ background: transparent;
56
+ transition: border-color 0.25s;
57
+ }
58
+
59
+ .DocSearch-Button:hover {
60
+ background: transparent;
61
+ }
62
+
63
+ .DocSearch-Button:focus {
64
+ outline: 1px dotted;
65
+ outline: 5px auto -webkit-focus-ring-color;
66
+ }
67
+
68
+ .DocSearch-Button:focus:not(:focus-visible) {
69
+ outline: none !important;
70
+ }
71
+
72
+ @media (min-width: 768px) {
73
+ .DocSearch-Button {
74
+ justify-content: flex-start;
75
+ border: 1px solid transparent;
76
+ border-radius: 8px;
77
+ padding: 0 10px 0 12px;
78
+ width: 100%;
79
+ height: 40px;
80
+ background-color: var(--va-c-bg-alt);
81
+ }
82
+
83
+ .DocSearch-Button:hover {
84
+ border-color: var(--va-c-brand);
85
+ background: var(--va-c-bg-alt);
86
+ }
87
+ }
88
+
89
+ .DocSearch-Button .DocSearch-Button-Container {
90
+ display: flex;
91
+ align-items: center;
92
+ }
93
+
94
+ .DocSearch-Button .DocSearch-Search-Icon {
95
+ position: relative;
96
+ width: 16px;
97
+ height: 16px;
98
+ color: var(--va-c-text-1);
99
+ fill: currentColor;
100
+ transition: color 0.5s;
101
+ }
102
+
103
+ .DocSearch-Button:hover .DocSearch-Search-Icon {
104
+ color: var(--va-c-text-1);
105
+ }
106
+
107
+ @media (min-width: 768px) {
108
+ .DocSearch-Button .DocSearch-Search-Icon {
109
+ top: 1px;
110
+ margin-right: 8px;
111
+ width: 14px;
112
+ height: 14px;
113
+ color: var(--va-c-text-2);
114
+ }
115
+ }
116
+
117
+ .DocSearch-Button .DocSearch-Button-Placeholder {
118
+ display: none;
119
+ margin-top: 2px;
120
+ padding: 0 16px 0 0;
121
+ font-size: 13px;
122
+ font-weight: 500;
123
+ color: var(--va-c-text-2);
124
+ transition: color 0.5s;
125
+ }
126
+
127
+ .DocSearch-Button:hover .DocSearch-Button-Placeholder {
128
+ color: var(--va-c-text-1);
129
+ }
130
+
131
+ @media (min-width: 768px) {
132
+ .DocSearch-Button .DocSearch-Button-Placeholder {
133
+ display: inline-block;
134
+ }
135
+ }
136
+
137
+ .DocSearch-Button .DocSearch-Button-Keys {
138
+ /*rtl:ignore*/
139
+ direction: ltr;
140
+ display: none;
141
+ min-width: auto;
142
+ }
143
+
144
+ @media (min-width: 768px) {
145
+ .DocSearch-Button .DocSearch-Button-Keys {
146
+ display: flex;
147
+ align-items: center;
148
+ }
149
+ }
150
+
151
+ .DocSearch-Button .DocSearch-Button-Key {
152
+ display: block;
153
+ margin: 2px 0 0 0;
154
+ border: 1px solid var(--va-c-divider);
155
+ /*rtl:begin:ignore*/
156
+ border-right: none;
157
+ border-radius: 4px 0 0 4px;
158
+ padding-left: 6px;
159
+ /*rtl:end:ignore*/
160
+ min-width: 0;
161
+ width: auto;
162
+ height: 22px;
163
+ font-family: var(--va-font-sans);
164
+ font-size: 12px;
165
+ font-weight: 500;
166
+ transition: color 0.5s, border-color 0.5s;
167
+ }
168
+
169
+ .DocSearch-Button .DocSearch-Button-Key + .DocSearch-Button-Key {
170
+ /*rtl:begin:ignore*/
171
+ border-right: 1px solid var(--va-c-divider);
172
+ border-left: none;
173
+ border-radius: 0 4px 4px 0;
174
+ padding-left: 2px;
175
+ padding-right: 6px;
176
+ /*rtl:end:ignore*/
177
+ }
178
+
179
+ .DocSearch-Button .DocSearch-Button-Key:first-child {
180
+ font-size: 1px;
181
+ letter-spacing: -12px;
182
+ color: transparent;
183
+ }
184
+
185
+ .DocSearch-Button .DocSearch-Button-Key:first-child:after {
186
+ content: v-bind(metaKey);
187
+ font-size: 12px;
188
+ letter-spacing: normal;
189
+ color: var(--docsearch-muted-color);
190
+ }
191
+
192
+ .DocSearch-Button .DocSearch-Button-Key:first-child > * {
193
+ display: none;
194
+ }
195
+
196
+ .dark .DocSearch-Footer {
197
+ border-top: 1px solid var(--va-c-divider);
198
+ }
199
+
200
+ .DocSearch-Form {
201
+ border: 1px solid var(--va-c-brand);
202
+ background-color: var(--va-c-white);
203
+ }
204
+
205
+ .dark .DocSearch-Form {
206
+ background-color: var(--va-c-bg-soft-mute);
207
+ }
208
+ </style>
@@ -2,18 +2,24 @@
2
2
  import { computed } from 'vue'
3
3
  import { useRoute } from 'vue-router'
4
4
 
5
- import { useFrontmatter, usePostList } from 'valaxy'
5
+ import { useFrontmatter, useSiteStore } from 'valaxy'
6
+ import { useI18n } from 'vue-i18n'
7
+ import { getLocaleTitle } from '../utils'
8
+
6
9
  const frontmatter = useFrontmatter()
7
10
 
8
11
  const route = useRoute()
9
- const posts = usePostList()
12
+ const site = useSiteStore()
10
13
 
11
14
  function findCurrentIndex() {
12
- return posts.value.findIndex(p => p.href === route.path)
15
+ return site.postList.findIndex(p => p.href === route.path)
13
16
  }
14
17
 
15
- const nextPost = computed(() => posts.value[findCurrentIndex() - 1])
16
- const prevPost = computed(() => posts.value[findCurrentIndex() + 1])
18
+ const nextPost = computed(() => site.postList[findCurrentIndex() - 1])
19
+ const prevPost = computed(() => site.postList[findCurrentIndex() + 1])
20
+
21
+ const { locale } = useI18n()
22
+ const localeTitle = computed(() => getLocaleTitle(locale.value, frontmatter.value))
17
23
  </script>
18
24
 
19
25
  <template>
@@ -30,7 +36,7 @@ const prevPost = computed(() => posts.value[findCurrentIndex() + 1])
30
36
  md:text-5xl md:leading-14
31
37
  "
32
38
  >
33
- {{ frontmatter.title }}
39
+ {{ localeTitle }}
34
40
  </h1>
35
41
  </header>
36
42
 
@@ -1,6 +1,5 @@
1
1
  <script lang="ts" setup>
2
- import { useFrontmatter } from 'valaxy'
3
- import { useAppStore } from 'valaxy/client/stores/app'
2
+ import { useAppStore, useFrontmatter } from 'valaxy'
4
3
  import PressOutline from './PressOutline.vue'
5
4
 
6
5
  const frontmatter = useFrontmatter()
@@ -21,22 +20,26 @@ const app = useAppStore()
21
20
  <aside
22
21
  class="press-aside lt-xl:fixed shadow
23
22
  press-card xl:(shadow-none hover:shadow-none) hover:shadow-lg"
23
+ flex="~ col grow"
24
24
  p="l-0 xl:l-8" text="center"
25
- z="5"
25
+ z="$"
26
26
  :class="app.isRightSidebarOpen && 'open'"
27
27
  >
28
+ <div class="aside-curtain" />
28
29
  <div class="aside-container lt-xl:fixed" flex="~ col">
29
- <PressOutline v-if="frontmatter.toc !== false" />
30
- <div class="flex-grow" />
31
- <div v-if="$slots.default" class="custom-container">
32
- <slot />
30
+ <div class="aside-content overflow-auto" flex="~ col">
31
+ <PressOutline v-if="frontmatter.toc !== false" />
32
+ <div class="flex-grow" />
33
+ <div v-if="$slots.default" class="custom-container">
34
+ <slot />
35
+ </div>
33
36
  </div>
34
37
  </div>
35
38
  </aside>
36
39
  </template>
37
40
 
38
41
  <style lang="scss">
39
- @use 'valaxy/client/styles/mixins' as *;
42
+ @use 'valaxy/client/styles/mixins/index.scss' as *;
40
43
 
41
44
  .press-card{
42
45
  background-color: var(--va-c-bg);
@@ -46,7 +49,7 @@ const app = useAppStore()
46
49
  top: 0;
47
50
  bottom: 0;
48
51
  right: 0;
49
- z-index: var(--pr-z-index-aside);
52
+ z-index: var(--pr-z-aside);
50
53
  width: var(--va-aside-width);
51
54
 
52
55
  transform: translateX(100%);
@@ -67,10 +70,19 @@ const app = useAppStore()
67
70
  top: 0;
68
71
  margin-top: calc(var(--pr-nav-height) * -1 - 20px);
69
72
  padding-top: calc(var(--pr-nav-height) + 20px);
70
- height: calc(100vh - var(--pr-nav-height) - 32px);
73
+ height: 100vh;
71
74
  }
72
75
 
73
- @include media('xl') {
76
+ .aside-curtain {
77
+ position: fixed;
78
+ bottom: 0;
79
+ z-index: 10;
80
+ width: 220px;
81
+ height: 32px;
82
+ background: linear-gradient(transparent,var(--va-c-bg) 70%);
83
+ }
84
+
85
+ @include screen('xl') {
74
86
  .aside-container {
75
87
  top: 0;
76
88
  }
@@ -17,7 +17,7 @@ defineProps<{
17
17
  right: 0;
18
18
  bottom: 0;
19
19
  left: 0;
20
- z-index: var(--pr-z-index-backdrop);
20
+ z-index: var(--pr-z-backdrop);
21
21
  background: rgba(0, 0, 0, .6);
22
22
  transition: opacity 0.5s;
23
23
 
@@ -25,8 +25,8 @@ const sidebar = computed(() => themeConfig.value.sidebar)
25
25
  <template>
26
26
  <ul v-for="item in sidebar" :key="item" class="category-list">
27
27
  <PressCategory
28
- v-if="categories.get(item)"
29
- :name="item" :category="categories.get(item)"
28
+ v-if="categories.find(c => c.name === item)"
29
+ :category="categories.find(c => c.name === item)"
30
30
  :level="level + 1"
31
31
  :display-category="displayCategory"
32
32
  :collapsable="collapsable"
@@ -1,11 +1,10 @@
1
1
  <script lang="ts" setup>
2
2
  import { ref } from 'vue'
3
3
  import type { Category, Post } from 'valaxy'
4
- import { isParentCategory } from 'valaxy'
4
+ import { isCategoryList } from 'valaxy'
5
5
  import { useI18n } from 'vue-i18n'
6
6
 
7
7
  const props = withDefaults(defineProps<{
8
- name: string
9
8
  // to eliminate the warning
10
9
  category: Category
11
10
  level?: number
@@ -22,7 +21,7 @@ const props = withDefaults(defineProps<{
22
21
  const collapsable = ref(props.collapsable)
23
22
  const { t, locale } = useI18n()
24
23
 
25
- const getTitle = (post: Post | any) => {
24
+ function getTitle(post: Post | any) {
26
25
  const lang = locale.value
27
26
  return post[`title_${lang}`] ? post[`title_${lang}`] : post.title
28
27
  }
@@ -35,8 +34,8 @@ const getTitle = (post: Post | any) => {
35
34
  w="full" border="t t-$pr-c-divider-light"
36
35
  class="category-list-item inline-flex items-center justify-between"
37
36
  >
38
- <span class="category-name" font="bold" m="l-1" @click="displayCategory ? displayCategory(name) : null">
39
- {{ name === 'Uncategorized' ? t('category.uncategorized') : name }}
37
+ <span class="category-name" font="bold" m="l-1" @click="displayCategory ? displayCategory(category.name) : null">
38
+ {{ category.name === 'Uncategorized' ? t('category.uncategorized') : category.name }}
40
39
  <!-- <sup font="normal">[{{ category.total }}]</sup> -->
41
40
  </span>
42
41
  <span class="folder-action inline-flex cursor-pointer" opacity="50" @click="collapsable = !collapsable">
@@ -46,13 +45,16 @@ const getTitle = (post: Post | any) => {
46
45
  </li>
47
46
 
48
47
  <template v-if="!collapsable">
49
- <ul v-if="!isParentCategory(category)">
50
- <li v-for="post, i in category.posts" :key="i" class="post-list-item">
51
- <router-link v-if="post.title" :to="post.path || ''" class="inline-flex items-center" active-class="active">
52
- <span m="l-1" text="sm">{{ getTitle(post) }}</span>
53
- </router-link>
48
+ <ul>
49
+ <li v-for="categoryItem, i in category.children" :key="i" class="post-list-item">
50
+ <template v-if="!isCategoryList(categoryItem)">
51
+ <router-link v-if="categoryItem.title" :to="categoryItem.path || ''" class="inline-flex items-center" active-class="active">
52
+ <span m="l-1" text="sm">{{ getTitle(categoryItem) }}</span>
53
+ </router-link>
54
+ </template>
55
+
56
+ <PressCategory v-else :category="categoryItem" :display-category="displayCategory" :collapsable="collapsable" />
54
57
  </li>
55
58
  </ul>
56
- <PressCategories v-else :categories="category.children" :display-category="displayCategory" :collapsable="collapsable" />
57
59
  </template>
58
60
  </template>
@@ -17,7 +17,7 @@ const grid = computed(() => {
17
17
 
18
18
  <template>
19
19
  <div class="press-features">
20
- <div class="m-auto container grid gap-4" :class="[grid]">
20
+ <div class="m-auto container grid gap-4" p="x-4" :class="[grid]">
21
21
  <div v-for="feature in features" :key="feature.title" class="inline-grid">
22
22
  <PressFeature :feature="feature" />
23
23
  </div>
@@ -29,7 +29,7 @@ const { hasSidebar } = useSidebar()
29
29
  }
30
30
 
31
31
  @media (min-width: 768px) {
32
- .VPFooter {
32
+ .pr-footer {
33
33
  padding: 32px;
34
34
  }
35
35
  }
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="press-home" p="x-6">
2
+ <div class="press-home" style="--va-code-mobile-margin-x: 0">
3
3
  <slot name="home-hero-before" />
4
4
  <PressHomeHero />
5
5
  <slot name="home-hero-after" />
@@ -1,5 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import { useFrontmatter } from 'valaxy'
3
+
3
4
  const fm = useFrontmatter()
4
5
  </script>
5
6
 
@@ -6,19 +6,18 @@ const fm = useFrontmatter()
6
6
  </script>
7
7
 
8
8
  <template>
9
- <h1 m="md:t-24 t-10 md:t-20" text="center">
10
- <span text="5rem" font="black" class="gradient-text from-purple-800 to-blue-500" bg="gradient-to-r">
9
+ <div text="center" m="md:t-24 t-10 md:t-20" flex="~ col" justify="center" items="center">
10
+ <ValaxyLogo mb="2" />
11
+ <h1 my="10" text="4xl md:8xl" font="black" class="gradient-text from-purple-800 to-blue-500" bg="gradient-to-r">
11
12
  {{ fm.hero.name }}
12
- </span>
13
- <br>
14
- <small opacity="75">LOGO NOT READY</small>
15
- </h1>
13
+ </h1>
14
+ </div>
16
15
 
17
- <h1 m="y-10" text="center 6xl" font="black" leading="tight">
16
+ <h2 m="b-10" text="center 6xl" font="black" leading="tight">
18
17
  Next Generation
19
18
  <br>
20
19
  Static <span class="gradient-text from-blue-500 to-purple-700" bg="gradient-to-r">Blog</span> Framework
21
- </h1>
20
+ </h2>
22
21
 
23
22
  <div p="2" text="center">
24
23
  <PressButton
@@ -1,5 +1,5 @@
1
1
  <script lang="ts" setup>
2
- import { useSidebar } from 'valaxy/client'
2
+ import { useSidebar } from 'valaxy'
3
3
 
4
4
  defineProps<{
5
5
  open: boolean
@@ -21,7 +21,7 @@ function scrollToTop() {
21
21
  <button
22
22
  class="menu"
23
23
  :aria-expanded="open"
24
- aria-controls="VPSidebarNav"
24
+ aria-controls="pr-sidebar-nav"
25
25
  @click="$emit('openMenu')"
26
26
  >
27
27
  <div i-ri-align-left class="menu-icon" />
@@ -35,13 +35,13 @@ function scrollToTop() {
35
35
  </template>
36
36
 
37
37
  <style scoped lang="scss">
38
- @use 'valaxy/client/styles/mixins' as *;
38
+ @use 'valaxy/client/styles/mixins/index.scss' as *;
39
39
 
40
40
  .press-local-nav {
41
41
  position: sticky;
42
42
  top: 0;
43
43
  left: 0;
44
- z-index: var(--pr-z-index-local-nav);
44
+ z-index: var(--pr-z-local-nav);
45
45
  display: flex;
46
46
  justify-content: space-between;
47
47
  align-items: center;
@@ -51,7 +51,7 @@ function scrollToTop() {
51
51
  transition: border-color 0.5s;
52
52
  }
53
53
 
54
- @include media('md') {
54
+ @include screen('md') {
55
55
  .press-local-nav {
56
56
  display: none;
57
57
  }
@@ -73,7 +73,7 @@ function scrollToTop() {
73
73
  transition: color 0.25s;
74
74
  }
75
75
 
76
- @include media('md') {
76
+ @include screen('md') {
77
77
  .menu {
78
78
  padding: 0 32px;
79
79
  }
@@ -92,16 +92,16 @@ function scrollToTop() {
92
92
  line-height: 24px;
93
93
  font-size: 12px;
94
94
  font-weight: 500;
95
- color: var(--vp-c-text-2);
95
+ color: var(--pr-c-text-2);
96
96
  transition: color 0.5s;
97
97
  }
98
98
 
99
99
  .top-link:hover {
100
- color: var(--vp-c-text-1);
100
+ color: var(--pr-c-text-1);
101
101
  transition: color 0.25s;
102
102
  }
103
103
 
104
- @include media('md') {
104
+ @include screen('md') {
105
105
  .top-link {
106
106
  padding: 12px 32px 11px;
107
107
  }
@@ -1,17 +1,42 @@
1
+ <script setup lang="ts">
2
+ import { computed, provide } from 'vue'
3
+ import { useWindowScroll } from '@vueuse/core'
4
+ import { useSidebar } from 'valaxy'
5
+ import { useNav } from '../composables/nav'
6
+
7
+ const { y } = useWindowScroll()
8
+
9
+ const { isScreenOpen, closeScreen, toggleScreen } = useNav()
10
+ const { hasSidebar } = useSidebar()
11
+
12
+ provide('close-screen', closeScreen)
13
+
14
+ const classes = computed(() => ({
15
+ 'no-sidebar': !hasSidebar.value,
16
+ 'fill-bg': y.value > 0,
17
+ }))
18
+ </script>
19
+
1
20
  <template>
2
- <nav w="full" class="press-nav relative md:fixed md:z-99 font-bold">
3
- <PressNavBar />
21
+ <nav w="full" class="press-nav relative md:fixed md:z-99 font-bold" :class="classes">
22
+ <PressNavBar :is-screen-open="isScreenOpen" @toggle-screen="toggleScreen" />
23
+
24
+ <PressNavScreen :open="isScreenOpen" />
4
25
  </nav>
5
26
  </template>
6
27
 
7
28
  <style lang="scss">
8
- @use 'valaxy/client/styles/mixins' as *;
29
+ @use 'valaxy/client/styles/mixins/index.scss' as *;
9
30
 
10
31
  .press-nav {
11
- z-index: var(--pr-z-index-nav);
32
+ z-index: var(--pr-z-nav);
33
+ }
34
+
35
+ .pr-Nav.fill-bg {
36
+ background-color: var(--pr-nav-bg-color);
12
37
  }
13
38
 
14
- @include media('md') {
39
+ @include screen('md') {
15
40
  .press-nav {
16
41
  -webkit-backdrop-filter: saturate(50%) blur(8px);
17
42
  backdrop-filter: saturate(50%) blur(8px);
@@ -0,0 +1,94 @@
1
+ <script lang="ts" setup>
2
+ import { useSidebar, useSiteConfig } from 'valaxy'
3
+ import { useThemeConfig } from '../composables'
4
+
5
+ defineProps<{
6
+ isScreenOpen?: boolean
7
+ }>()
8
+
9
+ defineEmits<{
10
+ (e: 'toggleScreen'): void
11
+ }>()
12
+
13
+ const { hasSidebar } = useSidebar()
14
+
15
+ const siteConfig = useSiteConfig()
16
+ const themeConfig = useThemeConfig()
17
+ </script>
18
+
19
+ <template>
20
+ <div class="pr-navbar flex justify-between items-center pl-4 pr-2" :class="{ 'has-sidebar': hasSidebar }">
21
+ <router-link class="text-xl flex justify-center items-center" to="/" :aria-label="siteConfig.title">
22
+ <img v-if="themeConfig.logo" class="logo" :src="themeConfig.logo" alt="LOGO">
23
+ <span class="inline-flex">{{ siteConfig.title }}</span>
24
+ </router-link>
25
+ <div class="self-stretch flex justify-center items-center text-sm leading-5">
26
+ <PressNavBarSearch p="x-2" />
27
+ <PressNavBarMenu p="x-2" />
28
+ <PressNavBarTranslations p="x-2" />
29
+ <PressNavBarAppearance p="x-2" />
30
+ <PressNavBarSocialLinks p="x-2" />
31
+
32
+ <PressNavBarHamburger :active="isScreenOpen" @click="$emit('toggleScreen')" />
33
+ </div>
34
+ </div>
35
+ </template>
36
+
37
+ <style lang="scss">
38
+ @use 'valaxy/client/styles/mixins/index.scss' as *;
39
+
40
+ :root {
41
+ --pr-navbar-c-bg: rgba(255, 255, 255, 0.8);
42
+ }
43
+
44
+ .logo {
45
+ width: 32px;
46
+ height: 32px;
47
+ margin-right: 8px;
48
+ }
49
+
50
+ .dark {
51
+ --pr-navbar-c-bg: rgba(24, 24, 24, 0.3);
52
+ }
53
+
54
+ .pr-navbar {
55
+ position: relative;
56
+ border-bottom: 1px solid var(--pr-c-divider-light);
57
+ padding: 0 8px 0 24px;
58
+ height: var(--pr-nav-height);
59
+ transition: border-color 0.5s;
60
+ background-color: var(--pr-navbar-c-bg);
61
+ }
62
+
63
+ @include screen('md') {
64
+ .pr-navbar {
65
+ padding: 0 32px;
66
+ }
67
+ }
68
+
69
+ @include screen('md') {
70
+ .pr-navbar.has-sidebar .content {
71
+ margin-right: -32px;
72
+ padding-right: 32px;
73
+ -webkit-backdrop-filter: saturate(50%) blur(8px);
74
+ backdrop-filter: saturate(50%) blur(8px);
75
+ }
76
+
77
+ @supports not (backdrop-filter: saturate(50%) blur(8px)) {
78
+ .pr-navbar.has-sidebar .content {
79
+ background: rgba(255, 255, 255, 0.95);
80
+ }
81
+
82
+ .dark .pr-navbar.has-sidebar .content {
83
+ background: rgba(36, 36, 36, 0.95);
84
+ }
85
+ }
86
+ }
87
+
88
+ .container {
89
+ display: flex;
90
+ justify-content: space-between;
91
+ margin: 0 auto;
92
+ max-width: calc(var(--pr-layout-max-width) - 64px);
93
+ }
94
+ </style>
@@ -0,0 +1,5 @@
1
+ <template>
2
+ <div class="inline-flex items-center lt-lg:hidden">
3
+ <PressSwitchAppearance />
4
+ </div>
5
+ </template>