Skip to content
Snippets Groups Projects
Commit 2df3dd33 authored by Chris Hallberg's avatar Chris Hallberg Committed by Demian Katz
Browse files

Carousel style improvements.

parent cabdbe22
No related merge requests found
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -5,8 +5,18 @@
width: 8px;
height: 8px;
margin: 2px;
background-color: rgba(255,255,255,.3);
border-color: @gray-darker;
margin-bottom: 4px;
background-color: #fff;
border: 1px solid @gray-darker;
box-shadow: none;
transition-duration: .4s;
transition-property: width, height, margin;
&.active {
width: 16px;
height: 16px;
margin-bottom: 0;
}
}
}
.hover-overlay {
......@@ -33,5 +43,11 @@
}
&:hover .content {display: block;}
}
.item {
padding: 0 4em;
&.prev,
&.active,
&.next { display: flex; }
}
.carousel-item { flex-basis: 25%; }
}
#similar-items-carousel .item {padding: 0 4em;}
......@@ -14,33 +14,29 @@
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<div class="row">
<? foreach ($similarRecords as $index=>$data): ?>
<div class="col-sm-<?=floor(12/$perPage) ?>">
<a class="hover-overlay" href="<?=$this->recordLink()->getUrl($data)?>">
<? $thumb = $this->record($data)->getThumbnail('large'); ?>
<img src="<?=$thumb ?>" title="<?=$data->getTitle() ?>"/>
<div class="content">
<? $formats = $data->getFormats(); ?>
<i class="fa fa-x<? if (count($formats) > 0): ?> fa-<?=preg_replace('/[^a-z0-9]/', '', strtolower($formats[0]))?>" title="<?=$formats[0] ?><? endif; ?>"></i>
<b><?=$this->escapeHtml($data->getTitle())?></b>
<? $authors = $data->getPrimaryAuthors(); if (!empty($authors)): ?>
<br/><?=$this->transEsc('by')?>: <?=$this->escapeHtml($authors[0]);?><? if (count($authors) > 1): ?>, <?=$this->transEsc('more_authors_abbrev')?><? endif; ?>
<? endif; ?>
<? $pubDates = $data->getPublicationDates(); if (!empty($pubDates)): ?>
<br/><?=$this->transEsc('Published')?>: (<?=$this->escapeHtml($pubDates[0])?>)
<? endif; ?>
</div>
</a>
</div>
<? if(($index+1) % $perPage == 0 && $index < count($similarRecords)-1): ?>
<? foreach ($similarRecords as $index=>$data): ?>
<div class="carousel-item">
<a class="hover-overlay" href="<?=$this->recordLink()->getUrl($data)?>">
<? $thumb = $this->record($data)->getThumbnail('large'); ?>
<img src="<?=$thumb ?>" title="<?=$data->getTitle() ?>"/>
<div class="content">
<? $formats = $data->getFormats(); ?>
<i class="fa fa-x<? if (count($formats) > 0): ?> fa-<?=preg_replace('/[^a-z0-9]/', '', strtolower($formats[0]))?>" title="<?=$formats[0] ?><? endif; ?>"></i>
<b><?=$this->escapeHtml($data->getTitle())?></b>
<? $authors = $data->getPrimaryAuthors(); if (!empty($authors)): ?>
<br/><?=$this->transEsc('by')?>: <?=$this->escapeHtml($authors[0]);?><? if (count($authors) > 1): ?>, <?=$this->transEsc('more_authors_abbrev')?><? endif; ?>
<? endif; ?>
<? $pubDates = $data->getPublicationDates(); if (!empty($pubDates)): ?>
<br/><?=$this->transEsc('Published')?>: (<?=$this->escapeHtml($pubDates[0])?>)
<? endif; ?>
</div>
</a>
</div>
</div>
<div class="item">
<div class="row">
<? endif; ?>
<? endforeach; ?>
</div>
<? if(($index+1) % $perPage == 0 && $index < count($similarRecords)-1): ?>
</div>
<div class="item">
<? endif; ?>
<? endforeach; ?>
</div>
</div>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment