Browse code

Initial commit

Benjamin Roth authored on16/03/2023 20:22:35
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,182 @@
1
+<?php
2
+if (TL_MODE == 'FE') {
3
+    $GLOBALS['TL_CSS'][] = 'files/base/layout/css/elements/custom-elements/ce_rsce_equalboxesrows.min.css|static';
4
+}
5
+?>
6
+
7
+
8
+    <div <?php echo $this->cssID; ?> class="content--element <?php echo $this->class; ?>">
9
+        <div class="ce--inner container">
10
+            <?php if ($this->headline || $this->subline || $this->topline) : ?>
11
+            <div class="ce--headline"
12
+                 data-aos="<?php if ($this->animation_type) : ?><?php echo $this->animation_type; ?><?php else : ?>animate__fadeInUp<?php endif; ?>">
13
+                <?php if ($this->topline) : ?>
14
+                    <span class="ce--topline"><?php echo $this->topline; ?></span>
15
+                <?php endif; ?>
16
+                <?php if ($this->headline) : ?>
17
+                <<?php echo($this->hl); ?>>
18
+                <?php echo($this->headline); ?>
19
+            </<?php echo($this->hl); ?>>
20
+        <?php endif; ?>
21
+            <?php if ($this->subline) : ?>
22
+                <span class="ce--subline"><?php echo $this->subline; ?></span>
23
+            <?php endif; ?>
24
+        </div>
25
+        <?php endif; ?>
26
+        <?php if ($this->row) : ?>
27
+
28
+        <?php foreach ($this->row as $row) : ?>
29
+        <div class="row-container">
30
+            <div class="row gy-0 <?php if ($row->swapcolumns) : ?>flex-row-reverse<?php endif; ?>">
31
+                <div class="col-12 col-md-6 left--col">
32
+                    <div class="left-col--inner">
33
+                        <div class="equal--box" style="z-index: 5; position: relative;"
34
+                             data-aos="<?php if ($row->animation_type) : ?><?php echo $row->animation_type; ?><?php else : ?>animate__fadeInUp<?php endif; ?>">
35
+                            <?php if ($row->main_url) : ?>
36
+                                <a href="<?php echo $row->main_url; ?>"></a>
37
+                            <?php endif; ?>
38
+                            <div class="box--inner lazy"
39
+                                 <?php if (count($row->main_image) == 1) : ?>data-bg="<?= Image::get(FilesModel::findByUuid($row->main_image[0])->path, null, null, null); ?>"
40
+                                 style="background-position: center center; background-repeat: no-repeat; center center no-repeat; background-size: cover;" <?php endif; ?>>
41
+                                <?php if (count($row->main_image) > 1) : ?>
42
+                                    <div class="swiper custom pb-0 background-slider background-slider_<?= $this->id; ?>"
43
+                                         style="width: 100%; height: 100%; position: absolute; left: 0; top: 0;">
44
+                                        <div class="swiper-wrapper">
45
+                                            <?php foreach ($row->main_image as $slide) : ?>
46
+                                                <div class="swiper-slide">
47
+                                                    <div class="swiper-lazy"
48
+                                                         data-background="<?= Image::get(FilesModel::findByUuid($slide)->path, null, null, null); ?>"
49
+                                                         style="width: 100%; height: 100%; background-size: cover; background-repeat: no-repeat; background-position: center center;"></div>
50
+                                                </div>
51
+                                            <?php endforeach ?>
52
+                                        </div>
53
+                                    </div>
54
+                                <?php endif; ?>
55
+                                <div class="box--content">
56
+                                    <div class="box--headline">
57
+                                        <?php if ($row->main_headline) : ?>
58
+                                        <?php if (!$row->main_onlystyle) : ?>
59
+                                        <<?php echo $row->main_headline_type; ?>>
60
+                                        <?php echo $row->main_headline; ?>
61
+                                    </<?php echo $row->main_headline_type; ?>>
62
+                                    <?php if ($row->main_subline) : ?>
63
+                                        <span class="ce--subline box--subline">
64
+                                    <?php echo $row->main_subline; ?>
65
+                                </span>
66
+                                    <?php endif; ?>
67
+                                    <?php else : ?>
68
+                                        <span class="<?php echo $row->main_headline_type; ?>">
69
+                                    <?php echo $row->main_headline; ?>
70
+                                </span>
71
+                                        <?php if ($row->main_subline) : ?>
72
+                                            <span class="ce--subline box--subline">
73
+                                        <?php echo $row->main_subline; ?>
74
+                                    </span>
75
+                                        <?php endif; ?><?php endif; ?>
76
+                                    <?php endif; ?>
77
+                                </div>
78
+                                <?php if ($row->main_content) : ?>
79
+                                    <div class="box--text">
80
+                                        <?php echo $row->main_content; ?>
81
+                                    </div>
82
+                                <?php endif; ?>
83
+                            </div>
84
+                        </div>
85
+                    </div>
86
+                </div>
87
+            </div>
88
+            <?php if ($row->boxes) : ?>
89
+            <div class="col-12 col-md-6 right--col">
90
+                <div class="right-col--inner">
91
+                    <?php foreach ($row->boxes as $box) : ?>
92
+                    <div class="equal--box" style="z-index: 5; position: relative;"
93
+                         data-aos="<?php if ($box->animation_type) : ?><?php echo $box->animation_type; ?><?php else : ?>animate__fadeInUp<?php endif; ?>">
94
+                        <?php if ($box->url) : ?>
95
+                            <a href="<?php echo $box->url; ?>"></a>
96
+                        <?php endif; ?>
97
+                        <div class="box--inner lazy"
98
+                             <?php if (count($box->image) == 1) : ?>data-bg="<?= Image::get(FilesModel::findByUuid($box->image[0])->path, null, null, null); ?>"
99
+                             style="background-position: center center; background-repeat: no-repeat; background-size: cover;" <?php endif; ?>>
100
+                            <?php if (count($box->image) > 1) : ?>
101
+                                <div class="swiper pb-0 custom background-slider background-slider_<?= $this->id; ?>"
102
+                                     style="width: 100%; height: 100%; position: absolute; left: 0; top: 0;">
103
+                                    <div class="swiper-wrapper">
104
+                                        <?php foreach ($box->image as $slide) : ?>
105
+                                            <div class="swiper-slide">
106
+                                                <div class="swiper-lazy"
107
+                                                     data-background="<?= Image::get(FilesModel::findByUuid($slide)->path, null, null, null); ?>"
108
+                                                     style="background-position: center center; background-repeat: no-repeat; width: 100%; height: 100%; background-size: cover;"></div>
109
+                                            </div>
110
+                                        <?php endforeach ?>
111
+                                    </div>
112
+                                </div>
113
+                            <?php endif; ?>
114
+                            <div class="box--content">
115
+                                <?php if ($box->headline) : ?>
116
+                                <div class="box--headline">
117
+
118
+                                    <?php if ($box->topline) : ?>
119
+                                        <span class="ce--topline box--topline"><?php echo $box->topline; ?></span>
120
+                                    <?php endif; ?>
121
+
122
+                                    <?php if (!$box->onlystyle) : ?>
123
+                                    <<?php echo $box->headline_type; ?>>
124
+                                    <?php echo $box->headline; ?>
125
+                                </<?php echo $box->headline_type; ?>>
126
+                            <?php if ($box->subline) : ?>
127
+                                <span class="ce--subline box--subline">
128
+                            <?php echo $box->subline; ?>
129
+                        </span>
130
+                            <?php endif; ?>
131
+                            <?php else : ?>
132
+                                <span class="<?php echo $box->headline_type; ?>">
133
+                            <?php echo $box->headline; ?>
134
+                        </span>
135
+                                <?php if ($box->subline) : ?>
136
+                                    <span class="ce--subline box--subline">
137
+                                <?php echo $box->subline; ?>
138
+                            </span>
139
+                                <?php endif; ?><?php endif; ?>
140
+                            </div>
141
+                        <?php endif; ?>
142
+                            <?php if ($box->content) : ?>
143
+                                <div class="box--text">
144
+                                    <?php echo $box->content; ?>
145
+                                </div>
146
+                            <?php endif; ?>
147
+                        </div>
148
+                    </div>
149
+                </div>
150
+                <?php endforeach; ?>
151
+            </div>
152
+        </div>
153
+    <?php endif; ?>
154
+    </div>
155
+    </div>
156
+<?php endforeach; ?>
157
+<?php endif; ?>
158
+    </div></div>
159
+
160
+<?php if (TL_MODE == 'FE'): ?>
161
+    <script>
162
+        window.addEventListener('load', function () {
163
+            if ($('.swiper.background-slider_<?= $this->id;?>').length) {
164
+
165
+                const swiper_<?php echo $this->id; ?> = new Swiper('.swiper.background-slider_<?= $this->id;?>', {
166
+                    direction: 'horizontal',
167
+
168
+
169
+                    autoplay: {
170
+                        delay: 3500,
171
+                    },
172
+                    preloadImages: false,
173
+                    lazy: true,
174
+                    slidesPerView: 1,
175
+                    spaceBetween: 0,
176
+                    speed: 1500,
177
+                    effect: 'fade',
178
+                });
179
+            }
180
+        }, {passive: true})
181
+    </script>
182
+<?php endif; ?>
0 183
\ No newline at end of file