themekit-js 1.1.3 → 1.1.5
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.
- package/README.md +50 -1
- package/dist/client/app/data.js +3 -0
- package/dist/client/app/index.js +23 -1
- package/dist/client/app/router.js +8 -4
- package/dist/client/app/utils.js +6 -5
- package/dist/client/index.d.ts +4 -0
- package/dist/client/index.js +1 -0
- package/dist/client/shared.js +2 -1
- package/dist/client/theme-default/Layout.vue +6 -1
- package/dist/client/theme-default/components/TKBlock.vue +43 -0
- package/dist/client/theme-default/components/VPContent.vue +9 -1
- package/dist/client/theme-default/components/VPHero.vue +1 -1
- package/dist/client/theme-default/components/VPHomeHero.vue +1 -1
- package/dist/client/theme-default/components/VPMenuLink.vue +1 -0
- package/dist/client/theme-default/components/VPNavBarTranslations.vue +48 -7
- package/dist/client/theme-default/components/blocks/Button.css +87 -0
- package/dist/client/theme-default/components/blocks/Button.vue +49 -0
- package/dist/client/theme-default/components/blocks/Doc.vue +72 -0
- package/dist/client/theme-default/components/blocks/Feature.vue +114 -0
- package/dist/client/theme-default/components/blocks/Features.vue +117 -0
- package/dist/client/theme-default/components/blocks/GithubCode._vue +111 -0
- package/dist/client/theme-default/components/blocks/Hero.vue +402 -0
- package/dist/client/theme-default/components/blocks/Image.vue +99 -0
- package/dist/node/cli.js +1 -1
- package/dist/node/index.d.ts +4 -2
- package/dist/node/index.js +4 -4
- package/dist/node/{serve-DQyJC2NI.js → serve-TkLPWTJT.js} +11101 -10990
- package/package.json +6 -3
- package/template/.themekit/config.js +3 -1
- package/types/shared.d.ts +2 -0
package/README.md
CHANGED
|
@@ -1 +1,50 @@
|
|
|
1
|
-
# ThemeKit
|
|
1
|
+
# ThemeKit
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
<!--#Doc-->
|
|
6
|
+
### markdown样式 222
|
|
7
|
+
<!--Doc #-->
|
|
8
|
+
|
|
9
|
+
<!--#GithubCode-->
|
|
10
|
+
[markdown-it](https://github.com/seedunk/markdown-it) [markdown-it2](https://github.com/seedunk/markdown-it)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
```javascript
|
|
14
|
+
set test="123123"
|
|
15
|
+
set test="123123"
|
|
16
|
+
function a(){}
|
|
17
|
+
//撒大大
|
|
18
|
+
```
|
|
19
|
+
<!--GithubCode #-->
|
|
20
|
+
|
|
21
|
+
<!--#Hero-->
|
|
22
|
+
## 个人
|
|
23
|
+
# Seedunk
|
|
24
|
+
其他站点说明
|
|
25
|
+
|
|
26
|
+
[跳转1](#) [跳转2](?theme=alt)
|
|
27
|
+
|
|
28
|
+

|
|
29
|
+

|
|
30
|
+
<!--Hero #-->
|
|
31
|
+
<!--#Doc-->
|
|
32
|
+
# markdown样式
|
|
33
|
+
<!--Doc #-->
|
|
34
|
+
|
|
35
|
+
<!--#Features-->
|
|
36
|
+
- 
|
|
37
|
+
# A
|
|
38
|
+
AAAAAAAAAAAAA
|
|
39
|
+
|
|
40
|
+
[查看更多](/baidu.com)
|
|
41
|
+
- ## B
|
|
42
|
+
bbbb
|
|
43
|
+
|
|
44
|
+
* ### c
|
|
45
|
+
ccc
|
|
46
|
+
* ### d
|
|
47
|
+
dd
|
|
48
|
+
* ### d
|
|
49
|
+
dd
|
|
50
|
+
<!--Features #-->
|
package/dist/client/app/data.js
CHANGED
|
@@ -37,6 +37,9 @@ export function initData(route) {
|
|
|
37
37
|
});
|
|
38
38
|
return {
|
|
39
39
|
site,
|
|
40
|
+
// @seedunk
|
|
41
|
+
themeName: computed(() => site.value.themeName),
|
|
42
|
+
base: computed(() => site.value.base),
|
|
40
43
|
theme: computed(() => site.value.themeConfig),
|
|
41
44
|
page: computed(() => route.data),
|
|
42
45
|
frontmatter: computed(() => route.data.frontmatter),
|
package/dist/client/app/index.js
CHANGED
|
@@ -29,12 +29,34 @@ const Theme = resolveThemeExtends(RawTheme);
|
|
|
29
29
|
const VitePressApp = defineComponent({
|
|
30
30
|
name: 'VitePressApp',
|
|
31
31
|
setup() {
|
|
32
|
-
const { site, lang, dir } = useData();
|
|
32
|
+
const { site, lang, dir, themeName, base } = useData();
|
|
33
33
|
// change the language on the HTML element based on the current lang
|
|
34
34
|
onMounted(() => {
|
|
35
35
|
watchEffect(() => {
|
|
36
36
|
document.documentElement.lang = lang.value;
|
|
37
37
|
document.documentElement.dir = dir.value;
|
|
38
|
+
//@seedunk-theme
|
|
39
|
+
document.documentElement.setAttribute("theme", themeName.value);
|
|
40
|
+
let links = [];
|
|
41
|
+
//let scripts=[]
|
|
42
|
+
if (themeName.value == "changzhou") {
|
|
43
|
+
links.push("bootstrap3/dist/css/bootstrap.min.css");
|
|
44
|
+
links.push("changzhou/dist/css/style.css");
|
|
45
|
+
}
|
|
46
|
+
for (var linkHref in links) {
|
|
47
|
+
const link = document.createElement('link');
|
|
48
|
+
link.href = base.value + '.themekit/assets/' + links[linkHref];
|
|
49
|
+
link.rel = "stylesheet";
|
|
50
|
+
document.head.appendChild(link);
|
|
51
|
+
}
|
|
52
|
+
/*
|
|
53
|
+
for(var scriptSrc in scripts){
|
|
54
|
+
const script = document.createElement('script');
|
|
55
|
+
script.src = base.value +'.themekit/assets/'+scripts[scriptSrc];
|
|
56
|
+
script.type="text/javascript";
|
|
57
|
+
document.body.appendChild(script);
|
|
58
|
+
}
|
|
59
|
+
*/
|
|
38
60
|
});
|
|
39
61
|
});
|
|
40
62
|
if (import.meta.env.PROD && site.value.router.prefetchLinks) {
|
|
@@ -54,7 +54,8 @@ export function createRouter(loadPageModule, fallbackComponent) {
|
|
|
54
54
|
if (inBrowser) {
|
|
55
55
|
nextTick(() => {
|
|
56
56
|
let actualPathname = siteDataRef.value.base +
|
|
57
|
-
__pageData.relativePath.replace(/(?:(^|\/)
|
|
57
|
+
__pageData.relativePath.replace(/(?:(^|\/)README)?\.md$/, '$1');
|
|
58
|
+
//@seedunk index __pageData.relativePath.replace(/(?:(^|\/)index)?\.md$/, '$1')
|
|
58
59
|
if (!siteDataRef.value.cleanUrls && !actualPathname.endsWith('/')) {
|
|
59
60
|
actualPathname += '.html';
|
|
60
61
|
}
|
|
@@ -215,15 +216,18 @@ function handleHMR(route) {
|
|
|
215
216
|
}
|
|
216
217
|
}
|
|
217
218
|
function shouldHotReload(payload) {
|
|
218
|
-
const payloadPath = payload.path.replace(/(?:(^|\/)index)?\.md$/, '$1')
|
|
219
|
+
//@seedunk index|const payloadPath = payload.path.replace(/(?:(^|\/)index)?\.md$/, '$1')
|
|
220
|
+
const payloadPath = payload.path.replace(/(?:(^|\/)README)?\.md$/, '$1');
|
|
219
221
|
const locationPath = location.pathname
|
|
220
|
-
|
|
222
|
+
//@seedunk index|.replace(/(?:(^|\/)index)?\.html$/, '')
|
|
223
|
+
.replace(/(?:(^|\/)README)?\.html$/, '')
|
|
221
224
|
.slice(siteDataRef.value.base.length - 1);
|
|
222
225
|
return payloadPath === locationPath;
|
|
223
226
|
}
|
|
224
227
|
function normalizeHref(href) {
|
|
225
228
|
const url = new URL(href, fakeHost);
|
|
226
|
-
url.pathname = url.pathname.replace(/(^|\/)index(\.html)?$/, '$1')
|
|
229
|
+
//@seedunk index| url.pathname = url.pathname.replace(/(^|\/)index(\.html)?$/, '$1')
|
|
230
|
+
url.pathname = url.pathname.replace(/(^|\/)README(\.html)?$/, '$1');
|
|
227
231
|
// ensure correct deep link so page refresh lands on correct files.
|
|
228
232
|
if (siteDataRef.value.cleanUrls)
|
|
229
233
|
url.pathname = url.pathname.replace(/\.html$/, '');
|
package/dist/client/app/utils.js
CHANGED
|
@@ -22,7 +22,8 @@ export function withBase(path) {
|
|
|
22
22
|
export function pathToFile(path) {
|
|
23
23
|
let pagePath = path.replace(/\.html$/, '');
|
|
24
24
|
pagePath = decodeURIComponent(pagePath);
|
|
25
|
-
pagePath = pagePath.replace(/\/$/, '/index')
|
|
25
|
+
//@seedunk index|pagePath = pagePath.replace(/\/$/, '/index') // /foo/ -> /foo/index
|
|
26
|
+
pagePath = pagePath.replace(/\/$/, '/README');
|
|
26
27
|
if (import.meta.env.DEV) {
|
|
27
28
|
// always force re-fetch content in dev
|
|
28
29
|
pagePath += `.md?t=${Date.now()}`;
|
|
@@ -34,14 +35,14 @@ export function pathToFile(path) {
|
|
|
34
35
|
if (inBrowser) {
|
|
35
36
|
const base = import.meta.env.BASE_URL;
|
|
36
37
|
pagePath =
|
|
37
|
-
sanitizeFileName(pagePath.slice(base.length).replace(/\//g, '_') || '
|
|
38
|
+
sanitizeFileName(pagePath.slice(base.length).replace(/\//g, '_') || 'README' //seedunk index| || 'index'
|
|
39
|
+
) + '.md';
|
|
38
40
|
// client production build needs to account for page hash, which is
|
|
39
41
|
// injected directly in the page's html
|
|
40
42
|
let pageHash = __VP_HASH_MAP__[pagePath.toLowerCase()];
|
|
41
43
|
if (!pageHash) {
|
|
42
|
-
pagePath = pagePath.endsWith('_index.md')
|
|
43
|
-
|
|
44
|
-
: pagePath.slice(0, -3) + '_index.md';
|
|
44
|
+
//@seedunk index| pagePath = pagePath.endsWith('_index.md') ? pagePath.slice(0, -9) + '.md' : pagePath.slice(0, -3) + '_index.md'
|
|
45
|
+
pagePath = pagePath.endsWith('_README.md') ? pagePath.slice(0, -9) + '.md' : pagePath.slice(0, -3) + '_README.md';
|
|
45
46
|
pageHash = __VP_HASH_MAP__[pagePath.toLowerCase()];
|
|
46
47
|
}
|
|
47
48
|
if (!pageHash)
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1292,6 +1292,7 @@ interface SiteData<ThemeConfig = any> {
|
|
|
1292
1292
|
| 'force-dark'
|
|
1293
1293
|
| (Omit<UseDarkOptions, 'initialValue'> & { initialValue?: 'dark' })
|
|
1294
1294
|
themeConfig: ThemeConfig
|
|
1295
|
+
themeName:string
|
|
1295
1296
|
scrollOffset:
|
|
1296
1297
|
| number
|
|
1297
1298
|
| string
|
|
@@ -1317,6 +1318,7 @@ interface LocaleSpecificConfig<ThemeConfig = any> {
|
|
|
1317
1318
|
description?: string
|
|
1318
1319
|
head?: HeadConfig[]
|
|
1319
1320
|
themeConfig?: ThemeConfig
|
|
1321
|
+
themeName?:string
|
|
1320
1322
|
}
|
|
1321
1323
|
|
|
1322
1324
|
type LocaleConfig<ThemeConfig = any> = Record<
|
|
@@ -1382,6 +1384,8 @@ interface VitePressData<T = any> {
|
|
|
1382
1384
|
title: Ref$1<string>;
|
|
1383
1385
|
description: Ref$1<string>;
|
|
1384
1386
|
lang: Ref$1<string>;
|
|
1387
|
+
themeName: Ref$1<string>;
|
|
1388
|
+
base: Ref$1<string>;
|
|
1385
1389
|
dir: Ref$1<string>;
|
|
1386
1390
|
localeIndex: Ref$1<string>;
|
|
1387
1391
|
isDark: Ref$1<boolean>;
|
package/dist/client/index.js
CHANGED
package/dist/client/shared.js
CHANGED
|
@@ -2,7 +2,8 @@ export const EXTERNAL_URL_RE = /^(?:[a-z]+:|\/\/)/i;
|
|
|
2
2
|
export const APPEARANCE_KEY = 'themekit-js-theme-appearance';
|
|
3
3
|
const HASH_RE = /#.*$/;
|
|
4
4
|
const HASH_OR_QUERY_RE = /[?#].*$/;
|
|
5
|
-
const INDEX_OR_EXT_RE = /(?:(^|\/)index)?\.(?:md|html)
|
|
5
|
+
//@seedunk index|const INDEX_OR_EXT_RE = /(?:(^|\/)index)?\.(?:md|html)$/
|
|
6
|
+
const INDEX_OR_EXT_RE = /(?:(^|\/)README)?\.(?:md|html)$/;
|
|
6
7
|
export const inBrowser = typeof document !== 'undefined';
|
|
7
8
|
export const notFoundPageData = {
|
|
8
9
|
relativePath: '',
|
|
@@ -51,6 +51,11 @@ provide('hero-image-slot-exists', heroImageSlotExists)
|
|
|
51
51
|
</VPSidebar>
|
|
52
52
|
|
|
53
53
|
<VPContent>
|
|
54
|
+
|
|
55
|
+
<!--@seedun from TKBlock-->
|
|
56
|
+
<template #block-top><slot name="block-top" /></template>
|
|
57
|
+
<template #block-bottom><slot name="block-bottom" /></template>
|
|
58
|
+
|
|
54
59
|
<template #page-top><slot name="page-top" /></template>
|
|
55
60
|
<template #page-bottom><slot name="page-bottom" /></template>
|
|
56
61
|
|
|
@@ -78,7 +83,7 @@ provide('hero-image-slot-exists', heroImageSlotExists)
|
|
|
78
83
|
<template #aside-ads-before><slot name="aside-ads-before" /></template>
|
|
79
84
|
<template #aside-ads-after><slot name="aside-ads-after" /></template>
|
|
80
85
|
</VPContent>
|
|
81
|
-
|
|
86
|
+
|
|
82
87
|
<VPFooter />
|
|
83
88
|
<slot name="layout-bottom" />
|
|
84
89
|
</div>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
|
|
3
|
+
import { useData } from '../composables/data'
|
|
4
|
+
import Hero from './blocks/Hero.vue';
|
|
5
|
+
import Doc from './blocks/Doc.vue';
|
|
6
|
+
import Features from './blocks/Features.vue';
|
|
7
|
+
const { frontmatter } = useData()
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<div class="TKBlock">
|
|
12
|
+
|
|
13
|
+
<div class="clearfix" v-for="(item, index) in frontmatter.blocks" :key="index">
|
|
14
|
+
<Hero :block="item" v-if="item.block_type =='Hero'"></Hero>
|
|
15
|
+
<Features :block="item" v-else-if="item.block_type =='Features'"></Features>
|
|
16
|
+
<Doc :block="item" v-else-if="item.block_type =='Doc'" ></Doc>
|
|
17
|
+
</div>
|
|
18
|
+
<VPHomeContent v-if="frontmatter.markdownStyles !== false">
|
|
19
|
+
<Content />
|
|
20
|
+
</VPHomeContent>
|
|
21
|
+
<Content v-else />
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
24
|
+
<style>
|
|
25
|
+
@import 'blocks/Button.css';
|
|
26
|
+
</style>
|
|
27
|
+
<style scoped>
|
|
28
|
+
.TKBlock {
|
|
29
|
+
margin-bottom: 96px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@media (min-width: 768px) {
|
|
33
|
+
.TKBlock {
|
|
34
|
+
margin-bottom: 128px;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
</style>
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
@@ -5,6 +5,7 @@ import { useSidebar } from '../composables/sidebar'
|
|
|
5
5
|
import VPDoc from './VPDoc.vue'
|
|
6
6
|
import VPHome from './VPHome.vue'
|
|
7
7
|
import VPPage from './VPPage.vue'
|
|
8
|
+
import TKBlock from './TKBlock.vue'
|
|
8
9
|
|
|
9
10
|
const { page, frontmatter } = useData()
|
|
10
11
|
const { hasSidebar } = useSidebar()
|
|
@@ -20,7 +21,11 @@ const { hasSidebar } = useSidebar()
|
|
|
20
21
|
}"
|
|
21
22
|
>
|
|
22
23
|
<slot name="not-found" v-if="page.isNotFound"><NotFound /></slot>
|
|
23
|
-
|
|
24
|
+
<!--@seedun add TKBlock-->
|
|
25
|
+
<TKBlock v-else-if="frontmatter.layout === 'block'">
|
|
26
|
+
<template #block-top><slot name="block-top" /></template>
|
|
27
|
+
<template #block-bottom><slot name="block-bottom" /></template>
|
|
28
|
+
</TKBlock>
|
|
24
29
|
<VPPage v-else-if="frontmatter.layout === 'page'">
|
|
25
30
|
<template #page-top><slot name="page-top" /></template>
|
|
26
31
|
<template #page-bottom><slot name="page-bottom" /></template>
|
|
@@ -36,6 +41,8 @@ const { hasSidebar } = useSidebar()
|
|
|
36
41
|
<template #home-hero-after><slot name="home-hero-after" /></template>
|
|
37
42
|
<template #home-features-before><slot name="home-features-before" /></template>
|
|
38
43
|
<template #home-features-after><slot name="home-features-after" /></template>
|
|
44
|
+
|
|
45
|
+
|
|
39
46
|
</VPHome>
|
|
40
47
|
|
|
41
48
|
<component
|
|
@@ -58,6 +65,7 @@ const { hasSidebar } = useSidebar()
|
|
|
58
65
|
<template #aside-ads-after><slot name="aside-ads-after" /></template>
|
|
59
66
|
<template #aside-bottom><slot name="aside-bottom" /></template>
|
|
60
67
|
</VPDoc>
|
|
68
|
+
|
|
61
69
|
</div>
|
|
62
70
|
</template>
|
|
63
71
|
|
|
@@ -36,7 +36,7 @@ const heroImageSlotExists = inject('hero-image-slot-exists') as Ref<boolean>
|
|
|
36
36
|
<p v-if="tagline" v-html="tagline" class="tagline"></p>
|
|
37
37
|
</slot>
|
|
38
38
|
<slot name="home-hero-info-after" />
|
|
39
|
-
|
|
39
|
+
|
|
40
40
|
<div v-if="actions" class="actions">
|
|
41
41
|
<div v-for="action in actions" :key="action.link" class="action">
|
|
42
42
|
<VPButton
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import VPFlyout from './VPFlyout.vue'
|
|
3
|
-
import VPMenuLink from './VPMenuLink.vue'
|
|
3
|
+
// seedunk import VPMenuLink from './VPMenuLink.vue'
|
|
4
4
|
import { useData } from '../composables/data'
|
|
5
5
|
import { useLangs } from '../composables/langs'
|
|
6
6
|
|
|
7
|
-
const { theme
|
|
7
|
+
const { theme,frontmatter} = useData()
|
|
8
8
|
const { localeLinks, currentLang } = useLangs({ correspondingLink: true })
|
|
9
|
+
|
|
10
|
+
|
|
9
11
|
</script>
|
|
10
12
|
|
|
11
13
|
<template>
|
|
@@ -16,11 +18,23 @@ const { localeLinks, currentLang } = useLangs({ correspondingLink: true })
|
|
|
16
18
|
:label="theme.langMenuLabel || 'Change language'"
|
|
17
19
|
>
|
|
18
20
|
<div class="items">
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
<
|
|
23
|
-
|
|
21
|
+
<p v-if="frontmatter.lang=='zh_CN'" class="title">简体中文</p>
|
|
22
|
+
<p v-if="frontmatter.lang=='en_US'" class="title">English</p>
|
|
23
|
+
<p v-if="frontmatter.lang=='ja_JP'" class="title">日本語</p>
|
|
24
|
+
<div v-if="frontmatter.en_US!=null" class="VPMenuLink">
|
|
25
|
+
<a class="VPLink link" :href="frontmatter.en_US" >English</a>
|
|
26
|
+
</div>
|
|
27
|
+
<div v-if="frontmatter.zh_CN!=null" class="VPMenuLink">
|
|
28
|
+
<a class="VPLink link" :href="frontmatter.zh_CN" >简体中文</a>
|
|
29
|
+
</div>
|
|
30
|
+
<div v-if="frontmatter.ja_JP!=null" class="VPMenuLink">
|
|
31
|
+
<a class="VPLink link" :href="frontmatter.ja_JP" >日本語</a>
|
|
32
|
+
</div>
|
|
33
|
+
<!--@seedunk
|
|
34
|
+
<p class="title">{{ currentLang.label }}</p>
|
|
35
|
+
<template v-for="locale in localeLinks" :key="locale.link">
|
|
36
|
+
<VPMenuLink :item="locale" />
|
|
37
|
+
</template>-->
|
|
24
38
|
</div>
|
|
25
39
|
</VPFlyout>
|
|
26
40
|
</template>
|
|
@@ -44,4 +58,31 @@ const { localeLinks, currentLang } = useLangs({ correspondingLink: true })
|
|
|
44
58
|
font-weight: 700;
|
|
45
59
|
color: var(--vp-c-text-1);
|
|
46
60
|
}
|
|
61
|
+
|
|
62
|
+
.VPMenuGroup + .VPMenuLink {
|
|
63
|
+
margin: 12px -12px 0;
|
|
64
|
+
border-top: 1px solid var(--vp-c-divider);
|
|
65
|
+
padding: 12px 12px 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.link {
|
|
69
|
+
display: block;
|
|
70
|
+
border-radius: 6px;
|
|
71
|
+
padding: 0 12px;
|
|
72
|
+
line-height: 32px;
|
|
73
|
+
font-size: 14px;
|
|
74
|
+
font-weight: 500;
|
|
75
|
+
color: var(--vp-c-text-1);
|
|
76
|
+
white-space: nowrap;
|
|
77
|
+
transition: background-color 0.25s, color 0.25s;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.link:hover {
|
|
81
|
+
color: var(--vp-c-brand-1);
|
|
82
|
+
background-color: var(--vp-c-default-soft);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.link.active {
|
|
86
|
+
color: var(--vp-c-brand-1);
|
|
87
|
+
}
|
|
47
88
|
</style>
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
.btn {
|
|
2
|
+
display: inline-block;
|
|
3
|
+
border: 1px solid transparent;
|
|
4
|
+
text-align: center;
|
|
5
|
+
font-weight: 600;
|
|
6
|
+
white-space: nowrap;
|
|
7
|
+
transition: color 0.25s, border-color 0.25s, background-color 0.25s;
|
|
8
|
+
}
|
|
9
|
+
a.btn{
|
|
10
|
+
text-decoration:none !important;
|
|
11
|
+
border-radius: 28px;
|
|
12
|
+
padding: 0 12px;
|
|
13
|
+
line-height: 28px;
|
|
14
|
+
font-size: 14px;
|
|
15
|
+
}
|
|
16
|
+
a.btn .icon{ display: inline-flex; vertical-align: middle; margin-left: -6px; margin-right: 2px;margin-top: -2px; }
|
|
17
|
+
.btn:active {
|
|
18
|
+
transition: color 0.1s, border-color 0.1s, background-color 0.1s;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.btn.medium {
|
|
22
|
+
border-radius: 20px;
|
|
23
|
+
padding: 0 20px;
|
|
24
|
+
line-height: 38px;
|
|
25
|
+
font-size: 14px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.btn.big {
|
|
29
|
+
border-radius: 24px;
|
|
30
|
+
padding: 0 24px;
|
|
31
|
+
line-height: 46px;
|
|
32
|
+
font-size: 16px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.btn.brand {
|
|
36
|
+
border-color: var(--vp-button-brand-border);
|
|
37
|
+
color: var(--vp-button-brand-text);
|
|
38
|
+
background-color: var(--vp-button-brand-bg);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.btn.brand:hover {
|
|
42
|
+
border-color: var(--vp-button-brand-hover-border);
|
|
43
|
+
color: var(--vp-button-brand-hover-text);
|
|
44
|
+
background-color: var(--vp-button-brand-hover-bg);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.btn.brand:active {
|
|
48
|
+
border-color: var(--vp-button-brand-active-border);
|
|
49
|
+
color: var(--vp-button-brand-active-text);
|
|
50
|
+
background-color: var(--vp-button-brand-active-bg);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.btn.alt {
|
|
54
|
+
border-color: var(--vp-button-alt-border);
|
|
55
|
+
color: var(--vp-button-alt-text);
|
|
56
|
+
background-color: var(--vp-button-alt-bg);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.btn.alt:hover {
|
|
60
|
+
border-color: var(--vp-button-alt-hover-border);
|
|
61
|
+
color: var(--vp-button-alt-hover-text);
|
|
62
|
+
background-color: var(--vp-button-alt-hover-bg);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.btn.alt:active {
|
|
66
|
+
border-color: var(--vp-button-alt-active-border);
|
|
67
|
+
color: var(--vp-button-alt-active-text);
|
|
68
|
+
background-color: var(--vp-button-alt-active-bg);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.btn.sponsor {
|
|
72
|
+
border-color: var(--vp-button-sponsor-border);
|
|
73
|
+
color: var(--vp-button-sponsor-text);
|
|
74
|
+
background-color: var(--vp-button-sponsor-bg);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.btn.sponsor:hover {
|
|
78
|
+
border-color: var(--vp-button-sponsor-hover-border);
|
|
79
|
+
color: var(--vp-button-sponsor-hover-text);
|
|
80
|
+
background-color: var(--vp-button-sponsor-hover-bg);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.btn.sponsor:active {
|
|
84
|
+
border-color: var(--vp-button-sponsor-active-border);
|
|
85
|
+
color: var(--vp-button-sponsor-active-text);
|
|
86
|
+
background-color: var(--vp-button-sponsor-active-bg);
|
|
87
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
block?:any
|
|
7
|
+
tag?: string
|
|
8
|
+
size?: 'medium' | 'big'
|
|
9
|
+
theme?: 'brand' | 'alt' | 'sponsor'
|
|
10
|
+
href?: string
|
|
11
|
+
target?: string;
|
|
12
|
+
rel?: string;
|
|
13
|
+
icon?:any;
|
|
14
|
+
baseClass?:string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
18
|
+
size: 'medium'
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
const component = computed(() => {
|
|
22
|
+
return props.tag || props.href ? 'a' : 'button'
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
const params = computed(() => {
|
|
26
|
+
const pattern = /[?&]([^=#]+)=([^&#]*)/g;
|
|
27
|
+
let params:any = {};
|
|
28
|
+
let match;
|
|
29
|
+
while ((match = pattern.exec(props.href==null?"?size=big":props.href)) !== null) {
|
|
30
|
+
params[match[1]] = match[2]
|
|
31
|
+
}
|
|
32
|
+
return params
|
|
33
|
+
// return [params["theme"]==null?props.theme:params["theme"],params["size"]==null?props.size:params["size"],props.baseClass]
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<template >
|
|
40
|
+
<component
|
|
41
|
+
:is="component"
|
|
42
|
+
class="btn"
|
|
43
|
+
:class="[params['theme']==null?props.theme:params['theme'],params['size']==null?props.size:params['size'],props.baseClass]"
|
|
44
|
+
:href="href ? href : undefined"
|
|
45
|
+
:target="props.target"
|
|
46
|
+
>
|
|
47
|
+
<slot></slot>
|
|
48
|
+
<template v-for="(item) in block.children" >{{item.content}}</template></component>
|
|
49
|
+
</template>
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useWindowSize } from '@vueuse/core'
|
|
3
|
+
import { computed } from 'vue'
|
|
4
|
+
const { width: vw } = useWindowSize({ includeScrollbar: false })
|
|
5
|
+
const { block} =defineProps<{
|
|
6
|
+
block?: any
|
|
7
|
+
}>()
|
|
8
|
+
|
|
9
|
+
const docStyles= computed(() => {
|
|
10
|
+
|
|
11
|
+
let styles:any=[ vw ? { '--vp-offset': "calc(50% - "+vw.value/2+"px)"} : {}];
|
|
12
|
+
if(block['background-color']){
|
|
13
|
+
styles.push({'padding':'1px 0','background-color':block['background-color']})
|
|
14
|
+
}
|
|
15
|
+
if(block['background-image']){
|
|
16
|
+
styles.push({'padding':'1px 0','background-image':block['background-image']})
|
|
17
|
+
}
|
|
18
|
+
return styles
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
</script>
|
|
23
|
+
<template>
|
|
24
|
+
|
|
25
|
+
<div class="vp-doc doc" :style="docStyles" >
|
|
26
|
+
<div class="container" v-html="block.content"></div>
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<style>
|
|
31
|
+
.doc{ background-size: cover;background-position: center;}
|
|
32
|
+
</style>
|
|
33
|
+
<style scoped>
|
|
34
|
+
|
|
35
|
+
.container {
|
|
36
|
+
margin: auto;
|
|
37
|
+
width: 100%;
|
|
38
|
+
max-width: 1280px;
|
|
39
|
+
padding: 0 24px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@media (min-width: 640px) {
|
|
43
|
+
.container {
|
|
44
|
+
padding: 0 48px;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@media (min-width: 960px) {
|
|
49
|
+
.container {
|
|
50
|
+
width: 100%;
|
|
51
|
+
padding: 0 64px;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.vp-doc :deep(.VPHomeSponsors),
|
|
56
|
+
.vp-doc :deep(.VPTeamPage) {
|
|
57
|
+
margin-left: var(--vp-offset, calc(50% - 50vw));
|
|
58
|
+
margin-right: var(--vp-offset, calc(50% - 50vw));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.vp-doc :deep(.VPHomeSponsors h2) {
|
|
62
|
+
border-top: none;
|
|
63
|
+
letter-spacing: normal;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.vp-doc :deep(.VPHomeSponsors a),
|
|
67
|
+
.vp-doc :deep(.VPTeamPage a){
|
|
68
|
+
text-decoration: none;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
</style>
|