11define ( [
22 'jquery' ,
3- ] , function ( $ ) {
3+ 'CustomGento_Cookiebot/js/video-blocker-widget'
4+ ] , function ( $ , createVideoBlocker ) {
45 'use strict' ;
56
67 return function ( widget ) {
@@ -14,29 +15,9 @@ define([
1415 }
1516
1617 const videoElement = event . target . querySelector ( '.product-video' ) ;
17- const divElement = document . createElement ( 'div' ) ;
18- const paragraphElement = document . createElement ( 'p' ) ;
19- const iframeHeight = videoElement ?. getBoundingClientRect ( ) . height || 300 ;
20- const iframeWidth = videoElement ?. getBoundingClientRect ( ) . width || 400 ;
21-
22- divElement . innerHTML = `
23- <div style="background-color:#CCC;display:inline-block;height:${ iframeHeight } px;position:relative;width:${ iframeWidth } px; z-index: 1000;">
24- <div style="background-color:#848484;border-radius:15px;height:50%;position:absolute;transform:translate(50%,50%);width:50%;">
25- <p style="color:#FFF;font-size:7.5em;position:relative;top:50%;left:50%;margin:0;text-align:center;transform:translate(-50%,-50%);">⋯</p>
26- </div>
27- </div>
28- ` ;
29-
30- divElement . classList . add ( 'cookieconsent-optout-marketing' ) ;
31- paragraphElement . innerHTML =
32- $ . mage . __ ( 'Please <a href="javascript:Cookiebot.renew()">accept marketing cookies</a> to view this content.' )
33- ;
34-
35- divElement . style . fontSize = '1.4rem' ;
36- divElement . append ( paragraphElement ) ;
37- paragraphElement . style . zIndex = '10001' ;
38- paragraphElement . style . position = 'relative' ;
39- videoElement ?. parentNode . insertBefore ( divElement , videoElement ) ;
18+
19+ // Use the video blocker widget
20+ createVideoBlocker ( videoElement ) ;
4021 } ,
4122
4223 _initialize : function ( ) {
0 commit comments