mirror of
https://github.com/fmhy/edit.git
synced 2025-07-31 08:12:23 +10:00
l
This commit is contained in:
parent
b1da9e7563
commit
887ad08707
8 changed files with 162 additions and 95 deletions
|
@ -277,9 +277,9 @@ export const wikiSidebar = [
|
||||||
items: [
|
items: [
|
||||||
meta.build.nsfw
|
meta.build.nsfw
|
||||||
? {
|
? {
|
||||||
text: '<span class="i-twemoji:no-one-under-eighteen"></span> NSFW',
|
text: '<span class="i-twemoji:no-one-under-eighteen"></span> NSFW',
|
||||||
link: 'https://rentry.co/NSFW-Checkpoint'
|
link: 'https://rentry.co/NSFW-Checkpoint'
|
||||||
}
|
}
|
||||||
: {},
|
: {},
|
||||||
{
|
{
|
||||||
text: '<span class="i-twemoji:warning"></span> Unsafe Sites',
|
text: '<span class="i-twemoji:warning"></span> Unsafe Sites',
|
||||||
|
|
|
@ -3,10 +3,7 @@
|
||||||
"verbatimModuleSyntax": true,
|
"verbatimModuleSyntax": true,
|
||||||
"module": "esnext",
|
"module": "esnext",
|
||||||
"target": "esnext",
|
"target": "esnext",
|
||||||
"lib": [
|
"lib": ["DOM", "ESNext"],
|
||||||
"DOM",
|
|
||||||
"ESNext"
|
|
||||||
],
|
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"jsx": "preserve",
|
"jsx": "preserve",
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
|
@ -16,13 +13,9 @@
|
||||||
"noUnusedLocals": true,
|
"noUnusedLocals": true,
|
||||||
"strictNullChecks": true,
|
"strictNullChecks": true,
|
||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
"types": [
|
"types": ["vitepress"]
|
||||||
"vitepress"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": ["node_modules"],
|
||||||
"node_modules"
|
|
||||||
],
|
|
||||||
"include": [
|
"include": [
|
||||||
"website/**/*.ts",
|
"website/**/*.ts",
|
||||||
"website/**/*.d.ts",
|
"website/**/*.d.ts",
|
||||||
|
|
|
@ -72,14 +72,14 @@ async function generateImage({
|
||||||
const _page = getPage(url)
|
const _page = getPage(url)
|
||||||
const title =
|
const title =
|
||||||
frontmatter.layout === 'home'
|
frontmatter.layout === 'home'
|
||||||
? frontmatter.hero.name ?? frontmatter.title
|
? (frontmatter.hero.name ?? frontmatter.title)
|
||||||
: frontmatter.title
|
: frontmatter.title
|
||||||
? frontmatter.title
|
? frontmatter.title
|
||||||
: _page?.title
|
: _page?.title
|
||||||
|
|
||||||
const description =
|
const description =
|
||||||
frontmatter.layout === 'home'
|
frontmatter.layout === 'home'
|
||||||
? frontmatter.hero.tagline ?? frontmatter.description
|
? (frontmatter.hero.tagline ?? frontmatter.description)
|
||||||
: frontmatter.description
|
: frontmatter.description
|
||||||
? frontmatter.description
|
? frontmatter.description
|
||||||
: _page?.description
|
: _page?.description
|
||||||
|
|
|
@ -85,21 +85,30 @@ const handleColorChange = (value: string) => {
|
||||||
:style="{ backgroundColor: colors[selectedColor][500] }"
|
:style="{ backgroundColor: colors[selectedColor][500] }"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<SelectRoot :model-value="selectedColor" @update:model-value="handleColorChange">
|
<SelectRoot
|
||||||
<SelectTrigger
|
:model-value="selectedColor"
|
||||||
class="color-input-text"
|
@update:model-value="handleColorChange"
|
||||||
aria-label="Select theme color">
|
>
|
||||||
|
<SelectTrigger class="color-input-text" aria-label="Select theme color">
|
||||||
<SelectValue :placeholder="normalizeColorName(selectedColor)" />
|
<SelectValue :placeholder="normalizeColorName(selectedColor)" />
|
||||||
</SelectTrigger>
|
</SelectTrigger>
|
||||||
|
|
||||||
<SelectPortal>
|
<SelectPortal>
|
||||||
<SelectContent class="bg-bg-elv border border-div rounded-md shadow-lg z-50 max-h-60 overflow-hidden z-9999"
|
<SelectContent
|
||||||
:side-offset="4">
|
class="bg-bg-elv border border-div rounded-md shadow-lg z-50 max-h-60 overflow-hidden z-9999"
|
||||||
|
:side-offset="4"
|
||||||
|
>
|
||||||
<SelectViewport class="p-1">
|
<SelectViewport class="p-1">
|
||||||
<SelectItem v-for="color in colorOptions" :key="color" :value="color"
|
<SelectItem
|
||||||
class="relative flex items-center gap-2 px-3 py-2 text-sm cursor-pointer hover:bg-bg-alt rounded-sm outline-none data-[highlighted]:bg-bg-alt data-[state=checked]:bg-bg-alt data-[state=checked]:text-text">
|
v-for="color in colorOptions"
|
||||||
<span class="inline-block w-4 h-4 rounded-full border border-div"
|
:key="color"
|
||||||
:style="{ backgroundColor: colors[color][500] }" />
|
:value="color"
|
||||||
|
class="relative flex items-center gap-2 px-3 py-2 text-sm cursor-pointer hover:bg-bg-alt rounded-sm outline-none data-[highlighted]:bg-bg-alt data-[state=checked]:bg-bg-alt data-[state=checked]:text-text"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
class="inline-block w-4 h-4 rounded-full border border-div"
|
||||||
|
:style="{ backgroundColor: colors[color][500] }"
|
||||||
|
/>
|
||||||
<SelectItemText>
|
<SelectItemText>
|
||||||
{{ normalizeColorName(color) }}
|
{{ normalizeColorName(color) }}
|
||||||
</SelectItemText>
|
</SelectItemText>
|
||||||
|
@ -158,10 +167,13 @@ const handleColorChange = (value: string) => {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
cursor: text;
|
cursor: text;
|
||||||
transition: border-color 0.25s, background 0.4s ease;
|
transition:
|
||||||
|
border-color 0.25s,
|
||||||
|
background 0.4s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.color-picker:hover, .color-picker:focus {
|
.color-picker:hover,
|
||||||
|
.color-picker:focus {
|
||||||
border-color: var(--vp-c-brand);
|
border-color: var(--vp-c-brand);
|
||||||
background: var(--vp-c-bg-alt);
|
background: var(--vp-c-bg-alt);
|
||||||
}
|
}
|
||||||
|
|
|
@ -134,24 +134,36 @@ const toggleCard = () => (isCardShown.value = !isCardShown.value)
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<template v-if="props.heading">
|
<template v-if="props.heading">
|
||||||
<button @click="toggleCard()"
|
<button
|
||||||
class="bg-$vp-c-default-soft text-primary border-$vp-c-default-soft hover:border-primary ml-3 inline-flex h-7 items-center justify-center whitespace-nowrap rounded-md border-2 border-solid px-1.5 py-3.5 text-sm font-medium transition-all duration-300 sm:h-6">
|
@click="toggleCard()"
|
||||||
<span :class="isCardShown === false ? `i-lucide:mail` : `i-lucide:mail-x`" />
|
class="bg-$vp-c-default-soft text-primary border-$vp-c-default-soft hover:border-primary ml-3 inline-flex h-7 items-center justify-center whitespace-nowrap rounded-md border-2 border-solid px-1.5 py-3.5 text-sm font-medium transition-all duration-300 sm:h-6"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
:class="isCardShown === false ? `i-lucide:mail` : `i-lucide:mail-x`"
|
||||||
|
/>
|
||||||
</button>
|
</button>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<div
|
<div
|
||||||
class="mt-2 p-4 border-2 border-solid bg-brand-50 border-brand-300 dark:bg-brand-950 dark:border-brand-800 rounded-xl col-span-3 transition-colors duration-250">
|
class="mt-2 p-4 border-2 border-solid bg-brand-50 border-brand-300 dark:bg-brand-950 dark:border-brand-800 rounded-xl col-span-3 transition-colors duration-250"
|
||||||
|
>
|
||||||
<div class="flex items-start md:items-center gap-3">
|
<div class="flex items-start md:items-center gap-3">
|
||||||
<div class="pt-1 md:pt-0">
|
<div class="pt-1 md:pt-0">
|
||||||
<div class="w-10 h-10 rounded-full flex items-center justify-center bg-brand-500 dark:bg-brand-400">
|
<div
|
||||||
<span :class="isCardShown === false
|
class="w-10 h-10 rounded-full flex items-center justify-center bg-brand-500 dark:bg-brand-400"
|
||||||
? `i-lucide:mail w-6 h-6 text-white dark:text-brand-950`
|
>
|
||||||
: `i-lucide:mail-x w-6 h-6 text-white dark:text-brand-950`
|
<span
|
||||||
" />
|
:class="
|
||||||
|
isCardShown === false
|
||||||
|
? `i-lucide:mail w-6 h-6 text-white dark:text-brand-950`
|
||||||
|
: `i-lucide:mail-x w-6 h-6 text-white dark:text-brand-950`
|
||||||
|
"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex-grow flex items-start md:items-center gap-3 flex-col md:flex-row">
|
<div
|
||||||
|
class="flex-grow flex items-start md:items-center gap-3 flex-col md:flex-row"
|
||||||
|
>
|
||||||
<div class="flex-grow">
|
<div class="flex-grow">
|
||||||
<div class="font-semibold text-brand-950 dark:text-brand-50">
|
<div class="font-semibold text-brand-950 dark:text-brand-50">
|
||||||
Got feedback?
|
Got feedback?
|
||||||
|
@ -163,7 +175,8 @@ const toggleCard = () => (isCardShown.value = !isCardShown.value)
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button
|
||||||
class="inline-block text-center rounded-full px-4 py-2.5 text-sm font-medium border-2 border-solid text-brand-700 border-brand-300 dark:text-brand-100 dark:border-brand-800"
|
class="inline-block text-center rounded-full px-4 py-2.5 text-sm font-medium border-2 border-solid text-brand-700 border-brand-300 dark:text-brand-100 dark:border-brand-800"
|
||||||
@click="toggleCard()">
|
@click="toggleCard()"
|
||||||
|
>
|
||||||
Share Feedback
|
Share Feedback
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -173,17 +186,22 @@ const toggleCard = () => (isCardShown.value = !isCardShown.value)
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<Transition name="fade" mode="out-in">
|
<Transition name="fade" mode="out-in">
|
||||||
<div v-if="isCardShown"
|
<div
|
||||||
class="border-$vp-c-divider bg-$vp-c-bg-alt b-rd-4 m-[2rem 0] mt-4 border-2 border-solid p-6">
|
v-if="isCardShown"
|
||||||
|
class="border-$vp-c-divider bg-$vp-c-bg-alt b-rd-4 m-[2rem 0] mt-4 border-2 border-solid p-6"
|
||||||
|
>
|
||||||
<Transition name="fade" mode="out-in">
|
<Transition name="fade" mode="out-in">
|
||||||
<div v-if="!feedback.type">
|
<div v-if="!feedback.type">
|
||||||
<p class="heading">
|
<p class="heading">
|
||||||
{{ helpfulText }}
|
{{ helpfulText }}
|
||||||
</p>
|
</p>
|
||||||
<div class="flex flex-wrap gap-2">
|
<div class="flex flex-wrap gap-2">
|
||||||
<button v-for="item in feedbackOptions" :key="item.value"
|
<button
|
||||||
|
v-for="item in feedbackOptions"
|
||||||
|
:key="item.value"
|
||||||
class="bg-bg border-$vp-c-default-soft hover:border-primary mt-2 select-none rounded border-2 border-solid font-bold transition-all duration-250 rounded-lg text-[14px] font-500 leading-normal m-0 px-3 py-1.5 text-center align-middle whitespace-nowrap"
|
class="bg-bg border-$vp-c-default-soft hover:border-primary mt-2 select-none rounded border-2 border-solid font-bold transition-all duration-250 rounded-lg text-[14px] font-500 leading-normal m-0 px-3 py-1.5 text-center align-middle whitespace-nowrap"
|
||||||
@click="handleSubmit(item.value)">
|
@click="handleSubmit(item.value)"
|
||||||
|
>
|
||||||
<span>{{ item.label }}</span>
|
<span>{{ item.label }}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -203,23 +221,30 @@ const toggleCard = () => (isCardShown.value = !isCardShown.value)
|
||||||
<strong>🕹️ Emulators</strong>
|
<strong>🕹️ Emulators</strong>
|
||||||
<p class="desc">
|
<p class="desc">
|
||||||
They're already on the
|
They're already on the
|
||||||
<a class="text-primary text-underline font-bold"
|
<a
|
||||||
href="https://emulation.gametechwiki.com/index.php/Main_Page">
|
class="text-primary text-underline font-bold"
|
||||||
|
href="https://emulation.gametechwiki.com/index.php/Main_Page"
|
||||||
|
>
|
||||||
Game Tech Wiki.
|
Game Tech Wiki.
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
<strong>🔻 Leeches</strong>
|
<strong>🔻 Leeches</strong>
|
||||||
<p class="desc">
|
<p class="desc">
|
||||||
They're already on the
|
They're already on the
|
||||||
<a class="text-primary text-underline font-bold"
|
<a
|
||||||
href="https://filehostlist.miraheze.org/wiki/Free_Premium_Leeches">
|
class="text-primary text-underline font-bold"
|
||||||
|
href="https://filehostlist.miraheze.org/wiki/Free_Premium_Leeches"
|
||||||
|
>
|
||||||
File Hosting Wiki.
|
File Hosting Wiki.
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
<strong>🐧 Distros</strong>
|
<strong>🐧 Distros</strong>
|
||||||
<p class="desc">
|
<p class="desc">
|
||||||
They're already on
|
They're already on
|
||||||
<a class="text-primary text-underline font-bold" href="https://distrowatch.com/">
|
<a
|
||||||
|
class="text-primary text-underline font-bold"
|
||||||
|
href="https://distrowatch.com/"
|
||||||
|
>
|
||||||
DistroWatch.
|
DistroWatch.
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
@ -234,25 +259,35 @@ const toggleCard = () => (isCardShown.value = !isCardShown.value)
|
||||||
</p>
|
</p>
|
||||||
</details>
|
</details>
|
||||||
</div>
|
</div>
|
||||||
<textarea v-model="feedback.message" autofocus
|
<textarea
|
||||||
|
v-model="feedback.message"
|
||||||
|
autofocus
|
||||||
class="bg-$vp-c-bg-alt text-$vp-c-text-2 w-full h-[100px] border border-$vp-c-divider rounded px-3 py-1.5 border-$vp-c-divider bg-$vp-c-bg-alt b-rd-4 border-2 border-solid"
|
class="bg-$vp-c-bg-alt text-$vp-c-text-2 w-full h-[100px] border border-$vp-c-divider rounded px-3 py-1.5 border-$vp-c-divider bg-$vp-c-bg-alt b-rd-4 border-2 border-solid"
|
||||||
placeholder="What a lovely wiki!" />
|
placeholder="What a lovely wiki!"
|
||||||
|
/>
|
||||||
<p class="desc mb-2">
|
<p class="desc mb-2">
|
||||||
Add your Discord handle if you would like a response, or if we need
|
Add your Discord handle if you would like a response, or if we need
|
||||||
more information from you, otherwise join our
|
more information from you, otherwise join our
|
||||||
<a class="text-primary text-underline font-semibold" href="https://rentry.co/FMHY-Invite/">
|
<a
|
||||||
|
class="text-primary text-underline font-semibold"
|
||||||
|
href="https://rentry.co/FMHY-Invite/"
|
||||||
|
>
|
||||||
Discord.
|
Discord.
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
<div class="flex flex-row gap-2">
|
<div class="flex flex-row gap-2">
|
||||||
<button
|
<button
|
||||||
class="bg-$vp-c-default-soft text-primary border-$vp-c-default-soft inline-flex h-7 items-center justify-center whitespace-nowrap rounded-md border-2 border-solid px-1.5 py-3.5 text-sm font-medium transition-all duration-300 sm:h-6"
|
class="bg-$vp-c-default-soft text-primary border-$vp-c-default-soft inline-flex h-7 items-center justify-center whitespace-nowrap rounded-md border-2 border-solid px-1.5 py-3.5 text-sm font-medium transition-all duration-300 sm:h-6"
|
||||||
@click="feedback.type = undefined">
|
@click="feedback.type = undefined"
|
||||||
|
>
|
||||||
<span class="i-lucide:panel-left-close">close</span>
|
<span class="i-lucide:panel-left-close">close</span>
|
||||||
</button>
|
</button>
|
||||||
<button type="submit"
|
<button
|
||||||
|
type="submit"
|
||||||
class="border border-div rounded-lg transition-colors duration-250 inline-block text-14px font-500 leading-1.5 px-3 py-3 text-center align-middle whitespace-nowrap disabled:opacity-50 text-text-2 bg-brand-100 dark:bg-brand-700 border-brand-800 dark:border-brand-700 disabled:bg-brand-100 dark:disabled:bg-brand-900 hover:border-brand-900 dark:hover:border-brand-800 hover:bg-brand-200 dark:hover:bg-brand-800"
|
class="border border-div rounded-lg transition-colors duration-250 inline-block text-14px font-500 leading-1.5 px-3 py-3 text-center align-middle whitespace-nowrap disabled:opacity-50 text-text-2 bg-brand-100 dark:bg-brand-700 border-brand-800 dark:border-brand-700 disabled:bg-brand-100 dark:disabled:bg-brand-900 hover:border-brand-900 dark:hover:border-brand-800 hover:bg-brand-200 dark:hover:bg-brand-800"
|
||||||
:disabled="isDisabled" @click="handleSubmit()">
|
:disabled="isDisabled"
|
||||||
|
@click="handleSubmit()"
|
||||||
|
>
|
||||||
Send Feedback 📩
|
Send Feedback 📩
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -7,7 +7,8 @@ import ToggleStarred from './ToggleStarred.vue'
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
class="bg-$vp-c-bg border-$vp-c-default-soft hover:border-primary transition-border relative z-0 rounded-lg border-2 border-solid p-5 duration-500">
|
class="bg-$vp-c-bg border-$vp-c-default-soft hover:border-primary transition-border relative z-0 rounded-lg border-2 border-solid p-5 duration-500"
|
||||||
|
>
|
||||||
<div class="align-center mb-4 flex justify-between">
|
<div class="align-center mb-4 flex justify-between">
|
||||||
<div class="text-$vp-c-text-1 lh-relaxed text-sm font-bold">
|
<div class="text-$vp-c-text-1 lh-relaxed text-sm font-bold">
|
||||||
Emoji Legend
|
Emoji Legend
|
||||||
|
@ -24,14 +25,10 @@ import ToggleStarred from './ToggleStarred.vue'
|
||||||
<ToggleStarred />
|
<ToggleStarred />
|
||||||
</template>
|
</template>
|
||||||
</InputField>
|
</InputField>
|
||||||
<InputField
|
<InputField id="icon-color" label="Color">
|
||||||
id="icon-color"
|
|
||||||
label="Color"
|
|
||||||
>
|
|
||||||
<template #display>
|
<template #display>
|
||||||
<ColorPicker class="ml-auto"/>
|
<ColorPicker class="ml-auto" />
|
||||||
</template>
|
</template>
|
||||||
</InputField>
|
</InputField>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -10,18 +10,18 @@ function treatAsHtml(filename: string): boolean {
|
||||||
(import.meta as any).env?.VITE_EXTRA_EXTENSIONS ||
|
(import.meta as any).env?.VITE_EXTRA_EXTENSIONS ||
|
||||||
''
|
''
|
||||||
|
|
||||||
// md, html? are intentionally omitted
|
// md, html? are intentionally omitted
|
||||||
; (
|
;(
|
||||||
'3g2,3gp,aac,ai,apng,au,avif,bin,bmp,cer,class,conf,crl,css,csv,dll,' +
|
'3g2,3gp,aac,ai,apng,au,avif,bin,bmp,cer,class,conf,crl,css,csv,dll,' +
|
||||||
'doc,eps,epub,exe,gif,gz,ics,ief,jar,jpe,jpeg,jpg,js,json,jsonld,m4a,' +
|
'doc,eps,epub,exe,gif,gz,ics,ief,jar,jpe,jpeg,jpg,js,json,jsonld,m4a,' +
|
||||||
'man,mid,midi,mjs,mov,mp2,mp3,mp4,mpe,mpeg,mpg,mpp,oga,ogg,ogv,ogx,' +
|
'man,mid,midi,mjs,mov,mp2,mp3,mp4,mpe,mpeg,mpg,mpp,oga,ogg,ogv,ogx,' +
|
||||||
'opus,otf,p10,p7c,p7m,p7s,pdf,png,ps,qt,roff,rtf,rtx,ser,svg,t,tif,' +
|
'opus,otf,p10,p7c,p7m,p7s,pdf,png,ps,qt,roff,rtf,rtx,ser,svg,t,tif,' +
|
||||||
'tiff,tr,ts,tsv,ttf,txt,vtt,wav,weba,webm,webp,woff,woff2,xhtml,xml,' +
|
'tiff,tr,ts,tsv,ttf,txt,vtt,wav,weba,webm,webp,woff,woff2,xhtml,xml,' +
|
||||||
'yaml,yml,zip' +
|
'yaml,yml,zip' +
|
||||||
(extraExts && typeof extraExts === 'string' ? ',' + extraExts : '')
|
(extraExts && typeof extraExts === 'string' ? ',' + extraExts : '')
|
||||||
)
|
)
|
||||||
.split(',')
|
.split(',')
|
||||||
.forEach((ext) => KNOWN_EXTENSIONS.add(ext))
|
.forEach((ext) => KNOWN_EXTENSIONS.add(ext))
|
||||||
}
|
}
|
||||||
|
|
||||||
const ext = filename.split('.').pop()
|
const ext = filename.split('.').pop()
|
||||||
|
@ -51,12 +51,12 @@ function normalizeLink(url: string): string {
|
||||||
pathname.endsWith('/') || pathname.endsWith('.html')
|
pathname.endsWith('/') || pathname.endsWith('.html')
|
||||||
? url
|
? url
|
||||||
: url.replace(
|
: url.replace(
|
||||||
/(?:(^\.+)\/)?.*$/,
|
/(?:(^\.+)\/)?.*$/,
|
||||||
`$1${pathname.replace(
|
`$1${pathname.replace(
|
||||||
/(\.md)?$/,
|
/(\.md)?$/,
|
||||||
site.value.cleanUrls ? '' : '.html'
|
site.value.cleanUrls ? '' : '.html'
|
||||||
)}${search}${hash}`
|
)}${search}${hash}`
|
||||||
)
|
)
|
||||||
|
|
||||||
return withBase(normalizedPath)
|
return withBase(normalizedPath)
|
||||||
}
|
}
|
||||||
|
@ -134,14 +134,22 @@ const processedItems = computed(() => {
|
||||||
<template>
|
<template>
|
||||||
<div v-if="theme === 'brand'" class="VPButtonDropdown" ref="dropdownRef">
|
<div v-if="theme === 'brand'" class="VPButtonDropdown" ref="dropdownRef">
|
||||||
<div class="VPButtonWrapper">
|
<div class="VPButtonWrapper">
|
||||||
<component :is="component" class="VPButton VPButtonMain" :class="[size, theme]"
|
<component
|
||||||
:href="href ? normalizeLink(href) : undefined" :target="props.target ?? (isExternal ? '_blank' : undefined)"
|
:is="component"
|
||||||
:rel="props.rel ?? (isExternal ? 'noreferrer' : undefined)">
|
class="VPButton VPButtonMain"
|
||||||
|
:class="[size, theme]"
|
||||||
|
:href="href ? normalizeLink(href) : undefined"
|
||||||
|
:target="props.target ?? (isExternal ? '_blank' : undefined)"
|
||||||
|
:rel="props.rel ?? (isExternal ? 'noreferrer' : undefined)"
|
||||||
|
>
|
||||||
<slot>{{ text }}</slot>
|
<slot>{{ text }}</slot>
|
||||||
</component>
|
</component>
|
||||||
<button
|
<button
|
||||||
class="bg-$vp-c-default-soft text-text border-$vp-c-default-soft hover:bg-$vp-c-default-hover active:bg-$vp-c-default-active inline-flex items-center justify-center whitespace-nowrap rounded-md border-2 border-solid px-2.5 py-5 text-md font-medium sm:h-7 VPButtonTrigger"
|
class="bg-$vp-c-default-soft text-text border-$vp-c-default-soft hover:bg-$vp-c-default-hover active:bg-$vp-c-default-active inline-flex items-center justify-center whitespace-nowrap rounded-md border-2 border-solid px-2.5 py-5 text-md font-medium sm:h-7 VPButtonTrigger"
|
||||||
@click="toggleDropdown" :aria-expanded="isDropdownOpen" aria-label="Toggle dropdown menu">
|
@click="toggleDropdown"
|
||||||
|
:aria-expanded="isDropdownOpen"
|
||||||
|
aria-label="Toggle dropdown menu"
|
||||||
|
>
|
||||||
<span class="i-lucide:menu"></span>
|
<span class="i-lucide:menu"></span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -151,12 +159,22 @@ const processedItems = computed(() => {
|
||||||
<template v-for="item in processedItems" :key="item.text">
|
<template v-for="item in processedItems" :key="item.text">
|
||||||
<div v-if="'items' in item" class="VPButtonDropdownSection">
|
<div v-if="'items' in item" class="VPButtonDropdownSection">
|
||||||
<div class="VPButtonDropdownSectionTitle" v-html="item.text"></div>
|
<div class="VPButtonDropdownSectionTitle" v-html="item.text"></div>
|
||||||
<a v-for="subItem in item.items" :key="subItem.text" :href="subItem.link" class="VPButtonDropdownItem"
|
<a
|
||||||
@click="closeDropdown">
|
v-for="subItem in item.items"
|
||||||
|
:key="subItem.text"
|
||||||
|
:href="subItem.link"
|
||||||
|
class="VPButtonDropdownItem"
|
||||||
|
@click="closeDropdown"
|
||||||
|
>
|
||||||
<span v-html="subItem.displayText"></span>
|
<span v-html="subItem.displayText"></span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<a v-else :href="item.link" class="VPButtonDropdownItem" @click="closeDropdown">
|
<a
|
||||||
|
v-else
|
||||||
|
:href="item.link"
|
||||||
|
class="VPButtonDropdownItem"
|
||||||
|
@click="closeDropdown"
|
||||||
|
>
|
||||||
<span v-html="item.displayText"></span>
|
<span v-html="item.displayText"></span>
|
||||||
</a>
|
</a>
|
||||||
</template>
|
</template>
|
||||||
|
@ -164,9 +182,15 @@ const processedItems = computed(() => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<component v-else :is="component" class="VPButton" :class="[size, theme]"
|
<component
|
||||||
:href="href ? normalizeLink(href) : undefined" :target="props.target ?? (isExternal ? '_blank' : undefined)"
|
v-else
|
||||||
:rel="props.rel ?? (isExternal ? 'noreferrer' : undefined)">
|
:is="component"
|
||||||
|
class="VPButton"
|
||||||
|
:class="[size, theme]"
|
||||||
|
:href="href ? normalizeLink(href) : undefined"
|
||||||
|
:target="props.target ?? (isExternal ? '_blank' : undefined)"
|
||||||
|
:rel="props.rel ?? (isExternal ? 'noreferrer' : undefined)"
|
||||||
|
>
|
||||||
<slot>{{ text }}</slot>
|
<slot>{{ text }}</slot>
|
||||||
</component>
|
</component>
|
||||||
</template>
|
</template>
|
||||||
|
@ -178,11 +202,17 @@ const processedItems = computed(() => {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
transition: color 0.25s, border-color 0.25s, background-color 0.25s;
|
transition:
|
||||||
|
color 0.25s,
|
||||||
|
border-color 0.25s,
|
||||||
|
background-color 0.25s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.VPButton:active {
|
.VPButton:active {
|
||||||
transition: color 0.1s, border-color 0.1s, background-color 0.1s;
|
transition:
|
||||||
|
color 0.1s,
|
||||||
|
border-color 0.1s,
|
||||||
|
background-color 0.1s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.VPButton.medium {
|
.VPButton.medium {
|
||||||
|
@ -282,7 +312,9 @@ const processedItems = computed(() => {
|
||||||
background-color: var(--vp-c-bg-elv);
|
background-color: var(--vp-c-bg-elv);
|
||||||
border: 1px solid var(--vp-c-divider);
|
border: 1px solid var(--vp-c-divider);
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(0, 0, 0, 0.08);
|
box-shadow:
|
||||||
|
0 12px 32px rgba(0, 0, 0, 0.1),
|
||||||
|
0 2px 6px rgba(0, 0, 0, 0.08);
|
||||||
min-width: 280px;
|
min-width: 280px;
|
||||||
max-height: 400px;
|
max-height: 400px;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
@ -332,14 +364,14 @@ const processedItems = computed(() => {
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.VPButtonDropdownItem span :deep([class*="i-"]) {
|
.VPButtonDropdownItem span :deep([class*='i-']) {
|
||||||
width: 16px;
|
width: 16px;
|
||||||
height: 16px;
|
height: 16px;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.VPButtonDropdownSectionTitle :deep([class*="i-"]) {
|
.VPButtonDropdownSectionTitle :deep([class*='i-']) {
|
||||||
width: 14px;
|
width: 14px;
|
||||||
height: 14px;
|
height: 14px;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
|
|
|
@ -133,7 +133,6 @@
|
||||||
text-decoration-style: solid;
|
text-decoration-style: solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
::selection {
|
::selection {
|
||||||
background-color: var(--vp-c-brand-400, #5586a6);
|
background-color: var(--vp-c-brand-400, #5586a6);
|
||||||
|
|
||||||
|
@ -195,7 +194,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#VPContent strong > a {
|
#VPContent strong > a {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue