PluginProbe ʕ •ᴥ•ʔ
Premium Addons for Elementor – Powerful Elementor Templates & Widgets / 4.1.0
Premium Addons for Elementor – Powerful Elementor Templates & Widgets v4.1.0
4.11.79 4.11.78 4.11.77 4.11.76 4.11.75 3.20.5 4.11.69 3.20.6 4.11.7 3.20.7 4.11.70 3.20.8 4.11.71 3.20.9 4.11.72 3.21.1 4.11.73 3.21.2 4.11.74 3.21.3 4.11.8 3.21.4 4.11.9 3.21.5 4.2.0 3.21.6 4.2.1 3.3.0 4.2.2 3.3.1 4.2.3 3.3.2 4.2.4 3.3.3 4.2.5 3.3.4 4.2.6 3.3.5 4.2.7 3.3.6 4.2.8 3.3.7 4.2.9 3.3.8 4.3.0 3.3.9 4.3.1 3.4.0 4.3.2 3.4.1 4.3.3 3.4.2 4.3.4 3.4.3 4.3.5 3.4.4 4.3.6 3.4.5 4.3.7 3.4.6 4.3.8 3.4.7 4.3.9 3.4.8 4.4.0 3.4.9 4.4.1 3.5.0 4.4.2 3.5.1 4.4.3 3.5.2 4.4.4 3.5.3 4.4.5 3.5.4 4.4.6 3.5.5 4.4.7 3.5.6 4.4.8 3.5.7 4.4.9 3.5.8 4.5.0 3.5.9 4.5.1 3.6.0 4.5.2 3.6.1 4.5.3 3.6.2 4.5.4 3.6.3 4.5.5 3.6.4 4.5.6 3.6.5 4.5.7 3.6.6 4.5.8 3.6.7 4.5.9 3.6.8 4.6.0 3.6.9 4.6.1 3.7.0 4.7.0 3.7.1 4.7.1 3.7.2 4.7.2 3.7.3 4.7.3 3.7.4 4.7.4 3.7.5 4.7.5 3.7.6 4.7.6 3.7.7 4.7.7 3.7.8 4.7.8 3.7.9 4.7.9 3.8.0 4.8.0 3.8.1 4.8.1 3.8.2 4.8.10 3.8.3 4.8.11 3.8.4 4.8.2 3.8.5 4.8.3 3.8.6 4.8.4 3.8.7 4.8.5 3.8.8 4.8.6 3.8.9 4.8.7 3.9.0 4.8.8 3.9.1 4.8.9 3.9.2 4.9.0 3.9.3 4.9.0-beta1 3.9.4 4.9.0-beta2 3.9.5 4.9.1 3.9.6 4.9.10 3.9.7 4.9.11 3.9.8 4.9.12 3.9.9 4.9.13 4.0.1 4.9.14 4.0.3 4.9.15 4.0.4 4.9.16 4.0.5 4.9.17 4.0.6 4.9.18 4.0.7 4.9.19 4.0.8 4.9.2 4.0.9 4.9.20 4.1.0 4.9.21 4.1.1 4.9.22 4.1.2 4.9.23 4.1.3 4.9.24 trunk 4.1.4 4.9.25 1.0 4.1.5 4.9.26 1.01 4.1.6 4.9.27 1.02 4.1.7 4.9.28 1.03 4.1.8 4.9.29 1.04 4.1.9 4.9.3 1.05 4.10.0 4.9.30 1.06 4.10.1 4.9.31 1.07 4.10.10 4.9.32 1.08 4.10.11 4.9.33 1.09 4.10.12 4.9.34 2.0 4.10.13 4.9.35 2.0.1 4.10.14 4.9.36 2.0.2 4.10.15 4.9.37 2.0.3 4.10.16 4.9.38 2.0.4 4.10.17 4.9.39 2.0.5 4.10.18 4.9.4 2.0.6 4.10.19 4.9.40 2.0.7 4.10.2 4.9.41 2.0.8 4.10.20 4.9.42 2.0.9 4.10.21 4.9.43 2.1.0 4.10.22 4.9.45 2.1.1 4.10.23 4.9.46 2.1.2 4.10.24 4.9.47 2.1.3 4.10.25 4.9.48 2.1.4 4.10.26 4.9.49 2.1.5 4.10.27 4.9.5 2.1.5-beta1 4.10.28 4.9.50 2.1.6 4.10.29 4.9.51 2.1.7 4.10.3 4.9.52 2.1.8 4.10.30 4.9.53 2.1.9 4.10.31 4.9.54 2.2.0 4.10.32 4.9.55 2.2.1 4.10.33 4.9.56 2.2.2 4.10.34 4.9.57 2.2.3 4.10.35 4.9.6 2.2.4 4.10.36 4.9.7 2.2.5 4.10.37 4.9.8 2.2.6 4.10.38 4.9.9 2.2.7 4.10.39 2.2.8 4.10.4 2.2.9 4.10.40 2.3.0 4.10.41 2.3.1 4.10.42 2.3.2 4.10.43 2.3.3 4.10.44 2.3.4 4.10.45 2.3.5 4.10.46 2.3.6 4.10.47 2.3.7 4.10.48 2.3.8 4.10.49 2.3.9 4.10.5 2.4.0 4.10.50 2.4.1 4.10.51 2.5.0 4.10.52 2.5.1 4.10.53 2.5.2 4.10.54 2.5.3 4.10.55 2.5.4 4.10.56 2.5.5 4.10.57 2.5.6 4.10.58 2.5.7 4.10.59 2.5.8 4.10.6 2.5.9 4.10.60 2.6.0 4.10.61 2.6.1 4.10.62 2.6.2 4.10.63 2.6.3 4.10.64 2.6.4 4.10.65 2.6.5 4.10.66 2.6.6 4.10.67 2.6.7 4.10.68 2.6.8 4.10.69 2.6.9 4.10.7 2.7.0 4.10.70 2.7.1 4.10.71 2.7.2 4.10.72 2.7.3 4.10.73 2.7.4 4.10.74 2.7.5 4.10.75 2.7.6 4.10.76 2.7.7 4.10.77 2.7.8 4.10.78 2.7.9 4.10.79 2.8.0 4.10.8 2.8.1 4.10.80 2.8.2 4.10.81 2.8.3 4.10.82 2.8.4 4.10.83 2.8.5 4.10.84 2.8.6 4.10.85 2.8.7 4.10.86 2.8.8 4.10.87 2.8.9 4.10.88 2.9.0 4.10.89 2.9.1 4.10.9 2.9.2 4.10.90 2.9.3 4.11.0 2.9.4 4.11.1 2.9.5 4.11.10 2.9.6 4.11.11 2.9.7 4.11.12 2.9.8 4.11.13 2.9.9 4.11.14 3.0.0 4.11.15 3.0.1 4.11.16 3.0.2 4.11.17 3.0.3 4.11.18 3.0.4 4.11.19 3.0.5 4.11.2 3.0.6 4.11.20 3.0.7 4.11.21 3.0.8 4.11.22 3.0.9 4.11.23 3.1.0 4.11.24 3.1.1 4.11.25 3.1.2 4.11.26 3.1.3 4.11.27 3.1.4 4.11.28 3.1.5 4.11.29 3.1.6 4.11.3 3.1.7 4.11.30 3.1.8 4.11.31 3.1.9 4.11.32 3.10.0 4.11.33 3.10.1 4.11.34 3.10.2 4.11.35 3.10.3 4.11.36 3.10.4 4.11.37 3.10.5 4.11.38 3.10.6 4.11.39 3.10.7 4.11.4 3.10.8 4.11.40 3.10.9 4.11.41 3.11.0 4.11.42 3.11.1 4.11.43 3.11.2 4.11.44 3.11.3 4.11.45 3.11.4 4.11.46 3.11.5 4.11.47 3.11.6 4.11.48 3.11.7 4.11.49 3.11.8 4.11.5 3.11.9 4.11.50 3.12.0 4.11.51 3.12.1 4.11.52 3.12.2 4.11.53 3.12.3 4.11.54 3.2.0 4.11.55 3.2.1 4.11.56 3.2.2 4.11.57 3.2.3 4.11.58 3.2.4 4.11.59 3.2.5 4.11.6 3.2.6 4.11.60 3.2.7 4.11.61 3.2.8 4.11.62 3.2.9 4.11.63 3.20.0 4.11.64 3.20.1 4.11.65 3.20.2 4.11.66 3.20.3 4.11.67 3.20.4 4.11.68
premium-addons-for-elementor / widgets / premium-image-scroll.php
premium-addons-for-elementor / widgets Last commit date
dep 5 years ago premium-banner.php 5 years ago premium-blog.php 5 years ago premium-button.php 5 years ago premium-carousel.php 5 years ago premium-contactform.php 5 years ago premium-countdown.php 5 years ago premium-counter.php 5 years ago premium-dual-header.php 5 years ago premium-fancytext.php 5 years ago premium-grid.php 5 years ago premium-icon-list.php 5 years ago premium-image-button.php 5 years ago premium-image-scroll.php 5 years ago premium-image-separator.php 5 years ago premium-lottie.php 5 years ago premium-maps.php 5 years ago premium-modalbox.php 5 years ago premium-person.php 5 years ago premium-pricing-table.php 5 years ago premium-progressbar.php 5 years ago premium-testimonials.php 5 years ago premium-title.php 5 years ago premium-videobox.php 5 years ago premium-vscroll.php 5 years ago
premium-image-scroll.php
909 lines
1 <?php
2
3 /**
4 * Premium Image Scroll.
5 */
6 namespace PremiumAddons\Widgets;
7
8 // Elementor Classes.
9 use Elementor\Widget_Base;
10 use Elementor\Utils;
11 use Elementor\Control_Media;
12 use Elementor\Controls_Manager;
13 use Elementor\Group_Control_Border;
14 use Elementor\Group_Control_Image_Size;
15 use Elementor\Group_Control_Css_Filter;
16 use Elementor\Group_Control_Box_Shadow;
17 use Elementor\Group_Control_Text_Shadow;
18
19
20 // PremiumAddons Classes.
21 use PremiumAddons\Includes\Premium_Template_Tags;
22 use PremiumAddons\Includes\Helper_Functions;
23
24 if ( ! defined( 'ABSPATH' ) ) exit;
25
26 /**
27 * Class Premium_Image_Scroll
28 */
29 class Premium_Image_Scroll extends Widget_Base {
30
31 public function getTemplateInstance() {
32 return $this->templateInstance = Premium_Template_Tags::getInstance();
33 }
34
35 public function get_name() {
36 return 'premium-image-scroll';
37 }
38
39 public function get_title() {
40 return sprintf( '%1$s %2$s', Helper_Functions::get_prefix(), __('Image Scroll', 'premium-addons-for-elementor') );
41 }
42
43 public function is_reload_preview_required() {
44 return true;
45 }
46
47 public function get_icon() {
48 return 'pa-image-scroll';
49 }
50
51 public function get_categories() {
52 return [ 'premium-elements' ];
53 }
54
55 public function get_style_depends() {
56 return [
57 'premium-addons'
58 ];
59 }
60
61 public function get_script_depends() {
62 return [
63 'imagesloaded',
64 'premium-addons'
65 ];
66 }
67
68 public function get_custom_help_url() {
69 return 'https://premiumaddons.com/support/';
70 }
71
72 protected function _register_controls() {
73
74 $this->start_controls_section('general_settings',
75 [
76 'label' => __('Image Settings', 'premium-addons-for-elementor')
77 ]
78 );
79
80 $this->add_control('image',
81 [
82 'label' => __('Image', 'premium-addons-for-elementor'),
83 'type' => Controls_Manager::MEDIA,
84 'dynamic' => [ 'active' => true ],
85 'default' => [
86 'url' => Utils::get_placeholder_image_src(),
87 ],
88 'description' => __('Choose the scroll image', 'premium-addons-for-elementor' ),
89 'label_block' => true
90 ]
91 );
92
93 $this->add_group_control(
94 Group_Control_Image_Size::get_type(),
95 [
96 'name' => 'thumbnail',
97 'default' => 'full',
98 'separator' => 'none',
99 ]
100 );
101
102 $this->add_responsive_control('image_height',
103 [
104 'label' => __('Image Height', 'premium-addons-for-elementor'),
105 'type' => Controls_Manager::SLIDER,
106 'size_units' => ['px', 'em', 'vh'],
107 'default' => [
108 'unit' => 'px',
109 'size' => 300,
110 ],
111 'range' => [
112 'px' => [
113 'min' => 200,
114 'max' => 800,
115 ],
116 'em' => [
117 'min' => 1,
118 'max' => 50,
119 ],
120 ],
121 'selectors' => [
122 '{{WRAPPER}} .premium-image-scroll-container' => 'height: {{SIZE}}{{UNIT}};',
123 ]
124 ]
125 );
126
127 $this->add_control('link_switcher',
128 [
129 'label' => __('Link', 'premium-addons-for-elementor'),
130 'type' => Controls_Manager::SWITCHER,
131 'description' => __('Add a custom link or select an existing page link','premium-addons-for-elementor'),
132 ]
133 );
134
135 $this->add_control('link_type',
136 [
137 'label' => __('Link/URL', 'premium-addons-for-elementor'),
138 'type' => Controls_Manager::SELECT,
139 'options' => [
140 'url' => __('URL', 'premium-addons-for-elementor'),
141 'link' => __('Existing Page', 'premium-addons-for-elementor'),
142 ],
143 'default' => 'url',
144 'condition' => [
145 'link_switcher' => 'yes',
146 ],
147 'label_block' => true,
148 ]
149 );
150
151 $this->add_control('link',
152 [
153 'label' => __('URL', 'premium-addons-for-elementor'),
154 'type' => Controls_Manager::URL,
155 'dynamic' => [ 'active' => true ],
156 'placeholder' => 'https://premiumaddons.com/',
157 'label_block' => true,
158 'condition' => [
159 'link_switcher' => 'yes',
160 'link_type' => 'url'
161 ]
162 ]
163 );
164
165 $this->add_control('existing_page',
166 [
167 'label' => __('Existing Page', 'premium-addons-for-elementor'),
168 'type' => Controls_Manager::SELECT2,
169 'options' => $this->getTemplateInstance()->get_all_posts(),
170 'condition' => [
171 'link_switcher' => 'yes',
172 'link_type' => 'link',
173 ],
174 'label_block' => true,
175 ]
176 );
177
178 $this->add_control('link_text',
179 [
180 'label' => __('Link Title', 'premium-addons-for-elementor'),
181 'type' => Controls_Manager::TEXT,
182 'condition' => [
183 'link_switcher' => 'yes',
184 ],
185 'label_block' => true
186 ]
187 );
188
189 $this->add_control(
190 'mask_image_scroll_switcher',
191 [
192 'label' => esc_html__( 'Mask Image Shape', 'premium-addons-for-elementor' ),
193 'type' => Controls_Manager::SWITCHER,
194 'separator' => 'before',
195 ]
196 );
197
198 $this->add_control(
199 'mask_shape_image_scroll',
200 [
201 'label' => esc_html__( 'Mask Image', 'premium-addons-for-elementor' ),
202 'type' => Controls_Manager::MEDIA,
203 'default' => [
204 'url' => '',
205 ],
206 'description' => esc_html__( 'Use PNG image with the shape you want to mask around feature image.', 'premium-addons-for-elementor' ),
207 'selectors' => [
208 '{{WRAPPER}} .premium-image-scroll-mask-media ' => 'mask-image: url("{{URL}}");-webkit-mask-image: url("{{URL}}");',
209 ],
210 'condition' => [
211 'mask_image_scroll_switcher' => 'yes',
212 ],
213 ]
214 );
215
216 $this->add_control('mask_size',
217 [
218 'label' => __( 'Mask Size', 'premium-addons-for-elementor' ),
219 'type' => Controls_Manager::SELECT,
220 'options' => [
221 'contain' => __( 'Contain', 'premium-addons-for-elementor' ),
222 'cover' => __( 'Cover', 'premium-addons-for-elementor' )
223 ],
224 'default' => 'contain',
225 'selectors' => [
226 '{{WRAPPER}} .premium-image-scroll-mask-media' => 'mask-size: {{VALUE}};-webkit-mask-size: {{VALUE}};',
227 ],
228 'condition' => [
229 'mask_image_scroll_switcher' => 'yes',
230 ],
231 ]
232 );
233
234 $this->add_control('mask_position_cover',
235 [
236 'label' => __( 'Mask Position', 'premium-addons-for-elementor' ),
237 'type' => Controls_Manager::SELECT,
238 'options' => [
239 'center center' => __( 'Center Center','premium-addons-pro' ),
240 'center left' => __( 'Center Left', 'premium-addons-pro' ),
241 'center right' => __( 'Center Right', 'premium-addons-pro' ),
242 'top center' => __( 'Top Center', 'premium-addons-pro' ),
243 'top left' => __( 'Top Left', 'premium-addons-pro' ),
244 'top right' => __( 'Top Right', 'premium-addons-pro' ),
245 'bottom center' => __( 'Bottom Center', 'premium-addons-pro' ),
246 'bottom left' => __( 'Bottom Left', 'premium-addons-pro' ),
247 'bottom right' => __( 'Bottom Right', 'premium-addons-pro' ),
248 ],
249 'default' => 'center center',
250 'selectors' => [
251 '{{WRAPPER}} .premium-image-scroll-mask-media' => 'mask-position: {{VALUE}};-webkit-mask-position: {{VALUE}}',
252 ],
253 'condition' => [
254 'mask_image_scroll_switcher' => 'yes',
255 'mask_size' => 'cover'
256 ],
257 ]
258 );
259
260 $this->add_control('mask_position_contain',
261 [
262 'label' => __( 'Mask Position', 'premium-addons-for-elementor' ),
263 'type' => Controls_Manager::SELECT,
264 'options' => [
265 'center center' => __( 'Center Center','premium-addons-pro' ),
266 'top center' => __( 'Top Center', 'premium-addons-pro' ),
267 'bottom center' => __( 'Bottom Center', 'premium-addons-pro' ),
268 ],
269 'default' => 'center center',
270 'selectors' => [
271 '{{WRAPPER}} .premium-image-scroll-mask-media' => 'mask-position: {{VALUE}};-webkit-mask-position: {{VALUE}}',
272 ],
273 'condition' => [
274 'mask_image_scroll_switcher' => 'yes',
275 'mask_size' => 'contain'
276 ],
277 ]
278 );
279
280 $this->add_control('image_scroll_shadow',
281 [
282 'label' => __('Image Shadow', 'premium-addons-for-elementor'),
283 'type' => Controls_Manager::POPOVER_TOGGLE,
284 'condition' => [
285 'mask_image_scroll_switcher' => 'yes',
286 ],
287 'return_value' => 'yes',
288 'render_type' => 'template',
289 ]
290 );
291
292 $this->start_popover();
293
294 $this->add_control('image_scroll_shadow_color',
295 [
296 'label' => __('Color', 'premium-addons-for-elementor'),
297 'type' => Controls_Manager::COLOR,
298 'default' => 'rgba(0,0,0,0.5)',
299 ]
300 );
301
302
303 $this->add_control('image_scroll_shadow_h',
304 [
305 'label' => __( 'Horizontal', 'premium-addons-for-elementor' ),
306 'type' => Controls_Manager::SLIDER,
307 'range' => [
308 'px' => [
309 'min' => 0,
310 'max' => 100,
311 'step' => 1
312 ]
313 ],
314 'default' => [
315 'size' => 0 ,
316 'unit' => 'px'
317 ],
318 ]
319 );
320
321 $this->add_control('image_scroll_shadow_v',
322 [
323 'label' => __( 'Vertical', 'premium-addons-for-elementor' ),
324 'type' => Controls_Manager::SLIDER,
325 'range' => [
326 'px' => [
327 'min' => 0,
328 'max' => 100,
329 'step' => 1
330 ]
331 ],
332 'default' => [
333 'size' => 0 ,
334 'unit' => 'px'
335 ],
336 ]
337 );
338
339 $this->add_control('image_scroll_shadow_blur',
340 [
341 'label' => __( 'Blur', 'premium-addons-for-elementor' ),
342 'type' => Controls_Manager::SLIDER,
343 'range' => [
344 'px' => [
345 'min' => 0,
346 'max' => 100,
347 'step' => 1
348 ]
349 ],
350 'default' => [
351 'size' => 10 ,
352 'unit' => 'px'
353 ],
354 ]
355 );
356
357 $this->end_popover();
358
359
360 $this->end_controls_section();
361
362 $this->start_controls_section('advanced_settings',
363 [
364 'label' => __( 'Advanced Settings' , 'premium-addons-for-elementor' )
365 ]
366 );
367
368 $this->add_control('direction_type',
369 [
370 'label' => __( 'Direction', 'premium-addons-for-elementor' ),
371 'description' => __( 'Select Scroll Direction', 'premium-addons-for-elementor' ),
372 'type' => Controls_Manager::SELECT,
373 'options' => [
374 'horizontal' => __( 'Horizontal', 'premium-addons-for-elementor' ),
375 'vertical' => __( 'Vertical', 'premium-addons-for-elementor' )
376 ],
377 'default' => 'vertical'
378 ]
379 );
380
381 $this->add_control('image_fit',
382 [
383 'label' => __( 'Image Fit', 'premium-addons-for-elementor' ),
384 'type' => Controls_Manager::SELECT,
385 'options' => [
386 'fill' => __( 'Fill', 'premium-addons-for-elementor' ),
387 'cover' => __( 'Cover', 'premium-addons-for-elementor' )
388 ],
389 'condition' => [
390 'direction_type' => 'horizontal',
391 ],
392 'default' => 'fill',
393 'selectors' => [
394 '{{WRAPPER}} .premium-image-scroll-container .premium-image-scroll-horizontal img ' => 'object-fit:{{VALUE}};',
395 ],
396 ]
397 );
398
399 $this->add_control('reverse',
400 [
401 'label' => __( 'Reverse Direction', 'premium-addons-for-elementor' ),
402 'type' => Controls_Manager::SWITCHER,
403 'condition' => [
404 'trigger_type' => 'hover',
405 ]
406 ]
407 );
408
409 $this->add_control('trigger_type',
410 [
411 'label' => __('Trigger', 'premium-addons-for-elementor'),
412 'type' => Controls_Manager::SELECT,
413 'options' => [
414 'hover' => __('Hover', 'premium-addons-for-elementor'),
415 'scroll' => __('Mouse Scroll', 'premium-addons-for-elementor'),
416 ],
417 'default' => 'hover',
418 ]
419 );
420
421 $this->add_control('duration_speed',
422 [
423 'label' => __( 'Speed', 'premium-addons-for-elementor' ),
424 'description' => __( 'Set the scroll speed value. The value will be counted in seconds (s)', 'premium-addons-for-elementor' ),
425 'type' => Controls_Manager::NUMBER,
426 'default' => 3,
427 'condition' => [
428 'trigger_type' => 'hover',
429 ],
430 'selectors' => [
431 '{{WRAPPER}} .premium-image-scroll-container img' => 'transition-duration: {{Value}}s',
432 ]
433 ]
434 );
435
436 $this->add_control('icon_switcher',
437 [
438 'label' => __('Icon', 'premium-addons-for-elementor'),
439 'type' => Controls_Manager::SWITCHER,
440 ]
441 );
442
443 $this->add_control('icon_size',
444 [
445 'label' => __('Icon Size', 'premium-addons-for-elementor'),
446 'type' => Controls_Manager::SLIDER,
447 'size_units' => ['px','em'],
448 'default' => [
449 'size' => 30,
450 ],
451 'range' => [
452 'px' => [
453 'min' => 5,
454 'max' => 100
455 ],
456 ],
457 'selectors' => [
458 '{{WRAPPER}} .premium-image-scroll-icon' => 'font-size: {{SIZE}}{{UNIT}};',
459 ],
460 'condition' => [
461 'icon_switcher' => 'yes'
462 ]
463 ]
464 );
465
466 $this->add_control('overlay',
467 [
468 'label' => __('Overlay','premium-addons-for-elementor'),
469 'type' => Controls_Manager::SWITCHER,
470 'label_on' => __('Show','premium-addons-for-elementor'),
471 'label_off' => __('Hide','premium-addons-for-elementor'),
472
473 ]
474 );
475
476 $this->end_controls_section();
477
478 $this->start_controls_section('section_pa_docs',
479 [
480 'label' => __('Helpful Documentations', 'premium-addons-for-elementor'),
481 ]
482 );
483
484 $doc1_url = Helper_Functions::get_campaign_link( 'https://premiumaddons.com/docs/image-scroll-widget-tutorial/', 'editor-page', 'wp-editor', 'get-support' );
485
486 $this->add_control('doc_1',
487 [
488 'type' => Controls_Manager::RAW_HTML,
489 'raw' => sprintf( '<a href="%s" target="_blank">%s</a>', $doc1_url ,__( 'Gettings started »', 'premium-addons-for-elementor' ) ),
490 'content_classes' => 'editor-pa-doc',
491 ]
492 );
493
494 $this->end_controls_section();
495
496 $this->start_controls_section('image_style',
497 [
498 'label' => __('Image', 'premium-addons-for-elementor'),
499 'tab' => Controls_Manager::TAB_STYLE,
500 ]
501 );
502
503 $this->add_control('icon_color',
504 [
505 'label' => __('Icon Color', 'premium-addons-for-elementor'),
506 'type' => Controls_Manager::COLOR,
507 'selectors' => [
508 '{{WRAPPER}} .premium-image-scroll-icon' => 'color: {{VALUE}};'
509 ],
510 'condition' => [
511 'icon_switcher' => 'yes'
512 ]
513 ]
514 );
515
516 $this->add_control('overlay_background',
517 [
518 'label' => __('Overlay Color', 'premium-addons-for-elementor'),
519 'type' => Controls_Manager::COLOR,
520 'selectors' => [
521 '{{WRAPPER}} .premium-image-scroll-overlay' => 'background: {{VALUE}};'
522 ],
523 'condition' => [
524 'overlay' => 'yes'
525 ]
526 ]
527 );
528
529 $this->start_controls_tabs('image_style_tabs');
530
531 $this->start_controls_tab('image_style_tab_normal',
532 [
533 'label' => __('Normal', 'premium-addons-for-elementor'),
534 ]
535 );
536
537 $this->add_control('opacity',
538 [
539 'label' => __( 'Opacity', 'premium-addons-for-elementor' ),
540 'type' => Controls_Manager::SLIDER,
541 'range' => [
542 'px' => [
543 'max' => 1,
544 'min' => 0.10,
545 'step' => 0.01,
546 ],
547 ],
548 'selectors' => [
549 '{{WRAPPER}} img' => 'opacity: {{SIZE}};',
550 ],
551 ]
552 );
553
554 $this->add_group_control(
555 Group_Control_Css_Filter::get_type(),
556 [
557 'name' => 'css_filters',
558 'selector' => '{{WRAPPER}} .premium-image-scroll-container img',
559 ]
560 );
561
562 $this->end_controls_tab();
563
564 $this->start_controls_tab('image_style_tab_hover',
565 [
566 'label' => __('Hover', 'premium-addons-for-elementor'),
567 ]
568 );
569
570 $this->add_control('hover_opacity',
571 [
572 'label' => __( 'Opacity', 'premium-addons-for-elementor' ),
573 'type' => Controls_Manager::SLIDER,
574 'range' => [
575 'px' => [
576 'max' => 1,
577 'min' => 0.10,
578 'step' => 0.01,
579 ],
580 ],
581 'selectors' => [
582 '{{WRAPPER}} .premium-image-scroll-section:hover img' => 'opacity: {{SIZE}};',
583 ],
584 ]
585 );
586
587 $this->add_group_control(
588 Group_Control_Css_Filter::get_type(),
589 [
590 'name' => 'css_filters_hover',
591 'selector' => '{{WRAPPER}} .premium-image-scroll-container img:hover',
592 ]
593 );
594
595 $this->end_controls_tab();
596
597 $this->end_controls_tabs();
598
599 $this->add_control('blend_mode',
600 [
601 'label' => __( 'Blend Mode', 'elementor' ),
602 'type' => Controls_Manager::SELECT,
603 'options' => [
604 '' => __( 'Normal', 'elementor' ),
605 'multiply' => 'Multiply',
606 'screen' => 'Screen',
607 'overlay' => 'Overlay',
608 'darken' => 'Darken',
609 'lighten' => 'Lighten',
610 'color-dodge' => 'Color Dodge',
611 'saturation' => 'Saturation',
612 'color' => 'Color',
613 'luminosity' => 'Luminosity',
614 ],
615 'separator' => 'before',
616 'selectors' => [
617 '{{WRAPPER}} .premium-image-scroll-container img' => 'mix-blend-mode: {{VALUE}}',
618 ],
619 ]
620 );
621
622 $this->end_controls_section();
623
624 $this->start_controls_section('container_style',
625 [
626 'label' => __('Container','premium-addons-for-elementor'),
627 'tab' => Controls_Manager::TAB_STYLE,
628 ]
629 );
630
631 $this->start_controls_tabs('container_style_tabs');
632
633 $this->start_controls_tab('container_style_normal',
634 [
635 'label' => __('Normal', 'premium-addons-for-elementor'),
636 ]
637 );
638
639 $this->add_group_control(
640 Group_Control_Border::get_type(),
641 [
642 'name' => 'container_border',
643 'selector' => '{{WRAPPER}} .premium-image-scroll-section',
644 ]
645 );
646
647 $this->add_control('container_border_radius',
648 [
649 'label' => __('Border Radius', 'premium-addons-for-elementor'),
650 'type' => Controls_Manager::SLIDER,
651 'size_units' => ['px', '%', 'em'],
652 'selectors' => [
653 '{{WRAPPER}} .premium-image-scroll-section, {{WRAPPER}} .premium-container-scroll' => 'border-radius: {{SIZE}}{{UNIT}}'
654 ]
655 ]
656 );
657
658 $this->add_group_control(
659 Group_Control_Box_Shadow::get_type(),
660 [
661 'name' => 'container_box_shadow',
662 'selector' => '{{WRAPPER}} .premium-image-scroll-section',
663 ]
664 );
665
666 $this->end_controls_tab();
667
668 $this->start_controls_tab('container_style_hover',
669 [
670 'label' => __('Hover', 'premium-addons-for-elementor'),
671 ]
672 );
673
674 $this->add_group_control(
675 Group_Control_Border::get_type(),
676 [
677 'name' => 'container_border_hover',
678 'selector' => '{{WRAPPER}} .premium-image-scroll-section:hover',
679 ]
680 );
681
682 $this->add_control('container_border_radius_hover',
683 [
684 'label' => __('Border Radius', 'premium-addons-for-elementor'),
685 'type' => Controls_Manager::SLIDER,
686 'size_units' => ['px', '%', 'em'],
687 'selectors' => [
688 '{{WRAPPER}} .premium-image-scroll-section:hover, {{WRAPPER}} .premium-container-scroll:hover' => 'border-radius: {{SIZE}}{{UNIT}}'
689 ]
690 ]
691 );
692
693 $this->add_group_control(
694 Group_Control_Box_Shadow::get_type(),
695 [
696 'name' => 'container_box_shadow_hover',
697 'selector' => '{{WRAPPER}} .premium-image-scroll-section:hover',
698 ]
699 );
700
701 $this->end_controls_tab();
702
703 $this->end_controls_tabs();
704
705 $this->end_controls_section();
706
707 }
708
709 /**
710 * Render Image Scroll widget output on the frontend.
711 *
712 * Written in PHP and used to generate the final HTML.
713 *
714 * @since 1.0.0
715 * @access protected
716 */
717 protected function render() {
718
719 $settings = $this->get_settings_for_display();
720
721 $link_type = $settings['link_type'];
722
723 $link_url = ( 'url' == $link_type ) ? $settings['link']['url'] : get_permalink( $settings['existing_page'] );
724
725 if ( $settings['link_switcher'] == 'yes' ) {
726 $this->add_render_attribute( 'link', 'class', 'premium-image-scroll-link' );
727
728 if( ! empty( $settings['link']['is_external'] ) ) {
729 $this->add_render_attribute( 'link', 'target', "_blank" );
730 }
731
732 if( ! empty( $settings['link']['nofollow'] ) ) {
733 $this->add_render_attribute( 'link', 'rel', "nofollow" );
734 }
735
736 if( ! empty( $settings['link_text'] ) ) {
737 $this->add_render_attribute( 'link', 'title', $settings['link_text'] );
738 }
739
740 if( ! empty( $settings['link']['url'] ) || ! empty( $settings['existing_page'] ) ) {
741 $this->add_render_attribute( 'link', 'href', $link_url );
742 }
743 }
744
745 if ( $settings['icon_switcher'] ) {
746 $icon_type = sprintf('pa-%s-mouse-scroll', $settings['direction_type'] );
747 }
748
749
750 $image_scroll = [
751 'trigger' => $settings['trigger_type'] ,
752 'direction' => $settings['direction_type'],
753 'reverse' => $settings['reverse'],
754 ];
755
756 $this->add_render_attribute( 'container', 'class', 'premium-image-scroll-container' );
757
758 $this->add_render_attribute( 'container', 'data-settings', wp_json_encode( $image_scroll ) );
759
760 $this->add_render_attribute( 'direction_type', 'class', 'premium-image-scroll-' . $settings['direction_type'] );
761
762 if(!empty($settings["mask_image_scroll_switcher"]) && $settings["mask_image_scroll_switcher"]==='yes'){
763 $this->add_render_attribute( 'direction_type', 'class', 'premium-image-scroll-mask-media' );
764 }
765
766 $image_html = '';
767 if ( ! empty( $settings['image']['url'] ) ) {
768
769 $this->add_render_attribute( 'image', [
770 'src' => $settings['image']['url'],
771 'alt' => Control_Media::get_image_alt( $settings['image'] ),
772 'title' => Control_Media::get_image_title( $settings['image'] )
773 ]);
774
775 $image_html = Group_Control_Image_Size::get_attachment_image_html( $settings, 'thumbnail', 'image' );
776
777 }
778 if($settings['mask_image_scroll_switcher'] === 'yes' && $settings['mask_shape_image_scroll']['url'] !== '' && $settings['image_scroll_shadow'] === 'yes'){
779 $this->add_render_attribute( 'shadow', 'style', 'filter: drop-shadow('.$settings['image_scroll_shadow_color'] .' '. $settings['image_scroll_shadow_h']['size'] .'px '. $settings['image_scroll_shadow_v']['size'] .'px '. $settings['image_scroll_shadow_blur']['size'].'px '.')' );
780 }
781
782 ?>
783 <div class="premium-image-scroll-section" <?php echo $this->get_render_attribute_string('shadow'); ?>>
784 <div <?php echo $this->get_render_attribute_string('container'); ?>>
785 <?php if( 'yes' == $settings['icon_switcher'] ) : ?>
786 <div class="premium-image-scroll-content">
787 <i class="premium-image-scroll-icon <?php echo $icon_type ?>"></i>
788 </div>
789 <?php endif; ?>
790 <div <?php echo $this->get_render_attribute_string('direction_type'); ?>>
791 <?php if($settings['overlay'] == 'yes') : ?>
792 <div class="premium-image-scroll-overlay">
793 <?php endif;
794 if ( $settings['link_switcher'] == 'yes' && ! empty( $link_url ) ) : ?>
795 <a <?php echo $this->get_render_attribute_string('link'); ?>></a>
796 <?php endif;
797 if( $settings['overlay'] == 'yes' ) : ?>
798 </div>
799 <?php endif;
800 echo $image_html;
801 ?>
802 </div>
803 </div>
804 </div>
805 <?php
806
807 }
808
809 /**
810 * Render Image Scroll widget output in the editor.
811 *
812 * Written as a Backbone JavaScript template and used to generate the live preview.
813 *
814 * @since 1.0.0
815 * @access protected
816 */
817 protected function content_template() {
818 ?>
819 <#
820
821 var linkType = settings.link_type,
822 trigger = settings.trigger_type,
823 direction = settings.direction_type,
824 reverse = settings.reverse,
825 url;
826
827 var scrollSettings = {};
828
829 scrollSettings.trigger = trigger;
830 scrollSettings.direction = direction,
831 scrollSettings.reverse = reverse;
832
833 if ( 'yes' == settings.icon_switcher ) {
834
835 var iconClass = 'pa-' + direction + '-mouse-scroll';
836
837 }
838
839
840 if ( 'yes' == settings.link_switcher ) {
841 view.addRenderAttribute( 'link', 'class', 'premium-image-scroll-link' );
842 url = 'url' == linkType ? settings.link.url : settings.existing_page;
843 view.addRenderAttribute( 'link', 'href', url );
844
845 if ( 'yes' == settings.link_switcher ) {
846 view.addRenderAttribute( 'link', 'title', settings.link_text );
847 }
848 }
849
850 view.addRenderAttribute( 'container', 'class', 'premium-image-scroll-container' );
851
852 view.addRenderAttribute( 'container', 'data-settings', JSON.stringify(scrollSettings) );
853
854 view.addRenderAttribute( 'direction_type', 'class', 'premium-image-scroll-' + direction );
855
856 view.addRenderAttribute( 'image', 'src', settings.image.url );
857
858 if(settings.mask_image_scroll_switcher && settings.mask_image_scroll_switcher ==='yes'){
859 view.addRenderAttribute( 'direction_type', 'class', 'premium-image-scroll-mask-media');
860 }
861
862 var imageHtml = '';
863 if ( settings.image.url ) {
864 var image = {
865 id: settings.image.id,
866 url: settings.image.url,
867 size: settings.thumbnail_size,
868 dimension: settings.thumbnail_custom_dimension,
869 model: view.getEditModel()
870 };
871
872 var image_url = elementor.imagesManager.getImageUrl( image );
873
874 imageHtml = '<img src="' + image_url + '"/>';
875
876 }
877 if(settings.mask_image_scroll_switcher === 'yes' && settings.mask_shape_image_scroll.url !== '' && settings.image_scroll_shadow === 'yes'){
878 view.addRenderAttribute( 'shadow', 'style', 'filter: drop-shadow('+settings.image_scroll_shadow_color +' '+ settings.image_scroll_shadow_h.size +'px '+ settings.image_scroll_shadow_v.size +'px '+ settings.image_scroll_shadow_blur.size+'px '+')' );
879 }
880
881 #>
882 <div class="premium-image-scroll-section" {{{ view.getRenderAttributeString('shadow') }}}>
883 <div {{{ view.getRenderAttributeString('container') }}}>
884 <# if ( 'yes' == settings.icon_switcher ) { #>
885 <div class="premium-image-scroll-content">
886 <i class="premium-image-scroll-icon {{ iconClass }}"></i>
887 </div>
888 <# } #>
889 <div {{{ view.getRenderAttributeString('direction_type') }}}>
890 <# if( 'yes' == settings.overlay ) { #>
891 <div class="premium-image-scroll-overlay">
892 <# }
893 if ( 'yes' == settings.link_switcher && '' != url ) { #>
894 <a {{{ view.getRenderAttributeString('link') }}}></a>
895 <# }
896 if( 'yes' == settings.overlay ) { #>
897 </div>
898 <# } #>
899
900 {{{ imageHtml }}}
901
902 </div>
903 </div>
904 </div>
905 <?php
906 }
907
908 }
909