valaxy-theme-hairy 0.1.5 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -22,11 +22,14 @@ const show = computed(() => {
22
22
  <template>
23
23
  <div class="HairyNav fixed w-full h-3.125rem top-0 z-20 opacity-0 transition-opacity duration-200" :class="[show && 'opacity-100']">
24
24
  <div class="mx-auto breakpoint flex relative z-1">
25
- <div class="flex-1 flex items-center">
26
- <HairyNavTitle class="lt-sm:hidden" />
27
- <HairyMenu />
25
+ <div class="flex items-center lt-sm:order-1 lt-sm:flex-1 justify-center">
26
+ <HairyNavTitle />
28
27
  </div>
29
- <div class="flex-center lt-sm:hidden">
28
+ <div class="flex items-center sm:flex-1">
29
+ <HairyNavMenu class="sm:hidden pl-3 pr-12" />
30
+ <HairyMenu class="lt-sm:hidden" />
31
+ </div>
32
+ <div class="flex-center order-1">
30
33
  <HairyNavToggleDark />
31
34
  <HairyNavSearch />
32
35
  </div>
@@ -0,0 +1,11 @@
1
+ <script lang="ts" setup>
2
+ import { useContext } from '../hooks/useContext'
3
+
4
+ const { drawerShow } = useContext()
5
+ </script>
6
+
7
+ <template>
8
+ <button class="yun-icon-btn" @click="drawerShow = true">
9
+ <div i="ri-menu-fill" />
10
+ </button>
11
+ </template>
@@ -11,7 +11,7 @@ const description = computed(() => theme.value.user?.description || config.value
11
11
  </script>
12
12
 
13
13
  <template>
14
- <div class="pt-5 animate__animated animate__fadeIn">
14
+ <div class="pt-5 animate__animated animate__fadeIn relative z-1">
15
15
  <div class="flex flex-col items-center">
16
16
  <img class="mx-auto w-40 rounded-full -mx-1px" :src="config.author.avatar" />
17
17
  <div class="leading-loose mt-2">
@@ -0,0 +1,35 @@
1
+ <script lang="ts" setup>
2
+ import { ElDrawer } from 'element-plus/es/components/drawer/index'
3
+ import 'element-plus/es/components/drawer/style/index'
4
+ import { useContext } from '../hooks/useContext'
5
+ const { drawerShow } = useContext()
6
+ </script>
7
+
8
+ <template>
9
+ <el-drawer v-model="drawerShow" size="auto" @close="drawerShow = false">
10
+ <HairyUserCard />
11
+ <div class="dark:hidden absolute inset-0 bg-white bg-opacity-85 blur-5" />
12
+ </el-drawer>
13
+ </template>
14
+
15
+ <style lang="scss">
16
+ .el-drawer {
17
+ .el-drawer__header {
18
+ position: relative;
19
+ z-index: 1;
20
+ }
21
+
22
+ background-color: transparent;
23
+ .el-icon.el-drawer__close {
24
+ font-size: 24px;
25
+ }
26
+ @media (max-width: 420px) {
27
+ width: 100% !important;
28
+ }
29
+ }
30
+ .dark {
31
+ .el-drawer {
32
+ background: radial-gradient(black, transparent);
33
+ }
34
+ }
35
+ </style>
@@ -1,16 +1,13 @@
1
1
  import { ref } from 'vue'
2
- import { createContext } from '../utils/createContext'
2
+ import { createSharedComposable } from '@vueuse/core'
3
3
 
4
- const HairyContext = createContext('Hairy', () => {
4
+ const _useContext = () => {
5
5
  const headerRef = ref<HTMLDivElement>()
6
-
6
+ const drawerShow = ref(false)
7
7
  return {
8
8
  headerRef,
9
+ drawerShow,
9
10
  }
10
- })
11
-
12
- export const useContext = () => {
13
- return HairyContext.inject()
14
11
  }
15
12
 
16
- export default HairyContext
13
+ export const useContext = createSharedComposable(_useContext)
package/layouts/hairy.vue CHANGED
@@ -22,6 +22,7 @@ setupDefaultDark()
22
22
  <template>
23
23
  <HairyBackToTop />
24
24
  <HairyMeting />
25
+ <HairyUserPopup />
25
26
  <home v-if="type === 'home'" />
26
27
  <post v-if="type === 'post'" />
27
28
  <archives v-if="type === 'archives'" />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valaxy-theme-hairy",
3
- "version": "0.1.5",
3
+ "version": "0.2.1",
4
4
  "packageManager": "pnpm@7.5.0",
5
5
  "author": {
6
6
  "email": "wwu710632@gmail.com",
package/setup/main.ts CHANGED
@@ -2,10 +2,8 @@ import { defineAppSetup } from 'valaxy'
2
2
 
3
3
  // import { install as installScroll } from '../modules/scroll'
4
4
  import { install as installLoading } from '../modules/loading'
5
- import { install as installContext } from '../modules/context'
6
5
 
7
6
  export default defineAppSetup((ctx) => {
8
7
  // installScroll(ctx)
9
8
  installLoading(ctx)
10
- installContext(ctx)
11
9
  })
@@ -1,5 +0,0 @@
1
- import HairyContext from '../hooks/useContext'
2
- import type { UserModule } from '..'
3
- export const install: UserModule = ({ app }) => {
4
- app.provide(HairyContext.key, HairyContext.getter())
5
- }