Files
Lucky_Wheel/apps/client/dist/assets/wheel-playfulcartoonwheel-D5oxWUgO.js
T
2026-09-15 17:26:42 +03:30

2 lines
2.8 KiB
JavaScript

import{u as k,t as v}from"./wheel-classiccasinowheel-DHnlMe5J.js";import{d as B,a as l,b as o,e,n as c,u as i,F as d,f as h,t as C,g as S,c as P}from"./vendor-vue-kYoPQr5S.js";const z={class:"relative w-full max-w-[340px] xs:max-w-[380px] sm:max-w-[420px] aspect-square mx-auto select-none"},F={class:"absolute inset-0 rounded-full p-3.5 bg-amber-400 border-4 border-amber-600 shadow-[0_12px_0_#b45309,0_20px_25px_rgba(0,0,0,0.5)]"},L={class:"w-full h-full rounded-full border-4 border-white relative overflow-hidden bg-amber-50"},D=["d","fill"],N=["transform"],R={x:"150",y:"45","text-anchor":"middle",fill:"#ffffff","font-size":"12","font-weight":"900",class:"wheel-slice-text font-sans tracking-wide",style:{"paint-order":"stroke fill",stroke:"rgba(0,0,0,0.3)","stroke-width":"2px"}},V=["href"],W=["cx","cy"],q=["cx","cy","fill"],E=["cx","cy"],H={class:"absolute -top-4 left-1/2 -translate-x-1/2 z-20 pointer-events-none drop-shadow-[0_6px_0_#991b1b]"},T=B({__name:"PlayfulCartoonWheel",props:{segments:{},targetSegmentIndex:{},spinning:{type:Boolean}},emits:["spin-finished"],setup(n,{emit:x}){const u=n,m=x,{wheelStyle:p,pointerStyle:w,getSlicePath:y,getTextRotation:_,makePegs:b}=k(u,()=>m("spin-finished"),{radius:138,pegRadius:142}),f=["#f43f5e","#8b5cf6","#06b6d4","#10b981","#f59e0b","#ec4899"],g=P(()=>b(24,142).map((a,s)=>({...a,color:f[s%f.length]})));return(a,s)=>(l(),o("div",z,[e("div",F,[e("div",L,[(l(),o("svg",{class:"w-full h-full",style:c(i(p)),viewBox:"0 0 300 300"},[(l(!0),o(d,null,h(n.segments,(t,r)=>(l(),o("g",{key:t.id},[e("path",{d:i(y)(r),fill:t.color||f[r%f.length],stroke:"#ffffff","stroke-width":"3"},null,8,D),e("g",{transform:i(_)(r)},[e("text",R,C(i(v)(t.title)),1),t.image?(l(),o("image",{key:0,href:t.image,x:"138",y:"54",width:"24",height:"24"},null,8,V)):S("",!0)],8,N)]))),128)),(l(!0),o(d,null,h(g.value,(t,r)=>(l(),o("g",{key:r},[e("circle",{cx:t.x,cy:t.y,r:"4",fill:"#ffffff",stroke:"#b45309","stroke-width":"1.5"},null,8,W),e("circle",{cx:t.x,cy:t.y,r:"2.8",fill:t.color},null,8,q),e("circle",{cx:t.x-.8,cy:t.y-.8,r:"0.8",fill:"#ffffff"},null,8,E)]))),128)),s[0]||(s[0]=e("circle",{cx:"150",cy:"150",r:"32",fill:"#ef4444",stroke:"#ffffff","stroke-width":"4"},null,-1)),s[1]||(s[1]=e("circle",{cx:"150",cy:"150",r:"22",fill:"#facc15",stroke:"#b45309","stroke-width":"2"},null,-1)),s[2]||(s[2]=e("text",{x:"150",y:"157","text-anchor":"middle","font-size":"20"},"✨",-1))],4))])]),e("div",H,[e("div",{style:c(i(w)),class:"w-[42px] h-[50px] origin-[50%_14px] will-change-transform"},[...s[3]||(s[3]=[e("svg",{width:"42",height:"50",viewBox:"0 0 42 50",fill:"none",class:"overflow-visible"},[e("path",{d:"M21 50L6 16C4 11 8 4 14 4H28C34 4 38 11 36 16L21 50Z",fill:"#ef4444",stroke:"#ffffff","stroke-width":"3"}),e("circle",{cx:"21",cy:"14",r:"6",fill:"#facc15",stroke:"#ffffff","stroke-width":"2"})],-1)])],4)])]))}});export{T as default};