Initial commit
This commit is contained in:
commit
65e0da7e11
1397 changed files with 596542 additions and 0 deletions
63
site/snippets/artist-image.php
Normal file
63
site/snippets/artist-image.php
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
<?php if( $image): ?>
|
||||
|
||||
<?php if ($image->laptopvideo()->isNotEmpty() ||
|
||||
$image->laptopvideo()->isNotEmpty() ||
|
||||
$image->monitorvideo()->isNotEmpty()): ?>
|
||||
|
||||
<?php snippet('video-player', ['image' => $image]) ?>
|
||||
|
||||
<?php else: ?>
|
||||
|
||||
<div class="artist-image">
|
||||
<?php
|
||||
if(!isset($maxWidth)) $maxWidth = 3400;
|
||||
if (isset($ratio)) {
|
||||
$placeholder = $image->crop(10, floor(10/$ratio))->dataURI();
|
||||
$src = $image->crop(1000, floor(1000/$ratio))->url();
|
||||
$srcset = $image->crop(340, floor(340/$ratio))->url() . ' 340w,';
|
||||
for ($i = 680; $i <= $maxWidth; $i += 340) $srcset .= $image->crop($i, floor($i/$ratio))->url() . ' ' . $i . 'w,';
|
||||
} else {
|
||||
$placeholder = $image->resize(10)->dataURI();
|
||||
$src = $image->resize(1000)->url();
|
||||
$srcset = $image->resize(340)->url() . ' 340w,';
|
||||
for ($i = 680; $i <= $maxWidth; $i += 340) $srcset .= $image->resize($i)->url() . ' ' . $i . 'w,';
|
||||
}
|
||||
?>
|
||||
<img
|
||||
class="lazy lazyload<?php if(isset($preload)) echo ' lazypreload' ?>"
|
||||
src="<?= $placeholder ?>"
|
||||
data-src="<?= $src ?>"
|
||||
data-srcset="<?= $srcset ?>"
|
||||
data-sizes="auto"
|
||||
data-optimumx="1.5"
|
||||
<?php if (isset($caption) && $caption): ?>
|
||||
alt="<?= $caption.' - © '.$site->title()->html() ?>"
|
||||
<?php elseif ($image->caption()->isNotEmpty()): ?>
|
||||
alt="<?= $image->caption().' - © '.$site->title()->html() ?>"
|
||||
<?php else: ?>
|
||||
alt="<?= $page->title()->html().' - © '.$site->title()->html() ?>"
|
||||
<?php endif ?>
|
||||
height="100%" width="auto" />
|
||||
<?php if($image->embed()->isNotEmpty()): ?>
|
||||
<?= video($image->embed()) ?>
|
||||
<?php endif ?>
|
||||
<noscript>
|
||||
<img src="<?= $src ?>"
|
||||
<?php if (isset($caption) && $caption): ?>
|
||||
alt="<?= $caption.' - © '.$site->title()->html() ?>"
|
||||
<?php elseif ($image->caption()->isNotEmpty()): ?>
|
||||
alt="<?= $image->caption().' - © '.$site->title()->html() ?>"
|
||||
<?php else: ?>
|
||||
alt="<?= $page->title()->html().' - © '.$site->title()->html() ?>"
|
||||
<?php endif ?>
|
||||
height="100%" width="auto" />
|
||||
</noscript>
|
||||
<?php if (isset($withCaption) && $image->caption()->isNotEmpty()): ?>
|
||||
<div class="row caption"><?= $image->caption()->kt() ?></div>
|
||||
<?php endif ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php endif ?>
|
||||
|
||||
<?php endif ?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue