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 / Team_Carousel.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
Team_Carousel.php
336 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' => __( 'Preset Skins', 'spider-elements' ),
97 ]
98 );
99
100 $this->add_control(
101 'style',
102 [
103 'label' => __( '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' => __( 'Content', 'spider-elements' ),
129 ]
130 );
131 $repeater = new \Elementor\Repeater();
132 $repeater->add_control(
133 'team_slider_image', [
134 'label' => __( 'Slider Image', 'spider-elements' ),
135 'type' => \Elementor\Controls_Manager::MEDIA,
136 'default' => [
137 'url' => \Elementor\Utils::get_placeholder_image_src(),
138 ],
139 ]
140 );
141 $repeater->add_control(
142 'team_name', [
143 'label' => __( 'Name', 'spider-elements' ),
144 'type' => \Elementor\Controls_Manager::TEXT,
145 'placeholder' => __( 'Enter Name', 'spider-elements' ),
146 'default' => __( 'John Deo', 'spider-elements' ),
147 'label_block' => true,
148 ]
149 );
150 $repeater->add_control(
151 'team_link',
152 [
153 'label' => esc_html__( 'Link', 'spider-elements' ),
154 'type' => \Elementor\Controls_Manager::URL,
155 'placeholder' => esc_html__( 'https://your-link.com', 'spider-elements' ),
156 'options' => [ 'url', 'is_external', 'nofollow' ],
157 'default' => [
158 'url' => '',
159 'is_external' => true,
160 'nofollow' => true,
161 // 'custom_attributes' => '',
162 ],
163 'label_block' => true,
164 ]
165 );
166
167 $repeater->add_control(
168 'team_job_position', [
169 'label' => __( 'Content Text', 'spider-elements' ),
170 'type' => \Elementor\Controls_Manager::TEXTAREA,
171 'placeholder' => __( 'Enter text', 'spider-elements' ),
172 'default' => __( 'Envato Customer', 'spider-elements' ),
173 'label_block' => true,
174 ]
175 );
176 $this->add_control(
177 'team_slider_item',
178 [
179 'label' => __( 'Team Item', 'spider-elements' ),
180 'type' => \Elementor\Controls_Manager::REPEATER,
181 'fields' => $repeater->get_controls(),
182 'prevent_empty' => false,
183 'default' => [
184 [
185 'team_name' => __( 'Elizabeth Foster', 'spider-elements' ),
186 'team_job_position' => __( 'UI/UX Designer', 'spider-elements' ),
187 ],
188 [
189 'team_name' => __( 'Julie Ake', 'spider-elements' ),
190 'team_job_position' => __( 'Product Designer', 'spider-elements' ),
191 ],
192 [
193 'team_name' => __( 'Elizabeth Foster', 'spider-elements' ),
194 'team_job_position' => __( 'UI/UX Designer', 'spider-elements' ),
195 ],
196 [
197 'team_name' => __( 'Juan Marko', 'spider-elements' ),
198 'team_job_position' => __( 'Java Developer', 'spider-elements' ),
199 ],
200
201 ],
202 ]
203 );
204 $this->end_controls_section();
205 }
206
207
208 /**
209 * Name: elementor_style_control()
210 * Desc: Register the Style Tab output on the Elementor editor.
211 * Params: no params
212 * Return: @void
213 * Since: @1.0.0
214 * Package: @spider-elements
215 * Author: spider-themes
216 */
217 public function team_style_control() {
218
219 $this->start_controls_section(
220 'team_img_style', [
221 'label' => __( 'Team Image', 'spider-elements' ),
222 'tab' => Controls_Manager::TAB_STYLE,
223 ]
224 );
225 $this->add_responsive_control(
226 'team_img_border_radius',
227 [
228 'label' => __( 'Border Radius', 'spider-elements' ),
229 'type' => Controls_Manager::DIMENSIONS,
230 'size_units' => [ 'px', '%', 'em' ],
231 'selectors' => [
232 '{{WRAPPER}} .card-style-three .img-meta img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
233 ],
234 ]
235 );
236 $this->end_controls_section();
237 //========================= Contents =========================//
238 $this->start_controls_section(
239 'team_style_content', [
240 'label' => __( 'Team Contents', 'spider-elements' ),
241 'tab' => Controls_Manager::TAB_STYLE,
242 ]
243 );
244
245
246 $this->start_controls_tabs(
247 'style_team_title_tabs'
248 );
249
250 //=== Normal icon
251 $this->start_controls_tab(
252 'style_normal',
253 [
254 'label' => __( 'Normal', 'spider-elements' ),
255 ]
256 );
257
258 $this->add_group_control(
259 Group_Control_Typography::get_type(), [
260 'name' => 'team_name_typo',
261 'selector' => '{{WRAPPER}} .card-style-three .name,{{WRAPPER}} .card-style-eight .name',
262 ]
263 ); //End Author Name
264 $this->add_control(
265 'team_name_color', [
266 'label' => __( 'Name Color', 'spider-elements' ),
267 'type' => Controls_Manager::COLOR,
268 'selectors' => [
269 '{{WRAPPER}} .card-style-three .name,{{WRAPPER}} .card-style-eight .name' => 'color: {{VALUE}};',
270 ],
271 'separator' => 'after'
272 ]
273 );
274
275 $this->end_controls_tab(); //End Normal icon
276
277 //=== Active icon
278 $this->start_controls_tab(
279 'team_title_hover', [
280 'label' => __( 'Hover', 'spider-elements' ),
281 ]
282 );
283
284 $this->add_control(
285 'team_name_hover_color', [
286 'label' => __( 'Name Hover Color', 'spider-elements' ),
287 'type' => Controls_Manager::COLOR,
288 'selectors' => [
289 '{{WRAPPER}} .card-style-three .name:hover,{{WRAPPER}} .card-style-eight .name:hover' => 'color: {{VALUE}};',
290 ],
291 'separator' => 'after'
292 ]
293 );
294
295 $this->end_controls_tab(); // End Active Tab Title
296 $this->end_controls_tabs(); // End Accordion icon Normal/Active/ State
297
298 $this->add_group_control(
299 Group_Control_Typography::get_type(), [
300 'name' => 'team_position_typo',
301 'selector' => '{{WRAPPER}} .card-style-three .post,{{WRAPPER}} .card-style-eight .post',
302 ]
303 ); //End Author Name
304 $this->add_control(
305 'team_position_color', [
306 'label' => __( 'Position Color', 'spider-elements' ),
307 'type' => Controls_Manager::COLOR,
308 'selectors' => [
309 '{{WRAPPER}} .card-style-three .post,{{WRAPPER}} .card-style-eight .post' => 'color: {{VALUE}};',
310 ],
311 ]
312 );
313
314
315 $this->end_controls_section();
316 }
317
318 /**
319 * Name: elementor_render()
320 * Desc: Render the widget output on the frontend.
321 * Params: no params
322 * Return: @void
323 * Since: @1.0.0
324 * Package: @spider-elements
325 * Author: spider-themes
326 */
327 protected function render() {
328 $settings = $this->get_settings_for_display();
329 extract( $settings ); //extract all settings array to variables converted to name of key
330 $team_id = $this->get_id();
331 //================= Template Parts =================//
332 include "templates/team/team-{$settings['style']}.php";
333 }
334
335
336 }