Submit
Path:
~
/
home
/
getwphos
/
www
/
twinkletown
/
wp-content
/
plugins
/
wuko-core
/
includes
/
elementor
/
widgets
/
File Content:
wgl-zoom.php
<?php /** * This template can be overridden by copying it to `yourtheme[-child]/wgl-extensions/elementor/widgets/wgl-zoom.php`. */ namespace WGL_Extensions\Widgets; defined( 'ABSPATH' ) || exit; // Abort, if called directly. use Elementor\{Frontend, Group_Control_Background, Group_Control_Border, Repeater, Widget_Base, Controls_Manager}; use WGL_Extensions\{ Includes\WGL_Elementor_Helper }; class WGL_Zoom extends Widget_Base { public function get_name() { return 'wgl-zoom'; } public function get_title() { return esc_html__('WGL Scroll Animation', 'wuko-core'); } public function get_icon() { return 'wgl-zoom'; } public function get_keywords() { return [ 'zoom', 'scale', 'scroll', 'animation' ]; } public function get_script_depends() { return ['wgl-widgets']; } public function get_categories() { return ['wgl-modules']; } protected function register_controls() { /*-----------------------------------------------------------------------------------*/ /* CONTENT -> GENERAL /*-----------------------------------------------------------------------------------*/ $this->start_controls_section( 'wgl_zoom_section', [ 'label' => esc_html__('General', 'wuko-core'), ] ); $this->add_control( 'speed', [ 'label' => esc_html__('Animation Section Size', 'wuko-core'), 'type' => Controls_Manager::SELECT, 'render_type' => 'template', 'options' => [ '0' => esc_html__('Default (is equal to 2vh)', 'wuko-core'), '1' => esc_html__('3vh', 'wuko-core'), '2' => esc_html__('4vh', 'wuko-core'), '3' => esc_html__('5vh', 'wuko-core'), '4' => esc_html__('6vh', 'wuko-core'), '5' => esc_html__('7vh', 'wuko-core'), ], 'default' => '0', 'selectors' => [ '{{WRAPPER}}' => '--wgl-anim-speed: {{VALUE}};', ], ] ); $this->add_responsive_control( 'items_height', [ 'label' => esc_html__( 'Items Height', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'size_units' => [ 'px', '%', 'vw', 'vh' ], 'range' => [ 'px' => [ 'min' => 100, 'max' => 1200, 'step' => 1 ], '%' => [ 'min' => 10, 'max' => 100, 'step' => 1 ], 'vw' => [ 'min' => 10, 'max' => 100, 'step' => 1 ], 'vh' => [ 'min' => 10, 'max' => 100, 'step' => 1 ], ], 'default' => [ 'size' => 100, 'unit' => 'vh' ], 'selectors' => [ '{{WRAPPER}}' => '--wgl-items-height: {{SIZE}}{{UNIT}};', ], ] ); $repeater = new Repeater(); $repeater->add_control( 'title', [ 'label' => esc_html__('Title', 'wuko-core'), 'description' => esc_html__('This option helps to configure the widget. You will not see this title on the frontend.', 'wuko-core'), 'type' => Controls_Manager::TEXT, 'dynamic' => ['active' => true], 'label_block' => true, ] ); $repeater->add_control( 'content_templates', [ 'label' => esc_html__('Choose Template', 'wuko-core'), 'type' => Controls_Manager::SELECT, 'options' => Wgl_Elementor_Helper::get_instance()->get_elementor_templates(), ] ); $repeater->add_responsive_control( 'wgl_zoom_items_position', [ 'label' => esc_html__('Position', 'wuko-core'), 'type' => Controls_Manager::SELECT, 'options' => [ 'top left' => esc_html__('Top Left', 'wuko-core'), 'top center' => esc_html__('Top Center', 'wuko-core'), 'top right' => esc_html__('Top Right', 'wuko-core'), 'center left' => esc_html__('Center Left', 'wuko-core'), 'center center' => esc_html__('Center Center', 'wuko-core'), 'center right' => esc_html__('Center Right', 'wuko-core'), 'bottom left' => esc_html__('Bottom Left', 'wuko-core'), 'bottom center' => esc_html__('Bottom Center', 'wuko-core'), 'bottom right' => esc_html__('Bottom Right', 'wuko-core'), ], 'selectors_dictionary' => [ 'top left' => '0 auto auto 0', 'top center' => '0 auto auto auto', 'top right' => '0 0 auto auto', 'center left' => 'auto auto auto 0', 'center center' => 'auto auto auto auto', 'center right' => 'auto 0 auto auto', 'bottom left' => 'auto auto 0 0', 'bottom center' => 'auto auto 0 auto', 'bottom right' => 'auto 0 0 auto', ], 'default' => 'center center', 'selectors' => [ '{{WRAPPER}} {{CURRENT_ITEM}} .wgl-zoom_item' => 'margin: {{VALUE}};', ], ] ); $repeater->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'wgl_zoom_items_bg', 'label' => esc_html__('Background', 'wuko-core'), 'types' => ['classic', 'gradient'], 'fields_options' => [ 'background' => [ 'selectors' => [ '{{SELECTOR}}' => 'content: \'\'' ], ], ], 'selector' => '{{WRAPPER}} {{CURRENT_ITEM}}::before', ] ); $repeater->add_responsive_control( 'wgl_zoom_items_z_index', [ 'label' => esc_html__('Z-Index', 'wuko-core' ), 'type' => Controls_Manager::NUMBER, 'dynamic' => ['active' => true], 'min' => -5, 'selectors' => [ '{{WRAPPER}} {{CURRENT_ITEM}}' => 'z-index: {{VALUE}}', ], ] ); $repeater->start_controls_tabs( 'wgl_zoom_tabs' ); $repeater->start_controls_tab( 'wgl_zoom_start', ['label' => esc_html__('Start', 'wuko-core')] ); $repeater->add_control( 'time_from', [ 'label' => esc_html__( 'Starting Animation Point on Screen', 'wuko-core' ), 'description' => esc_html__( 'Vertical position on the screen when all animation effects are applied to the current item( 0 - middle of a screen, 100 - very bottom, -100 - top of a screen)', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'range' => [ 'px' => [ 'min' => -100, 'max' => 200, 'step' => 1 ], ], ] ); $repeater->add_responsive_control( 'scale_from', [ 'label' => esc_html__( 'Scale From', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'devices' => [ 'desktop', 'tablet', 'mobile' ], 'range' => [ 'px' => [ 'min' => -10, 'max' => 50, 'step' => 0.01 ], ], ] ); $repeater->add_control( 'opacity_from', [ 'label' => esc_html__( 'Opacity From', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'range' => [ 'px' => [ 'min' => -2, 'max' => 5, 'step' => 0.01 ], ], ] ); $repeater->add_responsive_control( 'blur_from', [ 'label' => esc_html__( 'Blur From', 'wuko-core' ), 'description' => esc_html__( 'We recommend not using blur on tablet and mobile devices for better animation playback.', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'devices' => [ 'desktop', 'tablet', 'mobile' ], 'tablet_default' => ['size' => 0], 'mobile_default' => ['size' => 0], 'range' => [ 'px' => [ 'min' => -10, 'max' => 50, 'step' => 0.01 ], ], ] ); $repeater->add_responsive_control( 'vert_pos_from', [ 'label' => esc_html__('Vertical Position', 'wuko-core'), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'devices' => [ 'desktop', 'tablet', 'mobile' ], 'size_units' => [ 'px', '%' ], 'range' => [ 'px' => [ 'min' => -1200, 'max' => 1200 ], '%' => [ 'min' => -200, 'max' => 200 ], ], ] ); $repeater->add_responsive_control( 'hor_pos_from', [ 'label' => esc_html__('Horizontal Position', 'wuko-core'), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'devices' => [ 'desktop', 'tablet', 'mobile' ], 'size_units' => [ 'px', '%' ], 'range' => [ 'px' => [ 'min' => -1200, 'max' => 1200 ], '%' => [ 'min' => -200, 'max' => 200 ], ], ] ); $repeater->add_control( 'wgl_zoom_items_pointer_events_from', [ 'label' => esc_html__( 'Pointer Events', 'wuko-core' ), 'type' => Controls_Manager::SELECT, 'options' => [ '' => esc_html__( 'Default', 'wuko-core' ), 'auto' => esc_html__( 'Auto', 'wuko-core' ), 'none' => esc_html__( 'None', 'wuko-core' ), ], 'selectors' => [ '{{WRAPPER}} {{CURRENT_ITEM}}' => 'pointer-events: {{VALUE}};', ], ] ); $repeater->end_controls_tab(); $repeater->start_controls_tab( 'wgl_zoom_end', ['label' => esc_html__('End', 'wuko-core')] ); $repeater->add_control( 'time_to', [ 'label' => esc_html__( 'Ending Animation Point on Screen', 'wuko-core' ), 'description' => esc_html__( 'Vertical endpoint position on the screen for applying all animation effects (0 - middle of the screen, 100 - very bottom, -100 - top of the screen)', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'range' => [ 'px' => [ 'min' => -100, 'max' => 200, 'step' => 1 ], ], ] ); $repeater->add_responsive_control( 'scale_to', [ 'label' => esc_html__( 'Scale To', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'devices' => [ 'desktop', 'tablet', 'mobile' ], 'range' => [ 'px' => [ 'min' => -10, 'max' => 50, 'step' => 0.01 ], ], ] ); $repeater->add_control( 'opacity_to', [ 'label' => esc_html__( 'Opacity To', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'range' => [ 'px' => [ 'min' => -2, 'max' => 5, 'step' => 0.01 ], ], ] ); $repeater->add_responsive_control( 'blur_to', [ 'label' => esc_html__( 'Blur To', 'wuko-core' ), 'description' => esc_html__( 'We recommend not using blur on tablet and mobile devices for better animation playback.', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'devices' => [ 'desktop', 'tablet', 'mobile' ], 'tablet_default' => ['size' => 0], 'mobile_default' => ['size' => 0], 'range' => [ 'px' => [ 'min' => -10, 'max' => 50, 'step' => 0.01 ], ], ] ); $repeater->add_responsive_control( 'vert_pos_to', [ 'label' => esc_html__('Vertical Position', 'wuko-core'), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'devices' => [ 'desktop', 'tablet', 'mobile' ], 'size_units' => [ 'px'], 'range' => [ 'px' => [ 'min' => -1200, 'max' => 1200 ] ], ] ); $repeater->add_responsive_control( 'hor_pos_to', [ 'label' => esc_html__('Horizontal Position', 'wuko-core'), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'devices' => [ 'desktop', 'tablet', 'mobile' ], 'size_units' => [ 'px'], 'range' => [ 'px' => [ 'min' => -1200, 'max' => 1200 ] ], ] ); $repeater->add_control( 'wgl_zoom_items_pointer_events_to', [ 'label' => esc_html__( 'Pointer Events', 'wuko-core' ), 'type' => Controls_Manager::SELECT, 'options' => [ '' => esc_html__( 'Default', 'wuko-core' ), 'auto' => esc_html__( 'Auto', 'wuko-core' ), 'none' => esc_html__( 'None', 'wuko-core' ), ], 'selectors' => [ '{{WRAPPER}} .zoom_completed {{CURRENT_ITEM}}' => 'pointer-events: {{VALUE}};', ], ] ); $repeater->end_controls_tab(); $repeater->start_controls_tab( 'wgl_zoom_background', [ 'label' => esc_html__('Background', 'wuko-core'), 'condition' => ['wgl_zoom_items_bg_background!' => ''], ] ); $repeater->add_control( 'bg_time_from', [ 'label' => esc_html__( 'Starting Animation Point on Screen', 'wuko-core' ), 'description' => esc_html__( 'Vertical position on the screen when all animation effects are applied to the current item( 0 - middle of a screen, 100 - very bottom, -100 - top of a screen)', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'range' => [ 'px' => [ 'min' => -100, 'max' => 200, 'step' => 1 ], ], ] ); $repeater->add_control( 'bg_time_to', [ 'label' => esc_html__( 'Ending Animation Point on Screen', 'wuko-core' ), 'description' => esc_html__( 'Vertical endpoint position on the screen for applying all animation effects (0 - middle of the screen, 100 - very bottom, -100 - top of the screen)', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'range' => [ 'px' => [ 'min' => -100, 'max' => 200, 'step' => 1 ], ], ] ); $repeater->add_responsive_control( 'bg_scale_from', [ 'label' => esc_html__( 'Background Scale From', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'separator' => 'before', 'devices' => [ 'desktop', 'tablet', 'mobile' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 5, 'step' => 0.1 ], ], ] ); $repeater->add_responsive_control( 'bg_scale_to', [ 'label' => esc_html__( 'Background Scale To', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'devices' => [ 'desktop', 'tablet', 'mobile' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 5, 'step' => 0.1 ], ], ] ); $repeater->add_control( 'bg_opacity_from', [ 'label' => esc_html__( 'Background Opacity From', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'separator' => 'before', 'range' => [ 'px' => [ 'min' => 0, 'max' => 1, 'step' => 0.01 ], ], ] ); $repeater->add_control( 'bg_opacity_to', [ 'label' => esc_html__( 'Background Opacity To', 'wuko-core' ), 'type' => Controls_Manager::SLIDER, 'dynamic' => ['active' => true], 'range' => [ 'px' => [ 'min' => 0, 'max' => 1, 'step' => 0.01 ], ], ] ); $repeater->end_controls_tab(); $repeater->end_controls_tabs(); $this->add_control( 'items', [ 'label' => esc_html__('Layers', 'wuko-core'), 'type' => Controls_Manager::REPEATER, 'fields' => $repeater->get_controls(), 'title_field' => esc_html__('Template:', 'wuko-core') . ' {{{ content_templates }}} - {{{ title }}}', ] ); $this->end_controls_section(); /** * STYLE -> GENERAL */ $this->start_controls_section( 'section_style_general', [ 'label' => esc_html__('General', 'wuko-core'), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'item_overflow', [ 'label' => esc_html__('Item Overflow', 'wuko-core'), 'type' => Controls_Manager::SELECT, 'options' => [ '' => esc_html__('Theme Default', 'wuko-core'), 'overflow: visible;' => esc_html__('Visible', 'wuko-core'), 'overflow: hidden;' => esc_html__('Hidden', 'wuko-core'), 'overflow: clip;' => esc_html__('Clip', 'wuko-core'), ], 'selectors' => [ '{{WRAPPER}} .wgl-zoom_item__wrapper' => '{{VALUE}}', ], ] ); $this->add_responsive_control( 'item_padding', [ 'label' => esc_html__( 'Padding', 'wuko-core' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%', 'custom' ], 'selectors' => [ '{{WRAPPER}} .wgl-zoom_item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'item_border_radius', [ 'label' => esc_html__( 'Border Radius', 'wuko-core' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'custom' ], 'selectors' => [ '{{WRAPPER}} .wgl-zoom_item__wrapper' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'item_border', 'selector' => '{{WRAPPER}} .wgl-zoom_item__wrapper', ] ); $this->end_controls_section(); } protected function render() { $_s = $this->get_settings_for_display(); $this->add_render_attribute( 'zoom', [ 'class' => [ 'wgl-zoom' ], 'data-speed' => !!$_s['speed'] ? $_s['speed'] + 1 : 1, ] ); ?><div <?php echo $this->get_render_attribute_string( 'zoom' ); ?>> <div class="wgl-zoom_wrapper"><?php foreach ( $_s[ 'items' ] as $index => $item ) { $data_array['time_from'] = !!$item['time_from']['size'] ? $item['time_from']['size'] / 100 : 0; $data_array['time_to'] = !!$item['time_to']['size'] ? $item['time_to']['size'] / 100 : 1; $data_array['bg_time_from'] = !!$item['bg_time_from']['size'] ? $item['bg_time_from']['size'] / 100 : $data_array['time_from']; $data_array['bg_time_to'] = !!$item['bg_time_to']['size'] ? $item['bg_time_to']['size'] / 100 : $data_array['time_to']; $fields = [ 'scale_from', 'scale_to', 'scale_from_tablet', 'scale_to_tablet', 'scale_from_mobile', 'scale_to_mobile', 'opacity_from', 'opacity_to', 'blur_from', 'blur_to', 'blur_from_tablet', 'blur_to_tablet', 'blur_from_mobile', 'blur_to_mobile', 'hor_pos_from', 'hor_pos_to', 'hor_pos_from_tablet', 'hor_pos_to_tablet', 'hor_pos_from_mobile', 'hor_pos_to_mobile', 'vert_pos_from', 'vert_pos_to', 'vert_pos_from_tablet', 'vert_pos_to_tablet', 'vert_pos_from_mobile', 'vert_pos_to_mobile', 'bg_scale_from', 'bg_scale_to', 'bg_scale_from_tablet', 'bg_scale_to_tablet', 'bg_scale_from_mobile', 'bg_scale_to_mobile', 'bg_opacity_from', 'bg_opacity_to', ]; foreach ($fields as $field) { if (isset($item[$field]['size']) && '' !== $item[$field]['size']) $data_array[$field] = $item[$field]['size']; } $units = [ 'hor_pos_from', 'hor_pos_from_tablet', 'hor_pos_from_mobile', 'vert_pos_from', 'vert_pos_from_tablet', 'vert_pos_from_mobile', ]; foreach ($units as $unit) { if (isset($item[$unit]['unit']) && '' !== $item[$unit]['unit']) $data_array[$unit.'_unit'] = $item[$unit]['unit']; } $zoom_items = $this->get_repeater_setting_key( 'zoom_items', 'items' , $index ); $this->add_render_attribute( $zoom_items, [ 'class' => [ 'wgl-zoom_item__wrapper', 'elementor-repeater-item-'.$item['_id'] ], 'data-zoom' => json_encode($data_array, true), ] ); ?><div <?php echo $this->get_render_attribute_string( $zoom_items ); ?>><div class="wgl-zoom_item"><?php $wgl_frontend = new Frontend; echo $wgl_frontend->get_builder_content_for_display( $item['content_templates'] ); ?></div></div><?php } // end foreach ?></div> </div><?php } public function wpml_support_module() { add_filter( 'wpml_elementor_widgets_to_translate', [$this, 'wpml_widgets_to_translate_filter']); } public function wpml_widgets_to_translate_filter( $widgets ){ return \WGL_Extensions\Includes\WGL_WPML_Settings::get_translate( $this, $widgets ); } }
Edit
Rename
Chmod
Delete
FILE
FOLDER
Name
Size
Permission
Action
wgl-accordion-service.php
110791 bytes
0644
wgl-background-clip-text.php
21249 bytes
0644
wgl-blog.php
54012 bytes
0644
wgl-button-physics.php
48634 bytes
0644
wgl-button-widget.php
78290 bytes
0644
wgl-carousel.php
5648 bytes
0644
wgl-cases.php
174614 bytes
0644
wgl-circuit-service.php
21621 bytes
0644
wgl-clients.php
28542 bytes
0644
wgl-combo-menu.php
17440 bytes
0644
wgl-contact-form-7.php
64476 bytes
0644
wgl-countdown.php
19442 bytes
0644
wgl-counter.php
36515 bytes
0644
wgl-demo-item.php
33716 bytes
0644
wgl-double-heading.php
71788 bytes
0644
wgl-dynamic-title.php
11086 bytes
0644
wgl-flipbox.php
154999 bytes
0644
wgl-gallery.php
53821 bytes
0644
wgl-highlight-board.php
64418 bytes
0644
wgl-horizontal-scroll.php
25075 bytes
0644
wgl-image-animate.php
20947 bytes
0644
wgl-image-comparison.php
6032 bytes
0644
wgl-image-hotspots.php
52892 bytes
0644
wgl-image-layers.php
25243 bytes
0644
wgl-infinity-carousel.php
30821 bytes
0644
wgl-info-box.php
224793 bytes
0644
wgl-instagram.php
38631 bytes
0644
wgl-link-overlay.php
2495 bytes
0644
wgl-pie-chart.php
22332 bytes
0644
wgl-portfolio.php
115147 bytes
0644
wgl-pricing-table.php
209138 bytes
0644
wgl-products-categories.php
51718 bytes
0644
wgl-products-grid.php
79654 bytes
0644
wgl-progress-bar.php
30822 bytes
0644
wgl-rotated-text.php
22605 bytes
0644
wgl-satellite-service.php
35978 bytes
0644
wgl-showcase.php
208669 bytes
0644
wgl-social-icons.php
22240 bytes
0644
wgl-steps.php
48391 bytes
0644
wgl-striped-services.php
183259 bytes
0644
wgl-tabs-horizontal.php
42144 bytes
0644
wgl-tabs.php
53431 bytes
0644
wgl-team.php
36456 bytes
0644
wgl-template.php
8246 bytes
0644
wgl-testimonials.php
61375 bytes
0644
wgl-text-editor.php
55551 bytes
0644
wgl-text-path.php
41438 bytes
0644
wgl-time-line-horizontal.php
37694 bytes
0644
wgl-time-line-vertical.php
199396 bytes
0644
wgl-toggle-accordion.php
66819 bytes
0644
wgl-video-popup.php
30956 bytes
0644
wgl-working-hours.php
10870 bytes
0644
wgl-zoom.php
24854 bytes
0644
N4ST4R_ID | Naxtarrr