PageSourceSearch

https://borserebro.ru/assets/construction-bpsTtaMN.js

js borserebro.ru collected 2026-10-01 04:28:38 UTC 19,855 bytes, 1 lines download raw bytes

1import{bx as K,by as F,bz as _,bA as P,j as e,c as V,b8 as Z,r,C as D,T as U,bn as N,X as Q,bm as T,B as J,l as Y,t as ee,u as te,an as se,b as W,e as re}from"./index-CMqj2Al3.js";import{b as ae,c as ne}from"./breadcrumbs-gjvU9Ial.js";import{I as ie}from"./InnerPageHeader-OeZhgWhb.js";import{f as M,A as oe,M as le}from"./utils-DDgAo-D7.js";import{B as G}from"./building-2-BocFibHM.js";import{C as ce}from"./calendar-B7j8GY-U.js";import{F as de}from"./filter-BSPMIhX7.js";import"./arrow-left-DrgORKCk.js";function ue(s){const i=K||window.location.origin,u=typeof s.date=="string"?s.date:s.date.toISOString(),l=s.photos[0]?s.photos[0].startsWith("http")?s.photos[0]:`${i}${s.photos[0]}`:`${i}${F}`;return{"@context":"https://schema.org","@type":"NewsArticle",headline:s.title,datePublished:u,dateModified:u,image:l,author:{"@type":"Organization","@id":`${i}${P}`,name:_},publisher:{"@type":"Organization","@id":`${i}${P}`,name:_,logo:{"@type":"ImageObject",url:`${i}${F}`}},...s.description?{description:s.description}:{},mainEntityOfPage:{"@type":"WebPage","@id":`${i}/construction`}}}function he({latestReport:s}){const u=[ae(ne())];return s&&s.photos.length>0&&u.push(ue(s)),e.jsxs(e.Fragment,{children:[e.jsx(V,{title:"Ход строительства",description:"Фотоотчёты и обновления хода строительства ЖК «Серебряный бор» в Чите. Актуальные фото строительной площадки.",path:"/construction"}),e.jsx(Z,{data:u})]})}function me({reports:s,onCardClick:i,isMobile:u}){const l=r.useRef(null),f=r.useRef(null),h=r.useRef([]),[x,c]=r.useState(0),d=r.useRef(null),b=r.useRef(!1),j=r.useRef(!0),o=r.useRef(null),g=r.useRef(!1),p=r.useMemo(()=>{const t=[];for(const a of s)if(a.photos&&a.photos.length>0)for(const m of a.photos)t.push({url:m,houseNumber:a.houseNumber,date:a.date,title:a.title});return t},[s]),k=Math.min(p.length,u?2:6),C=r.useCallback(()=>{const t=l.current;!t||g.current||c(t.scrollLeft)},[]);r.useEffect(()=>{const t=l.current;if(!t||p.length<2)return;const a=t.children[0];if(!a)return;const m=a.offsetWidth+20,w=k*m;return t.scrollLeft=w,c(w),t.addEventListener("scroll",C,{passive:!0}),window.addEventListener("resize",C),()=>{t.removeEventListener("scroll",C),window.removeEventListener("resize",C)}},[C,p,k]),r.useEffect(()=>{const t=l.current;if(!t||p.length<2)return;const a=()=>{if(g.current)return;const m=t.children[0];if(!m)return;const w=m.offsetWidth+20,R=k*w,n=p.length*w,y=t.scrollLeft;y<=w*.5?(g.current=!0,t.scrollLeft=y+n,requestAnimationFrame(()=>{g.current=!1})):y>=R+n-w*.5&&(g.current=!0,t.scrollLeft=y-n,requestAnimationFrame(()=>{g.current=!1}))};return t.addEventListener("scroll",a,{passive:!0}),()=>t.removeEventListener("scroll",a)},[p,k]),r.useEffect(()=>{const t=f.current;if(!t)return;const a=new IntersectionObserver(([m])=>{j.current=m.isIntersecting},{threshold:.1});return a.observe(t),()=>a.disconnect()},[]),r.useEffect(()=>{const t=l.current;if(!t||p.length<2)return;const a=()=>{!b.current&&!g.current&&j.current&&(t.scrollLeft+=.7),d.current=requestAnimationFrame(a)};return d.current=requestAnimationFrame(a),()=>{d.current&&cancelAnimationFrame(d.current)}},[p]);const S=r.useCallback(()=>{b.current=!0,o.current&&clearTimeout(o.current)},[]),v=r.useCallback(()=>{o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{b.current=!1},2e3)},[]);r.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]);const L=r.useCallback(t=>{const a=l.current,m=h.current[t];if(!a||!m)return{};const w=a.getBoundingClientRect(),R=m.getBoundingClientRect(),n=w.left+w.width/2,I=(R.left+R.width/2-n)/(w.width/2),$=Math.max(-1,Math.min(1,I)),z=1-Math.abs($)*.12,B=1-Math.abs($)*.3;if(u)return{transform:`scale(${z})`,opacity:Math.max(.4,B),willChange:"transform, opacity",transition:"transform 0.05s linear, opacity 0.05s linear"};const H=$*15,X=-Math.abs($)*40;return{transform:`perspective(1500px) rotateY(${H}deg) translateZ(${X}px) scale(${z})`,opacity:Math.max(.5,B),willChange:"transform, opacity",transition:"transform 0.15s ease-out, opacity 0.15s ease-out"}},[x,u]),A=p.length>=2?[...p.slice(-k),...p,...p.slice(0,k)]:p,E=r.useMemo(()=>{const t=new Map;for(const a of s)for(const m of a.photos||[])t.set(m,a);return t},[s]),O=r.useCallback(t=>{const a=E.get(t.url);a&&i&&i(a)},[E,i]);return p.length===0?null:e.jsxs("div",{ref:f,className:"relative",onPointerEnter:S,onPointerLeave:v,onTouchStart:S,onTouchEnd:v,children:[e.jsx("div",{ref:l,className:"flex gap-5 overflow-x-auto px-6 md:px-12 lg:px-20 pb-6 pt-4",style:{scrollbarWidth:"none",msOverflowStyle:"none",WebkitOverflowScrolling:"touch",perspective:"1200px"},"data-testid":"curved-carousel",children:A.map((t,a)=>e.jsx("div",{ref:m=>{h.current[a]=m},className:"flex-shrink-0 w-[240px] md:w-[280px] lg:w-[300px]",style:L(a),children:e.jsxs("div",{className:"relative overflow-hidden rounded-[20px] aspect-[3/4] group cursor-pointer",onClick:()=>O(t),"data-testid":`carousel-card-${a}`,children:[e.jsx("img",{src:t.url,alt:`Ход строительства дом ${t.houseNumber}, ${M(t.date)} — ${t.title}`,className:"absolute inset-0 w-full h-full object-cover transition-transform duration-500 group-hover:scale-105",loading:"lazy",decoding:"async"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/70 via-black/10 to-transparent"}),e.jsxs("div",{className:"absolute bottom-0 left-0 right-0 p-4",children:[e.jsx("p",{className:"text-white/50 text-[10px] uppercase tracking-widest mb-1 font-mono",children:M(t.date)}),e.jsxs("p",{className:"text-white text-lg font-serif font-bold","data-testid":`carousel-item-${a}`,children:["Дом ",t.houseNumber]})]})]})},`${t.houseNumber}-${t.url}-${a}`))}),e.jsx("button",{type:"button",onClick:()=>{var t;return(t=l.current)==null?void 0:t.scrollBy({left:-300,behavior:"smooth"})},className:"absolute left-2 md:left-6 top-1/2 -translate-y-1/2 w-10 h-10 rounded-full bg-white/10 backdrop-blur-md flex items-center justify-center hover:bg-white/20 transition-colors z-10 border border-white/10","data-testid":"hero-scroll-left",children:e.jsx(D,{className:"w-5 h-5 text-white"})}),e.jsx("button",{type:"button",onClick:()=>{var t;return(t=l.current)==null?void 0:t.scrollBy({left:300,behavior:"smooth"})},className:"absolute right-2 md:right-6 top-1/2 -translate-y-1/2 w-10 h-10 rounded-full bg-white/10 backdrop-blur-md flex items-center justify-center hover:bg-white/20 transition-colors z-10 border border-white/10","data-testid":"hero-scroll-right",children:e.jsx(U,{className:"w-5 h-5 text-white"})})]})}function xe(){return e.jsx("div",{className:"flex gap-5 overflow-hidden px-6 md:px-12 lg:px-20 pb-6 pt-4","data-testid":"carousel-skeleton",children:Array.from({length:5}).map((s,i)=>e.jsx("div",{className:"flex-shrink-0 w-[240px] md:w-[280px] lg:w-[300px]",children:e.jsx("div",{className:"rounded-[20px] aspect-[3/4] bg-white/5 animate-pulse"})},`skeleton-${i}`))})}function fe({photos:s,onClose:i,title:u,date:l}){const[f,h]=r.useState(0),x=s.length;return r.useEffect(()=>{const c=d=>{d.key==="Escape"&&i(),d.key==="ArrowLeft"&&h(b=>Math.max(0,b-1)),d.key==="ArrowRight"&&h(b=>Math.min(x-1,b+1))};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[i,x]),e.jsxs(N.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[200] silver-gradient-bg silver-active flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-white/10",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-white font-bold text-lg","data-testid":"gallery-title",children:u}),e.jsx("p",{className:"text-white/50 text-sm",children:M(l)})]}),e.jsx("button",{type:"button",onClick:i,className:"w-10 h-10 rounded-full bg-white/10 flex items-center justify-center hover:bg-white/20 transition-colors","data-testid":"gallery-close",children:e.jsx(Q,{className:"w-5 h-5 text-white"})})]}),e.jsxs("div",{className:"flex-1 flex items-center justify-center relative px-4",children:[f>0&&e.jsx("button",{type:"button",onClick:()=>h(c=>c-1),className:"absolute left-4 w-12 h-12 rounded-full bg-white/10 flex items-center justify-center hover:bg-white/20 transition-colors z-10","data-testid":"gallery-prev",children:e.jsx(D,{className:"w-6 h-6 text-white"})}),e.jsx(T,{mode:"wait",children:e.jsx(N.img,{src:s[f],alt:`Ход строительства ${u} — фото ${f+1} из ${x}`,className:"max-h-[70vh] max-w-full object-contain rounded-lg",initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.2},"data-testid":"gallery-image"},f)}),f<x-1&&e.jsx("button",{type:"button",onClick:()=>h(c=>c+1),className:"absolute right-4 w-12 h-12 rounded-full bg-white/10 flex items-center justify-center hover:bg-white/20 transition-colors z-10","data-testid":"gallery-next",children:e.jsx(U,{className:"w-6 h-6 text-white"})})]}),e.jsx("div",{className:"flex items-center justify-center gap-2 py-4",children:e.jsxs("span",{className:"text-white/50 text-sm",children:[f+1," / ",x]})}),e.jsx("div",{className:"flex gap-2 px-6 pb-6 overflow-x-auto justify-center",style:{scrollbarWidth:"none"},children:s.map((c,d)=>e.jsx("button",{type:"button",onClick:()=>h(d),className:`flex-shrink-0 w-16 h-16 rounded-lg overflow-hidden border-2 transition-colors ${d===f?"border-primary":"border-transparent opacity-50 hover:opacity-80"}`,"data-testid":`gallery-thumb-${d}`,children:e.jsx("img",{src:c,alt:`${u} — миниатюра ${d+1}`,className:"w-full h-full object-cover"})},c))})]})}function pe({report:s,onOpen:i}){return e.jsxs(N.button,{type:"button",initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"bg-[#141414] rounded-2xl overflow-hidden border border-white/5 hover:border-white/10 transition-all cursor-pointer group text-left w-full",onClick:i,"data-testid":`report-card-${s.id}`,children:[e.jsx("div",{className:"relative",children:e.jsxs("div",{className:"aspect-[16/10] relative overflow-hidden",children:[e.jsx("img",{src:s.photos[0],alt:`Ход строительства дом ${s.houseNumber} — ${s.title}`,className:"absolute inset-0 w-full h-full object-cover transition-transform duration-500 group-hover:scale-105",loading:"lazy",decoding:"async"}),s.photos.length>1&&e.jsxs("div",{className:"absolute bottom-2 right-2 bg-black/60 backdrop-blur-sm text-white text-[10px] font-medium px-2 py-0.5 rounded-full",children:["+",s.photos.length-1," фото"]})]})}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-primary bg-primary/20/30 px-2 py-0.5 rounded-full",children:[e.jsx(G,{className:"w-3 h-3"}),"Дом №",s.houseNumber]}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-gray-500",children:[e.jsx(ce,{className:"w-3 h-3"}),M(s.date)]})]}),e.jsx("h3",{className:"font-semibold text-sm text-white leading-snug","data-testid":`report-title-${s.id}`,children:s.title}),s.description&&e.jsx("p",{className:"text-xs text-gray-500 mt-1 line-clamp-2",children:s.description}),e.jsxs("p",{className:"text-xs text-primary mt-2 font-medium",children:[s.photos.length," фото →"]})]})]})}function be({showFilters:s,setShowFilters:i,selectedHouse:u,selectedYear:l,selectedMonth:f,activeFilters:h,applyFilter:x,setSelectedHouse:c,setSelectedYear:d,setSelectedMonth:b,resetFilters:j}){return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx("h3",{className:"text-lg md:text-xl font-bold text-white","data-testid":"reports-section-title",children:"Отчёты о строительстве"}),e.jsxs(J,{variant:"outline",size:"sm",onClick:()=>i(!s),className:"relative bg-transparent border-white/10 text-white/70 hover:bg-white/5 hover:text-white","data-testid":"button-toggle-filters",children:[e.jsx(de,{className:"w-4 h-4 mr-1.5"}),"Фильтры",h>0&&e.jsx("span",{className:"absolute -top-1.5 -right-1.5 w-5 h-5 bg-primary text-white text-[10px] font-bold rounded-full flex items-center justify-center",children:h})]})]}),e.jsx(T,{children:s&&e.jsx(N.div,{initial:{height:0,opacity:0}
1,animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"overflow-hidden mb-6",children:e.jsxs("div",{className:"bg-white/5 rounded-xl p-4 space-y-4 border border-white/5",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-medium text-gray-500 uppercase tracking-wide mb-2 block",children:"Дом"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("button",{type:"button",onClick:()=>x(c,null),className:`px-3 py-1.5 rounded-lg text-xs font-medium transition-colors ${u?"bg-white/5 text-gray-400 hover:bg-white/10 border border-white/10":"bg-primary text-white"}`,"data-testid":"filter-house-all",children:"Все"}),oe.map(o=>e.jsxs("button",{type:"button",onClick:()=>x(c,o),className:`px-3 py-1.5 rounded-lg text-xs font-medium transition-colors ${u===o?"bg-primary text-white":"bg-white/5 text-gray-400 hover:bg-white/10 border border-white/10"}`,"data-testid":`filter-house-${o}`,children:["Дом ",o]},o))]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-medium text-gray-500 uppercase tracking-wide mb-2 block",children:"Год"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("button",{type:"button",onClick:()=>{x(d,null),b(null)},className:`px-3 py-1.5 rounded-lg text-xs font-medium transition-colors ${l?"bg-white/5 text-gray-400 hover:bg-white/10 border border-white/10":"bg-primary text-white"}`,"data-testid":"filter-year-all",children:"Все"}),[2025,2026].map(o=>e.jsx("button",{type:"button",onClick:()=>x(d,o),className:`px-3 py-1.5 rounded-lg text-xs font-medium transition-colors ${l===o?"bg-primary text-white":"bg-white/5 text-gray-400 hover:bg-white/10 border border-white/10"}`,"data-testid":`filter-year-${o}`,children:o},o))]})]}),l&&e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-medium text-gray-500 uppercase tracking-wide mb-2 block",children:"Месяц"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("button",{type:"button",onClick:()=>x(b,null),className:`px-3 py-1.5 rounded-lg text-xs font-medium transition-colors ${f?"bg-white/5 text-gray-400 hover:bg-white/10 border border-white/10":"bg-primary text-white"}`,"data-testid":"filter-month-all",children:"Все"}),le.map((o,g)=>e.jsx("button",{type:"button",onClick:()=>x(b,g+1),className:`px-3 py-1.5 rounded-lg text-xs font-medium transition-colors ${f===g+1?"bg-primary text-white":"bg-white/5 text-gray-400 hover:bg-white/10 border border-white/10"}`,"data-testid":`filter-month-${g+1}`,children:o.slice(0,3)},o))]})]}),h>0&&e.jsx("button",{type:"button",onClick:j,className:"text-xs text-primary hover:text-primary/80 font-medium","data-testid":"button-reset-filters",children:"Сбросить фильтры"})]})})})]})}const q=12;function $e(){r.useEffect(()=>(Y.track("page_view","view","Construction"),ee("construction")),[]),te();const s=se(),[i,u]=r.useState(null),[l,f]=r.useState(null),[h,x]=r.useState(null),[c,d]=r.useState(0),[b,j]=r.useState([]),[o,g]=r.useState(null),[p,k]=r.useState(!1),C=r.useRef(null),S=r.useMemo(()=>{const n=new URLSearchParams;return i&&n.set("house",String(i)),l&&n.set("year",String(l)),h&&n.set("month",String(h)),n.set("limit",String(q)),n.set("offset",String(c)),n.toString()},[i,l,h,c]),{data:v,isLoading:L}=W({queryKey:["/api/construction-reports",S],queryFn:async()=>{const n=await fetch(`/api/construction-reports?${S}`);if(!n.ok)throw new Error("Failed to fetch");return n.json()}});r.useEffect(()=>{v!=null&&v.data&&j(c===0?v.data:n=>{const y=new Set(n.map($=>$.id)),I=v.data.filter($=>!y.has($.id));return[...n,...I]})},[v,c]);const A=v?b.length<v.total:!1,E=r.useCallback(()=>{u(null),f(null),x(null),d(0),j([])},[]),O=r.useCallback((n,y)=>{n(y),d(0),j([])},[]),{data:t,isLoading:a}=W({queryKey:["/api/construction-reports","latest"],queryFn:async()=>{const n=await fetch("/api/construction-reports?limit=15&offset=0");if(!n.ok)throw new Error("Failed to fetch");return n.json()}}),m=(t==null?void 0:t.data)||[],w=[i,l,h].filter(Boolean).length,R=r.useCallback(()=>{var n;(n=C.current)==null||n.scrollIntoView({behavior:"smooth"})},[]);return e.jsxs("div",{className:"min-h-screen flex flex-col overflow-hidden silver-gradient-bg silver-active",children:[e.jsx(he,{latestReport:m[0]||null}),e.jsx(ie,{title:"Ход строительства"}),e.jsxs("div",{className:"pt-24 md:pt-32 pb-4",children:[e.jsxs("div",{className:"text-center mb-10 md:mb-14 px-4",children:[e.jsx(N.h2,{initial:{opacity:0,y:20}
1,animate:{opacity:1,y:0},className:"text-3xl md:text-5xl lg:text-6xl font-serif font-bold text-white mb-3","data-testid":"hero-title",children:"Ход строительства"}),e.jsx(N.p,{initial:{opacity:0,y:15},animate:{opacity:1,y:0},transition:{delay:.1},className:"text-gray-500 text-sm md:text-base max-w-md mx-auto",children:"Следите за прогрессом строительства жилого комплекса"})]}),e.jsx(N.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},children:a?e.jsx(xe,{}):e.jsx(me,{reports:m,onCardClick:n=>g(n),isMobile:s})}),e.jsx(N.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.6},className:"flex justify-center pt-6 pb-8",children:e.jsxs("button",{type:"button",onClick:R,className:"flex flex-col items-center gap-2 text-dim-subtle hover:text-white/70 transition-colors group","data-testid":"button-scroll-down",children:[e.jsx("span",{className:"text-xs uppercase tracking-widest font-mono",children:"Подробнее"}),e.jsx(N.div,{animate:{y:[0,8,0]},transition:{duration:1.5,repeat:1/0,ease:"easeInOut"},children:e.jsx(re,{className:"w-6 h-6"})})]})})]}),e.jsx("div",{ref:C,className:"border-t border-white/5 flex-1",style:{scrollMarginTop:"4rem"},children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 md:px-8 lg:px-12 py-8 md:py-12",children:[e.jsx(be,{showFilters:p,setShowFilters:k,selectedHouse:i,selectedYear:l,selectedMonth:h,activeFilters:w,applyFilter:O,setSelectedHouse:u,setSelectedYear:f,setSelectedMonth:x,resetFilters:E}),L&&c===0?e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-5",children:Array.from({length:6}).map((n,y)=>e.jsxs("div",{className:"bg-[#141414] rounded-2xl overflow-hidden animate-pulse border border-white/5",children:[e.jsx("div",{className:"aspect-[16/10] bg-white/5"}),e.jsxs("div",{className:"p-4 space-y-2",children:[e.jsx("div",{className:"h-4 bg-white/5 rounded w-1/3"}),e.jsx("div",{className:"h-4 bg-white/5 rounded w-2/3"})]})]},`skeleton-${y}`))}):b.length===0?e.jsxs("div",{className:"text-center py-16",children:[e.jsx(G,{className:"w-12 h-12 text-gray-700 mx-auto mb-4"}),e.jsx("p",{className:"text-gray-500 text-sm",children:"Отчёты не найдены"}),w>0&&e.jsx("button",{type:"button",onClick:E,className:"mt-3 text-sm text-primary hover:text-primary/80 font-medium","data-testid":"button-empty-reset",children:"Сбросить фильтры"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-5","data-testid":"reports-grid",children:b.map(n=>e.jsx(pe,{report:n,onOpen:()=>g(n)},n.id))}),A&&e.jsx("div",{className:"flex justify-center mt-8",children:e.jsx(J,{variant:"outline",size:"lg",onClick:()=>d(n=>n+q),disabled:L,className:"px-8 bg-transparent border-white/10 text-white/70 hover:bg-white/5 hover:text-white","data-testid":"button-load-more",children:L?"Загрузка...":"Показать ещё"})})]})]})}),e.jsx(T,{children:o&&e.jsx(fe,{photos:o.photos,title:o.title,date:o.date,onClose:()=>g(null)})})]})}export{$e 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.