Skip to content

Commit

Permalink
fix(theme-yun): nimbo menu header title align center
Browse files Browse the repository at this point in the history
  • Loading branch information
YunYouJun committed Nov 9, 2024
1 parent dace9ab commit 98b7312
Show file tree
Hide file tree
Showing 13 changed files with 94 additions and 65 deletions.
4 changes: 2 additions & 2 deletions demo/yun/theme.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { defineThemeConfig } from 'valaxy-theme-yun'

export default defineThemeConfig({
type: 'strato',
// type: 'nimbo',
// type: 'strato',
type: 'nimbo',
// colors: {
// primary: 'red',
// },
Expand Down
23 changes: 12 additions & 11 deletions packages/valaxy-theme-yun/components/YunFullscreenMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,21 @@ const app = useAppStore()
<YunToggleLocale v-if="app.showToggleLocale" />
</div> -->

<YunFullscreenMenuList>
<YunFullscreenMenuItem
:page="{
name: '站点主页',
icon: 'i-ri-home-2-line',
url: '/',
}"
/>
</YunFullscreenMenuList>

<div v-if="!yunApp.size.isLg" class="mt-4">
<div v-if="!yunApp.size.isLg" class="my-4">
<YunSiteInfo class="text-center" />

<YunGradientDivider class="my-2 op-20" />

<YunPostsInfo />
</div>
<YunGradientDivider v-if="!yunApp.size.isLg" class="my-2 op-20" />

<YunFullscreenMenuList />

<YunGradientDivider v-if="!yunApp.size.isLg" class="my-2 op-20" />
<div v-if="!yunApp.size.isLg" class="flex-center">
<YunConfig />
</div>
</div>
</Transition>
</template>
Expand Down
3 changes: 3 additions & 0 deletions packages/valaxy-theme-yun/components/YunSidebarCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
<YunCard class="p-4 min-h-sm" flex="~ col gap-1">
<YunSiteInfo class="text-center" />
<YunPostsInfo />
<YunGradientDivider class="my-2 op-20" />
<YunSocialLinks />
<YunGradientDivider class="my-2 op-20" />
<YunSidebarLinks />
</YunCard>
</template>
2 changes: 1 addition & 1 deletion packages/valaxy-theme-yun/components/YunSidebarLinks.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const themeConfig = useThemeConfig()
:to="item.url" :title="item.name"
:style="`color:${item.color}`"
>
<div :class="item.icon" class="icon w-8 h-8" />
<div :class="item.icon" class="icon size-6" />
</AppLink>
</div>
</template>
8 changes: 3 additions & 5 deletions packages/valaxy-theme-yun/components/menu/YunNavMenuTitle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,9 @@ function goToLink() {
{{ fm.subtitle }}
</span>
</div>
<Transition>
<span v-if="showSiteTitle" class="font-light truncate">
{{ siteConfig.title }}
</span>
</Transition>
<span v-if="showSiteTitle" class="font-light truncate">
{{ siteConfig.title }}
</span>
</div>
</template>

Expand Down
12 changes: 7 additions & 5 deletions packages/valaxy-theme-yun/components/prologue/PrologueSquare.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,18 @@ const showContent = ref(false)
<YunAuthorName class="mt-3" />
<YunAuthorIntro />

<YunDivider />

<div flex="~ col" class="gap-2 items-center justify-center">
<div
flex="~ col"
class="gap-2 items-center justify-center"
my-4 md:my-6
py-4 md:py-6
border="t-1px b-1px black/60 dark:white/60"
>
<YunSiteTitle />
<YunSiteSubtitle />
<YunSiteDescription />
</div>

<YunDivider />

<div
class="mt-4 flex-center w-64 md:w-100 m-auto gap-2"
flex="~ wrap"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ const yunApp = useYunAppStore()

<template>
<AppLink
class="link-item w-full items-center justify-center md:justify-start gap-2 transition rounded text-2xl p-4 sm:(text-3xl p-6) lg:(text-4xl p-7)"
inline-flex
class="inline-flex link-item items-center justify-center md:justify-start gap-2 transition rounded text-xl p-3 sm:(text-3xl p-6) lg:(text-4xl p-7 w-full)"
:to="page.url" :title="page.name"
:style="`color:${page.color}`"
hover="bg-gray-100/50 dark:bg-gray-800/50"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
<script lang="ts" setup>
import { useAppStore } from 'valaxy'
import { useThemeConfig } from '../../composables'
const app = useAppStore()
const themeConfig = useThemeConfig()
</script>

<template>
<div
class="links flex-center"
flex="~ col" text="left"
class="links flex-center lg:flex-col"
flex="~" text="left"
p="x-$rect-margin"
:class="{
'flex-wrap': app.isMobile,
}"
>
<slot />
<YunFullscreenMenuItem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,23 @@ const app = useAppStore()
}"
>
<!-- -->
<ValaxyHamburger
:active="yunApp.fullscreenMenu.isOpen"
class="menu-btn sidebar-toggle leading-4 size-12"
inline-flex cursor="pointer"
hover="bg-white/80 dark:bg-black/80"
z="$yun-z-menu-btn"
@click="yunApp.fullscreenMenu.toggle()"
/>
<YunNavMenuItem icon="i-ri-home-4-line" to="/" />
<div class="inline-flex justify-start items-center flex-1">
<ValaxyHamburger
:active="yunApp.fullscreenMenu.isOpen"
class="menu-btn sidebar-toggle leading-4 size-12"
inline-flex cursor="pointer"
hover="bg-white/80 dark:bg-black/80"
z="$yun-z-menu-btn"
@click="yunApp.fullscreenMenu.toggle()"
/>
<YunNavMenuItem icon="i-ri-home-4-line" to="/" />
</div>

