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,173 @@
1
+<?php
2
+if (TL_MODE == 'FE') {
3
+    $GLOBALS['TL_CSS'][] = 'files/base/layout/css/elements/custom-elements/ce_rsce_kachelfeld.min.css|static';
4
+}
5
+?>
6
+
7
+<?php
8
+if (!isset($this->size)) {
9
+    $this->{"size"} = "";
10
+}
11
+?>
12
+
13
+<div <?php echo $this->cssID; ?>
14
+        class="content--element <?php echo $this->class; ?> <?php if ($this->columns_evenly): ?>columns-evenly<?php endif; ?>">
15
+    <div class="ce--inner container">
16
+        <?php if ($this->headline || $this->subline || $this->topline) : ?>
17
+        <div class="ce--headline"
18
+             data-aos="<?php if ($this->animation_type) : ?><?php echo $this->animation_type; ?><?php else : ?>animate__fadeInUp<?php endif; ?>">
19
+
20
+            <?php if ($this->topline) : ?>
21
+                <span class="ce--topline"><?php echo $this->topline; ?></span>
22
+            <?php endif; ?>
23
+
24
+            <?php if ($this->headline) : ?>
25
+            <<?php echo($this->hl); ?>><?php echo($this->headline); ?></<?php echo($this->hl); ?>>
26
+    <?php endif; ?>
27
+        <?php if ($this->subline) : ?>
28
+            <span class=" ce--subline"><?php echo $this->subline; ?></span>
29
+        <?php endif; ?>
30
+    </div>
31
+    <?php endif; ?>
32
+    <div class="ce--kachelfeld ">
33
+        <div class="row <?php if ($this->column_gap) : ?><?php echo $this->column_gap; ?><?php else : ?>gx-lg-4<?php endif; ?>">
34
+            <?php foreach ($this->kachel as $i => $b) : ?>
35
+            <div class="<?php if ($b->column_width) : ?><?php echo $b->column_width; ?><?php else : ?>col-12 col-lg-4<?php endif; ?>">
36
+                <div id="kachelbox_<?= $this->id; ?>_<?= $i; ?>" class="kachelbox"
37
+                     data-aos="<?php if ($b->animation_type) : ?><?php echo $b->animation_type; ?><?php else : ?>animate__fadeInUp<?php endif; ?>"
38
+
39
+                     style="<?php if ($b->column_background_color): ?>
40
+                             background-color: <?= $b->column_background_color;?>;
41
+                        <?php endif; ?>
42
+
43
+                     <?php if ($b->column_text_color): ?>
44
+                             color: <?= $b->column_text_color;?>;
45
+                        <?php endif; ?>"
46
+
47
+                >
48
+                    <?php if ($b->link_url) : ?>
49
+                        <a class="kachel--url" href="<?php echo $b->link_url; ?>"></a>
50
+                    <?php endif; ?>
51
+
52
+                    <style>
53
+                        <?php if($b->column_background_hover_color):?>
54
+                        <?php
55
+                             $backgroundColor = $b->column_background_hover_color;
56
+                             $backgroundColor = str_replace("&#41", ")",$backgroundColor);
57
+                             $backgroundColor = str_replace("&#40", "(",$backgroundColor);
58
+                             $backgroundColor = str_replace("(;", "(",$backgroundColor);
59
+                             $backgroundColor = str_replace("&#35;", "#",$backgroundColor);
60
+                             $backgroundColor = str_replace(");", ")",$backgroundColor);
61
+                         ?>
62
+
63
+                        #kachelbox_<?=$this->id;?>_<?= $i;?>:hover {
64
+                            background-color: <?= $backgroundColor;?> !important;
65
+                        }
66
+
67
+                        <?php endif;?>
68
+
69
+                        <?php if($b->column_text_hover_color):?>
70
+                        <?php
71
+                            $textColor = $b->column_text_hover_color;
72
+                            $textColor = str_replace("&#41", ")",$textColor);
73
+                            $textColor = str_replace("&#40", "(",$textColor);
74
+                            $textColor = str_replace("(;", "(",$textColor);
75
+                            $textColor = str_replace("&#35;", "#",$textColor);
76
+                                $textColor = str_replace(");", ")",$textColor);
77
+                        ?>
78
+                        #kachelbox_<?=$this->id;?>_<?= $i;?>:hover .kb--content .box--headline .h5,
79
+                        #kachelbox_<?=$this->id;?>_<?= $i;?>:hover .kb--image i, #kachelbox_<?=$this->id;?>_<?= $i;?>:hover .box--text p a {
80
+                            color: <?= $textColor;?> !important;
81
+                        }
82
+
83
+                        <?php endif;?>
84
+                    </style>
85
+
86
+                    <div class="kachelbox--inner <?php if (!$b->headline && !$b->text && !$b->buttons[0]->link_text): ?>pb-0<?php endif; ?>">
87
+                        <?php if ($b->image || $b->icon) : ?>
88
+                            <div class="kb--image <?php if ($b->image_as_bg) : ?>as-bg<?php endif; ?>"
89
+                                 style="<?php if ($b->image_as_bg && $b->image_height) : ?>height: <?= $b->image_height;?>px<?php endif; ?>">
90
+                                <?php if ($b->icon) : ?>
91
+                                    <i class="<?php echo $b->icon; ?>"></i>
92
+                                <?php elseif ($b->image) : ?><?php if (!$b->image_as_bg) : ?>
93
+                                    <img class="lazy <?php if (!$b->headline) : ?>pb-3<?php endif; ?>"
94
+                                         data-src="<?= Image::get(FilesModel::findByUuid($b->image)->path, $this->size[0], $this->size[1], $this->size[2]); ?>">
95
+                                <?php else: ?>
96
+                                    <div data-bg="<?= Image::get(FilesModel::findByUuid($b->image)->path, $this->size[0], $this->size[1], $this->size[2]); ?>"
97
+                                         style="background-position: center center; background-repeat: no-repeat; background-size: cover;"
98
+                                         class="kb--image-holder lazy"></div>
99
+                                <?php endif; ?><?php endif; ?>
100
+
101
+                                <?php if ($b->kachel_top_text): ?>
102
+                                    <div class="column-kachel--wrapper <?php if ($b->kachel_hovereffect): ?> with-effect<?php endif; ?>  <?php if ($b->kachel_top_url): ?> with-url<?php endif; ?> <?php echo $b->kachel_top_position; ?>">
103
+
104
+                                        <?php if ($b->kachel_top_url): ?>
105
+                                            <a href="<?= $b->kachel_top_url; ?>"
106
+                                               <?php if ($b->kachel_new_tab): ?>target="_blank"<?php endif; ?>></a>
107
+                                        <?php endif; ?>
108
+
109
+                                        <div class="column--kachel <?php echo $b->kachel_top_text_position; ?>"
110
+                                             data-aos="<?php if ($b->animation_type_left_kachel) : ?><?php echo $b->animation_type_left_kachel; ?><?php else : ?>animate__fadeInUp<?php endif; ?>"
111
+                                             style="
112
+                                             <?php if ($b->kachel_top_background_color): ?>
113
+                                                     background-color: <?= $b->kachel_top_background_color;?>;
114
+                            <?php endif; ?>
115
+
116
+                                             <?php if ($b->kachel_top_text_color): ?>
117
+                                                     color: <?= $b->kachel_top_text_color;?>;
118
+                            <?php endif; ?>
119
+                                                     ">
120
+
121
+                                            <div class="column-kachel--inner">
122
+                                                <span>
123
+                                                    <?php echo $b->kachel_top_text; ?>
124
+                                                </span>
125
+
126
+                                                <?php if ($b->kachel_hover_text): ?>
127
+                                                    <div class="column-kachel--hover-text">
128
+                                                        <?= $b->kachel_hover_text; ?>
129
+                                                    </div>
130
+                                                <?php endif; ?>
131
+                                            </div>
132
+                                        </div>
133
+                                    </div>
134
+                                <?php endif; ?>
135
+                            </div>
136
+                        <?php endif; ?>
137
+
138
+
139
+                        <?php if ($b->headline || $b->text || $b->buttons[0]->link_text != ""): ?>
140
+
141
+                        <div class="kb--content  <?php if (!$b->headline) : ?>mt-0<?php endif; ?> <?= $b->textalign; ?>">
142
+                            <?php if ($b->headline) : ?>
143
+                            <div class="box--headline">
144
+                                <<?php echo $b->headline_type; ?> class="h5">
145
+                                <?php echo $b->headline; ?>
146
+                            </<?php echo $b->headline_type; ?>>
147
+                        </div>
148
+                    <?php endif; ?>
149
+                        <?php if ($b->text) : ?>
150
+                            <div class="box--text">
151
+                                <?php echo $b->text; ?>
152
+                            </div>
153
+                        <?php endif; ?>
154
+
155
+
156
+                        <?php if ($b->buttons[0]->link_text != "") : ?>
157
+                            <div class="box--button">
158
+                                <?php foreach ($b->buttons as $button) : ?>
159
+                                    <a <?php if ($button->new_tab): ?>target="_blank"<?php endif; ?>
160
+                                       class="d-block mt-2 btn <?php if ($button->link_size) : ?><?php echo $button->link_size; ?><?php endif; ?> <?php echo $button->link_type; ?>"
161
+                                       data-aos="<?php if ($button->animation_type) : ?><?php echo $button->animation_type; ?><?php else : ?>animate__fadeInUp<?php endif; ?>"
162
+                                       href="<?php echo $button->link_url; ?><?php if ($button->link_betreff) : ?>?subject=<?php echo $button->link_betreff; ?><?php endif; ?>"><?php echo $button->link_text; ?> </a>
163
+                                <?php endforeach ?>
164
+                            </div>
165
+                        <?php endif; ?>
166
+                    </div>
167
+                <?php endif; ?>
168
+                </div>
169
+            </div>
170
+        </div>
171
+        <?php endforeach; ?>
172
+    </div>
173
+</div></div></div>
0 174
\ No newline at end of file