templates/includes/cards/default.html.twig line 1

Open in your IDE?
  1. {% set page = project.page() %}
  2. {% set mod = 1 %}
  3. {% set sector = project.sectors | first %}
  4. {% set image = project.visuals.current() %}
  5. {% if labelOverride is defined and labelOverride is not empty %}
  6.     {% set customLabel = labelOverride %}
  7. {% else %}
  8.     {% set customLabel = null %}
  9. {% endif %}
  10. <div
  11.     class="block col-span-12 transition duration-300 bg-white hover:text-blue relative rounded overflow-hidden {{ class ?? '' }}">
  12.     <a
  13.         href="{{ page ? (page.url | trimUrl) : '' }}"
  14.         class="relative"
  15.     >
  16.         {% if image %}
  17.             {{ image.getThumbnail('project-card').html({
  18.                 pictureAttributes: {class: 'block overflow-hidden'},
  19.                 imgAttributes: {class: 'w-full'},
  20.             })|raw }}
  21.         {% endif %}
  22.         {% if customLabel is not empty %}
  23.             {% include 'includes/cards/partials/label.html.twig' with {
  24.                 label: customLabel,
  25.                 position: 'absolute top-6 right-6'
  26.             } %}
  27.         {% elseif sector is defined and sector %}
  28.             {% set icon = sector.icon %}
  29.             {% include 'includes/cards/partials/label.html.twig' with {
  30.                 label: sector.branchename,
  31.                 labelIcon: icon,
  32.                 position: 'absolute top-6 right-6'
  33.             } %}
  34.         {% endif %}
  35.     </a>
  36.     <div class="p-6">
  37.         <a href="{{ page ? (page.url | trimUrl) : '' }}">
  38.             <h3 class="text-xl">
  39.                 {{ project.title }}
  40.             </h3>
  41.             <p class="mb-3">
  42.                 {{ (project.meta_description ?: (project.webdesq_content|striptags|slice(0, 44) ~ '...'))|raw }}
  43.             </p>
  44.             <div class="flex justify-end pt-8">
  45.                 <span
  46.                     class=" absolute right-6 bottom-6 flex items-center justify-center w-8 h-8 ml-3 transition-all bg-white rounded-full text-blue border-2 border-blue group-hover:bg-blue group-hover:text-white">
  47.                     <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="14"
  48.                          height="10" viewBox="0 0 15.5857104 11.2450309" version="1.1">
  49.                         <g stroke="none" stroke-width="1" fill="none"
  50.                            fill-rule="evenodd">
  51.                             <g transform="translate(-895.000000, -698.366712)"
  52.                                fill="#0072BB">
  53.                                 <g id="img+text" transform="translate(0.000000, 174.000000)">
  54.                                     <g id="Group-13" transform="translate(316.000000, 80.000000)">
  55.                                         <g id="Group-10" transform="translate(0.000000, 395.000000)">
  56.                                             <g id="Group-5" transform="translate(562.000000, 30.000000)">
  57.                                                 <g id="icons/ui/arrow-line-right"
  58.                                                    transform="translate(17.000000, 19.000000)">
  59.                                                     <path
  60.                                                         d="M15.1058206,5.09504853 L3.39640583,5.09504853 L3.39640583,5.09504853 L6.61428562,1.8778871 C6.96000795,1.53224195 6.96007051,0.971777868 6.61442536,0.626055538 C6.61440207,0.626032244 6.61437878,0.626008952 6.61435549,0.625985661 C6.26865793,0.280288095 5.70817143,0.280288095 5.36247386,0.625985661 C5.36245892,0.62600061 5.36244397,0.626015558 5.36242902,0.626030508 L0.70705612,5.28207051 C0.316700705,5.67268453 0.316700705,6.30577137 0.70705612,6.69638539 L5.36242902,11.3524254 C5.70810182,11.6981477 6.26858831,11.6981879 6.61431065,11.3525151 C6.6143256,11.3525001 6.61434055,11.3524852 6.61435549,11.3524702 C6.96003924,11.0067865 6.96003924,10.4463224 6.61435549,10.1006387 C6.6143322,10.1006154 6.61430891,10.1005921 6.61428562,10.1005688 L3.39640583,6.88340737 L3.39640583,6.88340737 L15.1058206,6.88340737 C15.5996622,6.88340737 16,6.48306961 16,5.98922795 C16,5.49538629 15.5996622,5.09504853 15.1058206,5.09504853 Z"
  61.                                                         id="arrow-line-right"
  62.                                                         transform="translate(8.000000, 5.989228) scale(-1, 1) translate(-8.000000, -5.989228) "/>
  63.                                                 </g>
  64.                                             </g>
  65.                                         </g>
  66.                                     </g>
  67.                                 </g>
  68.                             </g>
  69.                         </g>
  70.                     </svg>
  71.                 </span>
  72.             </div>
  73.         </a>
  74.     </div>
  75. </div>