<?php
$html_id = pxl_get_element_id($settings);
?>
<?php if(isset($settings['lists']) && !empty($settings['lists']) && count($settings['lists'])):?>
    <div class="pxl-list-active pxl-list-active1">
    	<div class="pxl-item-inner">
    		<div class="pxl-inner-change">
		        <div class="bgr-change"></div>
		    </div>
    		<div class="pxl-content-meta">
    			<div class="pxl-item-heading">
	                <?php echo esc_attr($settings['heading']); ?>
	            </div>
    			<div class="pxl-item-desc">
	                <?php echo esc_attr($settings['desc']); ?>
	            </div>
    			<div class="pxl-list-inner">
		    		<?php foreach ($settings['lists'] as $key => $value):
		    			$image = isset($value['image']) ? $value['image'] : '';
			            $link_key = $widget->get_repeater_setting_key( 'link_item', 'value', $key );
			            if ( ! empty( $value['link_item']['url'] ) ) {
			                $widget->add_render_attribute( $link_key, 'href', $value['link_item']['url'] );

			                if ( $value['link_item']['is_external'] ) {
			                    $widget->add_render_attribute( $link_key, 'target', '_blank' );
			                }

			                if ( $value['link_item']['nofollow'] ) {
			                    $widget->add_render_attribute( $link_key, 'rel', 'nofollow' );
			                }
			            }
			            $link_attributes = $widget->get_render_attribute_string( $link_key ); 
		    		 	?>
			            <div id="<?php echo esc_attr($html_id.$key); ?>" class="pxl-item <?php echo esc_attr($settings['pxl_animate']); ?>" data-wow-delay="<?php echo esc_attr($settings['pxl_animate_delay']); ?>ms" style="background-image: url(<?php echo esc_attr($value['image']['url']); ?>);">
		                    <div class="pxl-item-content">
		                    	<div class="pxl-item--title">
				                    <?php echo pxl_print_html($value['title'])?>
				                </div>
		                    </div>
		                    <a class="pxl-item--link" <?php echo implode( ' ', [ $link_attributes ] ); ?>></a>
		                    <div class="pxl-item-img-content">
                                <div class="pxl-item-meta">
                                	<div class="pxl-meta--title">
					                    <?php echo pxl_print_html($value['meta_title'])?>
					                </div>
					                <div class="pxl-meta--desc">
					                    <?php echo pxl_print_html($value['meta_desc'])?>
					                </div>
					                <div class="pxl-meta-link">
					                	<a <?php echo implode( ' ', [ $link_attributes ] ); ?>>
					                		<svg xmlns="http://www.w3.org/2000/svg" fill="#000" height="512" viewBox="0 0 24 24" width="512"><path d="m16.0039 9.414-8.60699 8.607-1.414-1.414 8.60599-8.607h-7.58499v-2h10.99999v11h-2z" fill="rgb(0,0,0)"></path></svg>
					                	</a>
					                </div>
                                </div>
		                    </div>
			            </div>
			        <?php endforeach; ?>
		    	</div>
    		</div>
    	</div>
    </div>
<?php endif; ?>