valaxy-theme-yun 0.14.35 → 0.14.37

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.
@@ -19,8 +19,12 @@ const app = useAppStore()
19
19
  <ValaxyOverlay :show="app.isRightSidebarOpen" @click="app.toggleRightSidebar()" />
20
20
 
21
21
  <!-- -->
22
- <aside class="va-card yun-aside" :class="app.isRightSidebarOpen && 'open'" m="l-4" text="center">
23
- <div class="aside-container" flex="~ col" overflow="auto">
22
+ <aside
23
+ class="va-card yun-aside"
24
+ :class="app.isRightSidebarOpen && 'open'" m="l-4" text="center"
25
+ overflow="auto"
26
+ >
27
+ <div class="aside-container" flex="~ col">
24
28
  <h2 v-if="frontmatter.toc !== false" m="t-6 b-2" font="serif black">
25
29
  {{ t('sidebar.toc') }}
26
30
  </h2>
@@ -57,6 +57,8 @@ const bannerStyles = computed<CSSProperties>(() => {
57
57
  </template>
58
58
 
59
59
  <style lang="scss">
60
+ @use "../styles/widgets/banner.scss" as *;
61
+
60
62
  :root {
61
63
  // banner
62
64
  --banner-line-color: black;
@@ -3,7 +3,7 @@ defineProps<{ cover?: string }>()
3
3
  </script>
4
4
 
5
5
  <template>
6
- <div class="yun-card">
6
+ <div class="yun-card flex-center" flex="col" min-h="100px" bg="$va-c-bg-light">
7
7
  <img
8
8
  v-if="cover"
9
9
  width="640" height="360"
@@ -21,17 +21,3 @@ defineProps<{ cover?: string }>()
21
21
  </div>
22
22
  </div>
23
23
  </template>
24
-
25
- <style lang="scss">
26
- .yun-card {
27
- display: flex;
28
- justify-content: center;
29
- align-items: center;
30
- flex-direction: column;
31
-
32
- min-height: 100px;
33
-
34
- // todo
35
- background-color: var(--va-c-bg-light);
36
- }
37
- </style>
@@ -16,7 +16,7 @@ const YunTwikoo = runtimeConfig.value.addons['valaxy-addon-twikoo']
16
16
  </script>
17
17
 
18
18
  <template>
19
- <YunCard w="full" p="4" class="comment sm:p-6 lg:px-12 xl:px-16">
19
+ <YunCard w="full" p="4" class="comment markdown-body sm:p-6 lg:px-12 xl:px-16">
20
20
  <ClientOnly>
21
21
  <YunWaline />
22
22
  <YunTwikoo />
@@ -7,13 +7,16 @@ const router = useRouter()
7
7
  </script>
8
8
 
9
9
  <template>
10
- <div class="sidebar-panel">
10
+ <div class="sidebar-panel" p="2">
11
11
  <div class="site-info" m="t-6">
12
12
  <router-link class="site-author-avatar" to="/about">
13
13
  <img class="rounded-full" :src="siteConfig.author.avatar" alt="avatar">
14
14
  <span class="site-author-status">{{ siteConfig.author.status.emoji }}</span>
15
15
  </router-link>
16
- <div class="site-author-name">
16
+ <div
17
+ class="site-author-name leading-6"
18
+ m="t-0 b-4"
19
+ >
17
20
  <router-link to="/about">
18
21
  {{ siteConfig.author.name }}
19
22
  </router-link>
@@ -44,10 +47,6 @@ const router = useRouter()
44
47
  <style lang="scss">
45
48
  @use "valaxy/client/styles/mixins/index.scss" as *;
46
49
 
47
- .sidebar-panel {
48
- padding: 0.5rem;
49
- }
50
-
51
50
  .site-info {
52
51
  &.fix-top {
53
52
  margin-top: -1.5rem;
@@ -75,12 +74,6 @@ const router = useRouter()
75
74
  }
76
75
  }
77
76
 
78
- .site-author-name {
79
- margin-top: 0;
80
- margin-bottom: 1rem;
81
- line-height: 1.5;
82
- }
83
-
84
77
  .site-author-status {
85
78
  position: absolute;
86
79
  height: 1.8rem;
@@ -1,29 +1,72 @@
1
1
  <script lang="ts" setup>
2
2
  import { ref } from 'vue'
3
+ import { useAppStore, useLayout } from 'valaxy'
3
4
 
5
+ const app = useAppStore()
4
6
  const showOverview = ref(false)
7
+ const isHome = useLayout('home')
5
8
  </script>
6
9
 
7
10
  <template>
8
- <div v-if="$slots.default" class="sidebar-nav" m="t-6">
9
- <button m="x-4" class="sidebar-nav-item yun-icon-btn" :class="showOverview && 'active'" @click="showOverview = true">
10
- <div i-ri-passport-line />
11
- </button>
12
- <button m="x-4" class="sidebar-nav-item yun-icon-btn" :class="!showOverview && 'active'" @click="showOverview = false">
13
- <div i-ri-list-ordered />
14
- </button>
15
- </div>
16
-
17
- <div v-if="showOverview || !$slots.default" :class="$slots.default && '-mt-4'">
18
- <YunOverview />
19
- </div>
20
-
21
- <div v-else>
22
- <slot />
23
- </div>
11
+ <ValaxyOverlay class="md:hidden" :show="app.isSidebarOpen" @click="app.toggleSidebar()" />
12
+
13
+ <ValaxyHamburger
14
+ :active="app.isSidebarOpen"
15
+ class="menu-btn sidebar-toggle yun-icon-btn leading-4 fixed left-0.8rem top-0.6rem"
16
+ inline-flex cursor="pointer" z="$yun-z-menu-btn"
17
+ :class="isHome ? '' : 'md:hidden'" @click="app.toggleSidebar()"
18
+ />
19
+
20
+ <aside
21
+ class="va-card transition sidebar fixed inset-y-0 left-0 overflow-y-auto"
22
+ :class="[app.isSidebarOpen && 'open', !isHome && 'md:translate-x-0']"
23
+ text="center" bg="$yun-sidebar-bg-color contain no-repeat" z="$yun-z-sidebar"
24
+ >
25
+ <div v-if="$slots.default" class="sidebar-nav" m="t-6">
26
+ <button
27
+ m="x-4" class="sidebar-nav-item yun-icon-btn"
28
+ :class="showOverview && 'active'" @click="showOverview = true"
29
+ >
30
+ <div i-ri-passport-line />
31
+ </button>
32
+ <button
33
+ m="x-4" class="sidebar-nav-item yun-icon-btn"
34
+ :class="!showOverview && 'active'" @click="showOverview = false"
35
+ >
36
+ <div i-ri-list-ordered />
37
+ </button>
38
+ </div>
39
+
40
+ <div v-if="showOverview || !$slots.default" :class="$slots.default && '-mt-4'">
41
+ <YunOverview />
42
+ </div>
43
+
44
+ <div v-else>
45
+ <slot />
46
+ </div>
47
+ </aside>
24
48
  </template>
25
49
 
26
50
  <style lang="scss">
51
+ @use "sass:map";
52
+
53
+ .sidebar {
54
+ width: calc(100vw - 64px);
55
+ max-width: var(--va-sidebar-width);
56
+
57
+ background-image: var(--yun-sidebar-bg-img);
58
+ background-position: bottom 1rem center;
59
+
60
+ transform: translateX(-100%);
61
+ transition: box-shadow var(--va-transition-duration),
62
+ background-color var(--va-transition-duration), opacity 0.25s,
63
+ transform var(--va-transition-duration) cubic-bezier(0.19, 1, 0.22, 1) !important;
64
+
65
+ &.open {
66
+ transform: translateX(0);
67
+ }
68
+ }
69
+
27
70
  .sidebar-nav {
28
71
  .sidebar-nav-item {
29
72
  color: var(--va-c-primary);
@@ -5,27 +5,13 @@ const themeConfig = useThemeConfig()
5
5
  </script>
6
6
 
7
7
  <template>
8
- <div class="links">
9
- <AppLink v-for="item, i in themeConfig.pages" :key="i" class="link-item yun-icon-btn" :to="item.url" :title="item.name" :style="`color:${item.color}`">
10
- <div :class="item.icon" class="icon" />
8
+ <div class="links flex-center">
9
+ <AppLink
10
+ v-for="item, i in themeConfig.pages" :key="i"
11
+ class="link-item yun-icon-btn" inline-flex
12
+ :to="item.url" :title="item.name" :style="`color:${item.color}`"
13
+ >
14
+ <div :class="item.icon" class="icon w-8 h-8" />
11
15
  </AppLink>
12
16
  </div>
13
17
  </template>
14
-
15
- <style lang="scss">
16
- .sidebar {
17
- .links {
18
- display: flex;
19
- justify-content: center;
20
- }
21
-
22
- .link-item {
23
- display: inline-flex;
24
-
25
- .icon {
26
- width: 2rem;
27
- height: 2rem;
28
- }
29
- }
30
- }
31
- </style>
package/layouts/home.vue CHANGED
@@ -13,12 +13,11 @@ const isPage = computed(() => route.path.startsWith('/page'))
13
13
  </script>
14
14
 
15
15
  <template>
16
- <main class="yun-main justify-center items-center" :class="(isHome && !app.isSidebarOpen) && 'pl-0'" flex="~ col" w="full">
17
- <ValaxySidebar>
18
- <slot name="sidebar">
19
- <YunSidebar />
20
- </slot>
21
- </ValaxySidebar>
16
+ <main
17
+ class="yun-main flex-center"
18
+ :class="(isHome && !app.isSidebarOpen) && 'pl-0'" flex="~ col" w="full"
19
+ >
20
+ <YunSidebar />
22
21
 
23
22
  <template v-if="!isPage">
24
23
  <YunBanner v-if="themeConfig.banner.enable" />
@@ -3,14 +3,10 @@ import { asAny } from 'valaxy'
3
3
  </script>
4
4
 
5
5
  <template>
6
- <ValaxySidebar>
7
- <slot name="sidebar">
8
- <YunSidebar v-if="$slots['sidebar-child']">
9
- <slot name="sidebar-child" />
10
- </YunSidebar>
11
- <YunSidebar v-else />
12
- </slot>
13
- </ValaxySidebar>
6
+ <YunSidebar v-if="$slots['sidebar-child']">
7
+ <slot name="sidebar-child" />
8
+ </YunSidebar>
9
+ <YunSidebar v-else />
14
10
 
15
11
  <router-view v-slot="{ Component }">
16
12
  <component :is="asAny(Component)">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valaxy-theme-yun",
3
- "version": "0.14.35",
3
+ "version": "0.14.37",
4
4
  "author": {
5
5
  "email": "me@yunyoujun.cn",
6
6
  "name": "YunYouJun",
@@ -18,12 +18,12 @@
18
18
  "types": "types/index.d.ts",
19
19
  "dependencies": {
20
20
  "@iconify-json/ant-design": "^1.1.5",
21
- "@iconify-json/simple-icons": "^1.1.55",
21
+ "@iconify-json/simple-icons": "^1.1.59",
22
22
  "animejs": "^3.2.1",
23
23
  "valaxy-addon-waline": "0.1.0"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@types/animejs": "^3.1.7",
27
- "valaxy": "0.14.35"
27
+ "valaxy": "0.14.37"
28
28
  }
29
29
  }
@@ -0,0 +1,133 @@
1
+ $banner-animation-duration: 1s;
2
+ $char-animation-duration: 0.4s;
3
+
4
+ #banner {
5
+ --banner-line-height: 0;
6
+ --line-animation-duration: 0.4s;
7
+
8
+ position: relative;
9
+ display: flex;
10
+ flex-direction: column;
11
+ justify-content: center;
12
+ align-items: center;
13
+ width: 100%;
14
+ height: var(--banner-container-height, 100vh);
15
+ }
16
+
17
+ .banner-char-container {
18
+ display: flex;
19
+ flex-direction: column;
20
+ align-items: center;
21
+ }
22
+
23
+ .banner-line-container {
24
+ position: relative;
25
+ display: flex;
26
+ flex-direction: column;
27
+ align-items: center;
28
+ height: var(--banner-line-height);
29
+
30
+ &.bottom {
31
+ justify-content: end;
32
+ }
33
+ }
34
+
35
+ .vertical-line {
36
+ &-top,
37
+ &-bottom {
38
+ display: flex;
39
+ background-color: var(--banner-line-color);
40
+ width: 1px;
41
+ height: 0;
42
+ animation-name: extend-line;
43
+ animation-duration: var(--line-animation-duration);
44
+ animation-fill-mode: forwards;
45
+ animation-timing-function: ease-in;
46
+ }
47
+
48
+ &-bottom {
49
+ flex-direction: column-reverse;
50
+ }
51
+ }
52
+
53
+ @keyframes extend-line {
54
+ from {
55
+ height: 0;
56
+ }
57
+
58
+ to {
59
+ height: var(--banner-line-height);
60
+ }
61
+ }
62
+
63
+ .char {
64
+ font-family: var(--va-font-serif);
65
+ font-weight: 900;
66
+ font-size: var(--banner-char-size, 1rem);
67
+ background-color: var(--banner-char-bg-color);
68
+ line-height: 1;
69
+
70
+ transition: all 0.3s ease-in-out;
71
+ transition-delay: 0s;
72
+
73
+ &:hover {
74
+ color: var(--banner-char-hover-color);
75
+ background-color: var(--banner-char-color);
76
+ }
77
+
78
+ &-left,
79
+ &-right {
80
+ display: flex;
81
+ color: var(--banner-char-color);
82
+ opacity: 0;
83
+ }
84
+
85
+ &-left {
86
+ border-left: 1px solid var(--banner-line-color);
87
+ border-right: 0px solid rgba(var(--va-c-primary-rgb), 0.1);
88
+ border-right-width: 0px;
89
+ animation-name: char-move-left;
90
+ animation-duration: $char-animation-duration;
91
+ animation-delay: var(--line-animation-duration);
92
+ animation-fill-mode: forwards;
93
+ animation-timing-function: ease-out;
94
+ }
95
+
96
+ &-right {
97
+ border-left: 0px solid rgba(var(--va-c-primary-rgb), 0.1);
98
+ border-right: 1px solid var(--banner-line-color);
99
+ border-left-width: 0px;
100
+ animation-name: char-move-right;
101
+ animation-duration: $char-animation-duration;
102
+ animation-delay: var(--line-animation-duration);
103
+ animation-fill-mode: forwards;
104
+ animation-timing-function: ease-out;
105
+ }
106
+ }
107
+
108
+ @keyframes char-move-left {
109
+ from {
110
+ opacity: 0;
111
+ border-right-width: 0;
112
+ }
113
+
114
+ to {
115
+ opacity: 1;
116
+ border-right-width: var(
117
+ --banner-empty-border-size,
118
+ var(--banner-char-size)
119
+ );
120
+ }
121
+ }
122
+
123
+ @keyframes char-move-right {
124
+ from {
125
+ opacity: 0;
126
+ border-left-width: 0;
127
+ }
128
+
129
+ to {
130
+ opacity: 1;
131
+ border-left-width: var(--banner-empty-border-size, var(--banner-char-size));
132
+ }
133
+ }