elementor
/
modules
/
atomic-widgets
/
elements
/
atomic-background-video
/
atomic-background-video-content
/
atomic-background-video-content.php
atomic-background-video-content.php in Elementor Website Builder – more than just a page builder 4.3.2, at modules/atomic-widgets/elements/atomic-background-video/atomic-background-video-content/atomic-background-video-content.php
| 1 | <?php |
| 2 | |
| 3 | namespace Elementor\Modules\AtomicWidgets\Elements\Atomic_Background_Video\Atomic_Background_Video_Content; |
| 4 | |
| 5 | use Elementor\Modules\AtomicWidgets\Controls\Section; |
| 6 | use Elementor\Modules\AtomicWidgets\Elements\Base\Atomic_Element_Base; |
| 7 | use Elementor\Modules\AtomicWidgets\Elements\Base\Has_Element_Template; |
| 8 | use Elementor\Modules\AtomicWidgets\Elements\Base\Html_Tag_Computer; |
| 9 | use Elementor\Modules\AtomicWidgets\PropTypes\Attributes_Prop_Type; |
| 10 | use Elementor\Modules\AtomicWidgets\PropTypes\Classes_Prop_Type; |
| 11 | use Elementor\Modules\AtomicWidgets\PropTypes\Flex_Prop_Type; |
| 12 | use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\Number_Prop_Type; |
| 13 | use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\String_Prop_Type; |
| 14 | use Elementor\Modules\AtomicWidgets\PropTypes\Size_Prop_Type; |
| 15 | use Elementor\Modules\AtomicWidgets\Styles\Style_Definition; |
| 16 | use Elementor\Modules\AtomicWidgets\Styles\Style_Variant; |
| 17 | use Elementor\Modules\Components\PropTypes\Overridable_Prop_Type; |
| 18 | |
| 19 | if ( ! defined( 'ABSPATH' ) ) { |
| 20 | exit; |
| 21 | } |
| 22 | |
| 23 | class Atomic_Background_Video_Content extends Atomic_Element_Base { |
| 24 | use Has_Element_Template; |
| 25 | |
| 26 | const BASE_STYLE_KEY = 'base'; |
| 27 | |
| 28 | public static $widget_description = 'Content area for the Background Video element. Drop any widgets here to display them above the video.'; |
| 29 | |
| 30 | public function __construct( $data = [], $args = null ) { |
| 31 | parent::__construct( $data, $args ); |
| 32 | $this->meta( 'permanently_locked', true ); |
| 33 | } |
| 34 | |
| 35 | public static function get_type() { |
| 36 | return 'e-background-video-content'; |
| 37 | } |
| 38 | |
| 39 | public static function get_element_type(): string { |
| 40 | return 'e-background-video-content'; |
| 41 | } |
| 42 | |
| 43 | public function get_title() { |
| 44 | return esc_html__( 'Content Area', 'elementor' ); |
| 45 | } |
| 46 | |
| 47 | public function get_keywords() { |
| 48 | return [ 'ato', 'atom', 'atoms', 'atomic', 'background', 'video', 'content' ]; |
| 49 | } |
| 50 | |
| 51 | public function get_icon() { |
| 52 | return 'eicon-layout'; |
| 53 | } |
| 54 | |
| 55 | public function should_show_in_panel() { |
| 56 | return false; |
| 57 | } |
| 58 | |
| 59 | public static function get_computed_html_tag( array $settings ): string { |
| 60 | return Html_Tag_Computer::compute( $settings, 'div' ); |
| 61 | } |
| 62 | |
| 63 | protected static function define_props_schema(): array { |
| 64 | return [ |
| 65 | 'classes' => Classes_Prop_Type::make()->default( [] ), |
| 66 | 'attributes' => Attributes_Prop_Type::make()->meta( Overridable_Prop_Type::ignore() ), |
| 67 | ]; |
| 68 | } |
| 69 | |
| 70 | protected function define_atomic_controls(): array { |
| 71 | return [ |
| 72 | Section::make() |
| 73 | ->set_label( __( 'Settings', 'elementor' ) ) |
| 74 | ->set_id( 'settings' ) |
| 75 | ->set_items( [] ), |
| 76 | ]; |
| 77 | } |
| 78 | |
| 79 | protected function define_base_styles(): array { |
| 80 | return [ |
| 81 | static::BASE_STYLE_KEY => Style_Definition::make() |
| 82 | ->add_variant( |
| 83 | Style_Variant::make() |
| 84 | ->add_props( [ |
| 85 | 'display' => String_Prop_Type::generate( 'flex' ), |
| 86 | 'flex-direction' => String_Prop_Type::generate( 'column' ), |
| 87 | 'position' => String_Prop_Type::generate( 'relative' ), |
| 88 | 'z-index' => Number_Prop_Type::generate( 1 ), |
| 89 | // Root owns the default container padding (Flexbox parity); keep content |
| 90 | // padding at 0 so spacing is not doubled and empty-state outlines align. |
| 91 | 'padding' => Size_Prop_Type::generate( [ |
| 92 | 'size' => 0, |
| 93 | 'unit' => 'px', |
| 94 | ] ), |
| 95 | 'width' => Size_Prop_Type::generate( [ |
| 96 | 'size' => 100, |
| 97 | 'unit' => '%', |
| 98 | ] ), |
| 99 | 'flex' => Flex_Prop_Type::generate( [ |
| 100 | 'flexGrow' => Number_Prop_Type::generate( 1 ), |
| 101 | 'flexShrink' => Number_Prop_Type::generate( 1 ), |
| 102 | 'flexBasis' => Size_Prop_Type::generate( [ |
| 103 | 'size' => 'auto', |
| 104 | 'unit' => 'custom', |
| 105 | ] ), |
| 106 | ] ), |
| 107 | ] ) |
| 108 | ), |
| 109 | ]; |
| 110 | } |
| 111 | |
| 112 | protected function get_templates(): array { |
| 113 | return [ |
| 114 | 'elementor/elements/atomic-background-video-content' => __DIR__ . '/atomic-background-video-content.html.twig', |
| 115 | ]; |
| 116 | } |
| 117 | } |
| 118 |