PluginProbe ʕ •ᴥ•ʔ
Spider Elements – Premium Elementor Widgets & Addons Library / 1.1.0
Spider Elements – Premium Elementor Widgets & Addons Library v1.1.0
trunk 1.0.0 1.1.0 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.7.0 1.8.0 1.9.0
spider-elements / widgets / Marquee_Slides.php
spider-elements / widgets Last commit date
templates 2 years ago Accordion.php 2 years ago Alerts_Box.php 2 years ago Animated_Heading.php 2 years ago Before_after.php 2 years ago Blog_Grid.php 2 years ago Buttons.php 2 years ago Cheat_sheet.php 2 years ago Counter.php 2 years ago Fullscreen_Slider.php 2 years ago Icon_box.php 2 years ago Instagram.php 2 years ago Integrations.php 2 years ago List_Item.php 2 years ago Marquee_Slides.php 2 years ago Pricing_Table_Switcher.php 2 years ago Pricing_Table_Tabs.php 2 years ago Skill_Showcase.php 2 years ago Tabs.php 2 years ago Team_Carousel.php 2 years ago Testimonial.php 2 years ago Timeline.php 2 years ago Video_Playlist.php 2 years ago Video_Popup.php 2 years ago
Marquee_Slides.php
245 lines
1 <?php
2 /**
3 * Use namespace to avoid conflict
4 */
5
6 namespace SPEL\Widgets;
7
8 use Elementor\Repeater;
9 use Elementor\Widget_Base;
10 use Elementor\Utils;
11 use Elementor\Controls_Manager;
12 use Elementor\Group_Control_Typography;
13
14
15 if ( ! defined( 'ABSPATH' ) ) {
16 exit; // Exit if accessed directly.
17 }
18
19 /**
20 * Class Timeline
21 * @package spider\Widgets
22 */
23 class Marquee_Slides extends Widget_Base {
24
25 public function get_name() {
26 return 'spe_marquee_slides'; // ID of the widget (Don't change this name)
27 }
28
29 public function get_title() {
30 return esc_html__( 'Marquee Slides', 'spider-elements' );
31 }
32
33 public function get_icon() {
34 return 'eicon-slider-push spel-icon';
35 }
36
37 public function get_categories() {
38 return [ 'spider-elements' ];
39 }
40
41 /**
42 * Name: get_style_depends()
43 * Desc: Register the required CSS dependencies for the frontend.
44 */
45 public function get_style_depends() {
46 return [ 'spel-main', 'slick' ];
47 }
48
49 /**
50 * Name: get_script_depends()
51 * Desc: Register the required JS dependencies for the frontend.
52 */
53 public function get_script_depends() {
54 return [ 'slick', 'spel-el-widgets' ];
55 }
56
57
58 /**
59 * Name: register_controls()
60 * Desc: Register controls for these widgets
61 * Params: no params
62 * Return: @void
63 * Since: @1.0.0
64 * Package: @spider-elements
65 * Author: spider-themes
66 */
67 protected function register_controls() {
68 $this->elementor_content_control();
69 $this->elementor_style_control();
70 }
71
72 /**
73 * Name: elementor_content_control()
74 * Desc: Register the Content Tab output on the Elementor editor.
75 * Params: no params
76 * Return: @void
77 * Since: @1.0.0
78 * Package: @spider-elements
79 * Author: spider-themes
80 */
81 protected function elementor_content_control() {
82
83 //========================= preset Style ======================//
84 $this->start_controls_section(
85 'select_marquee_style', [
86 'label' => esc_html__( 'Preset Skins', 'spider-elements' ),
87 ]
88 );
89
90 $this->add_control(
91 'style', [
92 'label' => esc_html__( 'Marquee Slides', 'spider-elements' ),
93 'type' => Controls_Manager::CHOOSE,
94 'options' => [
95 '1' => [
96 'icon' => 'marquee1',
97 'title' => esc_html__( '01 : Marquee Slides', 'spider-elements' )
98 ],
99 '2' => [
100 'icon' => 'marquee2',
101 'title' => esc_html__( '02 : Marquee Slides', 'spider-elements' ),
102 ],
103 ],
104 'default' => '1',
105 ]
106 );
107
108 $this->end_controls_section(); // End Preset style
109
110
111 //===================== Marquee slides item =======================//
112 $this->start_controls_section(
113 'marquee_images',
114 [
115 'label' => __( 'Content', 'spider-elements' ),
116 ]
117 );
118
119 $this->add_control(
120 'right_slides',
121 [
122 'label' => esc_html__( 'Right Slides', 'spider-elements' ),
123 'type' => Controls_Manager::GALLERY,
124 'show_label' => true,
125 'condition' => [
126 'style' => '1'
127 ]
128 ]
129 );
130
131 $this->add_control(
132 'left_slides',
133 [
134 'label' => esc_html__( 'Left Slide', 'spider-elements' ),
135 'type' => Controls_Manager::GALLERY,
136 'show_label' => true,
137 'condition' => [
138 'style' => '1'
139 ]
140 ]
141 );
142
143 //=== Repeater Style two
144 $repeater = new Repeater();
145 $repeater->add_control(
146 'title',
147 [
148 'label' => esc_html__( 'Title', 'spider-elements' ),
149 'type' => Controls_Manager::TEXT,
150 'label_block' => true,
151 'default' => esc_html__( 'Web Developer', 'spider-elements' )
152 ]
153 );
154
155 $this->add_control(
156 'brand_name',
157 [
158 'label' => __( 'Add Brand Name', 'spider-elements' ),
159 'type' => Controls_Manager::REPEATER,
160 'fields' => $repeater->get_controls(),
161 'title_field' => '{{{ title }}}',
162 'prevent_empty' => false,
163 'default' => [
164 [
165 'title' => esc_html__( 'Web Developer', 'spider-elements' ),
166 ],
167 ],
168 'condition' => [
169 'style' => '2'
170 ]
171 ]
172 ); //End Icon
173
174 $this->add_control(
175 'shape_img',
176 [
177 'label' => esc_html__( 'Shape Image', 'spider-elements' ),
178 'type' => Controls_Manager::MEDIA,
179 'condition' => [
180 'style' => '2'
181 ]
182 ]
183 );
184
185 $this->end_controls_section(); //End Marquee Slides Item
186 }
187
188 /**
189 * Name: elementor_style_control()
190 * Desc: Register style content
191 * Params: no params
192 * Return: @void
193 * Since: @1.0.0
194 * Package: @allfolio
195 * Author: spider-themes
196 */
197 public function elementor_style_control() {
198
199 $this->start_controls_section(
200 'style_sec',
201 [
202 'label' => esc_html__( 'Marquee Slides', 'spider-elements' ),
203 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
204 'condition' => [
205 'style' => '2'
206 ]
207 ]
208 );
209
210 $this->add_control(
211 'title_color', [
212 'label' => esc_html__( 'Title Color', 'spider-elements' ),
213 'type' => Controls_Manager::COLOR,
214 'selectors' => [
215 '{{WRAPPER}} .se_marquee_title' => 'color: {{VALUE}};',
216 ],
217 ]
218 );
219
220 $this->add_group_control(
221 Group_Control_Typography::get_type(), [
222 'name' => 'title_typography',
223 'selector' => '{{WRAPPER}} .se_marquee_title',
224 ]
225 );
226
227 $this->end_controls_section();
228 }
229
230 /**
231 * Name: elementor_render()
232 * Desc: Render the widget output on the frontend.
233 * Params: no params
234 * Return: @void
235 * Since: @1.0.0
236 * Package: @spider-elements
237 * Author: spider-themes
238 */
239 protected function render() {
240 $settings = $this->get_settings_for_display();
241 extract( $settings ); //extract all settings array to variables converted to name of key
242 //======================== Template Parts ==========================//
243 include "templates/marquee/marquee-{$settings['style']}.php";
244 }
245 }