mirror of
https://github.com/Xevion/elect.xevion.dev.git
synced 2025-12-06 11:14:58 -06:00
4 lines
6.9 KiB
JavaScript
4 lines
6.9 KiB
JavaScript
import{o as r,c as i,a as n,d as k,r as C,u as H,b as K,e as N,n as y,f as e,g as E,w as F,h as a,i as _,j as u,k as l,l as p,m as w,V as f,p as O,q as j,F as q,s as P,t as T,v as U,x as G,y as m,z as b,A as L,_ as I,B as x}from"./index.b5f88166.js";const J={class:"slidev-icon",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"},Q=n("path",{fill:"currentColor",d:"M16 2C8.2 2 2 8.2 2 16s6.2 14 14 14s14-6.2 14-14S23.8 2 16 2zm0 26C9.4 28 4 22.6 4 16S9.4 4 16 4s12 5.4 12 12s-5.4 12-12 12z"},null,-1),W=n("path",{fill:"currentColor",d:"M21.4 23L16 17.6L10.6 23L9 21.4l5.4-5.4L9 10.6L10.6 9l5.4 5.4L21.4 9l1.6 1.6l-5.4 5.4l5.4 5.4z"},null,-1),X=[Q,W];function ee(c,s){return r(),i("svg",J,X)}var ne={name:"carbon-close-outline",render:ee};const te={class:"slidev-icon",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"},oe=n("path",{fill:"currentColor",d:"M2 16A14 14 0 1 0 16 2A14 14 0 0 0 2 16Zm23.15 7.75L8.25 6.85a12 12 0 0 1 16.9 16.9ZM8.24 25.16a12 12 0 0 1-1.4-16.89l16.89 16.89a12 12 0 0 1-15.49 0Z"},null,-1),se=[oe];function re(c,s){return r(),i("svg",te,se)}var le={name:"carbon-error",render:re};const ie={class:"slidev-icon",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"},ae=n("path",{fill:"currentColor",d:"M28.59 13.31L30 11.9L20 2l-1.31 1.42l1.18 1.18l-11.49 9.72l-1.72-1.71L5.25 14l5.66 5.68L2 28.58L3.41 30l8.91-8.91L18 26.75l1.39-1.42l-1.71-1.71l9.72-11.49ZM16.26 22.2L9.8 15.74L21.29 6L26 10.71Z"},null,-1),ce=[ae];function de(c,s){return r(),i("svg",ie,ce)}var _e={name:"carbon-pin",render:de};const ue={class:"slidev-icon",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"},he=n("path",{fill:"currentColor",d:"M28.586 13.314L30 11.9L20 2l-1.314 1.415l1.186 1.186L8.38 14.322l-1.716-1.715L5.25 14l5.657 5.677L2 28.583L3.41 30l8.911-8.909L18 26.748l1.393-1.414l-1.716-1.716l9.724-11.49Z"},null,-1),pe=[he];function ve(c,s){return r(),i("svg",ue,pe)}var me={name:"carbon-pin-filled",render:ve};const be={class:"slidev-icon",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"},ge=n("path",{fill:"currentColor",d:"M12 12h2v12h-2zm6 0h2v12h-2z"},null,-1),$e=n("path",{fill:"currentColor",d:"M4 6v2h2v20a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8h2V6zm4 22V8h16v20zm4-26h8v2h-8z"},null,-1),we=[ge,$e];function fe(c,s){return r(),i("svg",be,we)}var xe={name:"carbon-delete",render:fe};const Me={class:"slidev-icon",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"},Ce=n("path",{fill:"currentColor",d:"M12 10h12.185l-3.587-3.586L22 5l6 6l-6 6l-1.402-1.415L24.182 12H12a6 6 0 0 0 0 12h8v2h-8a8 8 0 0 1 0-16Z"},null,-1),Le=[Ce];function ke(c,s){return r(),i("svg",Me,Le)}var ye={name:"carbon-redo",render:ke};const Be={class:"slidev-icon",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"},Ae=n("path",{fill:"currentColor",d:"M20 10H7.815l3.587-3.586L10 5l-6 6l6 6l1.402-1.415L7.818 12H20a6 6 0 0 1 0 12h-8v2h8a8 8 0 0 0 0-16Z"},null,-1),ze=[Ae];function Ve(c,s){return r(),i("svg",Be,ze)}var Re={name:"carbon-undo",render:Ve};const Ze={class:"slidev-icon",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"},Ye=n("path",{fill:"currentColor",d:"M26 4H6a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM6 26V6h20v20Z"},null,-1),De=[Ye];function Se(c,s){return r(),i("svg",Ze,De)}var He={name:"carbon-checkbox",render:Se};const Ke={class:"slidev-icon",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"},Ne=n("path",{fill:"currentColor",d:"M16 2a14 14 0 1 0 14 14A14 14 0 0 0 16 2Zm0 26a12 12 0 1 1 12-12a12 12 0 0 1-12 12Z"},null,-1),Ee=[Ne];function Fe(c,s){return r(),i("svg",Ke,Ee)}var Oe={name:"carbon-radio-button",render:Fe};const je={class:"slidev-icon",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"},qe=n("path",{fill:"currentColor",d:"M10 6v2h12.59L6 24.59L7.41 26L24 9.41V22h2V6H10z"},null,-1),Pe=[qe];function Te(c,s){return r(),i("svg",je,Pe)}var Ue={name:"carbon-arrow-up-right",render:Te};const Ge=k({props:{storageKey:null,initial:null},setup(c){var t;const s=c,v=C(null),d=(t=s.initial)!=null?t:{x:0,y:0},g=s.storageKey?H(s.storageKey,d):C(d),{style:h}=K(v,{initialValue:g});return($,M)=>(r(),i("div",{ref_key:"el",ref:v,class:"fixed",style:y(e(h))},[N($.$slots,"default")],4))}}),Ie=n("svg",{width:"1em",height:"1em",class:"-mt-0.5",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24"},[n("path",{d:"M21.71 3.29a1 1 0 0 0-1.42 0l-18 18a1 1 0 0 0 0 1.42a1 1 0 0 0 1.42 0l18-18a1 1 0 0 0 0-1.42z",fill:"currentColor"})],-1),Je=[Ie],Qe=["onClick"],en=k({setup(c){function s(){L.undo()}function v(){L.redo()}function d(h){p.value=h,_.value=!0}function g(h){x.color=h,_.value=!0}return(h,t)=>{const $=I,M=Ue,B=Oe,A=He,z=Re,V=ye,R=xe,Z=me,Y=_e,D=le,S=ne;return r(),E(Ge,{class:a(["flex flex-wrap text-xl p-2 gap-1 rounded-md bg-main shadow transition-opacity duration-200 dark:border dark:border-gray-400 dark:border-opacity-10",e(_)?"":e(u)?"opacity-40 hover:opacity-90":"opacity-0 pointer-events-none"]),"storage-key":"slidev-drawing-pos","initial-x":10,"initial-y":10},{default:F(()=>[n("button",{class:a(["icon-btn",{shallow:e(p)!="stylus"}]),onClick:t[0]||(t[0]=o=>d("stylus"))},[l($)],2),n("button",{class:a(["icon-btn",{shallow:e(p)!="line"}]),onClick:t[1]||(t[1]=o=>d("line"))},Je,2),n("button",{class:a(["icon-btn",{shallow:e(p)!="arrow"}]),onClick:t[2]||(t[2]=o=>d("arrow"))},[l(M)],2),n("button",{class:a(["icon-btn",{shallow:e(p)!="ellipse"}]),onClick:t[3]||(t[3]=o=>d("ellipse"))},[l(B)],2),n("button",{class:a(["icon-btn",{shallow:e(p)!="rectangle"}]),onClick:t[4]||(t[4]=o=>d("rectangle"))},[l(A)],2),w(" TODO: not sure why it's not working! "),w(` <button class="icon-btn" :class="{ shallow: drawingMode != 'eraseLine' }" @click="setDrawingMode('eraseLine')">
|
|
<carbon:erase />
|
|
</button> `),l(f),(r(!0),i(q,null,O(e(j),o=>(r(),i("button",{key:o,class:a(["icon-btn",e(x).color===o?"active":"shallow"]),onClick:We=>g(o)},[n("div",{class:a(["w-6 h-6 transition-all transform border border-gray-400/50",e(x).color!==o?"rounded-1/2 scale-85":"rounded-md"]),style:y(e(_)?{background:o}:{borderColor:o})},null,6)],10,Qe))),128)),l(f),n("button",{class:a(["icon-btn",{disabled:!e(P)}]),onClick:t[5]||(t[5]=o=>s())},[l(z)],2),n("button",{class:a(["icon-btn",{disabled:!e(T)}]),onClick:t[6]||(t[6]=o=>v())},[l(V)],2),n("button",{class:a(["icon-btn",{disabled:!e(U)}]),onClick:t[7]||(t[7]=o=>e(G)())},[l(R)],2),l(f),n("button",{class:a(["icon-btn",{shallow:!e(u)}]),onClick:t[8]||(t[8]=o=>u.value=!e(u))},[m(l(Z,{class:"transform -rotate-45"},null,512),[[b,e(u)]]),m(l(Y,null,null,512),[[b,!e(u)]])],2),e(_)?(r(),i("button",{key:0,class:a(["icon-btn",{shallow:!e(_)}]),onClick:t[9]||(t[9]=o=>_.value=!e(_))},[m(l(D,null,null,512),[[b,e(u)]]),m(l(S,null,null,512),[[b,!e(u)]])],2)):w("v-if",!0)]),_:1},8,["class"])}}});export{en as default};
|