This commit is contained in:
2021-10-19 11:59:22 +03:00
parent e0afd13eea
commit dc5d2418c5
7 changed files with 25 additions and 5 deletions
+11 -1
View File
@@ -6,12 +6,22 @@ use \Wt\Core\Templater\Tools as TemplaterTools;
?> ?>
<picture class="kit-picture <?=$arParams['CLASS']?>"> <picture class="kit-picture <?=$arParams['CLASS']?>">
<? <?
foreach ((array)$arParams['SRCSET_LIST'] as $srcset) {
$webp = new Webp($_SERVER['DOCUMENT_ROOT'] . $srcset['src']);
if($webp->make()->isSuccess()) {
?><source srcset="<?=$webp->getPathOut(true)?>" type="image/webp"<?if($srcset['media']){?> media="<?=TemplaterTools::safeHtmlAttr($srcset['media'])?>"<?}?>><?
}
?>
<source srcset="<?=$srcset['src']?>" type="<?=$webp->mime?>"<?if($srcset['media']){?> media="<?=TemplaterTools::safeHtmlAttr($srcset['media'])?>"<?}?>>
<?
}
$webp = new Webp($_SERVER['DOCUMENT_ROOT'] . $arParams['SRC']); $webp = new Webp($_SERVER['DOCUMENT_ROOT'] . $arParams['SRC']);
if($webp->make()->isSuccess()) { if($webp->make()->isSuccess()) {
?><source srcset="<?=$webp->getPathOut(true)?>" type="image/webp"><? ?><source srcset="<?=$webp->getPathOut(true)?>" type="image/webp"><?
} }
?> ?>
<img class="kit-img" src="<?=$arParams['SRC']?>" alt="<?=TemplaterTools::safeHtmlAttr($arParams['ALT'])?>"<? <img class="kit-img"<?if($arParams['SRC']) {?> src="<?=$arParams['SRC']?>"<?}?> alt="<?=TemplaterTools::safeHtmlAttr($arParams['ALT'])?>"<?
if($arParams['TITLE']) { if($arParams['TITLE']) {
?> title="<?=TemplaterTools::safeHtmlAttr($arParams['TITLE'])?>"<? ?> title="<?=TemplaterTools::safeHtmlAttr($arParams['TITLE'])?>"<?
} }
+4
View File
@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="24" height="24" viewBox="0 0 18 18" xml:space="preserve">
<path style="fill:#E1251B;" d="M9,18L9,18c-5,0-9-4-9-9v0c0-5,4-9,9-9h0c5,0,9,4,9,9v0C18,14,14,18,9,18z"></path>
<path style="fill:#FFFFFF;" d="M9,4c1.8,0,3.7,3.2,3.7,6c0,2.2-0.8,4-3.7,4c-3,0-3.7-1.9-3.7-4C5.3,7.2,7.2,4,9,4"></path>
</svg>

After

Width:  |  Height:  |  Size: 366 B

+3 -3
View File
@@ -1,4 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="24" height="24" viewBox="0 0 18 18" xml:space="preserve"> <svg width="24" height="24" version="1.1" viewBox="0 0 18 18" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
<path style="fill:#E1251B;" d="M9,18L9,18c-5,0-9-4-9-9v0c0-5,4-9,9-9h0c5,0,9,4,9,9v0C18,14,14,18,9,18z"></path> <rect x="0" y="0" width="18" height="18" ry="15%" style="fill-rule:evenodd;fill:#e1251b;paint-order:markers fill stroke;stroke-linejoin:round;"></rect>
<path style="fill:#FFFFFF;" d="M9,4c1.8,0,3.7,3.2,3.7,6c0,2.2-0.8,4-3.7,4c-3,0-3.7-1.9-3.7-4C5.3,7.2,7.2,4,9,4"></path> <path d="m9 3.3c2.1 0 4.3 3.7 4.3 6.9 0 2.5-0.92 4.6-4.3 4.6-3.4 0-4.3-2.2-4.3-4.6 0-3.2 2.2-6.9 4.3-6.9" style="fill:#ffffff;"></path>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 366 B

After

Width:  |  Height:  |  Size: 422 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zM1 2v2h2l3.6 7.59-1.35 2.45c-.16.28-.25.61-.25.96 0 1.1.9 2 2 2h12v-2H7.42c-.14 0-.25-.11-.25-.25l.03-.12.9-1.63h7.45c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.08-.14.12-.31.12-.48 0-.55-.45-1-1-1H5.21l-.94-2H1zm16 16c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z"></path></svg>

After

Width:  |  Height:  |  Size: 428 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" style="fill: none; stroke: currentColor;" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" ><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg>

After

Width:  |  Height:  |  Size: 283 B

+3
View File
@@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" d="M8 16s6-5.686 6-10A6 6 0 0 0 2 6c0 4.314 6 10 6 10zm0-7a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"></path>
</svg>

After

Width:  |  Height:  |  Size: 217 B

+1
View File
@@ -0,0 +1 @@
<svg width="24" height="24" version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><path d="M27.414,24.586l-5.077-5.077C23.386,17.928,24,16.035,24,14c0-5.514-4.486-10-10-10S4,8.486,4,14 s4.486,10,10,10c2.035,0,3.928-0.614,5.509-1.663l5.077,5.077c0.78,0.781,2.048,0.781,2.828,0 C28.195,26.633,28.195,25.367,27.414,24.586z M7,14c0-3.86,3.14-7,7-7s7,3.14,7,7s-3.14,7-7,7S7,17.86,7,14z"></path></svg>

After

Width:  |  Height:  |  Size: 412 B