mirror of
https://github.com/pengzhanbo/vuepress-theme-plume.git
synced 2026-04-23 10:58:13 +08:00
2 lines
3.0 KiB
JavaScript
2 lines
3.0 KiB
JavaScript
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/pickr.min-1dwDXx4g.js","assets/chunk-DseTPa7n.js"])))=>i.map(i=>d[i]);
|
|
import{i as e}from"./chunk-DseTPa7n.js";import{E as t,K as n,M as r,P as i,R as a,X as o,_ as s,_t as c,c as l,f as u,g as d,i as f,j as p,l as m,lt as h,y as g,zt as _}from"./runtime-core.esm-bundler-CZvn3YaB.js";import{S as v}from"./client-C5e5tgZO.js";import{t as y}from"./preload-helper-ca-nBW7U.js";import{t as b}from"./plugin-vue_export-helper-CxTVcLa7.js";import{t as x}from"./VPButton-CjpnmuwG.js";import{n as S}from"./theme-colors-bZHGy5AR.js";import{t as C}from"./CodeViewer-o1p7DA2o.js";var w={class:`color-picker`},T=g({__name:`ColorPick`,props:{modelValue:{default:`rgba(0,0,0,1)`},modelModifiers:{}},emits:t([`update:modelValue`],[`update:modelValue`]),setup(t,{emit:a}){let s=a,c=n(t,`modelValue`),l=h(),d;return p(async()=>{if(!l.value||d)return;let{default:t}=await y(async()=>{let{default:t}=await import(`./pickr.min-1dwDXx4g.js`).then(t=>e(t.default,1));return{default:t}},__vite__mapDeps([0,1]));d=t.create({el:l.value,theme:`nano`,default:c.value,defaultRepresentation:`RGBA`,showAlways:!1,components:{preview:!0,opacity:!0,hue:!0,interaction:{input:!0}}}),d.on(`change`,e=>{s(`update:modelValue`,e.toRGBA().toString(0))}),o(c,()=>{d?.setColor(c.value)})}),r(()=>{d?.destroyAndRemove(),d=null}),(e,t)=>(i(),u(`div`,w,[m(`div`,{ref_key:`pickerEl`,ref:l},null,512)]))}}),E={class:`theme-colors-wrapper`},D={class:`desc`},O={class:`theme-colors-wrapper`},k={class:`desc`},A={href:`/guide/custom-style/`},j=b(g({__name:`ThemeColors`,setup(e){let t={"/":{reset:`重置`,light:`浅色主题`,dark:`深色主题`,desc:`复制下方的代码到您的项目中,请参考`,tip:`主题定制`},"/en/":{reset:`Reset`,light:`Light theme`,dark:`Dark theme`,desc:`Copy the code below and paste it into your project, please refer to`,tip:`Theme customization`}},n=v(),r=l(()=>t[n.value]),{lightColors:o,darkColors:p,css:h,reset:g}=S();return(e,t)=>(i(),u(f,null,[s(x,{theme:`alt`,text:r.value.reset,onClick:c(g)},null,8,[`text`,`onClick`]),m(`h2`,null,_(r.value.light),1),m(`div`,E,[(i(!0),u(f,null,a(c(o),({name:e,group:t},n)=>(i(),u(`div`,{key:n,class:`group`},[m(`h4`,null,_(e),1),(i(!0),u(f,null,a(t,e=>(i(),u(`section`,{key:e.key,class:`theme-color`},[s(T,{modelValue:e.value,"onUpdate:modelValue":t=>e.value=t},null,8,[`modelValue`,`onUpdate:modelValue`]),m(`div`,null,[m(`h5`,null,_(e.name),1),m(`span`,D,_(e.desc),1)])]))),128))]))),128))]),m(`h2`,null,_(r.value.dark),1),m(`div`,O,[(i(!0),u(f,null,a(c(p),({name:e,group:t},n)=>(i(),u(`div`,{key:n,class:`group`},[m(`h4`,null,_(e),1),(i(!0),u(f,null,a(t,e=>(i(),u(`section`,{key:e.key,class:`theme-color`},[s(T,{modelValue:e.value,"onUpdate:modelValue":t=>e.value=t},null,8,[`modelValue`,`onUpdate:modelValue`]),m(`div`,null,[m(`h5`,null,_(e.name),1),m(`span`,k,_(e.desc),1)])]))),128))]))),128))]),m(`p`,null,[d(_(r.value.desc)+` `,1),m(`a`,A,_(r.value.tip),1)]),s(C,{content:c(h),lang:`css`},null,8,[`content`])],64))}}),[[`__scopeId`,`data-v-2c90d1fb`]]);export{j as t}; |