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

2 lines
2.7 KiB
JavaScript

import{u as b,t as v}from"./wheel-classiccasinowheel-DHnlMe5J.js";import{d as B,a as l,b as o,e,n as d,u as i,F as c,f as h,t as C,g as S,c as z}from"./vendor-vue-kYoPQr5S.js";const F={class:"relative w-full max-w-[340px] xs:max-w-[380px] sm:max-w-[420px] aspect-square mx-auto select-none"},L={class:"absolute inset-0 rounded-full p-3.5 border-4 border-pink-300 shadow-[0_10px_0_#f9a8d4,0_16px_28px_rgba(244,114,182,0.35)]",style:{background:"linear-gradient(180deg, #ffe4e6 0%, #fbcfe8 100%)"}},P={class:"w-full h-full rounded-full border-4 border-white relative overflow-hidden bg-rose-50"},D=["d","fill"],N=["transform"],R={x:"150",y:"45","text-anchor":"middle",fill:"#ffffff","font-size":"11","font-weight":"900",class:"wheel-slice-text font-sans",style:{"paint-order":"stroke fill",stroke:"rgba(0,0,0,0.2)","stroke-width":"2px"}},V=["href"],W=["cx","cy"],q=["cx","cy","fill"],E={class:"absolute -top-4 left-1/2 -translate-x-1/2 z-20 pointer-events-none drop-shadow-[0_5px_0_#db2777]"},M=B({__name:"CandyLandWheel",props:{segments:{},targetSegmentIndex:{},spinning:{type:Boolean}},emits:["spin-finished"],setup(f,{emit:u}){const x=f,m=u,{wheelStyle:p,pointerStyle:g,getSlicePath:w,getTextRotation:y,makePegs:_}=b(x,()=>m("spin-finished"),{radius:138,pegRadius:142}),n=["#fb7185","#fbbf24","#34d399","#60a5fa","#c084fc","#f472b6"],k=z(()=>_(24,142).map((a,s)=>({...a,color:n[s%n.length]})));return(a,s)=>(l(),o("div",F,[e("div",L,[e("div",P,[(l(),o("svg",{class:"w-full h-full",style:d(i(p)),viewBox:"0 0 300 300"},[(l(!0),o(c,null,h(f.segments,(t,r)=>(l(),o("g",{key:t.id},[e("path",{d:i(w)(r),fill:t.color||n[r%n.length],stroke:"#ffffff","stroke-width":"3"},null,8,D),e("g",{transform:i(y)(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(c,null,h(k.value,(t,r)=>(l(),o("g",{key:r},[e("circle",{cx:t.x,cy:t.y,r:"4.2",fill:"#fff",stroke:"#f9a8d4","stroke-width":"1.2"},null,8,W),e("circle",{cx:t.x,cy:t.y,r:"2.6",fill:t.color},null,8,q)]))),128)),s[0]||(s[0]=e("circle",{cx:"150",cy:"150",r:"32",fill:"#fb7185",stroke:"#fff","stroke-width":"4"},null,-1)),s[1]||(s[1]=e("circle",{cx:"150",cy:"150",r:"20",fill:"#fef08a",stroke:"#f9a8d4","stroke-width":"2"},null,-1)),s[2]||(s[2]=e("text",{x:"150",y:"157","text-anchor":"middle","font-size":"16"},"🍬",-1))],4))])]),e("div",E,[e("div",{style:d(i(g)),class:"w-10 h-[48px] origin-[50%_14px] will-change-transform"},[...s[3]||(s[3]=[e("svg",{width:"40",height:"48",viewBox:"0 0 40 48",fill:"none"},[e("path",{d:"M20 48L6 16C4 11 8 4 14 4H26C32 4 36 11 34 16L20 48Z",fill:"#fb7185",stroke:"#fff","stroke-width":"2.5"}),e("circle",{cx:"20",cy:"14",r:"5.5",fill:"#fef08a",stroke:"#fff","stroke-width":"2"})],-1)])],4)])]))}});export{M as default};