Файловый менеджер - Редактировать - /home/admin/domains/octawebtools.com/public_html/wp-content/plugins/tmcaps/widgets/meme-generator.php
�азад
<?php namespace ElementorTMcaps\Widgets; use Elementor\Widget_Base; use Elementor\Controls_Manager; use Elementor\Group_Control_Background; use Elementor\Group_Control_Typography; use Elementor\Group_Control_Border; use Elementor\Group_Control_Box_Shadow; if ( ! defined( 'ABSPATH' ) ) exit; class TMcaps_Meme_Generator extends Widget_Base { public function get_name() { return 'tmcaps-meme-generator'; } public function get_title() { return esc_html__( 'Meme Generator', 'tmcaps' ); } public function get_icon() { return 'eicon-image'; } public function get_categories() { return [ 'tmcaps-widgets' ]; } public function get_style_depends() { return [ 'tooltipster','elementor-icons-fa-solid','tmcaps' ]; } public function get_script_depends() { return [ 'imagesloaded','tooltipster','fabric','vanilla-picker','tmcaps','tmcaps-custom' ]; } protected function register_controls() { $this->start_controls_section( 'settings_section', [ 'label' => esc_html__( 'Settings', 'tmcaps' ), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'text', [ 'label' => esc_html__( 'Default Text', 'tmcaps' ), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => esc_html__( 'Enter Your Text Here', 'tmcaps' ), 'dynamic' => [ 'active' => true, ], ] ); $this->add_control( 'image', [ 'label' => esc_html__( 'Default Image', 'tmcaps' ), 'type' => \Elementor\Controls_Manager::MEDIA, 'show_label' => true, 'default' => [ 'url' => \Elementor\Utils::get_placeholder_image_src(), ], ] ); $this->add_control( 'random_image', [ 'label' => esc_html__( 'Random Image', 'tmcaps' ), 'description' => esc_html__( 'Display random image from the template library. Meme templates must be enabled from plugin settings.', 'tmcaps'), 'type' => \Elementor\Controls_Manager::CHOOSE, 'options' => [ 'enable' => [ 'title' => esc_html__( 'Enable', 'tmcaps' ), 'icon' => 'eicons eicon-check', ], 'disable' => [ 'title' => esc_html__( 'Disable', 'tmcaps' ), 'icon' => 'eicons eicon-close', ], ], 'frontend_available' => true, 'default' => 'disable', 'toggle' => false ] ); $this->add_control( 'retina', [ 'label' => esc_html__( 'Retina Scaling', 'tmcaps' ), 'description' => esc_html__( 'When enabled, canvas is scaled by devicePixelRatio for better rendering on retina screens.', 'tmcaps'), 'type' => \Elementor\Controls_Manager::CHOOSE, 'options' => [ 'true' => [ 'title' => esc_html__( 'Enable', 'tmcaps' ), 'icon' => 'eicons eicon-check', ], 'false' => [ 'title' => esc_html__( 'Disable', 'tmcaps' ), 'icon' => 'eicons eicon-close', ], ], 'frontend_available' => true, 'default' => 'true', 'toggle' => false ] ); $this->end_controls_section(); $this->start_controls_section( 'd_settings_section', [ 'label' => esc_html__( 'Default Field Values', 'tmcaps' ), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'font_family', [ 'label' => esc_html__( 'Font family', 'tmcaps' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'Impact, Charcoal, sans-serif', 'options' => TMcaps_get_fonts(), 'frontend_available' => true ] ); $this->add_control( 'font_color', [ 'label' => esc_html__( 'Text Color', 'tmcaps' ), 'type' => Controls_Manager::COLOR, 'default' => '#000000', 'frontend_available' => true ] ); $this->add_control( 'font_bg_color', [ 'label' => esc_html__( 'Text Background', 'tmcaps' ), 'type' => Controls_Manager::COLOR, 'default' => 'rgba(255,255,255,0)', 'frontend_available' => true ] ); $this->add_control( 'font_size', [ 'label' => esc_html__( 'Font size', 'tmcaps' ), 'type' => \Elementor\Controls_Manager::NUMBER, 'default' => 60, 'frontend_available' => true ] ); $this->add_control( 'min_font_size', [ 'label' => esc_html__( 'Min. font size', 'tmcaps' ), 'type' => \Elementor\Controls_Manager::NUMBER, 'default' => 30 ] ); $this->add_control( 'max_font_size', [ 'label' => esc_html__( 'Max. font size', 'tmcaps' ), 'type' => \Elementor\Controls_Manager::NUMBER, 'default' => 300 ] ); $this->add_control( 'ds_hr_1', [ 'type' => \Elementor\Controls_Manager::DIVIDER, ] ); $this->add_control( 'outline_color', [ 'label' => esc_html__( 'Outline Color', 'tmcaps' ), 'type' => Controls_Manager::COLOR, 'default' => '#ffffff', 'frontend_available' => true ] ); $this->add_control( 'outline_size', [ 'label' => esc_html__( 'Outline size', 'tmcaps' ), 'type' => \Elementor\Controls_Manager::NUMBER, 'default' => 1, 'frontend_available' => true ] ); $this->add_control( 'min_outline_size', [ 'label' => esc_html__( 'Min. outline size', 'tmcaps' ), 'type' => \Elementor\Controls_Manager::NUMBER, 'default' => 0 ] ); $this->add_control( 'max_outline_size', [ 'label' => esc_html__( 'Max. outline size', 'tmcaps' ), 'type' => \Elementor\Controls_Manager::NUMBER, 'default' => 10 ] ); $this->add_control( 'ds_hr_2', [ 'type' => \Elementor\Controls_Manager::DIVIDER, ] ); $this->add_control( 'line_color', [ 'label' => esc_html__( 'Line Color', 'tmcaps' ), 'type' => Controls_Manager::COLOR, 'default' => '#F44336', 'frontend_available' => true ] ); $this->add_control( 'line_width', [ 'label' => esc_html__( 'Line width', 'tmcaps' ), 'type' => \Elementor\Controls_Manager::NUMBER, 'default' => 10, 'frontend_available' => true ] ); $this->add_control( 'min_line_width', [ 'label' => esc_html__( 'Min. line width', 'tmcaps' ), 'type' => \Elementor\Controls_Manager::NUMBER, 'default' => 1 ] ); $this->add_control( 'max_line_width', [ 'label' => esc_html__( 'Max. line width', 'tmcaps' ), 'type' => \Elementor\Controls_Manager::NUMBER, 'default' => 100 ] ); $this->add_control( 'ds_hr_3', [ 'type' => \Elementor\Controls_Manager::DIVIDER, ] ); $this->add_control( 'shape_color', [ 'label' => esc_html__( 'Shape Color', 'tmcaps' ), 'type' => Controls_Manager::COLOR, 'default' => 'rgba(244, 67, 54, 0.7)', 'frontend_available' => true ] ); $this->end_controls_section(); $this->start_controls_section( 'watermark_section', [ 'label' => esc_html__( 'Watermark', 'tmcaps' ), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'watermark', [ 'label' => esc_html__( 'Watermark', 'tmcaps' ), 'description' => esc_html__( 'To remove the watermark, leave this field blank.', 'tmcaps' ), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => esc_html__( 'www.codecanyon.net', 'tmcaps' ), 'label_block' => true, 'dynamic' => [ 'active' => true, ], ] ); $this->add_control( 'w_hr_1', [ 'type' => \Elementor\Controls_Manager::DIVIDER, ] ); $this->add_control( 'w_text_align', [ 'label' => esc_html__( 'Text Align', 'tmcaps' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => esc_html__( 'Left', 'tmcaps' ), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => esc_html__( 'Center', 'tmcaps' ), 'icon' => 'eicon-text-align-center', ], 'right' => [ 'title' => esc_html__( 'Right', 'tmcaps' ), 'icon' => 'eicon-text-align-right', ], ], 'frontend_available' => true, 'default' => 'right', 'toggle' => false, ] ); $this->add_control( 'w_font_color', [ 'label' => esc_html__( 'Text Color', 'tmcaps' ), 'type' => Controls_Manager::COLOR, 'default' => '#ffffff', 'frontend_available' => true ] ); $this->add_control( 'w_font_bg_color', [ 'label' => esc_html__( 'Background Color', 'tmcaps' ), 'type' => Controls_Manager::COLOR, 'default' => '#000000', 'frontend_available' => true ] ); $this->add_control( 'w_font_family', [ 'label' => esc_html__( 'Font family', 'tmcaps' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'Georgia, serif', 'options' => TMcaps_get_fonts(), 'frontend_available' => true ] ); $this->add_control( 'w_font_size', [ 'label' => esc_html__( 'Font Size', 'tmcaps' ), 'type' => \Elementor\Controls_Manager::NUMBER, 'default' => 22, 'frontend_available' => true ] ); $this->add_control( 'w_font_weight', [ 'label' => esc_html__( 'Bold', 'tmcaps' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'bold' => [ 'title' => esc_html__( 'Bold', 'tmcaps' ), 'icon' => 'eicons eicon-check', ], 'normal' => [ 'title' => esc_html__( 'Normal', 'tmcaps' ), 'icon' => 'eicons eicon-close', ], ], 'frontend_available' => true, 'default' => 'bold', 'toggle' => false, ] ); $this->add_control( 'w_font_style', [ 'label' => esc_html__( 'Italic', 'tmcaps' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'italic' => [ 'title' => esc_html__( 'Italic', 'tmcaps' ), 'icon' => 'eicons eicon-check', ], 'normal' => [ 'title' => esc_html__( 'Normal', 'tmcaps' ), 'icon' => 'eicons eicon-close', ], ], 'frontend_available' => true, 'default' => 'italic', 'toggle' => false, ] ); $this->end_controls_section(); $this->start_controls_section( 'section_header_style', [ 'label' => esc_html__( 'Header', 'tmcaps' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'header_typography', 'selector' => '{{WRAPPER}} .tm-caps-header .tm-caps-menu span', ] ); $this->add_control( 'header_icon_size', [ 'label' => esc_html__( 'Icon size', 'tmcaps' ), 'type' => \Elementor\Controls_Manager::NUMBER, 'default' => 14, 'selectors' => [ '{{WRAPPER}} .tm-caps-header button.tm-caps-menu i,{{WRAPPER}} .tm-caps-hidden-file + label i' => 'font-size: {{VALUE}}px;', ] ] ); $this->add_control( 'header_border_color', [ 'label' => esc_html__( 'Border Color', 'tmcaps' ), 'type' => Controls_Manager::COLOR, 'default' => 'rgba(255, 255, 255, 0.15)', 'selectors' => [ '{{WRAPPER}} .tm-caps-header button.tm-caps-menu' => 'border-color: {{VALUE}};', ] ] ); $this->add_control( 'header_hr_1', [ 'type' => \Elementor\Controls_Manager::DIVIDER, ] ); $this->start_controls_tabs( 'tabs_header_style' ); $this->start_controls_tab( 'tab_header_normal', [ 'label' => esc_html__( 'Normal', 'tmcaps'), ] ); $this->add_control( 'header_menu_color', [ 'label' => esc_html__( 'Text Color', 'tmcaps' ), 'type' => Controls_Manager::COLOR, 'default' => '#ffffff', 'selectors' => [ '{{WRAPPER}} .tm-caps-header .tm-caps-menu' => 'color: {{VALUE}};', ] ] ); $this->add_control( 'header_menu_bg', [ 'label' => esc_html__( 'Background', 'tmcaps' ), 'type' => Controls_Manager::COLOR, 'default' => '#673AB7', 'selectors' => [ '{{WRAPPER}} .tm-caps-header .tm-caps-menu,{{WRAPPER}} .tm-caps-header' => 'background: {{VALUE}};', ] ] ); $this->end_controls_tab(); $this->start_controls_tab( 'tab_header_active', [ 'label' => esc_html__( 'Active', 'tmcaps'), ] ); $this->add_control( 'header_menu_color_active', [ 'label' => esc_html__( 'Text Color', 'tmcaps' ), 'type' => Controls_Manager::COLOR, 'default' => '#ffffff', 'selectors' => [ '{{WRAPPER}} .tm-caps-header .tm-caps-menu:hover,{{WRAPPER}} .tm-caps-header .tm-caps-menu.active' => 'color: {{VALUE}};', ] ] ); $this->add_control( 'header_menu_bg_active', [ 'label' => esc_html__( 'Background', 'tmcaps' ), 'type' => Controls_Manager::COLOR, 'default' => '#000000', 'selectors' => [ '{{WRAPPER}} .tm-caps-header .tm-caps-menu:hover,{{WRAPPER}} .tm-caps-header .tm-caps-menu.active' => 'background: {{VALUE}};', ] ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->end_controls_section(); $this->start_controls_section( 'section_header_icons_style', [ 'label' => esc_html__( 'Header Icons', 'tmcaps' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'upload_icon', [ 'label' => esc_html__( 'Upload', 'tmcaps' ), 'description' => esc_html__( '* Required', 'tmcaps' ), 'type' => \Elementor\Controls_Manager::ICONS, 'default' => [ 'value' => 'fas fa-upload', 'library' => 'solid', ], ] ); $this->add_control( 'template_icon', [ 'label' => esc_html__( 'Templates', 'tmcaps' ), 'description' => esc_html__( '* Required', 'tmcaps' ), 'type' => \Elementor\Controls_Manager::ICONS, 'default' => [ 'value' => 'fas fa-images', 'library' => 'solid', ], ] ); $this->add_control( 'draw_icon', [ 'label' => esc_html__( 'Draw', 'tmcaps' ), 'description' => esc_html__( '* Required', 'tmcaps' ), 'type' => \Elementor\Controls_Manager::ICONS, 'default' => [ 'value' => 'fas fa-paint-brush', 'library' => 'solid', ], ] ); $this->add_control( 'shape_icon', [ 'label' => esc_html__( 'Add Shape', 'tmcaps' ), 'description' => esc_html__( '* Required', 'tmcaps' ), 'type' => \Elementor\Controls_Manager::ICONS, 'default' => [ 'value' => 'fas fa-shapes', 'library' => 'solid', ], ] ); $this->add_control( 'emoji_icon', [ 'label' => esc_html__( 'Add Emoji', 'tmcaps' ), 'description' => esc_html__( '* Required', 'tmcaps' ), 'type' => \Elementor\Controls_Manager::ICONS, 'default' => [ 'value' => 'fas fa-laugh', 'library' => 'solid', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_content_style', [ 'label' => esc_html__( 'Content', 'tmcaps' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'content_bg', [ 'label' => esc_html__( 'Background', 'tmcaps' ), 'type' => Controls_Manager::COLOR, 'default' => '#f5f5f5', 'selectors' => [ '{{WRAPPER}} .tm-caps-content' => 'background: {{VALUE}};', ] ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'content_shadow', 'label' => esc_html__( 'Box Shadow', 'tmcaps' ), 'selector' => '{{WRAPPER}} .tm-caps-container' ] ); $this->add_responsive_control( 'content_border_radius', [ 'label' => esc_html__( 'Border Radius', 'tmcaps' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'rem' ], 'selectors' => [ '{{WRAPPER}} .tm-caps-container' => 'border-top-left-radius: {{TOP}}{{UNIT}};border-top-right-radius: {{RIGHT}}{{UNIT}};border-bottom-right-radius: {{BOTTOM}}{{UNIT}};border-bottom-left-radius: {{LEFT}}{{UNIT}};', '{{WRAPPER}} .tm-caps-header' => 'border-top-left-radius: {{TOP}}{{UNIT}};border-top-right-radius: {{RIGHT}}{{UNIT}};border-bottom-right-radius: 0;border-bottom-left-radius: 0;', '{{WRAPPER}} .tm-caps-content' => 'border-top-left-radius: 0;border-top-right-radius: 0;border-bottom-right-radius: {{BOTTOM}}{{UNIT}};border-bottom-left-radius: {{LEFT}}{{UNIT}};', ] ] ); $this->add_control( 'content_hr_1', [ 'type' => \Elementor\Controls_Manager::DIVIDER, ] ); $this->add_responsive_control( 'padding', [ 'label' => esc_html__( 'Padding', 'tmcaps' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'rem' ], 'selectors' => [ '{{WRAPPER}} .tm-caps-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_controls_style', [ 'label' => esc_html__( 'Form Fields', 'tmcaps' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'controls_typography', 'label' => esc_html__( 'Label Typography', 'tmcaps' ), 'selector' => '{{WRAPPER}} .tm-caps-sliders>div>label,{{WRAPPER}} .tm-caps-select,{{WRAPPER}} .tmcaps-no-results-message' ] ); $this->add_control( 'control_text_color', [ 'label' => esc_html__( 'Text Color', 'tmcaps' ), 'type' => Controls_Manager::COLOR, 'default' => '#000000', 'selectors' => [ '{{WRAPPER}} .tm-caps-btn,{{WRAPPER}} .tm-caps-select,{{WRAPPER}} .tm-caps-sliders>div>label' => 'color: {{VALUE}};', ] ] ); $this->add_control( 'control_active_text_color', [ 'label' => esc_html__( 'Active Text Color', 'tmcaps' ), 'type' => Controls_Manager::COLOR, 'default' => '#fff', 'selectors' => [ '{{WRAPPER}} .tm-caps-btn.tm-caps-btn-primary,{{WRAPPER}} .tm-caps-btn.tm-caps-btn-primary:hover' => 'color: {{VALUE}};', ] ] ); $this->add_control( 'control_border_color', [ 'label' => esc_html__( 'Border Color', 'tmcaps' ), 'type' => Controls_Manager::COLOR, 'default' => '#dddddd', 'selectors' => [ '{{WRAPPER}} .tm-caps-btn,{{WRAPPER}} .tm-caps-select,{{WRAPPER}} .tm-caps-sliders,{{WRAPPER}} .tm-caps-sliders>div,{{WRAPPER}} .tm-caps-colorpicker,{{WRAPPER}} .tm-caps-draw-controls-inner .tm-caps-colorpicker' => 'border-color: {{VALUE}};', ] ] ); $this->add_control( 'control_bg_color', [ 'label' => esc_html__( 'Background Color', 'tmcaps' ), 'type' => Controls_Manager::COLOR, 'default' => '#ffffff', 'selectors' => [ '{{WRAPPER}} .tm-caps-btn,{{WRAPPER}} .tm-caps-select,{{WRAPPER}} .tm-caps-sliders' => 'background-color: {{VALUE}};', ] ] ); $this->add_control( 'control_highlight_color', [ 'label' => esc_html__( 'Highlight Color', 'tmcaps' ), 'type' => Controls_Manager::COLOR, 'default' => '#000000', 'selectors' => [ '{{WRAPPER}} .tm-caps-btn:hover' => 'background: {{VALUE}};', '{{WRAPPER}} .tm-caps-slider::-webkit-slider-thumb' => 'background: {{VALUE}};', '{{WRAPPER}} .tm-caps-slider::-moz-range-thumb' => 'background: {{VALUE}};', '{{WRAPPER}} .tm-caps-btn:hover' => 'border-color: {{VALUE}};', ] ] ); $this->add_control( 'control_primary_color', [ 'label' => esc_html__( 'Primary Color', 'tmcaps' ), 'type' => Controls_Manager::COLOR, 'default' => '#673AB7', 'selectors' => [ '{{WRAPPER}} .tm-caps-btn.tm-caps-btn-primary' => 'background: {{VALUE}};border-color: {{VALUE}};' ] ] ); $this->add_control( 'control_primary_hover_color', [ 'label' => esc_html__( 'Primary Hover Color', 'tmcaps' ), 'type' => Controls_Manager::COLOR, 'default' => '#000000', 'selectors' => [ '{{WRAPPER}} .tm-caps-btn.tm-caps-btn-primary:hover' => 'background: {{VALUE}};border-color: {{VALUE}};' ] ] ); $this->add_control( 'control_slider_bg', [ 'label' => esc_html__( 'Slider Background', 'tmcaps' ), 'type' => Controls_Manager::COLOR, 'default' => 'rgba(0, 0, 0, 0.1)', 'selectors' => [ '{{WRAPPER}} .tm-caps-slider' => 'background: {{VALUE}};' ] ] ); $this->end_controls_section(); $this->start_controls_section( 'section_templates_style', [ 'label' => esc_html__( 'Template Menu', 'tmcaps' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'temp_bg', [ 'label' => esc_html__( 'Container Background', 'tmcaps' ), 'type' => Controls_Manager::COLOR, 'default' => 'rgba(245, 245, 245, 0.95)', 'selectors' => [ '{{WRAPPER}} .tm-caps-gallery' => 'background: {{VALUE}};' ] ] ); $this->add_responsive_control( 'temp_grid_gap', [ 'label' => esc_html__( 'Grid Gap (px)', 'tmcaps' ), 'type' => \Elementor\Controls_Manager::NUMBER, 'default' => 15, 'selectors' => [ '{{WRAPPER}} .tm-caps-gallery-list' => 'column-gap: {{VALUE}}px;row-gap: {{VALUE}}px;' ] ] ); $this->add_responsive_control( 'temp_padding', [ 'label' => esc_html__( 'Padding', 'tmcaps' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'rem' ], 'selectors' => [ '{{WRAPPER}} .tm-caps-gallery-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], ] ); $this->add_control( 'temp_thumbnails', [ 'label' => esc_html__( 'Thumbnails', 'tmcaps' ), 'type' => \Elementor\Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_responsive_control( 'temp_max_thumb_size', [ 'label' => esc_html__( 'Max. Thumbnail Size (px)', 'tmcaps' ), 'type' => \Elementor\Controls_Manager::NUMBER, 'default' => 80, 'selectors' => [ '{{WRAPPER}} .tm-caps-gallery-list' => 'grid-template-columns: repeat(auto-fill, minmax(min({{VALUE}}px, 100%), 1fr));' ] ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'temp_img_border', 'label' => esc_html__( 'Border', 'tmcaps' ), 'selector' => '{{WRAPPER}} .tm-caps-gallery-list img' ] ); $this->add_responsive_control( 'temp_img_border_radius', [ 'label' => esc_html__( 'Border Radius', 'tmcaps' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'rem' ], 'selectors' => [ '{{WRAPPER}} .tm-caps-gallery-list img' => 'border-top-left-radius: {{TOP}}{{UNIT}};border-top-right-radius: {{RIGHT}}{{UNIT}};border-bottom-right-radius: {{BOTTOM}}{{UNIT}};border-bottom-left-radius: {{LEFT}}{{UNIT}};' ] ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'temp_img_border_shadow', 'label' => esc_html__( 'Box Shadow', 'tmcaps' ), 'selector' => '{{WRAPPER}} .tm-caps-gallery-list img' ] ); $this->end_controls_section(); $this->start_controls_section( 'section_emoji_style', [ 'label' => esc_html__( 'Emoji Menu', 'tmcaps' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'emoji_bg', [ 'label' => esc_html__( 'Container Background', 'tmcaps' ), 'type' => Controls_Manager::COLOR, 'default' => 'rgba(245, 245, 245, 0.95)', 'selectors' => [ '{{WRAPPER}} .tm-caps-emoji' => 'background: {{VALUE}};' ] ] ); $this->add_responsive_control( 'emoji_grid_gap', [ 'label' => esc_html__( 'Grid Gap (px)', 'tmcaps' ), 'type' => \Elementor\Controls_Manager::NUMBER, 'default' => 15, 'selectors' => [ '{{WRAPPER}} .tm-caps-emoji-list' => 'column-gap: {{VALUE}}px;row-gap: {{VALUE}}px;' ] ] ); $this->add_responsive_control( 'emoji_max_thumb_size', [ 'label' => esc_html__( 'Max. Icon Size (px)', 'tmcaps' ), 'type' => \Elementor\Controls_Manager::NUMBER, 'default' => 50, 'selectors' => [ '{{WRAPPER}} .tm-caps-emoji-list' => 'grid-template-columns: repeat(auto-fill, minmax(min({{VALUE}}px, 100%), 1fr));' ] ] ); $this->add_responsive_control( 'emoji_padding', [ 'label' => esc_html__( 'Padding', 'tmcaps' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'rem' ], 'selectors' => [ '{{WRAPPER}} .tm-caps-emoji-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_search_style', [ 'label' => esc_html__( 'Search Box', 'tmcaps' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'search_color', [ 'label' => esc_html__( 'Text Color', 'tmcaps' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .tmcaps-live-search-container input[type="search"].tmcaps-live-search-box' => 'color: {{VALUE}};' ] ] ); $this->add_control( 'placeholder_color', [ 'label' => esc_html__( 'Placeholder Color', 'tmcaps' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .tmcaps-live-search-container input[type="search"].tmcaps-live-search-box::placeholder' => 'color: {{VALUE}};' ] ] ); $this->add_control( 'search_bg_color', [ 'label' => esc_html__( 'Background Color', 'tmcaps' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .tmcaps-live-search-container input[type="search"].tmcaps-live-search-box' => 'background: {{VALUE}};' ] ] ); $this->add_control( 'search_border_color', [ 'label' => esc_html__( 'Border Color', 'tmcaps' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .tmcaps-live-search-container input[type="search"].tmcaps-live-search-box' => 'border-color: {{VALUE}};' ] ] ); $this->add_control( 'search_active_border_color', [ 'label' => esc_html__( 'Active Border Color', 'tmcaps' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .tmcaps-live-search-container input[type="search"].tmcaps-live-search-box:focus' => 'border-color: {{VALUE}};' ] ] ); $this->add_control( 'search_icon_color', [ 'label' => esc_html__( 'Icon Color', 'tmcaps' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .tmcaps-live-search-container i' => 'color: {{VALUE}};' ] ] ); $this->end_controls_section(); $this->start_controls_section( 'section_tooltip_style', [ 'label' => esc_html__( 'Tooltips', 'tmcaps' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'tooltip_typography', 'selector' => '.tmcaps.tooltipster-base .tooltipster-content', ] ); $this->add_control( 'tooltip_icon_color', [ 'label' => esc_html__( 'Text Color', 'tmcaps' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '.tmcaps.tooltipster-base .tooltipster-content' => 'color: {{VALUE}};' ] ] ); $this->add_control( 'tooltip_bg_color', [ 'label' => esc_html__( 'Background', 'tmcaps' ), 'type' => Controls_Manager::COLOR, 'alpha' => false, 'selectors' => [ 'body .tmcaps.tooltipster-base .tooltipster-content' => 'background: {{VALUE}};', 'body .tmcaps.tooltipster-sidetip.tooltipster-top .tooltipster-arrow-border' => 'border-top-color: {{VALUE}};', 'body .tmcaps.tooltipster-sidetip.tooltipster-bottom .tooltipster-arrow-border' => 'border-bottom-color: {{VALUE}};' ] ] ); $this->end_controls_section(); $this->start_controls_section( 'section_loader_style', [ 'label' => esc_html__( 'Loader', 'tmcaps' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'loader_color', [ 'label' => esc_html__( 'Loader Color', 'tmcaps' ), 'type' => Controls_Manager::COLOR, 'default' => '#000000', 'selectors' => [ '{{WRAPPER}} .tm-caps-loader' => 'border-top-color: {{VALUE}};' ] ] ); $this->add_control( 'loader_bg_color', [ 'label' => esc_html__( 'Background', 'tmcaps' ), 'type' => Controls_Manager::COLOR, 'default' => '#f5f5f5', 'selectors' => [ '{{WRAPPER}} .tm-caps-loader-wrapper' => 'background: {{VALUE}};' ] ] ); $this->end_controls_section(); } protected function render() { $settings = $this->get_settings_for_display(); // Get plugin settings $require_login = tmcaps_get_option( 'tmcaps_options', 'require_login', 'disable'); $upload_img = tmcaps_get_option( 'tmcaps_options', 'upload_img', 'enable'); $meme_templates = tmcaps_get_option( 'tmcaps_options', 'meme_templates', 'disable'); $templates = tmcaps_get_option( 'tmcaps_options_1', 'templates'); $draw = tmcaps_get_option( 'tmcaps_options', 'draw', 'enable'); $emoji = tmcaps_get_option( 'tmcaps_options', 'emoji', 'enable'); $shapes = tmcaps_get_option( 'tmcaps_options', 'shapes', 'enable'); $default_emojis = tmcaps_get_option( 'tmcaps_options_2', 'default_emojis', 'enable'); $custom_emojis = tmcaps_get_option( 'tmcaps_options_2', 'custom_emojis'); // Get Default Image $img_url = \Elementor\Utils::get_placeholder_image_src(); if ($settings['random_image'] == 'enable' && $meme_templates == 'enable' && $templates && is_array($templates)) { $random_id = array_rand($templates, 1); $img_url = $templates[$random_id]; } else if ($settings['image']['url'] != $img_url) { $img_array = wp_get_attachment_image_src($settings['image']['id'], 'full', true); $img_url = $img_array[0]; } // Get Default Text $text = esc_html__( 'Enter Your Text Here', 'tmcaps' ); if (!empty($settings['text'])) { $text = $settings['text']; } ?> <div class="tm-caps-container" data-default="<?php echo esc_attr($text); ?>" data-watermark="<?php echo esc_attr($settings['watermark']); ?>"> <div class="tm-caps-loader-wrapper"><div class="tm-caps-loader"></div></div> <div class="tm-caps-header"> <?php if ($upload_img == 'enable') { ?> <div class="tm-caps-header-item tm-caps-menu tm-caps-file-field"> <input type="file" name="tm-caps-file" id="tm-caps-file" class="tm-caps-hidden-file" accept="image/*" /> <label for="tm-caps-file" class="tm-caps-upload"><?php \Elementor\Icons_Manager::render_icon( $settings['upload_icon'], [ 'aria-hidden' => 'true' ] ); ?><span><?php esc_html_e( 'Upload', 'tmcaps' ); ?></span></label> </div> <?php } ?> <?php if ($meme_templates == 'enable') { ?> <button class="tm-caps-header-item tm-caps-menu tm-caps-select-template"><?php \Elementor\Icons_Manager::render_icon( $settings['template_icon'], [ 'aria-hidden' => 'true' ] ); ?><span><?php esc_html_e( 'Templates', 'tmcaps' ); ?></span></button> <?php } ?> <?php if ($draw == 'enable') { ?> <button class="tm-caps-header-item tm-caps-menu tm-caps-draw"><?php \Elementor\Icons_Manager::render_icon( $settings['draw_icon'], [ 'aria-hidden' => 'true' ] ); ?><span><?php esc_html_e( 'Draw', 'tmcaps' ); ?></span></button> <?php } ?> <?php if ($shapes == 'enable') { ?> <button class="tm-caps-header-item tm-caps-menu tm-caps-add-shape"><?php \Elementor\Icons_Manager::render_icon( $settings['shape_icon'], [ 'aria-hidden' => 'true' ] ); ?><span><?php esc_html_e( 'Add Shape', 'tmcaps' ); ?></span></button> <?php } ?> <?php if ($emoji == 'enable') { ?> <button class="tm-caps-header-item tm-caps-menu tm-caps-add-emoji"><?php \Elementor\Icons_Manager::render_icon( $settings['emoji_icon'], [ 'aria-hidden' => 'true' ] ); ?><span><?php esc_html_e( 'Add Emoji', 'tmcaps' ); ?></span></button> <?php } ?> </div> <div class="tm-caps-content"> <?php if ($emoji == 'enable') { ?> <div class="tm-caps-emoji"> <div class="tm-caps-emoji-inner"> <div class="tm-caps-emoji-list"> <?php if ($custom_emojis && is_array($custom_emojis)) { foreach ( (array) $custom_emojis as $attachment_id => $attachment_url ) { echo '<div class="tm-caps-emoji-item">'; echo '<img src="' . esc_url($attachment_url) . '" alt="' . esc_attr(get_the_title($attachment_id)) . '" />'; echo '</div>'; } } if ($default_emojis == 'enable') { $get_emojis = TMcaps_get_emojis(); foreach ($get_emojis as $emoji_key) { echo '<div class="tm-caps-emoji-item">'; echo '<img src="' . esc_url(TMCAPS_PLUGIN_URL . 'svg/' . $emoji_key . '.svg') . '" alt="' . esc_attr($emoji_key) . '" />'; echo '</div>'; } } ?> </div> </div> </div> <?php } ?> <?php if ($meme_templates == 'enable') { ?> <div class="tm-caps-gallery"> <div class="tm-caps-gallery-inner"> <div class="tmcaps-live-search-container"> <input type="search" class="tmcaps-live-search-box" placeholder="<?php esc_attr_e('Search by title...', 'tmcaps'); ?>" autocomplete="off" /> <i class="fas fa-search"></i> </div> <div class="tm-caps-gallery-list"> <?php if ($templates && is_array($templates)) { foreach ( (array) $templates as $attachment_id => $attachment_url ) { echo '<div class="tm-caps-gallery-item tm-caps-tooltip" data-largeimg="' . esc_url($attachment_url) . '" title="' . esc_attr(get_the_title($attachment_id)) . '" data-search-term="' . esc_attr(strtolower(get_the_title($attachment_id))) . '">'; echo wp_get_attachment_image( $attachment_id, 'thumbnail' ); echo '</div>'; } } ?> </div> <div class="tmcaps-no-results-message"><?php esc_html_e('No results found.', 'tmcaps'); ?></div> </div> </div> <?php } ?> <div class="tm-caps-text-controls"> <div class="tm-caps-text-controls-1"> <div class="tm-caps-btn-wrapper tm-caps-tooltip" title="<?php esc_attr_e( 'Image filter', 'tmcaps' ); ?>"> <select class="tm-caps-select tm-caps-select-filters" autocomplete="off"> <option value="nofilter" selected><?php esc_html_e( 'No Filter', 'tmcaps' ); ?></option> <option value="sepia"><?php esc_html_e( 'Sepia', 'tmcaps' ); ?></option> <option value="blackwhite"><?php esc_html_e( 'Black/White', 'tmcaps' ); ?></option> <option value="brownie"><?php esc_html_e( 'Brownie', 'tmcaps' ); ?></option> <option value="vintage"><?php esc_html_e( 'Vintage', 'tmcaps' ); ?></option> <option value="kodachrome"><?php esc_html_e( 'Kodachrome', 'tmcaps' ); ?></option> <option value="technicolor"><?php esc_html_e( 'Technicolor', 'tmcaps' ); ?></option> <option value="polaroid"><?php esc_html_e( 'Polaroid', 'tmcaps' ); ?></option> <option value="invert"><?php esc_html_e( 'Invert', 'tmcaps' ); ?></option> </select> </div> <div class="tm-caps-btn-wrapper tm-caps-tooltip" title="<?php esc_attr_e( 'Font family', 'tmcaps' ); ?>"> <select class="tm-caps-select tm-caps-select-fonts" autocomplete="off"> <?php $tmcaps_fonts = TMcaps_get_fonts(); foreach ($tmcaps_fonts as $key => $val) { if ($key == $settings['font_family']) { echo '<option style="font-family:' . esc_attr($key) . '" value="' . esc_attr($key) . '" selected>' . esc_html($val) . '</option>'; } else { echo '<option style="font-family:' . esc_attr($key) . '" value="' . esc_attr($key) . '">' . esc_html($val) . '</option>'; } } ?> </select> </div> </div> <div class="tm-caps-text-controls-2"> <div class="tm-caps-btn-wrapper tm-caps-tooltip" title="<?php esc_attr_e( 'Bold', 'tmcaps' ); ?>"> <button class="tm-caps-btn tm-caps-btn-bold active"><i class="fas fa-bold"></i></button> </div> <div class="tm-caps-btn-wrapper tm-caps-tooltip" title="<?php esc_attr_e( 'Italic', 'tmcaps' ); ?>"> <button class="tm-caps-btn tm-caps-btn-italic"><i class="fas fa-italic"></i></button> </div> <div class="tm-caps-btn-wrapper tm-caps-tooltip" title="<?php esc_attr_e( 'Underline', 'tmcaps' ); ?>"> <button class="tm-caps-btn tm-caps-btn-underline"><i class="fas fa-underline"></i></button> </div> <div class="tm-caps-btn-wrapper tm-caps-tooltip" title="<?php esc_attr_e( 'Align left', 'tmcaps' ); ?>"> <button class="tm-caps-btn tm-caps-btn-left-align"><i class="fas fa-align-left"></i></button> </div> <div class="tm-caps-btn-wrapper tm-caps-tooltip" title="<?php esc_attr_e( 'Align center', 'tmcaps' ); ?>"> <button class="tm-caps-btn tm-caps-btn-center active"><i class="fas fa-align-center"></i></button> </div> <div class="tm-caps-btn-wrapper tm-caps-tooltip" title="<?php esc_attr_e( 'Align right', 'tmcaps' ); ?>"> <button class="tm-caps-btn tm-caps-btn-right-align"><i class="fas fa-align-right"></i></button> </div> <div class="tm-caps-btn-wrapper tm-caps-tooltip" title="<?php esc_attr_e( 'Justify', 'tmcaps' ); ?>"> <button class="tm-caps-btn tm-caps-btn-justify"><i class="fas fa-align-justify"></i></button> </div> </div> <div class="tm-caps-text-controls-3"> <div class="tm-caps-btn-wrapper tm-caps-cpicker tm-caps-tooltip" title="<?php esc_attr_e( 'Text color', 'tmcaps' ); ?>"> <div class="tm-caps-colorpicker tm-caps-text-color"></div> </div> <div class="tm-caps-btn-wrapper tm-caps-cpicker tm-caps-tooltip" title="<?php esc_attr_e( 'Outline color', 'tmcaps' ); ?>"> <div class="tm-caps-colorpicker tm-caps-stroke-color"></div> </div> <div class="tm-caps-btn-wrapper tm-caps-cpicker tm-caps-tooltip" title="<?php esc_attr_e( 'Text background', 'tmcaps' ); ?>"> <div class="tm-caps-colorpicker tm-caps-textbg-color"></div> </div> </div> </div> <div class="tm-caps-draw-controls"> <div class="tm-caps-draw-controls-inner"> <div class="tm-caps-sliders"> <div> <label><?php esc_html_e( 'Line width', 'tmcaps' ); ?> <span>(<span class="tm-count-line-width"><?php echo esc_attr($settings['line_width']); ?></span>)</span></label> <input type="range" min="<?php echo esc_attr($settings['min_line_width']); ?>" max="<?php echo esc_attr($settings['max_line_width']); ?>" value="<?php echo esc_attr($settings['line_width']); ?>" class="tm-caps-slider tm-caps-line-width" autocomplete="off" data-default="<?php echo esc_attr($settings['line_width']); ?>"> </div> </div> <div class="tm-caps-cpicker tm-caps-tooltip" title="<?php esc_attr_e( 'Line color', 'tmcaps' ); ?>"> <div class="tm-caps-colorpicker tm-caps-line-color"></div> </div> <button class="tm-caps-btn tm-caps-delete-drawings tm-caps-tooltip" title="<?php esc_attr_e( 'Delete drawings', 'tmcaps' ); ?>"><i class="fas fa-trash"></i></button> </div> </div> <div class="tm-caps-shape-controls"> <div class="tm-caps-shape-controls-inner"> <div class="tm-caps-shape-btns"> <button class="tm-caps-btn tm-caps-add-rect"><i class="fas fa-plus"></i><?php esc_html_e( 'Rectangle', 'tmcaps' ); ?></button> <button class="tm-caps-btn tm-caps-add-circle"><i class="fas fa-plus"></i><?php esc_html_e( 'Circle', 'tmcaps' ); ?></button> <button class="tm-caps-btn tm-caps-add-triangle"><i class="fas fa-plus"></i><?php esc_html_e( 'Triangle', 'tmcaps' ); ?></button> <div class="tm-caps-file-field"> <input type="file" name="tm-caps-file" id="tm-caps-file2" class="tm-caps-hidden-file" accept="image/svg+xml" /> <label for="tm-caps-file2" class="tm-caps-btn"><?php \Elementor\Icons_Manager::render_icon( $settings['upload_icon'], [ 'aria-hidden' => 'true' ] ); ?><span><?php esc_html_e( 'SVG', 'tmcaps' ); ?></span></label> </div> </div> <div class="tm-caps-cpicker tm-caps-tooltip" title="<?php esc_attr_e( 'Shape Color', 'tmcaps' ); ?>"> <div class="tm-caps-colorpicker tm-caps-shape-color"></div> </div> </div> </div> <div class="tm-caps-slider-controls tm-caps-sliders"> <div> <label><?php esc_html_e( 'Image zoom', 'tmcaps' ); ?> <span>(<span class="tm-count-zoom">100</span>%)</span></label> <input type="range" min="50" max="100" value="100" class="tm-caps-slider tm-caps-zoom" autocomplete="off" data-default="100"> </div> <div> <label><?php esc_html_e( 'Font size', 'tmcaps' ); ?> <span>(<span class="tm-count-text-size"><?php echo esc_attr($settings['font_size']); ?></span>)</span></label> <input type="range" min="<?php echo esc_attr($settings['min_font_size']); ?>" max="<?php echo esc_attr($settings['max_font_size']); ?>" value="<?php echo esc_attr($settings['font_size']); ?>" class="tm-caps-slider tm-caps-text-size" autocomplete="off" data-default="<?php echo esc_attr($settings['font_size']); ?>"> </div> <div> <label><?php esc_html_e( 'Outline size', 'tmcaps' ); ?> <span>(<span class="tm-count-stroke-size"><?php echo esc_attr($settings['outline_size']); ?></span>)</span></label> <input type="range" min="<?php echo esc_attr($settings['min_outline_size']); ?>" max="<?php echo esc_attr($settings['max_outline_size']); ?>" value="<?php echo esc_attr($settings['outline_size']); ?>" class="tm-caps-slider tm-caps-stroke-size" autocomplete="off" data-default="<?php echo esc_attr($settings['outline_size']); ?>"> </div> </div> <div class="tm-caps-wrapper"> <div class="tm-caps-img-wrapper"> <img class="tm-caps-img" src="<?php echo esc_url($img_url) ?>" alt="<?php esc_html_e( 'Placeholder', 'tmcaps' ); ?>" /> </div> <canvas class="tm-caps-canvas"></canvas> </div> <div class="tm-caps-footer"> <button class="tm-caps-btn tm-caps-reset"><i class="fas fa-undo"></i><span><?php esc_html_e( 'Reset', 'tmcaps' ); ?></span></button> <?php if ($require_login == 'enable' && !is_user_logged_in()) { ?> <a href="<?php echo esc_url( wp_login_url( get_the_permalink() ) ); ?>" class="tm-caps-btn tm-caps-btn-primary tm-caps-login"><i class="fas fa-sign-in-alt"></i><span><?php esc_html_e( 'Login to download', 'tmcaps' ); ?></span></a> <?php } else { ?> <button class="tm-caps-btn tm-caps-btn-primary tm-caps-download"><i class="fas fa-download"></i><span><?php esc_html_e( 'Download', 'tmcaps' ); ?></span></button> <?php } ?> </div> </div> </div> <?php } } ?>
| ver. 1.4 |
Github
|
.
| PHP 8.1.32 | Генераци� �траницы: 0 |
proxy
|
phpinfo
|
�а�тройка