Adv_Accordion.php
4 years ago
Adv_Tabs.php
4 years ago
Advanced_Data_Table.php
4 years ago
Better_Payment.php
4 years ago
Betterdocs_Category_Box.php
4 years ago
Betterdocs_Category_Grid.php
4 years ago
Betterdocs_Search_Form.php
4 years ago
Caldera_Forms.php
4 years ago
Career_Page.php
4 years ago
Contact_Form_7.php
4 years ago
Content_Ticker.php
4 years ago
Countdown.php
4 years ago
Creative_Button.php
4 years ago
Crowdfundly_All_Campaign.php
4 years ago
Crowdfundly_Organization.php
4 years ago
Crowdfundly_Single_Campaign.php
4 years ago
Cta_Box.php
4 years ago
Data_Table.php
4 years ago
Dual_Color_Header.php
4 years ago
EmbedPress.php
4 years ago
Event_Calendar.php
4 years ago
Facebook_Feed.php
4 years ago
Fancy_Text.php
4 years ago
Feature_List.php
4 years ago
Filterable_Gallery.php
4 years ago
Flip_Box.php
4 years ago
FluentForm.php
4 years ago
Formstack.php
4 years ago
GravityForms.php
4 years ago
Image_Accordion.php
4 years ago
Info_Box.php
4 years ago
Interactive_Circle.php
4 years ago
Login_Register.php
4 years ago
NinjaForms.php
4 years ago
Post_Grid.php
4 years ago
Post_Timeline.php
4 years ago
Pricing_Table.php
4 years ago
Product_Grid.php
4 years ago
Progress_Bar.php
4 years ago
Simple_Menu.php
4 years ago
Sticky_Video.php
4 years ago
Team_Member.php
4 years ago
Testimonial.php
4 years ago
Tooltip.php
4 years ago
Twitter_Feed.php
4 years ago
TypeForm.php
4 years ago
WeForms.php
4 years ago
Woo_Cart.php
4 years ago
Woo_Checkout.php
4 years ago
Woo_Product_Carousel.php
4 years ago
Woo_Product_Compare.php
4 years ago
Woo_Product_Gallery.php
4 years ago
Woocommerce_Review.php
4 years ago
WpForms.php
4 years ago
Twitter_Feed.php
1029 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Essential_Addons_Elementor\Elements; |
| 4 | |
| 5 | // If this file is called directly, abort. |
| 6 | if (!defined('ABSPATH')) { |
| 7 | exit; |
| 8 | } |
| 9 | |
| 10 | use \Elementor\Controls_Manager; |
| 11 | use \Elementor\Group_Control_Border; |
| 12 | use \Elementor\Group_Control_Box_Shadow; |
| 13 | use \Elementor\Group_Control_Typography; |
| 14 | use \Elementor\Widget_Base; |
| 15 | |
| 16 | class Twitter_Feed extends Widget_Base |
| 17 | { |
| 18 | use \Essential_Addons_Elementor\Traits\Twitter_Feed; |
| 19 | |
| 20 | public function get_name() |
| 21 | { |
| 22 | return 'eael-twitter-feed'; |
| 23 | } |
| 24 | |
| 25 | public function get_title() |
| 26 | { |
| 27 | return esc_html__('Twitter Feed', 'essential-addons-for-elementor-lite'); |
| 28 | } |
| 29 | |
| 30 | public function get_icon() |
| 31 | { |
| 32 | return 'eaicon-twitter-feed'; |
| 33 | } |
| 34 | |
| 35 | public function get_categories() |
| 36 | { |
| 37 | return ['essential-addons-elementor']; |
| 38 | } |
| 39 | |
| 40 | public function get_keywords() |
| 41 | { |
| 42 | return [ |
| 43 | 'twitter', |
| 44 | 'ea twitter feed', |
| 45 | 'ea twitter gallery', |
| 46 | 'social media', |
| 47 | 'twitter embed', |
| 48 | 'twitter feed', |
| 49 | 'twitter marketing', |
| 50 | 'tweet feed', |
| 51 | 'tweet embed', |
| 52 | 'ea', |
| 53 | 'essential addons', |
| 54 | ]; |
| 55 | } |
| 56 | |
| 57 | public function get_custom_help_url() |
| 58 | { |
| 59 | return 'https://essential-addons.com/elementor/docs/twitter-feed/'; |
| 60 | } |
| 61 | |
| 62 | public function get_style_depends() |
| 63 | { |
| 64 | return [ |
| 65 | 'font-awesome-5-all', |
| 66 | 'font-awesome-4-shim', |
| 67 | ]; |
| 68 | } |
| 69 | |
| 70 | public function get_script_depends() |
| 71 | { |
| 72 | return [ |
| 73 | 'font-awesome-4-shim', |
| 74 | ]; |
| 75 | } |
| 76 | |
| 77 | protected function register_controls() |
| 78 | { |
| 79 | $this->start_controls_section( |
| 80 | 'eael_section_twitter_feed_acc_settings', |
| 81 | [ |
| 82 | 'label' => esc_html__('Account Settings', 'essential-addons-for-elementor-lite'), |
| 83 | ] |
| 84 | ); |
| 85 | |
| 86 | $this->add_control( |
| 87 | 'eael_twitter_feed_ac_name', |
| 88 | [ |
| 89 | 'label' => esc_html__('Account Name', 'essential-addons-for-elementor-lite'), |
| 90 | 'type' => Controls_Manager::TEXT, |
| 91 | 'dynamic' => [ 'active' => true ], |
| 92 | 'default' => '@wpdevteam', |
| 93 | 'label_block' => false, |
| 94 | 'description' => esc_html__('Use @ sign with your account name.', 'essential-addons-for-elementor-lite'), |
| 95 | ] |
| 96 | ); |
| 97 | |
| 98 | $this->add_control( |
| 99 | 'eael_twitter_feed_hashtag_name', |
| 100 | [ |
| 101 | 'label' => esc_html__('Hashtag Name', 'essential-addons-for-elementor-lite'), |
| 102 | 'type' => Controls_Manager::TEXT, |
| 103 | 'dynamic' => [ 'active' => true ], |
| 104 | 'label_block' => false, |
| 105 | 'description' => esc_html__('Remove # sign from your hashtag name.', 'essential-addons-for-elementor-lite'), |
| 106 | ] |
| 107 | ); |
| 108 | |
| 109 | $this->add_control( |
| 110 | 'eael_twitter_feed_consumer_key', |
| 111 | [ |
| 112 | 'label' => esc_html__('Consumer Key', 'essential-addons-for-elementor-lite'), |
| 113 | 'type' => Controls_Manager::TEXT, |
| 114 | 'label_block' => false, |
| 115 | 'default' => 'wwC72W809xRKd9ySwUzXzjkmS', |
| 116 | 'description' => '<a href="https://apps.twitter.com/app/" target="_blank">Get Consumer Key.</a> Create a new app or select existing app and grab the <b>consumer key.</b>', |
| 117 | ] |
| 118 | ); |
| 119 | |
| 120 | $this->add_control( |
| 121 | 'eael_twitter_feed_consumer_secret', |
| 122 | [ |
| 123 | 'label' => esc_html__('Consumer Secret', 'essential-addons-for-elementor-lite'), |
| 124 | 'type' => Controls_Manager::TEXT, |
| 125 | 'label_block' => false, |
| 126 | 'default' => 'rn54hBqxjve2CWOtZqwJigT3F5OEvrriK2XAcqoQVohzr2UA8h', |
| 127 | 'description' => '<a href="https://apps.twitter.com/app/" target="_blank">Get Consumer Secret.</a> Create a new app or select existing app and grab the <b>consumer secret.</b>', |
| 128 | ] |
| 129 | ); |
| 130 | |
| 131 | $this->add_control( |
| 132 | 'eael_auto_clear_cache', |
| 133 | [ |
| 134 | 'label' => esc_html__( 'Auto Cache Clear', 'essential-addons-for-elementor-lite' ), |
| 135 | 'type' => Controls_Manager::SWITCHER, |
| 136 | 'label_on' => __( 'Yes', 'essential-addons-for-elementor-lite' ), |
| 137 | 'label_off' => __( 'No', 'essential-addons-for-elementor-lite' ), |
| 138 | 'default' => 'yes', |
| 139 | 'return_value' => 'yes', |
| 140 | ] |
| 141 | ); |
| 142 | |
| 143 | $this->add_control( |
| 144 | 'eael_twitter_feed_cache_limit', |
| 145 | [ |
| 146 | 'label' => __( 'Data Cache Time', 'essential-addons-for-elementor-lite' ), |
| 147 | 'type' => Controls_Manager::NUMBER, |
| 148 | 'min' => 1, |
| 149 | 'default' => 60, |
| 150 | 'description' => __( 'Cache expiration time (Minutes)', 'essential-addons-for-elementor-lite' ), |
| 151 | 'condition' => [ |
| 152 | 'eael_auto_clear_cache' => 'yes' |
| 153 | ] |
| 154 | ] |
| 155 | ); |
| 156 | |
| 157 | $this->add_control( |
| 158 | 'eael_clear_cache_control', |
| 159 | [ |
| 160 | 'label' => __( 'Clear Cache', 'essential-addons-for-elementor-lite' ), |
| 161 | 'type' => Controls_Manager::BUTTON, |
| 162 | 'text' => __( 'Clear', 'essential-addons-for-elementor-lite' ), |
| 163 | 'event' => 'ea:cache:clear', |
| 164 | 'description' => esc_html__( 'Note: This will refresh your feed and fetch the latest data from your Twitter account', 'essential-addons-for-elementor-lite' ), |
| 165 | 'condition' => [ |
| 166 | 'eael_auto_clear_cache' => '' |
| 167 | ] |
| 168 | ] |
| 169 | ); |
| 170 | |
| 171 | $this->end_controls_section(); |
| 172 | |
| 173 | $this->start_controls_section( |
| 174 | 'eael_section_twitter_feed_settings', |
| 175 | [ |
| 176 | 'label' => esc_html__('Layout Settings', 'essential-addons-for-elementor-lite'), |
| 177 | ] |
| 178 | ); |
| 179 | |
| 180 | $this->add_control( |
| 181 | 'eael_twitter_feed_type', |
| 182 | [ |
| 183 | 'label' => esc_html__('Content Layout', 'essential-addons-for-elementor-lite'), |
| 184 | 'type' => Controls_Manager::SELECT, |
| 185 | 'default' => 'masonry', |
| 186 | 'options' => [ |
| 187 | 'list' => esc_html__('List', 'essential-addons-for-elementor-lite'), |
| 188 | 'masonry' => esc_html__('Masonry', 'essential-addons-for-elementor-lite'), |
| 189 | ], |
| 190 | ] |
| 191 | ); |
| 192 | |
| 193 | $this->add_control( |
| 194 | 'eael_twitter_feed_type_col_type', |
| 195 | [ |
| 196 | 'label' => __('Column Grid', 'essential-addons-for-elementor-lite'), |
| 197 | 'type' => Controls_Manager::SELECT, |
| 198 | 'options' => [ |
| 199 | 'col-2' => '2 Columns', |
| 200 | 'col-3' => '3 Columns', |
| 201 | 'col-4' => '4 Columns', |
| 202 | ], |
| 203 | 'default' => 'col-3', |
| 204 | 'condition' => [ |
| 205 | 'eael_twitter_feed_type' => 'masonry', |
| 206 | ], |
| 207 | ] |
| 208 | ); |
| 209 | |
| 210 | $this->add_control( |
| 211 | 'eael_twitter_feed_content_length', |
| 212 | [ |
| 213 | 'label' => esc_html__('Content Length', 'essential-addons-for-elementor-lite'), |
| 214 | 'type' => Controls_Manager::NUMBER, |
| 215 | 'label_block' => false, |
| 216 | 'min' => 1, |
| 217 | 'max' => 400, |
| 218 | 'default' => 400, |
| 219 | ] |
| 220 | ); |
| 221 | |
| 222 | $this->add_responsive_control( |
| 223 | 'eael_twitter_feed_column_spacing', |
| 224 | [ |
| 225 | 'label' => esc_html__('Column spacing', 'essential-addons-for-elementor-lite'), |
| 226 | 'type' => Controls_Manager::SLIDER, |
| 227 | 'range' => [ |
| 228 | 'px' => [ |
| 229 | 'max' => 50, |
| 230 | ], |
| 231 | ], |
| 232 | 'default' => [ |
| 233 | 'unit' => 'px', |
| 234 | 'size' => 10, |
| 235 | ], |
| 236 | ] |
| 237 | ); |
| 238 | |
| 239 | $this->add_control( |
| 240 | 'eael_twitter_feed_post_limit', |
| 241 | [ |
| 242 | 'label' => esc_html__('Post Limit', 'essential-addons-for-elementor-lite'), |
| 243 | 'type' => Controls_Manager::NUMBER, |
| 244 | 'label_block' => false, |
| 245 | 'default' => 10, |
| 246 | ] |
| 247 | ); |
| 248 | |
| 249 | $this->add_control( |
| 250 | 'eael_twitter_feed_media', |
| 251 | [ |
| 252 | 'label' => esc_html__('Show Media Elements', 'essential-addons-for-elementor-lite'), |
| 253 | 'type' => Controls_Manager::SWITCHER, |
| 254 | 'label_on' => __('yes', 'essential-addons-for-elementor-lite'), |
| 255 | 'label_off' => __('no', 'essential-addons-for-elementor-lite'), |
| 256 | 'default' => 'true', |
| 257 | 'return_value' => 'true', |
| 258 | ] |
| 259 | ); |
| 260 | |
| 261 | $this->end_controls_section(); |
| 262 | |
| 263 | $this->start_controls_section( |
| 264 | 'eael_section_twitter_feed_card_settings', |
| 265 | [ |
| 266 | 'label' => esc_html__('Card Settings', 'essential-addons-for-elementor-lite'), |
| 267 | ] |
| 268 | ); |
| 269 | |
| 270 | $this->add_control( |
| 271 | 'eael_twitter_feed_show_avatar', |
| 272 | [ |
| 273 | 'label' => esc_html__('Show Avatar', 'essential-addons-for-elementor-lite'), |
| 274 | 'type' => Controls_Manager::SWITCHER, |
| 275 | 'label_on' => __('yes', 'essential-addons-for-elementor-lite'), |
| 276 | 'label_off' => __('no', 'essential-addons-for-elementor-lite'), |
| 277 | 'default' => 'true', |
| 278 | 'return_value' => 'true', |
| 279 | ] |
| 280 | ); |
| 281 | |
| 282 | $this->add_control( |
| 283 | 'eael_twitter_feed_show_date', |
| 284 | [ |
| 285 | 'label' => esc_html__('Show Date', 'essential-addons-for-elementor-lite'), |
| 286 | 'type' => Controls_Manager::SWITCHER, |
| 287 | 'label_on' => __('yes', 'essential-addons-for-elementor-lite'), |
| 288 | 'label_off' => __('no', 'essential-addons-for-elementor-lite'), |
| 289 | 'default' => 'true', |
| 290 | 'return_value' => 'true', |
| 291 | ] |
| 292 | ); |
| 293 | |
| 294 | $this->add_control( |
| 295 | 'eael_twitter_feed_show_read_more', |
| 296 | [ |
| 297 | 'label' => esc_html__('Show Read More', 'essential-addons-for-elementor-lite'), |
| 298 | 'type' => Controls_Manager::SWITCHER, |
| 299 | 'label_on' => __('yes', 'essential-addons-for-elementor-lite'), |
| 300 | 'label_off' => __('no', 'essential-addons-for-elementor-lite'), |
| 301 | 'default' => 'true', |
| 302 | 'return_value' => 'true', |
| 303 | ] |
| 304 | ); |
| 305 | |
| 306 | $this->add_control( |
| 307 | 'eael_twitter_feed_show_read_more_text', |
| 308 | [ |
| 309 | 'label' => esc_html__('Read More Text', 'essential-addons-for-elementor-lite'), |
| 310 | 'type' => Controls_Manager::TEXT, |
| 311 | 'label_block' => false, |
| 312 | 'default' => __('Read More', 'essential-addons-for-elementor-lite'), |
| 313 | 'condition' => [ |
| 314 | 'eael_twitter_feed_show_read_more' => 'true', |
| 315 | ] |
| 316 | ] |
| 317 | ); |
| 318 | |
| 319 | $this->add_control( |
| 320 | 'eael_twitter_feed_show_icon', |
| 321 | [ |
| 322 | 'label' => esc_html__('Show Icon', 'essential-addons-for-elementor-lite'), |
| 323 | 'type' => Controls_Manager::SWITCHER, |
| 324 | 'label_on' => __('yes', 'essential-addons-for-elementor-lite'), |
| 325 | 'label_off' => __('no', 'essential-addons-for-elementor-lite'), |
| 326 | 'default' => 'true', |
| 327 | 'return_value' => 'true', |
| 328 | ] |
| 329 | ); |
| 330 | |
| 331 | $this->end_controls_section(); |
| 332 | |
| 333 | if (!apply_filters('eael/pro_enabled', false)) { |
| 334 | $this->start_controls_section( |
| 335 | 'eael_section_pro', |
| 336 | [ |
| 337 | 'label' => __('Go Premium for More Features', 'essential-addons-for-elementor-lite'), |
| 338 | ] |
| 339 | ); |
| 340 | |
| 341 | $this->add_control( |
| 342 | 'eael_control_get_pro', |
| 343 | [ |
| 344 | 'label' => __('Unlock more possibilities', 'essential-addons-for-elementor-lite'), |
| 345 | 'type' => Controls_Manager::CHOOSE, |
| 346 | 'options' => [ |
| 347 | '1' => [ |
| 348 | 'title' => '', |
| 349 | 'icon' => 'fa fa-unlock-alt', |
| 350 | ], |
| 351 | ], |
| 352 | 'default' => '1', |
| 353 | 'description' => '<span class="pro-feature"> Get the <a href="https://wpdeveloper.com/upgrade/ea-pro" target="_blank">Pro version</a> for more stunning elements and customization options.</span>', |
| 354 | ] |
| 355 | ); |
| 356 | |
| 357 | $this->end_controls_section(); |
| 358 | } |
| 359 | |
| 360 | /** |
| 361 | * ------------------------------------------- |
| 362 | * Tab Style (Twitter Feed Card Style) |
| 363 | * ------------------------------------------- |
| 364 | */ |
| 365 | $this->start_controls_section( |
| 366 | 'eael_section_twitter_feed_card_style_settings', |
| 367 | [ |
| 368 | 'label' => esc_html__('Card Style', 'essential-addons-for-elementor-lite'), |
| 369 | 'tab' => Controls_Manager::TAB_STYLE, |
| 370 | ] |
| 371 | ); |
| 372 | |
| 373 | $this->add_control( |
| 374 | 'eael_twitter_feed_card_choose_style', |
| 375 | [ |
| 376 | 'label' => __('Choose Style', 'essential-addons-for-elementor-lite'), |
| 377 | 'type' => \Elementor\Controls_Manager::SELECT, |
| 378 | 'default' => '', |
| 379 | 'options' => [ |
| 380 | '' => __('Default Style', 'essential-addons-for-elementor-lite'), |
| 381 | 'two' => __('Style Two (right icon)', 'essential-addons-for-elementor-lite'), |
| 382 | 'three' => __('Style Three', 'essential-addons-for-elementor-lite'), |
| 383 | ], |
| 384 | ] |
| 385 | ); |
| 386 | |
| 387 | $this->add_control( |
| 388 | 'eael_twitter_feed_card_left_icon_alignment', |
| 389 | [ |
| 390 | 'label' => __('Left Icon Alignment', 'essential-addons-for-elementor-lite'), |
| 391 | 'type' => \Elementor\Controls_Manager::CHOOSE, |
| 392 | 'options' => [ |
| 393 | 'flex-start' => [ |
| 394 | 'title' => __('Top', 'essential-addons-for-elementor-lite'), |
| 395 | 'icon' => 'eicon-text-align-left', |
| 396 | ], |
| 397 | 'center' => [ |
| 398 | 'title' => __('Middle', 'essential-addons-for-elementor-lite'), |
| 399 | 'icon' => 'eicon-text-align-center', |
| 400 | ], |
| 401 | 'flex-end' => [ |
| 402 | 'title' => __('Bottom', 'essential-addons-for-elementor-lite'), |
| 403 | 'icon' => 'eicon-text-align-right', |
| 404 | ], |
| 405 | ], |
| 406 | 'default' => 'center', |
| 407 | 'selectors' => [ |
| 408 | '{{WRAPPER}} .eael-twitter-feed-entry-iconwrap' => 'align-self: {{VALUE}};', |
| 409 | ], |
| 410 | 'condition' => [ |
| 411 | 'eael_twitter_feed_card_choose_style' => 'three', |
| 412 | ], |
| 413 | ] |
| 414 | ); |
| 415 | |
| 416 | $this->add_control( |
| 417 | 'eael_twitter_feed_card_is_gradient_bg', |
| 418 | [ |
| 419 | 'label' => __('Use gradient Background!', 'essential-addons-for-elementor-lite'), |
| 420 | 'type' => \Elementor\Controls_Manager::SWITCHER, |
| 421 | 'label_on' => __('Show', 'essential-addons-for-elementor-lite'), |
| 422 | 'label_off' => __('Hide', 'essential-addons-for-elementor-lite'), |
| 423 | 'return_value' => 'yes', |
| 424 | ] |
| 425 | ); |
| 426 | |
| 427 | $this->add_group_control( |
| 428 | \Elementor\Group_Control_Background::get_type(), |
| 429 | [ |
| 430 | 'name' => 'eael_twitter_feed_card_gradient_bg', |
| 431 | 'label' => __('Background', 'essential-addons-for-elementor-lite'), |
| 432 | 'types' => ['classic', 'gradient'], |
| 433 | 'selector' => '{{WRAPPER}} .eael-twitter-feed-item-inner', |
| 434 | 'condition' => [ |
| 435 | 'eael_twitter_feed_card_is_gradient_bg' => 'yes', |
| 436 | ], |
| 437 | ] |
| 438 | ); |
| 439 | |
| 440 | $this->add_control( |
| 441 | 'eael_twitter_feed_card_bg_color', |
| 442 | [ |
| 443 | 'label' => esc_html__('Background Color', 'essential-addons-for-elementor-lite'), |
| 444 | 'type' => Controls_Manager::COLOR, |
| 445 | 'default' => '', |
| 446 | 'selectors' => [ |
| 447 | '{{WRAPPER}} .eael-twitter-feed-item-inner' => 'background-color: {{VALUE}};', |
| 448 | ], |
| 449 | 'condition' => [ |
| 450 | 'eael_twitter_feed_card_is_gradient_bg' => '', |
| 451 | ], |
| 452 | ] |
| 453 | ); |
| 454 | |
| 455 | $this->add_responsive_control( |
| 456 | 'eael_twitter_feed_card_inner_padding', |
| 457 | [ |
| 458 | 'label' => esc_html__('Main Card Padding', 'essential-addons-for-elementor-lite'), |
| 459 | 'type' => Controls_Manager::DIMENSIONS, |
| 460 | 'size_units' => ['px', 'em', '%'], |
| 461 | 'selectors' => [ |
| 462 | '{{WRAPPER}} .eael-twitter-feed-item-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 463 | ], |
| 464 | 'condition' => [ |
| 465 | 'eael_twitter_feed_card_choose_style' => 'three', |
| 466 | ], |
| 467 | ] |
| 468 | ); |
| 469 | |
| 470 | $this->add_responsive_control( |
| 471 | 'eael_twitter_feed_card_container_padding', |
| 472 | [ |
| 473 | 'label' => esc_html__('Padding', 'essential-addons-for-elementor-lite'), |
| 474 | 'type' => Controls_Manager::DIMENSIONS, |
| 475 | 'size_units' => ['px', 'em', '%'], |
| 476 | 'selectors' => [ |
| 477 | '{{WRAPPER}} .eael-twitter-feed-item-header' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} 0 {{LEFT}}{{UNIT}};', |
| 478 | '{{WRAPPER}} .eael-twitter-feed-item-content' => 'padding: 0 {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 479 | ], |
| 480 | 'condition' => [ |
| 481 | 'eael_twitter_feed_card_choose_style!' => 'three', |
| 482 | ], |
| 483 | ] |
| 484 | ); |
| 485 | |
| 486 | $this->add_group_control( |
| 487 | Group_Control_Border::get_type(), |
| 488 | [ |
| 489 | 'name' => 'eael_twitter_feed_card_border', |
| 490 | 'label' => esc_html__('Border', 'essential-addons-for-elementor-lite'), |
| 491 | 'selector' => '{{WRAPPER}} .eael-twitter-feed-item-inner', |
| 492 | ] |
| 493 | ); |
| 494 | |
| 495 | $this->add_control( |
| 496 | 'eael_twitter_feed_card_border_radius', |
| 497 | [ |
| 498 | 'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'), |
| 499 | 'type' => Controls_Manager::SLIDER, |
| 500 | 'range' => [ |
| 501 | 'px' => [ |
| 502 | 'max' => 500, |
| 503 | ], |
| 504 | ], |
| 505 | 'selectors' => [ |
| 506 | '{{WRAPPER}} .eael-twitter-feed-item-inner' => 'border-radius: {{SIZE}}px;', |
| 507 | ], |
| 508 | ] |
| 509 | ); |
| 510 | |
| 511 | $this->add_group_control( |
| 512 | Group_Control_Box_Shadow::get_type(), |
| 513 | [ |
| 514 | 'name' => 'eael_twitter_feed_card_shadow', |
| 515 | 'selector' => '{{WRAPPER}} .eael-twitter-feed-item-inner', |
| 516 | ] |
| 517 | ); |
| 518 | $this->add_control( |
| 519 | 'eael_twitter_feed_card_left_icon_heading', |
| 520 | [ |
| 521 | 'label' => __('Left Icon Area', 'essential-addons-for-elementor-lite'), |
| 522 | 'type' => \Elementor\Controls_Manager::HEADING, |
| 523 | 'separator' => 'after', |
| 524 | 'condition' => [ |
| 525 | 'eael_twitter_feed_card_choose_style' => 'three', |
| 526 | ], |
| 527 | ] |
| 528 | ); |
| 529 | $this->add_responsive_control( |
| 530 | 'eael_twitter_feed_card_item_left_padding', |
| 531 | [ |
| 532 | 'label' => esc_html__('Padding', 'essential-addons-for-elementor-lite'), |
| 533 | 'type' => Controls_Manager::DIMENSIONS, |
| 534 | 'size_units' => ['px', 'em', '%'], |
| 535 | 'selectors' => [ |
| 536 | '{{WRAPPER}} .eael-twitter-feed-item-style-three .eael-twitter-feed-item-inner .eael-twitter-feed-entry-iconwrap' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 537 | ], |
| 538 | 'default' => [ |
| 539 | 'top' => '10', |
| 540 | 'right' => '10', |
| 541 | 'bottom' => '10', |
| 542 | 'left' => '10', |
| 543 | 'unit' => 'px', |
| 544 | 'isLinked' => true, |
| 545 | ], |
| 546 | 'condition' => [ |
| 547 | 'eael_twitter_feed_card_choose_style' => 'three', |
| 548 | ], |
| 549 | ] |
| 550 | ); |
| 551 | $this->add_control( |
| 552 | 'eael_twitter_feed_card_right_content_heading', |
| 553 | [ |
| 554 | 'label' => __('Right Content Area', 'essential-addons-for-elementor-lite'), |
| 555 | 'type' => \Elementor\Controls_Manager::HEADING, |
| 556 | 'separator' => 'after', |
| 557 | 'condition' => [ |
| 558 | 'eael_twitter_feed_card_choose_style' => 'three', |
| 559 | ], |
| 560 | ] |
| 561 | ); |
| 562 | $this->add_responsive_control( |
| 563 | 'eael_twitter_feed_card_item_right_padding', |
| 564 | [ |
| 565 | 'label' => esc_html__('Padding', 'essential-addons-for-elementor-lite'), |
| 566 | 'type' => Controls_Manager::DIMENSIONS, |
| 567 | 'size_units' => ['px', 'em', '%'], |
| 568 | 'selectors' => [ |
| 569 | '{{WRAPPER}} .eael-twitter-feed-item-style-three .eael-twitter-feed-item-inner .eael-twitter-feed-entry-contentwrap' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 570 | ], |
| 571 | 'condition' => [ |
| 572 | 'eael_twitter_feed_card_choose_style' => 'three', |
| 573 | ], |
| 574 | ] |
| 575 | ); |
| 576 | $this->add_group_control( |
| 577 | \Elementor\Group_Control_Border::get_type(), |
| 578 | [ |
| 579 | 'name' => 'eael_twitter_feed_card_item_right_border', |
| 580 | 'label' => __('Border', 'essential-addons-for-elementor-lite'), |
| 581 | 'selector' => '{{WRAPPER}} .eael-twitter-feed-item-style-three .eael-twitter-feed-item-inner .eael-twitter-feed-entry-contentwrap', |
| 582 | 'condition' => [ |
| 583 | 'eael_twitter_feed_card_choose_style' => 'three', |
| 584 | ] |
| 585 | ] |
| 586 | ); |
| 587 | |
| 588 | $this->add_control( |
| 589 | 'eael_twitter_feed_card_item_right_border_radius', |
| 590 | [ |
| 591 | 'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'), |
| 592 | 'type' => Controls_Manager::DIMENSIONS, |
| 593 | 'size_units' => ['px', 'em', '%'], |
| 594 | 'selectors' => [ |
| 595 | '{{WRAPPER}} .eael-twitter-feed-item-style-three .eael-twitter-feed-item-inner .eael-twitter-feed-entry-contentwrap' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 596 | ], |
| 597 | 'condition' => [ |
| 598 | 'eael_twitter_feed_card_choose_style' => 'three', |
| 599 | ], |
| 600 | ] |
| 601 | ); |
| 602 | |
| 603 | $this->end_controls_section(); |
| 604 | |
| 605 | /** |
| 606 | * ------------------------------------------- |
| 607 | * Tab Style (Card Hover Style) |
| 608 | * ------------------------------------------- |
| 609 | */ |
| 610 | $this->start_controls_section( |
| 611 | 'eael_section_twitter_feed_card_hover_settings', |
| 612 | [ |
| 613 | 'label' => esc_html__('Card Hover Style', 'essential-addons-for-elementor-lite'), |
| 614 | 'tab' => Controls_Manager::TAB_STYLE, |
| 615 | ] |
| 616 | ); |
| 617 | $this->add_control( |
| 618 | 'eael_twitter_feed_card_hover_title_color', |
| 619 | [ |
| 620 | 'label' => __('Title Color', 'essential-addons-for-elementor-lite'), |
| 621 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 622 | 'selectors' => [ |
| 623 | '{{WRAPPER}} .eael-twitter-feed-item-inner:hover .eael-twitter-feed-item-author' => 'color: {{VALUE}}', |
| 624 | ], |
| 625 | ] |
| 626 | ); |
| 627 | $this->add_control( |
| 628 | 'eael_twitter_feed_card_hover_content_color', |
| 629 | [ |
| 630 | 'label' => __('Content Color', 'essential-addons-for-elementor-lite'), |
| 631 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 632 | 'selectors' => [ |
| 633 | '{{WRAPPER}} .eael-twitter-feed-item-inner:hover .eael-twitter-feed-item-content p' => 'color: {{VALUE}}', |
| 634 | ], |
| 635 | ] |
| 636 | ); |
| 637 | $this->add_control( |
| 638 | 'eael_twitter_feed_card_hover_link_color', |
| 639 | [ |
| 640 | 'label' => __('Link Color', 'essential-addons-for-elementor-lite'), |
| 641 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 642 | 'selectors' => [ |
| 643 | '{{WRAPPER}} .eael-twitter-feed-item-inner:hover .eael-twitter-feed-item-content a' => 'color: {{VALUE}}', |
| 644 | ], |
| 645 | ] |
| 646 | ); |
| 647 | $this->add_control( |
| 648 | 'eael_twitter_feed_card_hover_date_color', |
| 649 | [ |
| 650 | 'label' => __('Date Color', 'essential-addons-for-elementor-lite'), |
| 651 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 652 | 'selectors' => [ |
| 653 | '{{WRAPPER}} .eael-twitter-feed-item-inner:hover .eael-twitter-feed-item-header .eael-twitter-feed-item-date' => 'color: {{VALUE}}', |
| 654 | ], |
| 655 | ] |
| 656 | ); |
| 657 | $this->add_control( |
| 658 | 'eael_twitter_feed_card_hover_icon_color', |
| 659 | [ |
| 660 | 'label' => __('Icon Color', 'essential-addons-for-elementor-lite'), |
| 661 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 662 | 'selectors' => [ |
| 663 | '{{WRAPPER}} .eael-twitter-feed-item-inner:hover .eael-twitter-feed-item-icon' => 'color: {{VALUE}}', |
| 664 | ], |
| 665 | ] |
| 666 | ); |
| 667 | |
| 668 | $this->add_control( |
| 669 | 'eael_twitter_feed_card_border_hover_color', |
| 670 | [ |
| 671 | 'label' => __('Border Color', 'essential-addons-for-elementor-lite'), |
| 672 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 673 | 'selectors' => [ |
| 674 | '{{WRAPPER}} .eael-twitter-feed-item-inner:hover' => 'border-color: {{VALUE}}', |
| 675 | ], |
| 676 | ] |
| 677 | ); |
| 678 | |
| 679 | $this->add_group_control( |
| 680 | \Elementor\Group_Control_Background::get_type(), |
| 681 | [ |
| 682 | 'name' => 'eael_twitter_feed_card_hover_bg', |
| 683 | 'label' => __('Background', 'essential-addons-for-elementor-lite'), |
| 684 | 'types' => ['classic', 'gradient'], |
| 685 | 'selector' => '{{WRAPPER}} .eael-twitter-feed-item-inner:hover', |
| 686 | ] |
| 687 | ); |
| 688 | |
| 689 | $this->add_group_control( |
| 690 | \Elementor\Group_Control_Box_Shadow::get_type(), |
| 691 | [ |
| 692 | 'name' => 'eael_twitter_feed_card_hover_shadow', |
| 693 | 'label' => __('Box Shadow', 'essential-addons-for-elementor-lite'), |
| 694 | 'selector' => '{{WRAPPER}} .eael-twitter-feed-item-inner:hover', |
| 695 | ] |
| 696 | ); |
| 697 | |
| 698 | $this->end_controls_section(); |
| 699 | |
| 700 | /** |
| 701 | * ------------------------------------------- |
| 702 | * Tab Style (Twitter Feed Typography Style) |
| 703 | * ------------------------------------------- |
| 704 | */ |
| 705 | $this->start_controls_section( |
| 706 | 'eael_section_twitter_feed_card_typo_settings', |
| 707 | [ |
| 708 | 'label' => esc_html__('Color & Typography', 'essential-addons-for-elementor-lite'), |
| 709 | 'tab' => Controls_Manager::TAB_STYLE, |
| 710 | ] |
| 711 | ); |
| 712 | |
| 713 | $this->add_control( |
| 714 | 'eael_twitter_feed_title_heading', |
| 715 | [ |
| 716 | 'label' => esc_html__('Title Style', 'essential-addons-for-elementor-lite'), |
| 717 | 'type' => Controls_Manager::HEADING, |
| 718 | ] |
| 719 | ); |
| 720 | |
| 721 | $this->add_control( |
| 722 | 'eael_twitter_feed_title_color', |
| 723 | [ |
| 724 | 'label' => esc_html__('Color', 'essential-addons-for-elementor-lite'), |
| 725 | 'type' => Controls_Manager::COLOR, |
| 726 | 'default' => '', |
| 727 | 'selectors' => [ |
| 728 | '{{WRAPPER}} .eael-twitter-feed-item .eael-twitter-feed-item-author' => 'color: {{VALUE}};', |
| 729 | ], |
| 730 | ] |
| 731 | ); |
| 732 | |
| 733 | $this->add_group_control( |
| 734 | Group_Control_Typography::get_type(), |
| 735 | [ |
| 736 | 'name' => 'eael_twitter_feed_title_typography', |
| 737 | 'selector' => '{{WRAPPER}} .eael-twitter-feed-item .eael-twitter-feed-item-author', |
| 738 | ] |
| 739 | ); |
| 740 | // Content Style |
| 741 | $this->add_control( |
| 742 | 'eael_twitter_feed_content_heading', |
| 743 | [ |
| 744 | 'label' => esc_html__('Content Style', 'essential-addons-for-elementor-lite'), |
| 745 | 'type' => Controls_Manager::HEADING, |
| 746 | 'separator' => 'before', |
| 747 | ] |
| 748 | ); |
| 749 | |
| 750 | $this->add_control( |
| 751 | 'eael_twitter_feed_content_color', |
| 752 | [ |
| 753 | 'label' => esc_html__('Color', 'essential-addons-for-elementor-lite'), |
| 754 | 'type' => Controls_Manager::COLOR, |
| 755 | 'default' => '', |
| 756 | 'selectors' => [ |
| 757 | '{{WRAPPER}} .eael-twitter-feed-item .eael-twitter-feed-item-content p' => 'color: {{VALUE}};', |
| 758 | ], |
| 759 | ] |
| 760 | ); |
| 761 | |
| 762 | $this->add_group_control( |
| 763 | Group_Control_Typography::get_type(), |
| 764 | [ |
| 765 | 'name' => 'eael_twitter_feed_content_typography', |
| 766 | 'selector' => '{{WRAPPER}} .eael-twitter-feed-item .eael-twitter-feed-item-content p', |
| 767 | ] |
| 768 | ); |
| 769 | |
| 770 | // Content Link Style |
| 771 | $this->add_control( |
| 772 | 'eael_twitter_feed_content_link_heading', |
| 773 | [ |
| 774 | 'label' => esc_html__('Link Style', 'essential-addons-for-elementor-lite'), |
| 775 | 'type' => Controls_Manager::HEADING, |
| 776 | 'separator' => 'before', |
| 777 | ] |
| 778 | ); |
| 779 | |
| 780 | $this->add_control( |
| 781 | 'eael_twitter_feed_content_link_color', |
| 782 | [ |
| 783 | 'label' => esc_html__('Color', 'essential-addons-for-elementor-lite'), |
| 784 | 'type' => Controls_Manager::COLOR, |
| 785 | 'default' => '', |
| 786 | 'selectors' => [ |
| 787 | '{{WRAPPER}} .eael-twitter-feed-item .eael-twitter-feed-item-content a' => 'color: {{VALUE}};', |
| 788 | ], |
| 789 | ] |
| 790 | ); |
| 791 | |
| 792 | $this->add_control( |
| 793 | 'eael_twitter_feed_content_link_hover_color', |
| 794 | [ |
| 795 | 'label' => esc_html__('Hover Color', 'essential-addons-for-elementor-lite'), |
| 796 | 'type' => Controls_Manager::COLOR, |
| 797 | 'default' => '', |
| 798 | 'selectors' => [ |
| 799 | '{{WRAPPER}} .eael-twitter-feed-item .eael-twitter-feed-item-content a:hover' => 'color: {{VALUE}};', |
| 800 | ], |
| 801 | ] |
| 802 | ); |
| 803 | |
| 804 | $this->add_group_control( |
| 805 | Group_Control_Typography::get_type(), |
| 806 | [ |
| 807 | 'name' => 'eael_twitter_feed_content_link_typography', |
| 808 | 'selector' => '{{WRAPPER}} .eael-twitter-feed-item .eael-twitter-feed-item-content a', |
| 809 | ] |
| 810 | ); |
| 811 | |
| 812 | $this->end_controls_section(); |
| 813 | |
| 814 | /** |
| 815 | * ------------------------------------------- |
| 816 | * Tab Style (avatar style) |
| 817 | * ------------------------------------------- |
| 818 | */ |
| 819 | $this->start_controls_section( |
| 820 | 'eael_section_twitter_feed_avatar_style', |
| 821 | [ |
| 822 | 'label' => esc_html__('Avatar', 'essential-addons-for-elementor-lite'), |
| 823 | 'tab' => Controls_Manager::TAB_STYLE, |
| 824 | 'condition' => [ |
| 825 | 'eael_twitter_feed_show_avatar' => 'true', |
| 826 | ], |
| 827 | ] |
| 828 | ); |
| 829 | |
| 830 | $this->add_control( |
| 831 | 'eael_twitter_feed_avatar_width', |
| 832 | [ |
| 833 | 'label' => __('Width', 'essential-addons-for-elementor-lite'), |
| 834 | 'type' => Controls_Manager::SLIDER, |
| 835 | 'size_units' => ['px', '%'], |
| 836 | 'range' => [ |
| 837 | 'px' => [ |
| 838 | 'min' => 0, |
| 839 | 'max' => 1000, |
| 840 | 'step' => 5, |
| 841 | ], |
| 842 | '%' => [ |
| 843 | 'min' => 0, |
| 844 | 'max' => 100, |
| 845 | ], |
| 846 | ], |
| 847 | 'default' => [ |
| 848 | 'unit' => 'px', |
| 849 | 'size' => 38, |
| 850 | ], |
| 851 | 'selectors' => [ |
| 852 | '{{WRAPPER}} .eael-twitter-feed-item .eael-twitter-feed-item-avatar img' => 'width: {{SIZE}}{{UNIT}};', |
| 853 | ], |
| 854 | ] |
| 855 | ); |
| 856 | |
| 857 | $this->add_control( |
| 858 | 'eael_twitter_feed_avatar_height', |
| 859 | [ |
| 860 | 'label' => __('Height', 'essential-addons-for-elementor-lite'), |
| 861 | 'type' => Controls_Manager::SLIDER, |
| 862 | 'size_units' => ['px', '%'], |
| 863 | 'range' => [ |
| 864 | 'px' => [ |
| 865 | 'min' => 0, |
| 866 | 'max' => 1000, |
| 867 | 'step' => 5, |
| 868 | ], |
| 869 | '%' => [ |
| 870 | 'min' => 0, |
| 871 | 'max' => 100, |
| 872 | ], |
| 873 | ], |
| 874 | 'selectors' => [ |
| 875 | '{{WRAPPER}} .eael-twitter-feed-item .eael-twitter-feed-item-avatar img' => 'height: {{SIZE}}{{UNIT}};', |
| 876 | ], |
| 877 | ] |
| 878 | ); |
| 879 | |
| 880 | $this->add_control( |
| 881 | 'eael_twitter_feed_avatar_style', |
| 882 | [ |
| 883 | 'label' => __('Avatar Style', 'essential-addons-for-elementor-lite'), |
| 884 | 'type' => Controls_Manager::SELECT, |
| 885 | 'options' => [ |
| 886 | 'circle' => 'Circle', |
| 887 | 'square' => 'Square', |
| 888 | ], |
| 889 | 'default' => 'circle', |
| 890 | ] |
| 891 | ); |
| 892 | |
| 893 | $this->add_group_control( |
| 894 | \Elementor\Group_Control_Border::get_type(), |
| 895 | [ |
| 896 | 'name' => 'eael_twitter_feed_avatar_border', |
| 897 | 'label' => __('Border', 'essential-addons-for-elementor-lite'), |
| 898 | 'selector' => '{{WRAPPER}} .eael-twitter-feed-item .eael-twitter-feed-item-avatar img', |
| 899 | ] |
| 900 | ); |
| 901 | $this->add_group_control( |
| 902 | \Elementor\Group_Control_Box_Shadow::get_type(), |
| 903 | [ |
| 904 | 'name' => 'eael_twitter_feed_avatar_shadow', |
| 905 | 'label' => __('Box Shadow', 'essential-addons-for-elementor-lite'), |
| 906 | 'selector' => '{{WRAPPER}} .eael-twitter-feed-item .eael-twitter-feed-item-avatar img', |
| 907 | ] |
| 908 | ); |
| 909 | |
| 910 | $this->end_controls_section(); |
| 911 | /** |
| 912 | * ------------------------------------------- |
| 913 | * Tab Style (Icon style) |
| 914 | * ------------------------------------------- |
| 915 | */ |
| 916 | $this->start_controls_section( |
| 917 | 'eael_section_twitter_feed_icon_style', |
| 918 | [ |
| 919 | 'label' => esc_html__('Icon', 'essential-addons-for-elementor-lite'), |
| 920 | 'tab' => Controls_Manager::TAB_STYLE, |
| 921 | 'condition' => [ |
| 922 | 'eael_twitter_feed_show_icon' => 'true', |
| 923 | ], |
| 924 | ] |
| 925 | ); |
| 926 | |
| 927 | $this->add_control( |
| 928 | 'eael_section_twitter_feed_icon_size', |
| 929 | [ |
| 930 | 'label' => __('Font Size', 'essential-addons-for-elementor-lite'), |
| 931 | 'type' => Controls_Manager::SLIDER, |
| 932 | 'size_units' => ['px', '%'], |
| 933 | 'range' => [ |
| 934 | 'px' => [ |
| 935 | 'min' => 0, |
| 936 | 'max' => 1000, |
| 937 | 'step' => 5, |
| 938 | ], |
| 939 | '%' => [ |
| 940 | 'min' => 0, |
| 941 | 'max' => 100, |
| 942 | ], |
| 943 | ], |
| 944 | 'selectors' => [ |
| 945 | '{{WRAPPER}} .eael-twitter-feed-item .eael-twitter-feed-item-icon' => 'font-size: {{SIZE}}{{UNIT}};', |
| 946 | ], |
| 947 | ] |
| 948 | ); |
| 949 | |
| 950 | $this->add_control( |
| 951 | 'eael_section_twitter_feed_icon_color', |
| 952 | [ |
| 953 | 'label' => __('Color', 'essential-addons-for-elementor-lite'), |
| 954 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 955 | 'scheme' => [ |
| 956 | 'type' => \Elementor\Core\Schemes\Color::get_type(), |
| 957 | 'value' => \Elementor\Core\Schemes\Color::COLOR_1, |
| 958 | ], |
| 959 | 'selectors' => [ |
| 960 | '{{WRAPPER}} .eael-twitter-feed-item .eael-twitter-feed-item-icon' => 'color: {{VALUE}}', |
| 961 | ], |
| 962 | ] |
| 963 | ); |
| 964 | |
| 965 | $this->end_controls_section(); |
| 966 | } |
| 967 | |
| 968 | protected function render() |
| 969 | { |
| 970 | $settings = $this->get_settings_for_display(); |
| 971 | $feedcolumnspacing = $this->get_settings('eael_twitter_feed_column_spacing')['size']; |
| 972 | |
| 973 | echo '<div class="eael-twitter-feed eael-twitter-feed-' . $this->get_id() . ' eael-twitter-feed-' . $settings['eael_twitter_feed_type'] . ' eael-twitter-feed-' . $settings['eael_twitter_feed_type_col_type'] . ' clearfix" data-gutter="' . $settings['eael_twitter_feed_column_spacing']['size'] . '"> |
| 974 | ' . $this->twitter_feed_render_items($this->get_id(), $settings) . ' |
| 975 | </div>'; |
| 976 | |
| 977 | echo '<style> |
| 978 | .eael-twitter-feed-' . $this->get_id() . '.eael-twitter-feed-masonry.eael-twitter-feed-col-2 .eael-twitter-feed-item { |
| 979 | width: calc(50% - ' . ceil($feedcolumnspacing / 2) . 'px); |
| 980 | } |
| 981 | .eael-twitter-feed-' . $this->get_id() . '.eael-twitter-feed-masonry.eael-twitter-feed-col-3 .eael-twitter-feed-item { |
| 982 | width: calc(33.33% - ' . ceil($settings['eael_twitter_feed_column_spacing']['size'] * 2 / 3) . 'px); |
| 983 | } |
| 984 | .eael-twitter-feed-' . $this->get_id() . '.eael-twitter-feed-masonry.eael-twitter-feed-col-4 .eael-twitter-feed-item { |
| 985 | width: calc(25% - ' . ceil($feedcolumnspacing * 3 / 4) . 'px); |
| 986 | } |
| 987 | |
| 988 | .eael-twitter-feed-' . $this->get_id() . '.eael-twitter-feed-col-2 .eael-twitter-feed-item, |
| 989 | .eael-twitter-feed-' . $this->get_id() . '.eael-twitter-feed-col-3 .eael-twitter-feed-item, |
| 990 | .eael-twitter-feed-' . $this->get_id() . '.eael-twitter-feed-col-4 .eael-twitter-feed-item { |
| 991 | margin-bottom: ' . $settings['eael_twitter_feed_column_spacing']['size'] . 'px; |
| 992 | } |
| 993 | @media only screen and (min-width: 768px) and (max-width: 992px) { |
| 994 | .eael-twitter-feed-' . $this->get_id() . '.eael-twitter-feed-masonry.eael-twitter-feed-col-3 .eael-twitter-feed-item, |
| 995 | .eael-twitter-feed-' . $this->get_id() . '.eael-twitter-feed-masonry.eael-twitter-feed-col-4 .eael-twitter-feed-item { |
| 996 | width: calc(50% - ' . ceil($feedcolumnspacing / 2) . 'px); |
| 997 | } |
| 998 | } |
| 999 | </style>'; |
| 1000 | if (\Elementor\Plugin::instance()->editor->is_edit_mode()) { |
| 1001 | echo '<script type="text/javascript"> |
| 1002 | jQuery(document).ready(function($) { |
| 1003 | $(".eael-twitter-feed").each(function() { |
| 1004 | var $node_id = "' . $this->get_id() . '", |
| 1005 | $scope = $(".elementor-element-"+$node_id+""), |
| 1006 | $gutter = $(".eael-twitter-feed", $scope).data("gutter"), |
| 1007 | $settings = { |
| 1008 | itemSelector: ".eael-twitter-feed-item", |
| 1009 | percentPosition: true, |
| 1010 | masonry: { |
| 1011 | columnWidth: ".eael-twitter-feed-item", |
| 1012 | gutter: $gutter |
| 1013 | } |
| 1014 | }; |
| 1015 | |
| 1016 | // init isotope |
| 1017 | $twitter_feed_gallery = $(".eael-twitter-feed", $scope).isotope($settings); |
| 1018 | |
| 1019 | // layout gal, while images are loading |
| 1020 | $twitter_feed_gallery.imagesLoaded().progress(function() { |
| 1021 | $twitter_feed_gallery.isotope("layout"); |
| 1022 | }); |
| 1023 | }); |
| 1024 | }); |
| 1025 | </script>'; |
| 1026 | } |
| 1027 | } |
| 1028 | } |
| 1029 |