vendor/store.shopware.com/ieslazyloading6/src/Resources/views/storefront/layout/meta.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/layout/meta.html.twig' %}
  2. {% block layout_head_stylesheet %}
  3.     {{ parent() }}
  4.     {% block layout_head_stylesheet_lazyload %}
  5.         {% apply spaceless %}
  6.             {% set lazyLoadingIcon = config('IesLazyLoading6.config.lazyloadIcon')|default('audio') %}
  7.             {% if lazyLoadingIcon is not same as 'disabled' %}
  8.                 {% set lazyloadColor = config('IesLazyLoading6.config.lazyloadColor')|default('#000') %}
  9.                 {% set iconContent %}
  10.                     {% sw_include '@IesLazyLoading6/storefront/icons/' ~ lazyLoadingIcon ~ '.svg' with {
  11.                         color: lazyloadColor
  12.                     } %}
  13.                 {% endset %}
  14.                 <style>
  15.                     [data-ies-lazy-loading="true"]:not(.gallery-slider-thumbnails-image):not(.ies-lazy-loading-loaded) {
  16.                         background-image: url('data:image/svg+xml;charset=UTF-8,{{ iconContent|replace({
  17.                             '#': '%23',
  18.                             "\n":' ',
  19.                             "\r":' '
  20.                         })|raw }}');
  21.                     }
  22.                 </style>
  23.                 <script type="text/javascript">
  24.                     function onIesLazyLoaded(img) {
  25.                         img.classList.add('ies-lazy-loading-loaded');
  26.                         let loadingCls = 'is-loading';
  27.                         let tnsContainer = img.closest('.' + loadingCls);
  28.                         if (tnsContainer && !tnsContainer._iesTnsLoadingTimout) {
  29.                             tnsContainer._iesTnsLoadingTimout = setTimeout(() => {
  30.                                 tnsContainer.classList.remove(loadingCls);
  31.                             }, 1000);
  32.                         }
  33.                     }
  34.                 </script>
  35.             {% endif %}
  36.         {% endapply %}
  37.     {% endblock %}
  38. {% endblock %}