drinkmaker
11/10/2015 - 9:37 AM

workouts.php

workouts.php

<?php
/**
 * Aklere Features template for module mod_articles_category, exclusively on Envato Market: http://codecanyon.net/user/aklare
 * @encoding     UTF-8
 * @version      1.0
 * @copyright    Copyright (C) 2015 Aklare (http://aklare.com). All rights reserved.
 * @license      GNU General Public License version 2 or later, see http://www.gnu.org/licenses/gpl-2.0.html
 * @author       Alexandr Khmelnytsky (support@aklare.com)
 */

defined('_JEXEC') or die; ?>

<div class="newsflash-workouts tm-page-workouts<?php echo $moduleclass_sfx; ?>">
    
    
    <div class="uk-grid" data-uk-grid-margin="" data-uk-grid-match="{target:'.uk-panel'}">
        <?php $delay = 0; ?>
        <?php foreach ($list as $item) : ?>
            <?php 
                $delay = $delay + 200;// Animation delay
                // Item width depending on the number of elements
                $count = count($list);
                $widthLarge = 1;
                if ($count==1) {
                    $widthLarge = 1;
                } elseif ($count == 2) { 
                    $widthLarge = 2; 
                } elseif ($count == 3) { 
                    $widthLarge = 3; 
                } else {
                    $widthLarge = 4; 
                }
            ?>
            <div class="uk-width-medium-1-1 uk-width-large-1-<?=$widthLarge?> uk-text-left" data-uk-scrollspy="{cls:'uk-animation-scale-up', repeat: true, delay:<?=$delay?>}">
                <div class="uk-width-1-1">
                    <div class="uk-panel tm-workouts" onclick="location.href='<?php echo $item->link; ?>';">
                        <?php $image_intro = json_decode($item->images)->image_intro; ?>
                        
                        <div class="uk-cover-background uk-position-relative" style="background-image: url(<?php if($image_intro) {echo $image_intro;}?>);">
                            <?php if($image_intro) {?><img src="<?php echo $image_intro; ?>" class="uk-invisible" width="295" height="500" alt="<?=$item->title?>"><?php }?>
                            <div class="uk-position-cover uk-flex uk-flex-center uk-flex-bottom">
                                <div class="ak-overlay uk-width-1-1">
                                    <div class="tm-panel-subtitle">
                                        <?php echo $item->introtext; ?>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        <?php endforeach; ?>
    </div>
    
    
</div>