PluginProbe ʕ •ᴥ•ʔ
Spider Elements – Premium Elementor Widgets & Addons Library / 1.5.0
Spider Elements – Premium Elementor Widgets & Addons Library v1.5.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 / Team_Carousel.php
spider-elements / widgets Last commit date
templates 1 year ago Accordion.php 1 year ago Alerts_Box.php 1 year ago Animated_Heading.php 1 year ago Before_after.php 1 year ago Blog_Grid.php 1 year ago Buttons.php 1 year ago Cheat_sheet.php 1 year ago Counter.php 1 year ago Fullscreen_Slider.php 1 year ago Icon_box.php 1 year ago Instagram.php 1 year ago Integrations.php 1 year ago List_Item.php 1 year ago Pricing_Table_Switcher.php 1 year ago Pricing_Table_Tabs.php 1 year ago Tabs.php 1 year ago Team_Carousel.php 1 year ago Testimonial.php 1 year ago Timeline.php 1 year ago Video_Playlist.php 1 year ago Video_Popup.php 1 year ago
Team_Carousel.php
353 lines
1 <?php
2 /**
3 * Use namespace to avoid conflict
4 */
5
6 namespace SPEL\Widgets;
7
8 use Elementor\Group_Control_Background;
9 use Elementor\Group_Control_Border;
10 use Elementor\Group_Control_Typography;
11 use Elementor\Widget_Base;
12 use Elementor\Controls_Manager;
13 use Elementor\Repeater;
14
15 // Exit if accessed directly
16 if ( ! defined( 'ABSPATH' ) ) {
17 exit;
18 }
19
20 /**
21 * Class Team
22 * @package spider\Widgets
23 * @since 1.0.0
24 */
25 class Team_Carousel extends Widget_Base {
26
27 public function get_name() {
28 return 'docy_team_carousel'; // ID of the widget (Don't change this name)
29 }
30
31 public function get_title() {
32 return esc_html__( 'Team Carousel', 'spider-elements' );
33 }
34
35 public function get_icon() {
36 return 'eicon-nested-carousel spel-icon';
37 }
38
39 public function get_keywords() {
40 return [ 'spider', 'spider elements', 'team', 'team', 'team widget' ];
41 }
42
43 public function get_categories() {
44 return [ 'spider-elements' ];
45 }
46
47 /**
48 * Name: get_style_depends()
49 * Desc: Register the required CSS dependencies for the frontend.
50 */
51 public function get_style_depends() {
52 return [ 'elegant-icon', 'slick', 'slick-theme', 'spel-main' ];
53 }
54
55 /**
56 * Name: get_script_depends()
57 * Desc: Register the required JS dependencies for the frontend.
58 */
59 public function get_script_depends() {
60 return [ 'slick', 'spel-el-widgets' ];
61 }
62
63
64 /**
65 * Name: register_controls()
66 * Desc: Register controls for these widgets
67 * Params: no params
68 * Return: @void
69 * Since: @1.0.0
70 * Package: @spider-elements
71 * Author: spider-themes
72 */
73 protected function register_controls() {
74 $this->elementor_content_control();
75 $this->team_slider_control();
76 $this->team_style_control();
77 }
78
79
80 /**
81 * Name: elementor_content_control()
82 * Desc: Register the Content Tab output on the Elementor editor.
83 * Params: no params
84 * Return: @void
85 * Since: @1.0.0
86 * Package: @spider-elements
87 * Author: spider-themes
88 */
89
90 public function elementor_content_control() {
91
92 // ============================ Select Style ===========================//
93 $this->start_controls_section(
94 'select_style',
95 [
96 'label' => esc_html__( 'Preset Skins', 'spider-elements' ),
97 ]
98 );
99
100 $this->add_control(
101 'style',
102 [
103 'label' => esc_html__( 'Team Style', 'spider-elements' ),
104 'type' => Controls_Manager::CHOOSE,
105 'options' => [
106 '1' => [
107 'icon' => 'team1',
108 'title' => esc_html__( '01 : Team Carousel', 'spider-elements' )
109 ],
110 '2' => [
111 'icon' => 'team2',
112 'title' => esc_html__( '02 : Team Carousel', 'spider-elements' ),
113 ]
114 ],
115 'default' => '1',
116 ]
117 );
118
119
120 $this->end_controls_section(); // End Select Style
121 }
122
123 public function team_slider_control() {
124 //start content layout
125 $this->start_controls_section(
126 'section_title_control',
127 [
128 'label' => esc_html__( 'Content', 'spider-elements' ),
129 ]
130 );
131
132 //================= Team Slider Item =================//
133 $repeater = new \Elementor\Repeater();
134 $repeater->add_control(
135 'team_slider_image', [
136 'label' => esc_html__( 'Slider Image', 'spider-elements' ),
137 'type' => \Elementor\Controls_Manager::MEDIA,
138 'default' => [
139 'url' => \Elementor\Utils::get_placeholder_image_src(),
140 ],
141 ]
142 );
143
144 $repeater->add_control(
145 'team_name', [
146 'label' => esc_html__( 'Name', 'spider-elements' ),
147 'type' => \Elementor\Controls_Manager::TEXT,
148 'placeholder' => esc_html__( 'Enter Name', 'spider-elements' ),
149 'default' => esc_html__( 'John Deo', 'spider-elements' ),
150 'label_block' => true,
151 ]
152 );
153
154 $repeater->add_control(
155 'team_link',
156 [
157 'label' => esc_html__( 'Link', 'spider-elements' ),
158 'type' => \Elementor\Controls_Manager::URL,
159 'placeholder' => esc_html__( 'https://your-link.com', 'spider-elements' ),
160 'options' => [ 'url', 'is_external', 'nofollow' ],
161 'default' => [
162 'url' => '',
163 'is_external' => true,
164 'nofollow' => true,
165 // 'custom_attributes' => '',
166 ],
167 'label_block' => true,
168 ]
169 );
170
171 $repeater->add_control(
172 'team_job_position', [
173 'label' => esc_html__( 'Content Text', 'spider-elements' ),
174 'type' => \Elementor\Controls_Manager::TEXTAREA,
175 'placeholder' => esc_html__( 'Enter text', 'spider-elements' ),
176 'default' => esc_html__( 'Envato Customer', 'spider-elements' ),
177 'label_block' => true,
178 ]
179 );
180
181 $this->add_control(
182 'team_slider_item',
183 [
184 'label' => esc_html__( 'Team Item', 'spider-elements' ),
185 'type' => \Elementor\Controls_Manager::REPEATER,
186 'fields' => $repeater->get_controls(),
187 'prevent_empty' => false,
188 'default' => [
189 [
190 'team_name' => esc_html__( 'Elizabeth Foster', 'spider-elements' ),
191 'team_job_position' => esc_html__( 'UI/UX Designer', 'spider-elements' ),
192 ],
193 [
194 'team_name' => esc_html__( 'Julie Ake', 'spider-elements' ),
195 'team_job_position' => esc_html__( 'Product Designer', 'spider-elements' ),
196 ],
197 [
198 'team_name' => esc_html__( 'Elizabeth Foster', 'spider-elements' ),
199 'team_job_position' => esc_html__( 'UI/UX Designer', 'spider-elements' ),
200 ],
201 [
202 'team_name' => esc_html__( 'Juan Marko', 'spider-elements' ),
203 'team_job_position' => esc_html__( 'Java Developer', 'spider-elements' ),
204 ],
205
206 ],
207 ]
208 );
209 $this->end_controls_section();
210 }
211
212
213 /**
214 * Name: elementor_style_control()
215 * Desc: Register the Style Tab output on the Elementor editor.
216 * Params: no params
217 * Return: @void
218 * Since: @1.0.0
219 * Package: @spider-elements
220 * Author: spider-themes
221 */
222 public function team_style_control() {
223
224 $this->start_controls_section(
225 'team_img_style', [
226 'label' => esc_html__( 'Team Image', 'spider-elements' ),
227 'tab' => Controls_Manager::TAB_STYLE,
228 ]
229 );
230 $this->add_responsive_control(
231 'team_img_border_radius',
232 [
233 'label' => esc_html__( 'Border Radius', 'spider-elements' ),
234 'type' => Controls_Manager::DIMENSIONS,
235 'size_units' => [ 'px', '%', 'em' ],
236 'selectors' => [
237 '{{WRAPPER}} .card-style-three .img-meta img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
238 ],
239 ]
240 );
241 $this->end_controls_section();
242 //========================= Contents =========================//
243 $this->start_controls_section(
244 'team_style_content', [
245 'label' => esc_html__( 'Team Contents', 'spider-elements' ),
246 'tab' => Controls_Manager::TAB_STYLE,
247 ]
248 );
249
250 $this->add_control(
251 'name_heading', [
252 'label' => esc_html__( 'Name', 'spider-elements' ),
253 'type' => Controls_Manager::HEADING,
254 ]
255 );
256
257 $this->start_controls_tabs(
258 'style_team_title_tabs'
259 );
260
261 //=== Normal icon
262 $this->start_controls_tab(
263 'style_normal',
264 [
265 'label' => esc_html__( 'Normal', 'spider-elements' ),
266 ]
267 );
268
269 $this->add_group_control(
270 Group_Control_Typography::get_type(), [
271 'name' => 'team_name_typo',
272 'selector' => '{{WRAPPER}} .card-style-three .name,{{WRAPPER}} .card-style-eight .name',
273 ]
274 ); //End Author Name
275 $this->add_control(
276 'team_name_color', [
277 'label' => esc_html__( 'Color', 'spider-elements' ),
278 'type' => Controls_Manager::COLOR,
279 'selectors' => [
280 '{{WRAPPER}} .card-style-three .name,{{WRAPPER}} .card-style-eight .name' => 'color: {{VALUE}};',
281 ],
282 ]
283 );
284
285 $this->end_controls_tab(); //End Normal icon
286
287 //=== Active icon
288 $this->start_controls_tab(
289 'team_title_hover', [
290 'label' => esc_html__( 'Hover', 'spider-elements' ),
291 ]
292 );
293
294 $this->add_control(
295 'team_name_hover_color', [
296 'label' => esc_html__( 'Color', 'spider-elements' ),
297 'type' => Controls_Manager::COLOR,
298 'selectors' => [
299 '{{WRAPPER}} .card-style-three .name:hover,{{WRAPPER}} .card-style-eight .name:hover' => 'color: {{VALUE}};',
300 ],
301 ]
302 );
303
304 $this->end_controls_tab(); // End Active Tab Title
305 $this->end_controls_tabs(); // End Accordion icon Normal/Active/ State
306
307 $this->add_control(
308 'designation_heading', [
309 'label' => esc_html__( 'Designation', 'spider-elements' ),
310 'type' => Controls_Manager::HEADING,
311 'separator' => 'before',
312 ]
313 );
314
315 $this->add_group_control(
316 Group_Control_Typography::get_type(), [
317 'name' => 'team_position_typo',
318 'selector' => '{{WRAPPER}} .card-style-three .post,{{WRAPPER}} .card-style-eight .post',
319 ]
320 ); //End Author Name
321 $this->add_control(
322 'team_position_color', [
323 'label' => esc_html__( 'Color', 'spider-elements' ),
324 'type' => Controls_Manager::COLOR,
325 'selectors' => [
326 '{{WRAPPER}} .card-style-three .post,{{WRAPPER}} .card-style-eight .post' => 'color: {{VALUE}};',
327 ],
328 ]
329 );
330
331
332 $this->end_controls_section();
333 }
334
335 /**
336 * Name: elementor_render()
337 * Desc: Render the widget output on the frontend.
338 * Params: no params
339 * Return: @void
340 * Since: @1.0.0
341 * Package: @spider-elements
342 * Author: spider-themes
343 */
344 protected function render() {
345 $settings = $this->get_settings_for_display();
346 extract( $settings ); //extract all settings array to variables converted to name of key
347 $team_id = $this->get_id();
348 //================= Template Parts =================//
349 include "templates/team/team-{$settings['style']}.php";
350 }
351
352
353 }