valaxy-theme-press 0.0.3 → 0.1.0

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 (58) hide show
  1. package/README.md +7 -0
  2. package/assets/images/none.jpg +0 -0
  3. package/components/PressAlgoliaSearch.vue +208 -0
  4. package/components/PressArticle.vue +12 -6
  5. package/components/PressAside.vue +24 -17
  6. package/components/PressBackdrop.vue +1 -1
  7. package/components/PressButton.vue +5 -1
  8. package/components/PressCategories.vue +8 -3
  9. package/components/PressCategory.vue +13 -11
  10. package/components/PressDocFooterLastUpdated.vue +2 -1
  11. package/components/PressFeatures.vue +1 -1
  12. package/components/PressFooter.vue +1 -1
  13. package/components/PressHome.vue +1 -1
  14. package/components/PressHomeFeatures.vue +1 -0
  15. package/components/PressHomeHero.vue +12 -10
  16. package/components/PressLocalNav.vue +9 -9
  17. package/components/PressNav.vue +30 -5
  18. package/components/PressNavBar.vue +94 -0
  19. package/components/PressNavBarAppearance.vue +5 -0
  20. package/components/PressNavBarHamburger.vue +79 -0
  21. package/components/PressNavBarMenu.vue +14 -0
  22. package/components/PressNavBarSearch.vue +40 -0
  23. package/components/PressNavBarSocialLinks.vue +26 -0
  24. package/components/PressNavBarTranslations.vue +5 -0
  25. package/components/{nav/PressNavItemGroup.vue → PressNavItemGroup.vue} +8 -5
  26. package/components/{nav/PressNavItemLink.vue → PressNavItemLink.vue} +2 -1
  27. package/components/PressNavScreen.vue +95 -0
  28. package/components/PressNavScreenAppearance.vue +32 -0
  29. package/components/PressNavScreenMenu.vue +22 -0
  30. package/components/PressNavScreenMenuGroup.vue +115 -0
  31. package/components/PressNavScreenMenuGroupLink.vue +32 -0
  32. package/components/PressNavScreenMenuGroupSection.vue +37 -0
  33. package/components/PressNavScreenMenuLink.vue +33 -0
  34. package/components/PressNavScreenSocialLinks.vue +13 -0
  35. package/components/PressNavScreenTranslations.vue +7 -0
  36. package/components/PressOutline.vue +3 -4
  37. package/components/PressPostList.vue +6 -6
  38. package/components/PressSidebar.vue +10 -9
  39. package/components/PressSocialLink.vue +40 -0
  40. package/components/PressSocialLinks.vue +26 -0
  41. package/components/ValaxyMain.vue +46 -33
  42. package/composables/config.ts +0 -1
  43. package/composables/nav.ts +37 -0
  44. package/config/index.ts +5 -2
  45. package/layouts/layout.vue +2 -3
  46. package/locales/en.yml +4 -0
  47. package/locales/zh-CN.yml +4 -0
  48. package/package.json +3 -13
  49. package/pages/{[..all].vue → [...all].vue} +1 -0
  50. package/setup/main.ts +16 -3
  51. package/styles/css-vars.scss +11 -6
  52. package/styles/markdown.scss +9 -12
  53. package/tsconfig.json +11 -11
  54. package/types/index.d.ts +20 -5
  55. package/utils/index.ts +8 -0
  56. package/components/DocsBoard.vue +0 -24
  57. package/components/nav/PressNavBar.vue +0 -111
  58. /package/components/{nav/PressSwitchAppearance.vue → PressSwitchAppearance.vue} +0 -0
package/README.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  This is a theme for valaxy docs.
4
4
 
