valaxy-theme-press 1.0.0-rc.2 → 1.0.0-rc.4
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.
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { useSiteConfig, withBase } from 'valaxy'
|
|
3
|
+
import { computed } from 'vue'
|
|
2
4
|
import { useI18n } from 'vue-i18n'
|
|
3
5
|
|
|
4
6
|
defineProps<{
|
|
@@ -8,6 +10,10 @@ defineProps<{
|
|
|
8
10
|
}>()
|
|
9
11
|
|
|
10
12
|
const { t } = useI18n()
|
|
13
|
+
const siteConfig = useSiteConfig()
|
|
14
|
+
const iconStyle = computed(() => ({
|
|
15
|
+
maskImage: `url("${withBase(siteConfig.value.favicon)}")`,
|
|
16
|
+
}))
|
|
11
17
|
</script>
|
|
12
18
|
|
|
13
19
|
<template>
|
|
@@ -19,7 +25,7 @@ const { t } = useI18n()
|
|
|
19
25
|
>
|
|
20
26
|
<div class="flex justify-center items-center">
|
|
21
27
|
<div class="svg-wrapper">
|
|
22
|
-
<div class="icon" />
|
|
28
|
+
<div class="icon" :style="iconStyle" />
|
|
23
29
|
</div>
|
|
24
30
|
<span>
|
|
25
31
|
{{ t(text) }}
|
|
@@ -48,8 +54,6 @@ const { t } = useI18n()
|
|
|
48
54
|
transform-origin: center center;
|
|
49
55
|
transition: all var(--va-transition-duration) ease-in-out;
|
|
50
56
|
|
|
51
|
-
// mask
|
|
52
|
-
mask-image: url('/favicon.svg');
|
|
53
57
|
mask-size: 100% 100%;
|
|
54
58
|
background-color: white;
|
|
55
59
|
width: 1.2em;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
+
import type { Hero } from '../types'
|
|
2
3
|
import { useFrontmatter } from 'valaxy'
|
|
3
4
|
import { computed } from 'vue'
|
|
4
5
|
import { useLocaleConfig } from '../composables'
|
|
5
6
|
import PressButton from './PressButton.vue'
|
|
6
7
|
|
|
7
8
|
const fm = useFrontmatter()
|
|
9
|
+
const hero = computed(() => fm.value.hero as Hero | undefined)
|
|
8
10
|
|
|
9
11
|
const { currentLocale, currentLocaleKey, hasLocales } = useLocaleConfig()
|
|
10
12
|
|
|
@@ -20,7 +22,7 @@ function resolveLocaleLink(link: string): string {
|
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
const actions = computed(() => {
|
|
23
|
-
return (
|
|
25
|
+
return (hero.value?.actions || []).map(action => ({
|
|
24
26
|
...action,
|
|
25
27
|
link: resolveLocaleLink(action.link),
|
|
26
28
|
}))
|
|
@@ -28,20 +30,23 @@ const actions = computed(() => {
|
|
|
28
30
|
</script>
|
|
29
31
|
|
|
30
32
|
<template>
|
|
31
|
-
<template v-if="
|
|
33
|
+
<template v-if="hero">
|
|
32
34
|
<div text="center" m="md:t-24 t-10 md:t-20" flex="~ col" justify="center" items="center">
|
|
33
|
-
<
|
|
35
|
+
<div v-if="hero.image" class="press-hero-image" mb="2">
|
|
36
|
+
<div class="press-hero-image-bg" />
|
|
37
|
+
<PressImage class="fly-animation h-50" :image="hero.image" />
|
|
38
|
+
</div>
|
|
34
39
|
<h1 my="10" text="4xl md:8xl" font="black" class="gradient-text from-purple-800 to-blue-500 bg-gradient-to-r">
|
|
35
|
-
{{
|
|
40
|
+
{{ hero.name }}
|
|
36
41
|
</h1>
|
|
37
42
|
</div>
|
|
38
43
|
|
|
39
|
-
<h2 v-if="
|
|
40
|
-
{{
|
|
44
|
+
<h2 v-if="hero.text" flex="~ wrap justify-center" px="2" m="b-10" text="center 6xl" font="black" leading="tight">
|
|
45
|
+
{{ hero.text }}
|
|
41
46
|
</h2>
|
|
42
47
|
|
|
43
|
-
<p v-if="
|
|
44
|
-
{{
|
|
48
|
+
<p v-if="hero.tagline" m="b-10" text="center xl" op="80">
|
|
49
|
+
{{ hero.tagline }}
|
|
45
50
|
</p>
|
|
46
51
|
|
|
47
52
|
<div v-if="actions.length" p="2" text="center" class="flex justify-center items-center">
|
|
@@ -64,3 +69,34 @@ const actions = computed(() => {
|
|
|
64
69
|
<br>
|
|
65
70
|
</template>
|
|
66
71
|
</template>
|
|
72
|
+
|
|
73
|
+
<style scoped>
|
|
74
|
+
.press-hero-image {
|
|
75
|
+
position: relative;
|
|
76
|
+
display: inline-flex;
|
|
77
|
+
justify-content: center;
|
|
78
|
+
align-items: center;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.press-hero-image-bg {
|
|
82
|
+
position: absolute;
|
|
83
|
+
border-radius: 50%;
|
|
84
|
+
filter: blur(72px);
|
|
85
|
+
width: 150%;
|
|
86
|
+
height: 150%;
|
|
87
|
+
background-image: linear-gradient(-45deg, rgb(108 34 236) 50%, rgb(59 130 246) 50%);
|
|
88
|
+
opacity: 0.3;
|
|
89
|
+
transition: opacity var(--va-transition-duration-fast);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.press-hero-image:hover .press-hero-image-bg {
|
|
93
|
+
opacity: 0.4;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.press-hero-image :deep(img) {
|
|
97
|
+
position: relative;
|
|
98
|
+
z-index: 1;
|
|
99
|
+
margin: auto;
|
|
100
|
+
object-fit: contain;
|
|
101
|
+
}
|
|
102
|
+
</style>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { ThemeableImage } from '../types'
|
|
3
|
+
import { withBase } from 'valaxy'
|
|
4
|
+
|
|
5
|
+
defineOptions({ inheritAttrs: false })
|
|
6
|
+
|
|
7
|
+
defineProps<{
|
|
8
|
+
image: ThemeableImage
|
|
9
|
+
alt?: string
|
|
10
|
+
}>()
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<template v-if="image">
|
|
15
|
+
<img
|
|
16
|
+
v-if="typeof image === 'string' || 'src' in image"
|
|
17
|
+
v-bind="typeof image === 'string' ? $attrs : { ...image, ...$attrs }"
|
|
18
|
+
:src="withBase(typeof image === 'string' ? image : image.src)"
|
|
19
|
+
:alt="alt ?? (typeof image === 'string' ? '' : image.alt || '')"
|
|
20
|
+
>
|
|
21
|
+
<template v-else>
|
|
22
|
+
<PressImage
|
|
23
|
+
class="dark"
|
|
24
|
+
:image="image.dark"
|
|
25
|
+
:alt="image.alt"
|
|
26
|
+
v-bind="$attrs"
|
|
27
|
+
/>
|
|
28
|
+
<PressImage
|
|
29
|
+
class="light"
|
|
30
|
+
:image="image.light"
|
|
31
|
+
:alt="image.alt"
|
|
32
|
+
v-bind="$attrs"
|
|
33
|
+
/>
|
|
34
|
+
</template>
|
|
35
|
+
</template>
|
|
36
|
+
</template>
|
|
37
|
+
|
|
38
|
+
<style scoped>
|
|
39
|
+
html:not(.dark) img.dark {
|
|
40
|
+
display: none;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.dark img.light {
|
|
44
|
+
display: none;
|
|
45
|
+
}
|
|
46
|
+
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { useSidebar, useSiteConfig } from 'valaxy'
|
|
2
|
+
import { useSidebar, useSiteConfig, withBase } from 'valaxy'
|
|
3
3
|
import { computed } from 'vue'
|
|
4
4
|
import { useLocaleConfig } from '../composables'
|
|
5
5
|
|
|
@@ -24,7 +24,7 @@ const homeLink = computed(() => hasLocales.value ? currentLocale.value.link : '/
|
|
|
24
24
|
class="text-xl flex justify-center items-center font-black gradient-text from-purple-800 to-blue-500 bg-gradient-to-r"
|
|
25
25
|
:to="homeLink" :aria-label="siteConfig.title"
|
|
26
26
|
>
|
|
27
|
-
<img v-if="localeConfig.logo" class="logo" :src="localeConfig.logo" alt="LOGO">
|
|
27
|
+
<img v-if="localeConfig.logo" class="logo" :src="withBase(localeConfig.logo)" alt="LOGO">
|
|
28
28
|
<span class="inline-flex">{{ siteConfig.title }}</span>
|
|
29
29
|
</RouterLink>
|
|
30
30
|
<div class="self-stretch flex justify-center items-center text-sm leading-5">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "valaxy-theme-press",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.4",
|
|
4
4
|
"description": "Docs (VitePress-like) theme for Valaxy",
|
|
5
5
|
"author": {
|
|
6
6
|
"email": "me@yunyoujun.cn",
|
|
@@ -37,6 +37,6 @@
|
|
|
37
37
|
"vitepress": "^2.0.0-alpha.17"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"valaxy": "1.0.0-rc.
|
|
40
|
+
"valaxy": "1.0.0-rc.4"
|
|
41
41
|
}
|
|
42
42
|
}
|
package/types/home.d.ts
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
export type ThemeableImage
|
|
2
|
+
= | string
|
|
3
|
+
| { src: string, alt?: string, [prop: string]: any }
|
|
4
|
+
| { light: string, dark: string, alt?: string, [prop: string]: any }
|
|
5
|
+
|
|
6
|
+
export interface HeroAction {
|
|
7
|
+
theme: 'brand' | 'alt'
|
|
8
|
+
text: string
|
|
9
|
+
link: string
|
|
10
|
+
type?: 'fly'
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface Hero {
|
|
14
|
+
name?: string
|
|
15
|
+
text?: string
|
|
16
|
+
tagline?: string
|
|
17
|
+
image?: ThemeableImage
|
|
18
|
+
actions?: HeroAction[]
|
|
19
|
+
}
|
|
20
|
+
|
|
1
21
|
export interface Feature {
|
|
2
22
|
icon?: string
|
|
3
23
|
title: string
|