-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathauto-scroll-section.liquid
103 lines (91 loc) · 2.14 KB
/
auto-scroll-section.liquid
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
{% stylesheet %}
.overflow-hidden{
overflow: hidden;
}
.scroll-parent {
position: relative;
width: 100vw;
height: 20rem;
padding: 2rem 0;
overflow-x: hidden;
}
.scroll-element {
width: inherit;
height: inherit;
position: absolute;
left: 0%;
top: 0%;
display: flex;
align-items: center;
justify-content: space-around;
}
.scroll-element img {
width: 15%;
}
.primary {
animation: primary 13s linear infinite;
}
.secondary {
animation: secondary 13s linear infinite;
}
@keyframes primary {
from {
left: 0%;
}
to {
left: -100%;
}
}
@keyframes secondary {
from {
left: 100%;
}
to {
left: 0%;
}
} {% endstylesheet %}
<div class="container overflow-hidden">
<div class="scroll-parent">
<div class="scroll-element primary">
{% for block in section.blocks %}
<img
src="{{ block.settings.single_img | img_url: 'original' }}"
alt="{{ block.settings.single_img.alt }}"
/>
{% endfor %}
</div>
<div class="scroll-element secondary">
{% for block in section.blocks %}
<img
src="{{ block.settings.single_img | img_url: 'original' }}"
alt="{{ block.settings.single_img.alt }}"
/>
{% endfor %}
</div>
</div>
</div>
{% schema %}
{
"name": "scrollable gallery",
"settings": [
],
"blocks": [
{
"type": "scrollable_gallary",
"name": "scrollable gallery",
"settings": [
{
"type": "image_picker",
"id": "single_img",
"label": "Select Image"
}
]
}
],
"presets": [
{
"name": "scrollable gallery"
}
]
}
{% endschema %}