airi / assets /index-ns-YwWID.js
nekomeowww's picture
release: build 856bcd0bc0ff568af0b9adb71ddbd80d387a985f
ce0a262
raw
history blame
3.75 kB
import"./Stage.vue_vue_type_style_index_0_scoped_dc801a8a_lang-j0nM_wkh.js";import{_ as E,c as m,o as v,f as P,d as z,g as t,w as H,h as Z,i as q,j as D,a as p,k as L,n as B,l as R,m as U,p as O,b as d,u as A}from"./index-C9syKmat.js";import"./emotions-DklqG3pM.js";import{_ as X,M as Y,W as G,I as J,a as K}from"./MobileInteractiveArea.vue_vue_type_script_setup_true_lang-C-AcXYQs.js";import{b as I}from"./route-block-B_A1xBdJ.js";import"./queue-C_pdx0nC.js";import"./queues-DX8_B84M.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BRAn0QOS.js";import"./HeaderLink.vue_vue_type_script_setup_true_lang-C1ZGRUE3.js";import"./index-C6reCA2R.js";import"./providers-kZHh7EE9.js";const Q={},T={class:"cross-background-container"};function ee(_,e){return v(),m("div",T,[P(_.$slots,"default",{},void 0,!0)])}const te=E(Q,[["render",ee],["__scopeId","data-v-ff7347db"]]),ae={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(_){const e=_,i=t(null),u=t(null),r=t(0),l=t(e.height),M=t(e.amplitude),a=t(e.waveLength),y=t(""),w=t(e.fillColor),g=t(e.direction);function F(c,n,f,o,b){const s=[],k=Math.ceil(c/o)*o,V=1,W=b==="up"?n-f:f;s.push(`M 0 ${W}`);for(let h=0;h<=k;h+=V){const j=b==="up"?W-f*Math.sin(2*Math.PI*h/o):W+f*Math.sin(2*Math.PI*h/o);s.push(`L ${h} ${j}`)}return b==="up"?(s.push(`L ${k} ${n}`),s.push(`L 0 ${n} Z`)):(s.push(`L ${k} 0`),s.push("L 0 0 Z")),s.join(" ")}function $(){var c;if(i.value){const n=i.value.clientWidth;r.value=n;const o=Math.ceil(n*2/a.value)*a.value;y.value=F(o,l.value,M.value,a.value,g.value),(c=u.value)==null||c.setAttribute("width",o.toString())}}let C;const N=t(e.animationSpeed),x=t(0);function S(){x.value-=N.value,Math.abs(x.value)>=a.value&&(x.value+=a.value),u.value&&(u.value.style.transform=`translateX(${x.value}px)`),C=requestAnimationFrame(S)}return H(()=>[e.height,e.amplitude,e.waveLength,e.fillColor,e.direction],()=>{l.value=e.height,M.value=e.amplitude,a.value=e.waveLength,w.value=e.fillColor,g.value=e.direction,$()},{immediate:!0}),Z("resize",$),q(()=>{$(),S()}),D(()=>{cancelAnimationFrame(C)}),(c,n)=>(v(),m("div",ae,[P(c.$slots,"default"),p("div",{ref_key:"container",ref:i,absolute:"","left-0":"","right-0":"","top-0":"","w-full":"","overflow-hidden":""},[g.value==="down"?(v(),m("div",{key:0,style:B({backgroundColor:w.value,height:`${l.value}px`}),"w-full":""},null,4)):L("",!0),(v(),m("svg",{ref_key:"svg",ref:u,width:a.value*Math.ceil(r.value*2/a.value),height:l.value,viewBox:`0 0 ${a.value*Math.ceil(r.value*2/a.value)} ${l.value}`,xmlns:"http://www.w3.org/2000/svg",h:"[100%]",w:"[200%]",style:{willChange:"transform"}},[p("path",{d:y.value,fill:w.value},null,8,ne)],8,le)),g.value==="up"?(v(),m("div",{key:1,style:B({backgroundColor:w.value,height:`${l.value}px`}),"w-full":""},null,4)):L("",!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(_){const e=R(),i=t(!1);function u(r){i.value=r}return(r,l)=>(v(),U(te,null,{default:O(()=>[d(oe,{"fill-color":A(e)?"#563544":"#f8e8f2"},{default:O(()=>[p("div",se,[p("div",null,[d(X,{class:"flex <md:hidden",p2:""}),d(Y,{class:"hidden <md:block"})]),p("div",ie,[d(A(G),{"flex-1":"","min-w":"1/2",paused:i.value},null,8,["paused"]),d(J,{class:"flex <md:hidden","flex-1":"","max-w":"500px","min-w":"30%"}),d(K,{class:"hidden <md:block",mx2:"",mb2:"",onSettingsOpen:u})])])]),_:1},8,["fill-color"])]),_:1}))}});typeof I=="function"&&I(ue);export{ue as default};