Files
ntspi-app/public/build/assets/PostItemBlock-B3bvWdQ2.js
T
2024-10-28 12:57:16 +05:00

2 lines
2.9 KiB
JavaScript

import"./SearchModal-YI3bdWA9.js";import{m as r,i as n,r as d,o as l,c as i,k as c,a as u,w as p,b as e,t as g,j as f}from"./app-lT3z3TR3.js";import{_ as m}from"./_plugin-vue_export-helper-DlAUqK2U.js";const h={name:"PostListBlock",components:{axios:r,Link:n},data(){return{post:null,loading:!0}},methods:{getPost(t){r.get(route("client.widget.post.single",t),{params:{count:this.block.data.count,category:this.block.data.category}}).then(s=>{this.post=s.data,this.loading=!1}).catch(s=>{console.error("Ошибка:",s),this.loading=!1})}},mounted(){this.getPost(this.block.data.post)},props:{block:{type:Object}}},v={class:"w-full px-4 py-5 sm:px-6 lg:px-8 lg:py-7 mx-auto"},x={key:0,class:"flex flex-col space-y-4"},w={key:1,class:"grid lg:grid-cols-1 lg:gap-y-16 gap-10"},y={class:"flex flex-col sm:flex-row sm:items-center gap-3 sm:gap-5"},b={class:"shrink-0 relative rounded-xl overflow-hidden w-full sm:w-56 h-44"},k=["src"],_={class:"grow"},B={class:"text-xl font-semibold text-gray-800 group-hover:text-gray-600"};function P(t,s,j,L,o,N){const a=d("Link");return l(),i("div",v,[o.loading?(l(),i("div",x,s[0]||(s[0]=[c('<div class="flex animate-pulse"><div class="shrink-0 relative rounded-xl overflow-hidden w-full sm:w-56 h-44"><div class="bg-gray-200 group-focus:scale-105 transition-transform duration-500 ease-in-out size-full absolute top-0 start-0 object-cover rounded-xl"></div></div><div class="ms-4 mt-2 w-full"><p class="h-4 bg-gray-200 rounded-full" style="width:40%;"></p><ul class="mt-5 space-y-3 flex flex-col"><li class="w-full h-4 bg-gray-200 rounded-full"></li><li class="w-full h-4 bg-gray-200 rounded-full"></li><li class="w-full h-4 bg-gray-200 rounded-full"></li><li class="w-full h-4 bg-gray-200 rounded-full"></li><li class="w-20 h-4 bg-gray-200 rounded-full"></li></ul></div></div>',1)]))):(l(),i("div",w,[u(a,{class:"group block rounded-xl overflow-hidden focus:outline-none",href:t.route("client.post.show",o.post.data.slug)},{default:p(()=>[e("div",y,[e("div",b,[e("img",{class:"group-hover:scale-105 group-focus:scale-105 transition-transform duration-500 ease-in-out size-full absolute top-0 start-0 object-cover rounded-xl",src:o.post.data.preview?"storage/images/"+o.post.data.preview:"/img/thumbnail-1.png"},null,8,k)]),e("div",_,[e("h3",B,g(o.post.data.title),1),s[1]||(s[1]=e("p",{class:"mt-3 text-gray-600"}," Produce professional, reliable streams easily leveraging Preline's innovative broadcast studio ",-1)),s[2]||(s[2]=e("p",{class:"mt-4 inline-flex items-center gap-x-1 text-sm text-primaryBlue decoration-2 group-hover:underline group-focus:underline font-medium"},[f(" Читать далее "),e("svg",{class:"shrink-0 size-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("path",{d:"m9 18 6-6-6-6"})])],-1))])])]),_:1},8,["href"])]))])}const S=m(h,[["render",P]]);export{S as default};