From d01ded3063dfa1176615b12de96289e8391fdb24 Mon Sep 17 00:00:00 2001 From: soufiane Date: Tue, 24 Sep 2024 12:27:45 +0200 Subject: [PATCH] wait #7094 @2:00 --- .../cube/src/Elementor/Widgets/HeroBlock.php | 37 ++++++++++++++++++- .../c6/resources/assets/images/player.svg | 24 ++++++++++++ .../assets/styles/widgets/hero-block.styl | 31 ++++++++++++++++ 3 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 wp-content/themes/c6/resources/assets/images/player.svg diff --git a/wp-content/mu-plugins/cube/src/Elementor/Widgets/HeroBlock.php b/wp-content/mu-plugins/cube/src/Elementor/Widgets/HeroBlock.php index 1ce65c8..f62565b 100644 --- a/wp-content/mu-plugins/cube/src/Elementor/Widgets/HeroBlock.php +++ b/wp-content/mu-plugins/cube/src/Elementor/Widgets/HeroBlock.php @@ -40,7 +40,15 @@ class HeroBlock extends Widget_Base { * @return array Widget scripts dependencies. */ public function get_script_depends() { - return []; + wp_register_script( + 'cube-video-popup', + \App\asset_path('scripts/video-popup.js'), + ['jquery'], // Dependencies + null, // Version + true // In footer? + ); + + return ['cube-video-popup']; } /** * Register the widget controls. @@ -120,6 +128,19 @@ class HeroBlock extends Widget_Base { 'show_external' => true ] ); + + $this->add_control( + 'url_video', + [ + 'label' => __('Video embed url', 'cube'), + 'type' => Controls_Manager::URL, + 'default' => [ + 'url' => '', + 'is_external' => false, + ], + 'show_external' => false + ] + ); $this->end_controls_section(); } @@ -139,6 +160,7 @@ class HeroBlock extends Widget_Base { $body_image = $this->get_settings('body_image'); $cta_text = $this->get_settings('cta_text'); $cta_link = $this->get_settings('cta_link'); + $url_video = $this->get_settings('url_video'); if ( ! empty( $cta_link['url'] ) ) { $this->add_render_attribute( 'cta_text', 'href', $cta_link['url'] ); @@ -192,6 +214,11 @@ class HeroBlock extends Widget_Base { 'hero-block-body-image']); ?> + +
+ toHtml(); ?> +
+ @@ -213,6 +240,14 @@ class HeroBlock extends Widget_Base { } + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wp-content/themes/c6/resources/assets/styles/widgets/hero-block.styl b/wp-content/themes/c6/resources/assets/styles/widgets/hero-block.styl index 3989aab..550ddb4 100644 --- a/wp-content/themes/c6/resources/assets/styles/widgets/hero-block.styl +++ b/wp-content/themes/c6/resources/assets/styles/widgets/hero-block.styl @@ -106,3 +106,34 @@ $breakpoint-hero = 1024px // to be and overflow: hidden can work on animated arrows display: inline-flex margin-top: 2em + + &-player-button + position: absolute + left: 50% + top: 50% + transform: translate(-50%,-50%) + cursor: pointer + +below(1300px) + top: 70% + + svg + +below(1300px) + width: 185px + +below(768px) + width: 90px + + &-video + display: none + position fixed + top: 0 + left: 0 + width: 100vw + height: 100vh + z-index: 99 + align-items: center + justify-content: center + background-color: rgba(0,0,0,.5) + +#player-video + visibility: hidden + position: absolute -- 2.39.5