-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchunk-B7d7vZaZ.js
More file actions
1 lines (1 loc) · 7.71 KB
/
Copy pathchunk-B7d7vZaZ.js
File metadata and controls
1 lines (1 loc) · 7.71 KB
1
import{r as l,j as t,L as T,b as R,aw as _,ax as z,a3 as A,m as v,A as D,w as L,G as P,Q as S}from"../entries/pages.BZkyDMuN.js";import{e as $}from"./chunk-CNa8ID-3.js";import{o as B}from"./chunk-zP1DvYGW.js";import{d as H}from"./chunk-D1oYsk9A.js";import{S as U}from"./chunk-D8YfSULr.js";import{B as M}from"./chunk-CxCYcf40.js";import"./chunk-BXl3LOEh.js";/* empty css */const O="radial-gradient(#d2a679 1px, transparent 1px), radial-gradient(#d2a679 1px, transparent 1px)",Q=()=>{const[i,x]=l.useState([{id:"header-note",type:"header",text:"PROJECT: UNVEILING THE HIDDEN ARCHITECTURE",x:200,y:40,rotation:-2},{id:"1",type:"note",text:"THEY ARE WATCHING",x:100,y:150,color:"#fff9c4",rotation:-5},{id:"2",type:"polaroid",src:"",x:400,y:100,rotation:10},{id:"3",type:"note",text:"FOLLOW THE WHITE RABBIT",x:250,y:400,color:"#ffccbc",rotation:2}]),[c,p]=l.useState([{from:"1",to:"2"},{from:"2",to:"3"}]),[s,f]=l.useState(null),[h,y]=l.useState(null),u=l.useRef({x:0,y:0}),m=l.useRef(null),n=l.useRef(null),j=async()=>{if(n.current){const e=n.current.querySelectorAll(".item-actions"),o=n.current.querySelector(".toolbar"),r=n.current.querySelector(".ambient-text");e.forEach(a=>a.style.display="none"),o&&(o.style.display="none"),r&&(r.style.display="none");try{const a=await H.toPng(n.current,{quality:1,bgcolor:"#8b5e3c",width:n.current.scrollWidth,height:n.current.scrollHeight}),d=document.createElement("a");d.download=`conspiracy-${Date.now()}.png`,d.href=a,d.click()}catch(a){console.error("Download failed",a)}finally{e.forEach(a=>a.style.display=""),o&&(o.style.display=""),r&&(r.style.display="")}}},N=(e,o)=>{e.target.closest("button")||e.target.tagName==="TEXTAREA"||(e.preventDefault(),y(o.id),u.current={x:e.clientX-o.x,y:e.clientY-o.y})},k=e=>{h&&x(o=>o.map(r=>r.id===h?{...r,x:e.clientX-u.current.x,y:e.clientY-u.current.y}:r))},w=()=>y(null),E=e=>{const o=e.target.files[0];if(o){const r=new FileReader;r.onload=a=>b("polaroid",a.target.result),r.readAsDataURL(o)}e.target.value=null},b=(e,o=null)=>{const r={id:Date.now().toString(),type:e,text:e==="note"?"New Evidence...":e==="header"?"TOP SECRET":"",src:o||"",x:Math.random()*400+50,y:Math.random()*300+50,color:["#fff9c4","#ffccbc","#c8e6c9","#bbdefb"][Math.floor(Math.random()*4)],rotation:(Math.random()-.5)*20};x([...i,r])},C=e=>{x(i.filter(o=>o.id!==e)),p(c.filter(o=>o.from!==e&&o.to!==e))},I=e=>{if(!s)f(e);else if(s===e)f(null);else{const o=c.find(r=>r.from===s&&r.to===e||r.from===e&&r.to===s);p(o?c.filter(r=>r!==o):[...c,{from:s,to:e}]),f(null)}};return t.jsxs("div",{ref:n,className:"min-h-screen relative overflow-hidden bg-[#8b5e3c] cursor-crosshair",style:{backgroundImage:O,backgroundSize:"40px 40px",backgroundPosition:"0 0, 20px 20px"},onPointerMove:k,onPointerUp:w,onPointerLeave:w,children:[t.jsx(U,{title:"The Conspiracy Board | Fezcodex",description:"Connect the dots, find the truth. A digital corkboard for your wildest theories.",keywords:["conspiracy","detective","board","mindmap","red string","theory"]}),t.jsx("div",{className:"absolute inset-0 bg-black/10 pointer-events-none shadow-inner"}),t.jsxs("div",{className:"toolbar absolute top-6 left-6 z-50 flex gap-4 pointer-events-auto transition-opacity duration-300",children:[t.jsxs(T,{to:"/apps",className:"bg-[#5d4037] text-[#efebe9] px-6 py-3 font-mono border-2 border-[#3e2723] shadow-[4px_4px_0px_#3e2723] hover:translate-x-[2px] hover:translate-y-[2px] hover:shadow-none transition-all flex items-center gap-2",children:[t.jsx(R,{weight:"bold"}),t.jsx("span",{children:"EXIT BOARD"})]}),t.jsx("button",{onClick:()=>b("note"),className:"bg-[#fff9c4] text-[#3e2723] p-3 border-2 border-[#3e2723] shadow-[4px_4px_0px_#3e2723] hover:scale-105 transition-transform",children:t.jsx(_,{size:24,weight:"bold"})}),t.jsx("button",{onClick:()=>b("header"),className:"bg-[#efebe9] text-[#3e2723] p-3 border-2 border-[#3e2723] shadow-[4px_4px_0px_#3e2723] hover:scale-105 transition-transform",children:t.jsx(z,{size:24,weight:"bold"})}),t.jsx("button",{onClick:()=>m.current.click(),className:"bg-white text-[#3e2723] p-3 border-2 border-[#3e2723] shadow-[4px_4px_0px_#3e2723] hover:scale-105 transition-transform",children:t.jsx($,{size:24,weight:"bold"})}),t.jsx("button",{onClick:j,className:"bg-blue-100 text-[#3e2723] p-3 border-2 border-[#3e2723] shadow-[4px_4px_0px_#3e2723] hover:scale-105 transition-transform",children:t.jsx(A,{size:24,weight:"bold"})}),t.jsx("input",{type:"file",ref:m,onChange:E,accept:"image/*",className:"hidden"})]}),t.jsx("svg",{className:"absolute inset-0 w-full h-full pointer-events-none z-10 overflow-visible",children:c.map(e=>{const o=i.find(g=>g.id===e.from),r=i.find(g=>g.id===e.to);if(!o||!r)return null;const a=o.x+(o.type==="note"?96:o.type==="header"?300:112),d=r.x+(r.type==="note"?96:r.type==="header"?300:112);return t.jsx(v.line,{x1:a,y1:o.y+5,x2:d,y2:r.y+5,stroke:"#d32f2f",strokeWidth:"3",strokeLinecap:"round",initial:{pathLength:0,opacity:0},animate:{pathLength:1,opacity:.8},style:{filter:"drop-shadow(2px 2px 2px rgba(0,0,0,0.5))"}},`${e.from}-${e.to}`)})}),t.jsx("div",{className:"absolute inset-0 w-full h-full",children:t.jsx(D,{children:i.map(e=>t.jsxs(v.div,{initial:{scale:0,rotate:e.rotation-20},animate:{scale:1,rotate:e.rotation},exit:{scale:0,opacity:0},onPointerDown:o=>N(o,e),className:`absolute cursor-grab active:cursor-grabbing shadow-2xl select-none z-20 ${e.type==="note"?"w-48 bg-transparent":e.type==="header"?"w-[600px] bg-[#efebe9]":"w-56 bg-white"} ${s===e.id?"ring-4 ring-red-500":""}`,style:{left:e.x,top:e.y,backgroundColor:e.type==="note"?e.color:void 0,zIndex:h===e.id?50:20},children:[t.jsx("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2 text-red-600 drop-shadow-md z-30 pointer-events-none",children:t.jsx(L,{weight:"fill",size:32})}),e.type==="header"?t.jsx("div",{className:"py-4 px-4 border-b-4 border-double border-[#3e2723]",children:t.jsx("textarea",{className:"bg-transparent border-none outline-none w-full text-4xl font-playfairDisplay font-black text-[#3e2723] leading-tight text-center resize-none overflow-hidden",defaultValue:e.text,rows:2,onChange:o=>{e.text=o.target.value}})}):e.type==="note"?t.jsx("div",{className:"p-6",children:t.jsx("textarea",{className:"bg-transparent border-none outline-none w-full h-24 text-[#3e2723] font-arvo font-bold text-lg resize-none",defaultValue:e.text,onChange:o=>{e.text=o.target.value}})}):t.jsxs("div",{className:"p-4 pb-10",children:[t.jsxs("div",{className:"aspect-square bg-gray-200 overflow-hidden mb-4 border border-gray-100 relative",children:[e.src?t.jsx("img",{src:e.src,alt:"Evidence",className:"w-full h-full object-cover grayscale sepia contrast-125",draggable:!1}):t.jsx(P,{seed:e.id,className:"w-full h-full grayscale sepia contrast-125"}),t.jsx("div",{className:"absolute inset-0 bg-[#3e2723] mix-blend-overlay opacity-20 pointer-events-none"})]}),t.jsxs("p",{className:"font-mono text-[10px] text-gray-400 text-center uppercase tracking-widest",children:["FILE_ID: ",e.id.slice(-6)]})]}),t.jsxs("div",{className:"item-actions absolute -bottom-10 left-0 right-0 flex justify-center gap-2 opacity-0 hover:opacity-100 transition-opacity",children:[t.jsx("button",{onClick:()=>I(e.id),className:`p-2 rounded-full shadow-lg ${s===e.id?"bg-red-500 text-white":"bg-white text-gray-800"}`,children:t.jsx(B,{weight:"bold"})}),t.jsx("button",{onClick:()=>C(e.id),className:"p-2 bg-white text-red-600 rounded-full shadow-lg",children:t.jsx(S,{weight:"bold"})})]})]},e.id))})}),t.jsxs("div",{className:"ambient-text absolute bottom-6 right-6 font-mono text-sm text-[#5d4037] opacity-50 uppercase tracking-[0.5em] pointer-events-none transition-opacity duration-300 flex flex-col items-end gap-2",children:[t.jsx(M,{title:"Conspiracy Board",slug:"cb",variant:"brutalist",className:"!text-[#5d4037]"}),t.jsx("span",{children:"Everything is connected"})]})]})};export{Q as default};