1 |
1 |
new file mode 100644
|
... |
... |
@@ -0,0 +1,14 @@
|
|
1 |
+<?php if ($this->sources): ?>
|
|
2 |
+<picture>
|
|
3 |
+ <?php foreach ($this->sources as $source): ?>
|
|
4 |
+ <source srcset="<?= $source['srcset'] ?>"<?php if (!empty($source['sizes'])): ?> sizes="<?= $source['sizes'] ?>"<?php endif; ?><?php if (!empty($source['media'])): ?> media="<?= $source['media'] ?>"<?php endif; ?><?php if (!empty($source['type'])): ?> type="<?= $source['type'] ?>"<?php endif; ?><?php if (!empty($source['width']) && !empty($source['height'])): ?> width="<?= $source['width'] ?>" height="<?= $source['height'] ?>"<?php endif; ?>>
|
|
5 |
+ <?php endforeach; ?>
|
|
6 |
+ <?php endif; ?>
|
|
7 |
+
|
|
8 |
+ <img class="lazy"
|
|
9 |
+ data-src="<?= $this->img['src'] ?>"<?php if ($this->img['srcset'] !== $this->img['src']): ?> srcset="<?= $this->img['srcset'] ?>"<?php endif; ?><?php if (!empty($this->img['sizes'])): ?> sizes="<?= $this->img['sizes'] ?>"<?php endif; ?><?php if (!empty($this->img['width']) && !empty($this->img['height'])): ?> width="<?= $this->img['width'] ?>" height="<?= $this->img['height'] ?>"<?php endif; ?>
|
|
10 |
+ alt="<?= $this->alt ?>"<?php if (!empty($this->img['loading'])): ?> loading="<?= $this->img['loading'] ?>"<?php endif; ?><?php if ($this->title): ?> title="<?= $this->title ?>"<?php endif; ?><?php if ($this->class || !empty($this->img['class'])): ?> class="<?= trim($this->class . ' ' . $this->img['class']) ?>"<?php endif; ?><?= $this->attributes ?>>
|
|
11 |
+
|
|
12 |
+ <?php if ($this->sources): ?>
|
|
13 |
+</picture>
|
|
14 |
+<?php endif; ?>
|