airi / assets /index-Bt4XhQ82.js
nekomeowww's picture
release: build 03d74df7e8219a67e7987c0e41f18db53d5b3cc5
0e9f56a
raw
history blame
3.39 kB
import"./Stage.vue_vue_type_style_index_0_scoped_0f1c2eb6_lang-ZJ7Jq9AK.js";import{c as f,o as r,e as P,d as z,f as a,w as E,g as H,h as Z,i as q,j as h,k as S,n as B,l as D,m as R,p as A,a as u,b as I}from"./index-BRAl2tv-.js";import{_ as U,M as X,W as Y,I as G,a as J,b as O}from"./route-block-CQW9rUut.js";import{_ as K}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./queue-DFs1yKwI.js";import"./index-B2_pIh1j.js";const Q={},T={class:"cross-background-container"};function ee(m,e){return r(),f("div",T,[P(m.$slots,"default",{},void 0,!0)])}const ae=K(Q,[["render",ee],["__scopeId","data-v-ff7347db"]]),te={class:"relative"},le=["width","height","viewBox"],ne=["d","fill"],oe=z({__name:"AnimatedBackground",props:{verticalOffset:{default:20},height:{default:40},amplitude:{default:14},waveLength:{default:250},fillColor:{default:"#f8e8f2"},direction:{default:"down"},animationSpeed:{default:.5}},setup(m){const e=m,p=a(null),c=a(null),x=a(0),s=a(e.height),M=a(e.amplitude),t=a(e.waveLength),y=a(""),_=a(e.fillColor),w=a(e.direction);function F(i,l,d,n,b){const o=[],k=Math.ceil(i/n)*n,V=1,W=b==="up"?l-d:d;o.push(`M 0 ${W}`);for(let v=0;v<=k;v+=V){const j=b==="up"?W-d*Math.sin(2*Math.PI*v/n):W+d*Math.sin(2*Math.PI*v/n);o.push(`L ${v} ${j}`)}return b==="up"?(o.push(`L ${k} ${l}`),o.push(`L 0 ${l} Z`)):(o.push(`L ${k} 0`),o.push("L 0 0 Z")),o.join(" ")}function $(){var i;if(p.value){const l=p.value.clientWidth;x.value=l;const n=Math.ceil(l*2/t.value)*t.value;y.value=F(n,s.value,M.value,t.value,w.value),(i=c.value)==null||i.setAttribute("width",n.toString())}}let C;const N=a(e.animationSpeed),g=a(0);function L(){g.value-=N.value,Math.abs(g.value)>=t.value&&(g.value+=t.value),c.value&&(c.value.style.transform=`translateX(${g.value}px)`),C=requestAnimationFrame(L)}return E(()=>[e.height,e.amplitude,e.waveLength,e.fillColor,e.direction],()=>{s.value=e.height,M.value=e.amplitude,t.value=e.waveLength,_.value=e.fillColor,w.value=e.direction,$()},{immediate:!0}),H("resize",$),Z(()=>{$(),L()}),q(()=>{cancelAnimationFrame(C)}),(i,l)=>(r(),f("div",te,[P(i.$slots,"default"),h("div",{ref_key:"container",ref:p,absolute:"","left-0":"","right-0":"","top-0":"","w-full":"","overflow-hidden":""},[w.value==="down"?(r(),f("div",{key:0,style:B({backgroundColor:_.value,height:`${s.value}px`}),"w-full":""},null,4)):S("",!0),(r(),f("svg",{ref_key:"svg",ref:c,width:t.value*Math.ceil(x.value*2/t.value),height:s.value,viewBox:`0 0 ${t.value*Math.ceil(x.value*2/t.value)} ${s.value}`,xmlns:"http://www.w3.org/2000/svg",h:"[100%]",w:"[200%]",style:{willChange:"transform"}},[h("path",{d:y.value,fill:_.value},null,8,ne)],8,le)),w.value==="up"?(r(),f("div",{key:1,style:B({backgroundColor:_.value,height:`${s.value}px`}),"w-full":""},null,4)):S("",!0)],512)]))}}),se={relative:"",flex:"~ col","z-2":"","h-100vh":"","w-100vw":"","of-hidden":""},ie={relative:"",flex:"~ 1 row gap-y-0 gap-x-2 <md:col"},ue=z({__name:"index",setup(m){const e=D();return(p,c)=>(r(),R(ae,null,{default:A(()=>[u(oe,{"fill-color":I(e)?"#563544":"#f8e8f2"},{default:A(()=>[h("div",se,[h("div",null,[u(U,{class:"flex <md:hidden",p2:""}),u(X,{class:"hidden <md:block"})]),h("div",ie,[u(I(Y),{"flex-1":"","min-w":"1/2"}),u(G,{class:"flex <md:hidden","flex-1":"","max-w":"30%"}),u(J,{class:"hidden <md:block",mx2:"",mb2:""})])])]),_:1},8,["fill-color"])]),_:1}))}});typeof O=="function"&&O(ue);export{ue as default};