1 line
4.3 KiB
JavaScript
1 line
4.3 KiB
JavaScript
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[405],{5557:function(e,l,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/",function(){return t(5171)}])},5171:function(e,l,t){"use strict";t.r(l),t.d(l,{__N_SSG:function(){return p},default:function(){return f}});var s=t(5893),r=t(7294),n=t(7205);let a=(e,l)=>e===l?"border-t":"";var o=e=>{let{activeTab:l,setActiveTab:t}=e;return(0,s.jsxs)("div",{className:"flex items-center justify-center text-center gap-5 border-t mb-4",children:[(0,s.jsx)("button",{onClick:()=>t("photos"),className:"uppercase tracking-tight font-semibold text-sm border-black pt-3 px-3 ".concat(a("photos",l)),children:"Photos"}),(0,s.jsx)("button",{onClick:()=>t("videos"),className:"uppercase tracking-tight font-semibold text-sm pt-3 px-3 border-black ".concat(a("videos",l)),children:"Videos"})]})},i=e=>{let{media:l,type:t,setOverlayContent:r,currentIndex:n,limitPerPage:a}=e;return(0,s.jsx)("main",{className:"grid grid-cols-3 gap-1",children:l.slice(n,a).map(e=>{let{id:l,url:n,previewPath:a,embedPath:o=n}=e;return(0,s.jsx)("a",{href:n,target:"_blank",rel:"noopener noreferer",onClick:e=>{e.preventDefault(),r({url:o,type:t})},children:(0,s.jsx)("img",{alt:n,loading:"lazy",src:a,className:"aspect-".concat(t)})},l)})})},d=e=>{let{profile:l,totalPosts:t}=e;return(0,s.jsxs)("div",{className:"flex flex-warp",children:[(0,s.jsx)("div",{className:"lg:w-4/12 w-3/12 md:py-10 ml-3 md:ml-0 lg:px-20 md:px-10",children:(0,s.jsx)("img",{alt:l.display_name,src:l.avatar,className:"w-100 rounded-full mx-auto border border-gray-200 p-1"})}),(0,s.jsxs)("div",{className:"lg:w-9/12 md:w-10/12 mb-5 md:p-5 ml-5",children:[(0,s.jsxs)("div",{className:"md:flex items-center",children:[(0,s.jsx)("h2",{className:"text-2xl font-semibold",children:l.username}),(0,s.jsxs)("div",{className:"md:ml-4 my-4",children:[(0,s.jsx)("a",{className:"rounded-md bg-gray-100 px-5 font-semibold py-2 md:ml-2 text-sm leading-relaxed",href:l.follow_url,children:"Follow"}),(0,s.jsx)("a",{className:"rounded-md bg-gray-100 px-5 font-semibold py-2 ml-2 text-sm leading-relaxed",href:l.message_url,children:"Message"})]})]}),(0,s.jsx)("div",{className:"md:my-5 my-3 font-bold text-sm",children:(0,s.jsxs)("p",{children:[t," posts"]})}),(0,s.jsx)("p",{className:"font-bold mb-1",children:l.display_name}),(0,s.jsx)("p",{children:l.about}),(0,s.jsx)("p",{className:"leading-loose font-semibold text-blue-900",children:(0,s.jsx)("a",{target:"_blank",rel:"noopener noreferer",href:"https://".concat(l.link),children:l.link})})]})]})};let c=e=>{let{overlayContent:l}=e;return(null==l?void 0:l.type)===n.oZ.PHOTOS?(0,s.jsx)("img",{alt:null==l?void 0:l.url,src:null==l?void 0:l.url,className:"z-20 cursor-default"}):(null==l?void 0:l.type)===n.oZ.VIDEOS?(0,s.jsx)("iframe",{className:"md:w-6/12 w-full h-1/2",allow:"fullscreen",sandbox:"allow-same-origin allow-scripts allow-popups",src:null==l?void 0:l.url}):void 0};var m=e=>{let{overlayContent:l,closeOverlay:t}=e,r=(null==l?void 0:l.type)!==void 0;return(0,s.jsxs)("div",{onClick:t,className:"".concat(r?"bg-neutral-800/95 fixed w-full h-full left-0 top-0 cursor-pointer":""),children:[r?(0,s.jsx)("p",{onClick:t,className:"fixed right-0 bottom-0 md:mx-5 my-5 text-white rounded text-sm text-center w-full z-30",children:'Click anywhere or press "Escape" to close'}):null,(0,s.jsx)("div",{className:"flex justify-center items-center ".concat(r?"h-full w-full":"h-0 w-0"),children:(0,s.jsx)(c,{overlayContent:l})})]})},u=t(356);let x=e=>{let{activeTab:l,photos:t,videos:r,...a}=e;return l===n.oZ.PHOTOS?(0,s.jsx)(i,{media:t,type:l,...a}):l===n.oZ.VIDEOS?(0,s.jsx)(i,{media:r,type:l,...a}):(0,s.jsx)("div",{className:"text-center pt-10 font-bold text-2xl",children:"nice try"})};var p=!0,f=e=>{let{photos:l,videos:t,totalPosts:a}=e,[i,c]=(0,r.useState)(n.oZ.PHOTOS),[p,f]=(0,r.useState)(0),[h,v]=(0,r.useState)(null),j=()=>v(null),b=e=>{let{keyCode:l}=e;l===n.O_&&j()};return(0,r.useEffect)(()=>(window.addEventListener("keydown",b),()=>{window.removeEventListener("keydown",b)}),[b]),(0,s.jsxs)(r.Fragment,{children:[(0,s.jsx)(d,{profile:u.N5,totalPosts:a}),(0,s.jsx)(o,{activeTab:i,setActiveTab:c}),(0,s.jsx)(m,{overlayContent:h,closeOverlay:j}),(0,s.jsx)(x,{currentIndex:p,setCurrentIndex:f,limitPerPage:n.Zv,activeTab:i,setOverlayContent:v,photos:l,videos:t})]})}}},function(e){e.O(0,[774,888,179],function(){return e(e.s=5557)}),_N_E=e.O()}]); |