valaxy-theme-hairy 0.1.4 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- package/components/HairyNav.vue +7 -4
- package/components/HairyNavMenu.vue +11 -0
- package/components/HairyUserCard.vue +1 -1
- package/components/HairyUserPopup.vue +35 -0
- package/hooks/useContext.ts +5 -8
- package/layouts/hairy.vue +1 -0
- package/package.json +2 -1
- package/setup/main.ts +0 -2
- package/modules/context.ts +0 -5
package/components/HairyNav.vue
CHANGED
@@ -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
|
26
|
-
<HairyNavTitle
|
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
|
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>
|
@@ -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'
|
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>
|
package/hooks/useContext.ts
CHANGED
@@ -1,16 +1,13 @@
|
|
1
1
|
import { ref } from 'vue'
|
2
|
-
import {
|
2
|
+
import { createSharedComposable } from '@vueuse/core'
|
3
3
|
|
4
|
-
const
|
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
|
13
|
+
export const useContext = createSharedComposable(_useContext)
|
package/layouts/hairy.vue
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "valaxy-theme-hairy",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.2.0",
|
4
4
|
"packageManager": "pnpm@7.5.0",
|
5
5
|
"author": {
|
6
6
|
"email": "wwu710632@gmail.com",
|
@@ -24,6 +24,7 @@
|
|
24
24
|
"@hairy/vue-use": "^1.2.0",
|
25
25
|
"@iconify-json/ant-design": "^1.1.3",
|
26
26
|
"@iconify-json/simple-icons": "^1.1.19",
|
27
|
+
"@iconify-json/fluent": "^1.1.18",
|
27
28
|
"@vueuse/core": "^8.9.4",
|
28
29
|
"@waline/client": "^2.6.1",
|
29
30
|
"animate.css": "^4.1.1",
|
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
|
})
|