@total_onion/onion-library 2.0.157 → 2.0.159
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -13,7 +13,66 @@
|
|
|
13
13
|
{{sectionStyles}}
|
|
14
14
|
}
|
|
15
15
|
</style>
|
|
16
|
-
<section {{block.anchor ? "id=" ~ block.anchor : ''}} class="{{blockClassName}} {{
|
|
16
|
+
<section {{block.anchor ? "id=" ~ block.anchor : ''}} class="{{blockClassName}} {{loop ? block.className.index ~ '-' ~ loop.index : ''}} {{classNameEntryPoint}} lazy-fade {{block.id}}" {{dataAttributeEntryPoint}} data-jsload="false" data-renderdynamic="{{renderDynamic}}" data-pattern-gradient-overlay data-blockid="{{block.id}}" data-assetkey="{{blockClassName}}">
|
|
17
|
+
|
|
18
|
+
{% set enableOverlay = fields.enable_gradient_overlay %}
|
|
19
|
+
{% set overlayType = fields.overlay_type|ru|default('gradient') %}
|
|
20
|
+
|
|
21
|
+
{% if enableOverlay and overlayType == "gradient" %}
|
|
22
|
+
{% set gradientOriginMap = { top: '0deg', right: '90deg', bottom: '180deg', left: '270deg' } %}
|
|
23
|
+
{% set gradientSpread = '--gradient-spread:' ~ (fields.gradient_overlay_spread|default(0)) ~ '%;' %}
|
|
24
|
+
{% set gradientAmount = '--gradient-amount:' ~ (fields.gradient_overlay_amount|default(0)) ~ '%;' %}
|
|
25
|
+
{% set gradientOpacity = '--gradient-opacity:' ~ (fields.gradient_overlay_opacity|default(0)) ~ ';' %}
|
|
26
|
+
{% set gradientColour = '--gradient-colour:' ~ (fields.gradient_overlay_colour|ru|default('transparent')) ~ ';' %}
|
|
27
|
+
{% set gradientZIndex = '--gradient-zindex:' ~ (fields.gradient_z_index|ru|default(4)) ~ ';' %}
|
|
28
|
+
{% set gradientGridArea = '--gradient-grid-area:' ~ (fields.gradient_grid_area|ru|default('unset')) ~ ';' %}
|
|
29
|
+
|
|
30
|
+
{% set gradientTypeKey = fields.gradient_overlay_origin|ru %}
|
|
31
|
+
{% set gradientOrigin = '--gradient-origin-before:' ~ gradientOriginMap[gradientTypeKey] ~ ';' %}
|
|
32
|
+
{% set enableAfter = "--enable-after: ;" %}
|
|
33
|
+
{% if gradientTypeKey == 'vertical' %}
|
|
34
|
+
{% set gradientOrigin = '--gradient-origin-before: 0deg;' %}
|
|
35
|
+
{% set gradientOriginAfter = '--gradient-origin-after: 180deg;' %}
|
|
36
|
+
{% set enableAfter = "--enable-after: '';" %}
|
|
37
|
+
{% endif %}
|
|
38
|
+
{% if gradientTypeKey == 'horizontal' %}
|
|
39
|
+
{% set gradientOrigin = '--gradient-origin-before: 90deg;' %}
|
|
40
|
+
{% set gradientOriginAfter = '--gradient-origin-after: 270deg;' %}
|
|
41
|
+
{% set enableAfter = "--enable-after: '';" %}
|
|
42
|
+
{% endif %}
|
|
43
|
+
{% set gradientStyleString = '' %}
|
|
44
|
+
|
|
45
|
+
{% set gradientStyleString = gradientSpread ~ gradientAmount ~ gradientOpacity ~ gradientColour ~ gradientOrigin ~ gradientZIndex ~ gradientGridArea ~ enableAfter ~ gradientOriginAfter %}
|
|
46
|
+
|
|
47
|
+
<style>
|
|
48
|
+
.{{blockClassName}}.{{block.id}}{
|
|
49
|
+
{{gradientStyleString}}
|
|
50
|
+
}
|
|
51
|
+
</style>
|
|
52
|
+
|
|
53
|
+
<div class="{{blockClassName}}__gradient-overlay-element"></div>
|
|
54
|
+
|
|
55
|
+
{% endif %}
|
|
56
|
+
|
|
57
|
+
{% if enableOverlay and overlayType == "blur" %}
|
|
58
|
+
{% if type == 'style' %}
|
|
59
|
+
{% set blurColour = '--blur-colour:' ~ (fields.blur_overlay_colour|default('')) ~ ';' %}
|
|
60
|
+
{% set blurValue = '--blur-value:' ~ (fields.blur_overlay_value|default(0)) ~ 'px' ~ ';' %}
|
|
61
|
+
{% set blurZIndex = '--blur-zindex:' ~ (fields.blur_z_index|ru|default(5)) ~ ';' %}
|
|
62
|
+
|
|
63
|
+
{% set blurStyleString = blurColour ~ blurValue ~ blurZIndex %}
|
|
64
|
+
|
|
65
|
+
<style>
|
|
66
|
+
.{{blockClassName}}.{{block.id}}{
|
|
67
|
+
{{blurStyleString}}
|
|
68
|
+
}
|
|
69
|
+
</style>
|
|
70
|
+
|
|
71
|
+
{% endif %}
|
|
72
|
+
|
|
73
|
+
<div class="{{blockClassName}}__blur-overlay-element"></div>
|
|
74
|
+
{% endif %}
|
|
75
|
+
|
|
17
76
|
|
|
18
77
|
{{htmlEntryPoint}}
|
|
19
78
|
</section>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{# Do not edit this file outside of the component library as your changes will be lost with future updates. #}
|
|
2
|
+
{% if fields.show_on_desktop or fields.show_on_tablet_portrait or fields.show_on_mobile %}
|
|
3
|
+
{% set display = displaytype ? displaytype : 'block' %}
|
|
4
|
+
{% set showOnDesktop = '--display-desktop: ' ~ (fields.show_on_desktop ? display : 'none') ~ ';' %}
|
|
5
|
+
{% set showOnPortrait = '--display-portrait: ' ~ (fields.show_on_tablet_portrait ? display : 'none') ~ ';' %}
|
|
6
|
+
{% set showOnMobile = '--display-mobile: ' ~ (fields.show_on_mobile ? display : 'none') ~ ';' %}
|
|
7
|
+
{% set showHide = showOnDesktop ~ showOnPortrait ~ showOnMobile %}
|
|
8
|
+
{{showHide}}
|
|
9
|
+
{% endif %}
|
|
@@ -22,6 +22,3 @@
|
|
|
22
22
|
{% if fields.lottie_animations.enable_lottie_animations %}
|
|
23
23
|
{{ include('components/lottie-animations-v3.twig', { fields, block, blockClassName }, with_context = false) }}
|
|
24
24
|
{% endif %}
|
|
25
|
-
{% if fields.enable_gradient_overlay %}
|
|
26
|
-
{{ include('components/gradient-overlay-v3.twig', { fields, block, blockClassName, type : 'html' }, with_context = false) }}
|
|
27
|
-
{% endif %}
|