<div class="flex flex-1 flex-center">
<YunNavMenuTitle />
</div>

<div class="inline-flex-center">
<div class="inline-flex-center justify-end items-center flex-1">
<!-- <template v-if="!app.isMobile && themeConfig.nav">
<template v-for="item in themeConfig.nav" :key="item.text">
<AppLink
Expand Down
24 changes: 24 additions & 0 deletions packages/valaxy-theme-yun/components/ui/YunGradientDivider.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<template>
<div class="yun-gradient-line" />
</template>

<style lang="scss">
.yun-gradient-line {
--c-end: rgba(0 0 0 / 0);
--c-mid: rgba(0 0 0 / 1);
}
.dark {
.yun-gradient-line {
--c-end: rgba(255 255 255 / 0);
--c-mid: rgba(255 255 255 / 1);
}
}
/* stylelint-disable-next-line no-duplicate-selectors */
.yun-gradient-line {
width: 100%;
height: 1px;
background: linear-gradient(to right, var(--c-end) 0%, var(--c-mid) 50%, var(--c-end) 100%);
}
</style>
21 changes: 9 additions & 12 deletions packages/valaxy-theme-yun/layouts/collection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@
</script>

<template>
<YunSidebar v-if="$slots['sidebar-child']">
<slot name="sidebar-child" />
</YunSidebar>
<YunSidebar v-else />

<RouterView v-slot="{ Component }">
<component :is="Component">
<div flex="~ wrap" gap="4">
Collection
</div>
</component>
</RouterView>
<YunLayoutWrapper>
<RouterView v-slot="{ Component }">
<component :is="Component">
<div flex="~ wrap" gap="4">
Collection
</div>
</component>
</RouterView>
</YunLayoutWrapper>
</template>
27 changes: 12 additions & 15 deletions packages/valaxy-theme-yun/layouts/collections.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,16 @@ const { collections } = useCollections()
</script>

<template>
<YunSidebar v-if="$slots['sidebar-child']">
<slot name="sidebar-child" />
</YunSidebar>
<YunSidebar v-else />

<RouterView v-slot="{ Component }">
<component :is="Component">
<div flex="~ wrap" gap="4">
<YunCollectionItem
v-for="collection in collections" :key="collection.id"
:collection="collection"
/>
</div>
</component>
</RouterView>
<YunLayoutWrapper>
<RouterView v-slot="{ Component }">
<component :is="Component">
<div flex="~ wrap" gap="4">
<YunCollectionItem
v-for="collection in collections" :key="collection.id"
:collection="collection"
/>
</div>
</component>
</RouterView>
</YunLayoutWrapper>
</template>
1 change: 1 addition & 0 deletions packages/valaxy/node/modules/rss/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ export async function getPosts(params: {
return false
// skip draft post
if (data.draft) {
// TODO: console draftPosts
draftPosts.push(p)
return false
}
Expand Down

1 comment on commit 98b7312

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 Published on https://yun.valaxy.site as production
🚀 Deployed on https://672f93f6ab98e488935f8548--valaxy.netlify.app

Please sign in to comment.