public/themes/karen/modules/article-bar.html.twig line 1

Open in your IDE?
  1. {% set articles = getArticles({} , 'latest',10) %}
  2.         {% if articles|length > 0 %}
  3. <section class="mx-4 lg:container mt-10 lg:mt-20">
  4.     <div class="flex flex-col gap-y-4 xs:flex-row items-center justify-between w-full text-center xs:text-start">
  5.         <div class="flex items-center gap-x-2 sm:gap-x-4">
  6.                     <span class="size-12 hidden xs:flex rounded-lg bg-white shadow-lg dark:bg-gray-800 flex-center">
  7.                         <svg class="size-7 text-gray-700 dark:text-gray-100">
  8.                             <use href="#check-badge"></use>
  9.                         </svg>
  10.                     </span>
  11.             <div class="space-y-1 md:space-y-1">
  12.                 <h3 class="text-xl md:text-2xl font-MorabbaMedium text-gray-800 dark:text-gray-50">محبوب‌ترین
  13.                     <span class="text-blue-600 dark:text-blue-500">مقالات</span>
  14.                 </h3>
  15.                 <p class="text-sm text-gray-500 dark:text-gray-300">جدیدترین و بروزترین مقالات</p>
  16.             </div>
  17.         </div>
  18.         <div class="w-full xs:w-auto flex justify-between xs:justify-end  items-center gap-x-2">
  19.             <div class="flex items-center gap-x-2">
  20.                 <button class="slider-navigate_btn articleSlider-prev-slide">
  21.                     <svg class="size-6 -rotate-90">
  22.                         <use href="#chevron"/>
  23.                     </svg>
  24.                 </button>
  25.                 <button class="slider-navigate_btn articleSlider-next-slide">
  26.                     <svg class="size-6 rotate-90">
  27.                         <use href="#chevron"/>
  28.                     </svg>
  29.                 </button>
  30.             </div>
  31.             <a href="{{ path('app_shop_site_blog') }}"
  32.                class="group shadow-xl text-sm md:text-base flex gap-x-1.5 items-center px-2 h-10 md:px-3 text-white bg-blue-600 rounded-xl">
  33.                 <p>مشاهده همه</p>
  34.                 <span
  35.                         class="w-7 h-7 rounded-full bg-blue-500 flex-center md:group-hover:-translate-x-1 transition-transform duration-300">
  36.                             <svg class="size-5">
  37.                                 <use href="#arrow"/>
  38.                             </svg>
  39.                         </span>
  40.             </a>
  41.         </div>
  42.     </div>
  43.     <div class="swiper articleSlider w-full mt-5">
  44.         <div class="swiper-wrapper w-full py-5">
  45.             {% for item in articles  %}
  46.                 <div class="swiper-slide group article-box">
  47.                     <div class="relative overflow-hidden rounded-lg">
  48.                         <img src="{{ path('app_cdn_path' , {'path' :item.imageUrl }) }}" class="article-box_img" alt="{{ item.title }}"/>
  49.                         <div
  50.                                 class="absolute opacity-0 left-0 top-0 bottom-0 right-0 bg-black/60 flex items-center justify-center group-hover:opacity-100 duration-300 transition-all rounded-bl-3xl rounded-tr-3xl">
  51.                             <a href="{{ path('app_shop_site_blog_single' , {'urlSlug' : item.urlSlug}) }}"
  52.                                class="flex items-center px-2 py-1 gap-x-1 font-DanaMedium rounded-lg border-2 border-white text-white">
  53.                                 <p>ادامه مطالب</p>
  54.                                 <svg class="w-4 h-4 rotate-90">
  55.                                     <use href="#chevron"></use>
  56.                                 </svg>
  57.                             </a>
  58.                         </div>
  59.                     </div>
  60.                     <div class="flex flex-col gap-y-1 py-5 px-1">
  61.                         <h2 class="font-DanaDemiBold"> {{ item.title }} </h2>
  62.                     </div>
  63.                     <span class="flex w-full h-1 py-1 border-t border-gray-100 dark:border-white/10"></span>
  64.                     <div class="flex items-center justify-between text-sm px-1">
  65.                             <span class="flex items-center gap-x-1 text-blue-500 dark:text-sky-400">
  66.                                 <svg class="w-4 h-4">
  67.                                     <use href="#calendar"></use>
  68.                                 </svg>
  69.                                 <p class="mt-1">       {{ item.createdAt|persianDate }}</p>
  70.                             </span>
  71. {#                        <span class="flex items-start gap-x-1 text-gray-300">#}
  72. {#                                <p class="font-DanaDemiBold">120</p>#}
  73. {#                                <svg class="w-4 h-4">#}
  74. {#                                    <use href="#eye"></use>#}
  75. {#                                </svg>#}
  76. {#                            </span>#}
  77.                     </div>
  78.                 </div>
  79.             {% endfor %}
  80.         </div>
  81.     </div>
  82. </section>
  83. {% endif %}