ig.rizaldy.club/_next/static/chunks/pages/index-23ef8f4a48181610.js

1 line
4.5 KiB
JavaScript
Raw Normal View History

(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 r=t(5893),s=t(7294),a=t(7205);let n=(e,l)=>e===l?"border-t dark:border-neutral-400":"";var o=e=>{let{activeTab:l,setActiveTab:t}=e;return(0,r.jsxs)("div",{className:"flex items-center justify-center text-center gap-5 border-t mb-4 dark:border-neutral-800",children:[(0,r.jsx)("button",{onClick:()=>t("photos"),className:"uppercase tracking-tight font-semibold text-sm border-black pt-3 px-3 ".concat(n("photos",l)),children:"Photos"}),(0,r.jsx)("button",{onClick:()=>t("videos"),className:"uppercase tracking-tight font-semibold text-sm pt-3 px-3 border-black ".concat(n("videos",l)),children:"Videos"})]})},d=e=>{let{media:l,type:t,setOverlayContent:s,currentIndex:a,limitPerPage:n}=e;return(0,r.jsx)("main",{className:"grid grid-cols-3 gap-1",children:l.slice(a,n).map(e=>{let{id:l,url:a,previewPath:n,embedPath:o=a}=e;return(0,r.jsx)("a",{href:a,target:"_blank",rel:"noopener noreferer",onClick:e=>{e.preventDefault(),s({url:o,type:t})},children:(0,r.jsx)("img",{alt:a,loading:"lazy",src:n,className:"aspect-".concat(t," bg-neutral-100 dark:bg-neutral-900")})},l)})})},i=e=>{let{profile:l,totalPosts:t}=e;return(0,r.jsxs)("div",{className:"flex flex-warp",children:[(0,r.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,r.jsx)("img",{loading:"lazy",alt:l.display_name,src:l.avatar,className:"w-full rounded-full mx-auto border bg-neutral-100 border-gray-200 p-1 dark:border-neutral-800 dark:bg-black"})}),(0,r.jsxs)("div",{className:"lg:w-9/12 md:w-10/12 mb-5 md:p-5 ml-5",children:[(0,r.jsxs)("div",{className:"md:flex items-center",children:[(0,r.jsx)("h2",{className:"text-2xl font-semibold",children:l.username}),(0,r.jsxs)("div",{className:"md:ml-4 my-4",children:[(0,r.jsx)("a",{className:"rounded-md bg-gray-100 px-5 font-semibold py-2 md:ml-2 text-sm leading-relaxed dark:bg-neutral-800",href:l.follow_url,children:"Follow"}),(0,r.jsx)("a",{className:"rounded-md bg-gray-100 px-5 font-semibold py-2 ml-2 text-sm leading-relaxed dark:bg-neutral-800",href:l.message_url,children:"Message"})]})]}),(0,r.jsx)("div",{className:"md:my-5 my-3 font-bold text-sm",children:(0,r.jsxs)("p",{children:[t," posts"]})}),(0,r.jsx)("p",{className:"font-bold mb-1",children:l.display_name}),(0,r.jsx)("p",{children:l.about}),(0,r.jsx)("p",{className:"leading-loose font-semibold text-blue-900 dark:text-blue-200",children:(0,r.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)===a.oZ.PHOTOS?(0,r.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)===a.oZ.VIDEOS?(0,r.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 u=e=>{let{overlayContent:l,closeOverlay:t}=e,s=(null==l?void 0:l.type)!==void 0;return(0,r.jsxs)("div",{onClick:t,className:"".concat(s?"bg-neutral-800/95 fixed w-full h-full left-0 top-0 cursor-pointer":""),children:[s?(0,r.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,r.jsx)("div",{className:"flex justify-center items-center ".concat(s?"h-full w-full":"h-0 w-0"),children:(0,r.jsx)(c,{overlayContent:l})})]})},m=t(356);let x=e=>{let{activeTab:l,photos:t,videos:s,...n}=e;return l===a.oZ.PHOTOS?(0,r.jsx)(d,{media:t,type:l,...n}):l===a.oZ.VIDEOS?(0,r.jsx)(d,{media:s,type:l,...n}):(0,r.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:n}=e,[d,c]=(0,s.useState)(a.oZ.PHOTOS),[p,f]=(0,s.useState)(0),[b,h]=(0,s.useState)(null),g=()=>h(null),v