Showcase items appear as full length rows. This turns them into a grid of image and title.
function rebuildShowcaseGrid(){
$(".cmsi-showcase-list li").each(function(){
$(this).find('.cmsi-showcase-desc').remove();
$(this).find('img').parent().addClass('showcase-grid-img');
$(this).find('.cmsi-showcase-readmore:not(.showcase-grid-img)').remove();
var thumbRef = null;
var imgRef = null;
thumbRef = $(this).find('.cmsi-showcase-thumb').find('img').attr('src');
imgRef = thumbRef.replace('/showcasephoto/200/', '/showcasephoto/340/');
$(this).find('.cmsi-showcase-thumb').find('img').attr('src', imgRef);
$(this).removeClass('cmsi-module-showcase-evenrow');
$(this).removeClass('cmsi-module-showcase-oddrow');
$(this).find('.cmsi-showcase-readmore').removeClass('cmsi-showcase-readmore');
$(this).find('.cmsi-showcase-thumb').removeClass('cmsi-showcase-thumb');
})
}
if ($("ul.cmsi-showcase-list")){
$("ul.cmsi-showcase-list").addClass("showcase-grid");
rebuildShowcaseGrid();
}
/*Showcase grid DISPLAY:GRID VERSION*/
ul.showcase-grid{
margin: 0 auto;
padding-left:0px;
display: table; /*for browsers that don't support grid*/
display: grid;
ms-grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
ms-grid-gap: 20px 40px;
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
grid-gap: 20px 40px;
}
ul.showcase-grid > li{
position:relative;
ms-grid-column: span 1;
grid-column: span 1;
list-style:none;
border:0px solid #fff;
text-align: center;
transition: opacity .5s ease;
}
ul.showcase-grid li img{
width:100%;
}
ul.showcase-grid li a img{
margin-bottom: 10px;
transition: transform .3s ease-in;
}
ul.showcase-grid li:hover a img{
transform: scale(1.01);
}
ul.showcase-grid li a img:hover{
opacity: 0.8;
}
ul.showcase-grid li a.showcase-grid-img{
text-align: center;
font-weight: 600;
border: 0;
text-shadow: none;
box-shadow: none;
}
ul.showcase-grid li a:hover,
ul.showcase-grid li a:hover a {
text-decoration:none;
}