5
+ Inspired by [vitepress](https://vitepress.dev).
6
+
7
+ 我开发此主题以编写 Valaxy 的初期文档,同时以便发现 valaxy 编写主题中的痛点。
8
+ <!-- 它增加了 VitePress 一些所没有的功能,而随着 VitePress 的完善,该主题将不再被维护,文档也将在未来迁移至 VitePress。 -->
9
+
10
+ - [预览](https://press.valaxy.site)
11
+
5
12
  ## Reference
6
13
 
7
14
  - [vitepress](https://vitepress.vuejs.org/)
Binary file
@@ -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()
@@ -19,34 +18,33 @@ const app = useAppStore()
19
18
  <ValaxyOverlay :show="app.isRightSidebarOpen" @click="app.toggleRightSidebar()" />
20
19
 
21
20
  <aside
22
- class="press-aside lt-xl:fixed shadow
23
- press-card xl:(shadow-none hover:shadow-none) hover:shadow-lg"
21
+ class="press-aside lt-xl:fixed shadow xl:(shadow-none hover:shadow-none) hover:shadow-lg"
22
+ flex="~ col grow"
24
23
  p="l-0 xl:l-8" text="center"
25
- z="5"
24
+ z="$"
26
25
  :class="app.isRightSidebarOpen && 'open'"
27
26
  >
27
+ <div class="aside-curtain" />
28
28
  <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 />
29
+ <div class="aside-content overflow-auto" flex="~ col">
30
+ <PressOutline v-if="frontmatter.toc !== false" />
31
+ <div class="flex-grow" />
32
+ <div v-if="$slots.default" class="custom-container">
33
+ <slot />
34
+ </div>
33
35
  </div>
34
36
  </div>
35
37
  </aside>
36
38
  </template>
37
39
 
38
40
  <style lang="scss">
39
- @use 'valaxy/client/styles/mixins' as *;
40
-
41
- .press-card{
42
- background-color: var(--va-c-bg);
43
- }
41
+ @use 'valaxy/client/styles/mixins/index.scss' as *;
44
42
 
45
43
  .press-aside {
46
44
  top: 0;
47
45
  bottom: 0;
48
46
  right: 0;
49
- z-index: var(--pr-z-index-aside);
47
+ z-index: var(--pr-z-aside);
50
48
  width: var(--va-aside-width);
51
49
 
52
50
  transform: translateX(100%);
@@ -67,10 +65,19 @@ const app = useAppStore()
67
65
  top: 0;
68
66
  margin-top: calc(var(--pr-nav-height) * -1 - 20px);
69
67
  padding-top: calc(var(--pr-nav-height) + 20px);
70
- height: calc(100vh - var(--pr-nav-height) - 32px);
68
+ height: 100vh;
69
+ }
70
+
71
+ .aside-curtain {
72
+ position: fixed;
73
+ bottom: 0;
74
+ z-index: 10;
75
+ width: 220px;
76
+ height: 32px;
77
+ background: linear-gradient(transparent,var(--va-c-bg) 70%);
71
78
  }
72
79
 
73
- @include media('xl') {
80
+ @include screen('xl') {
74
81
  .aside-container {
75
82
  top: 0;
76
83
  }
@@ -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
 
@@ -1,6 +1,8 @@
1
1
  <script lang="ts" setup>
2
2
  import { computed } from 'vue'
3
3
 
4
+ import { useI18n } from 'vue-i18n'
5
+
4
6
  const props = defineProps<{
5
7
  theme: 'brand' | 'alt'
6
8
  link: string
@@ -16,6 +18,8 @@ const classes = computed(() => {
16
18
 
17
19
  return arr
18
20
  })
21
+
22
+ const { t } = useI18n()
19
23
  </script>
20
24
 
21
25
  <template>
@@ -26,6 +30,6 @@ const classes = computed(() => {
26
30
  class="sese-btn btn rounded-full hover:shadow-lg" bg="gradient-to-r"
27
31
  p="x-6"
28
32
  >
29
- {{ text }}
33
+ {{ t(text) }}
30
34
  </AppLink>
31
35
  </template>
@@ -2,6 +2,7 @@
2
2
  import { useThemeConfig } from 'valaxy'
3
3
  import type { Categories } from 'valaxy'
4
4
  import { computed, ref } from 'vue'
5
+ import type { PressTheme } from '../types'
5
6
 
6
7
  const props = withDefaults(defineProps<{
7
8
  categories: Categories
@@ -18,15 +19,19 @@ const props = withDefaults(defineProps<{
18
19
 
19
20
  const collapsable = ref(props.collapsable)
20
21
 
21
- const themeConfig = useThemeConfig()
22
+ const themeConfig = useThemeConfig<PressTheme.Config>()
22
23
  const sidebar = computed(() => themeConfig.value.sidebar)
24
+
25
+ function getCategoryByName(name: string) {
26
+ return props.categories.find(c => c.name === name)
27
+ }
23
28
  </script>
24
29
 
25
30
  <template>
26
31
  <ul v-for="item in sidebar" :key="item" class="category-list">
27
32
  <PressCategory
28
- v-if="categories.get(item)"
29
- :name="item" :category="categories.get(item)"
33
+ v-if="getCategoryByName(item)"
34
+ :category="getCategoryByName(item)"
30
35
  :level="level + 1"
31
36
  :display-category="displayCategory"
32
37
  :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') : t(`category.${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>
@@ -1,9 +1,10 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, onMounted, ref, watchEffect } from 'vue'
3
3
  import { useData, useThemeConfig } from 'valaxy'
4
+ import type { PressTheme } from '../types'
4
5
 
5
6
  const data = useData()
6
- const themeConfig = useThemeConfig()
7
+ const themeConfig = useThemeConfig<PressTheme.Config>()
7
8
 
8
9
  const date = computed(() => new Date(data.lastUpdated!))
9
10
  const isoDatetime = computed(() => date.value.toISOString())
@@ -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
 
@@ -1,24 +1,26 @@
1
1
  <script lang="ts" setup>
2
2
  import { useFrontmatter } from 'valaxy'
3
+ import { useI18n } from 'vue-i18n'
3
4
  import PressButton from './PressButton.vue'
4
5
 
5
6
  const fm = useFrontmatter()
7
+
8
+ const { t } = useI18n()
6
9
  </script>
7
10
 
8
11
  <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">
12
+ <div text="center" m="md:t-24 t-10 md:t-20" flex="~ col" justify="center" items="center">
13
+ <ValaxyLogo mb="2" />
14
+ <h1 my="10" text="4xl md:8xl" font="black" class="gradient-text from-purple-800 to-blue-500" bg="gradient-to-r">
11
15
  {{ fm.hero.name }}
12
- </span>
13
- <br>
14
- <small opacity="75">LOGO NOT READY</small>
15
- </h1>
16
+ </h1>
17
+ </div>
16
18
 
17
- <h1 m="y-10" text="center 6xl" font="black" leading="tight">
18
- Next Generation
19
+ <h2 m="b-10" text="center 6xl" font="black" leading="tight">
20
+ {{ t('banner.next-generation') }}
19
21
  <br>
20
- Static <span class="gradient-text from-blue-500 to-purple-700" bg="gradient-to-r">Blog</span> Framework
21
- </h1>
22
+ {{ t('banner.static') }} <span class="gradient-text from-blue-500 to-purple-700" bg="gradient-to-r">{{ t('banner.blog') }}</span> {{ t('banner.framework') }}
23
+ </h2>
22
24
 
23
25
  <div p="2" text="center">
24
26
  <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);