PageSourceSearch

https://boysreview.com/static/app/js/HotOrNotPage-DvEd6UkH.js

js boysreview.com collected 2026-10-10 01:33:15 UTC 5,448 bytes, 6 lines download raw bytes

1import{h as k,r as n,b as w,j as e,H as S,k as z,L as f,ab as L,p as C,B as j,v as H,f as P,K as T}from"./index-BSEGU3Pg.js";import{F as y}from"./flame-DwZaRKc0.js";import{T as E}from"./thumbs-down-DIhvZMlD.js";/**
2 * @license lucide-react v0.562.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const V=[["path",{d:"M21 4v16",key:"7j8fe9"}],["path",{d:"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"zs4d6"}]],F=k("skip-forward",V);function B(){const[o,d]=n.useState(null),[i,m]=n.useState(!0),[r,l]=n.useState(!1),[b,h]=n.useState({totalVotes:0,hotPercentage:0}),u=w(),g=n.useRef(0),x=async()=>{try{const s=await fetch(`${T}/hotornot/random?_=${Date.now()}`,{cache:"no-store",headers:{"Cache-Control":"no-cache",Pragma:"no-cache"}});if(!s.ok)return null;const t=await s.json(),a=t.photo||t;return a&&a.id?{id:a.id,title:a.title,categoryId:a.categoryId,categoryName:a.categoryName,categorySlug:a.categorySlug||(a.categoryName?a.categoryName.toLowerCase().replace(/\s+/g,"-"):""),image:a.image||a.thumbnail||t.image||t.thumbnail,stats:t.stats||a.stats||{totalVotes:0,hotPercentage:0}}:null}catch(s){return console.error("Fetch error:",s),null}};n.useEffect(()=>{(async()=>{m(!0);const s=await x();d(s),s&&h(s.stats),m(!1)})()},[]);const c=async s=>{if(!o||r)return;l(!0),console.log("Voting:",s?"hot":"not","for photo:",o.id),fetch("/br-backend/hotornot/vote",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({photoId:o.id,vote:s?"hot":"not"})}).then(a=>a.json()).then(a=>console.log("Vote result:",a)).catch(a=>console.error("Vote error:",a));const t=await x();console.log("Next photo:",t==null?void 0:t.id),d(t),t&&h(t.stats),l(!1)},p=async()=>{if(r)return;l(!0);const s=await x();d(s),s&&h(s.stats),l(!1)},N=s=>{g.current=s.touches[0].clientX},v=s=>{if(i||r)return;const t=g.current-s.changedTouches[0].clientX;Math.abs(t)>80&&c(t<0)};return n.useEffect(()=>{const s=t=>{i||r||(t.key==="ArrowLeft"||t.key==="n"?c(!1):t.key==="ArrowRight"||t.key==="h"?c(!0):(t.key===" "||t.key==="s")&&(t.preventDefault(),p()))};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[i,r,o]),e.jsxs(e.Fragment,{children:[e.jsxs(S,{children:[e.jsx("title",{children:"Hot or Not - Rate Photos | BoysReview"}),e.jsx("meta",{name:"description",content:"Vote on the hottest photos."}),e.jsx("link",{rel:"canonical",href:z("/hotornot")})]}),e.jsxs("nav",{className:"flex items-center gap-2 text-sm text-gray-400 mb-6",children:[e.jsxs(f,{to:u("/"),className:"hover:text-primary-400 flex items-center gap-1",children:[e.jsx(L,{size:14})," Home"]}),e.jsx(C,{size:14}),e.jsx("span",{className:"text-white",children:"Hot or Not"})]}),e.jsx(j,{position:"top"}),e.jsxs("div",{className:"max-w-2xl mx-auto",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsxs("h1",{className:"text-3xl font-bold text-white mb-2 flex items-center justify-center gap-3",children:[e.jsx(y,{className:"text-orange-500",size:32}),"Hot or Not"]}),e.jsx("p",{className:"text-gray-400",children:"Swipe or tap to rate"})]}),e.jsx("div",{className:"bg-dark-900 rounded-xl overflow-hidden shadow-xl",onTouchStart:N,onTouchEnd:v,children:i?e.jsx("div",{className:"aspect-[3/4] flex items-center justify-center bg-dark-800",children:e.jsx(H,{className:"w-12 h-12 animate-spin text-primary-500"})}):o?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"relative",children:[e.jsx("img",{src:o.image,alt:o.title||"Rate this photo",className:"w-full aspect-[3/4] object-cover"},o.id),e.jsxs("div",{className:"absolute top-4 right-4 bg-black/60 rounded-lg px-3 py-1.5 text-sm text-white flex items-center gap-2",children:[e.jsx(P,{size:14}),b.totalVotes," votes"]}),e.jsxs("div",{className:"absolute top-4 left-4 bg-black/60 rounded-lg px-3 py-1.5 text-xs text-gray-300",children:["ID: ",o.id]})]}),o.categoryName&&e.jsx("div",{className:"p-4 border-b border-dark-700",children:e.jsxs(f,{to:u(`/gallery/${o.categorySlug}`),className:"text-primary-400 hover:text-primary-300 text-sm",children:["From: ",o.categoryName]})}),e.jsx("div",{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-center gap-6",children:[e.jsxs("button",{onClick:()=>c(!1),disabled:r,className:"flex flex-col items-center gap-2 p-4 rounded-xl bg-blue-600/20 hover:bg-blue-600/40 text-blue-400 disabled:opacity-50",children:[e.jsx(E,{size:40}),e.jsx("span",{className:"font-medium",children:"Not"})]}),e.jsxs("button",{onClick:p,disabled:r,className:"flex flex-col items-center gap-2 p-4 rounded-xl bg-dark-700 hover:bg-dark-600 text-gray-400 disabled:opacity-50",children:[e.jsx(F,{size:32}),e.jsx("span",{className:"text-sm",children:"Skip"})]}),e.jsxs("button",{onClick:()=>c(!0),disabled:r,className:"flex flex-col items-center gap-2 p-4 rounded-xl bg-orange-600/20 hover:bg-orange-600/40 text-orange-400 disabled:opacity-50",children:[e.jsx(y,{size:40}),e.jsx("span",{className:"font-medium",children:"Hot!"})]})]})})]}):e.jsx("div",{className:"aspect-[3/4] flex items-center justify-center bg-dark-800",children:e.jsx("p",{className:"text-gray-400",children:"No photos available"})})}),e.jsx("div",{className:"mt-6 p-4 bg-dark-800/50 rounded-lg text-center text-sm text-gray-500",children:"← N = Not | → H = Hot | Space = Skip"})]}),e.jsx(j,{position:"bottom"})]})}
6export{B as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.