chore: add more color options (#351)

This commit is contained in:
YangFong 2024-08-24 23:38:39 +08:00 committed by GitHub
parent 6392e70b22
commit b8a7165b84
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 42 additions and 17 deletions

View File

@ -1,4 +1,6 @@
export const fontFamilyOptions = [ import type { IConfigOption } from '@/types'
export const fontFamilyOptions: IConfigOption[] = [
{ {
label: `无衬线`, label: `无衬线`,
value: `-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif`, value: `-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif`,
@ -16,7 +18,7 @@ export const fontFamilyOptions = [
}, },
] ]
export const fontSizeOptions = [ export const fontSizeOptions: IConfigOption[] = [
{ {
label: `12px`, label: `12px`,
value: `12px`, value: `12px`,
@ -44,23 +46,42 @@ export const fontSizeOptions = [
}, },
] ]
export const colorOptions = [ export const colorOptions: IConfigOption[] = [
{ {
label: `经典蓝`, label: `经典蓝`,
value: `rgba(15, 76, 129, 1)`, value: `#0F4C81`,
desc: `最新流行`, desc: `最新流行`,
}, },
{ {
label: `翡翠绿`, label: `翡翠绿`,
value: `rgba(0, 152, 116, 1)`, value: `#009874`,
desc: `优雅清新`, desc: `优雅清新`,
}, },
{ {
label: `活力橘`, label: `活力橘`,
value: `rgba(250, 81, 81, 1)`, value: `#FA5151`,
desc: `热情活泼`, desc: `热情活泼`,
}, },
// { label: `微信绿`, value: `rgb(26, 173, 25,1)`, desc: `经典微信绿` }, {
label: `柠檬黄`,
value: `#FECE00`,
desc: `明亮温暖`,
},
{
label: `樱桃红`,
value: `#FF445F`,
desc: `浪漫热情`,
},
{
label: `浅紫色`,
value: `#92617E`,
desc: `优雅高贵`,
},
{
label: `天空蓝`,
value: `#55C9EA`,
desc: `清新脱俗`,
},
] ]
const codeBlockUrlPrefix = `https://cdn.bootcdn.net/ajax/libs/highlight.js/11.10.0/styles/` const codeBlockUrlPrefix = `https://cdn.bootcdn.net/ajax/libs/highlight.js/11.10.0/styles/`
@ -140,16 +161,15 @@ const codeBlockThemeList = [
`xt256.min.css`, `xt256.min.css`,
].sort() ].sort()
export const codeBlockThemeOptions = [ export const codeBlockThemeOptions: IConfigOption[] = codeBlockThemeList.map((codeBlockTheme) => {
...codeBlockThemeList.map((codeBlockTheme) => { const label = codeBlockTheme.replace(`.min.css`, ``)
const url = `${codeBlockUrlPrefix}${codeBlockTheme}` const value = `${codeBlockUrlPrefix}${codeBlockTheme}`
const label = codeBlockTheme.replace(`.min.css`, ``) return {
return { label,
label, value,
value: url, desc: ``,
} }
}), })
]
export const legendOptions = [ export const legendOptions = [
{ {

5
src/types/index.ts Normal file
View File

@ -0,0 +1,5 @@
export interface IConfigOption {
label: string
value: string
desc: string
}