Luxup

Splash + sticky Viads

Feb 24th, 2026 (edited)
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <style>
  2.     #%DIV_ID% .__lxG__splash-counter {background-color: transparent; color: #48647F;}
  3.     #%DIV_ID% .__lxG__splash {background-color: white}
  4. </style>
  5. <script>
  6. (function() {
  7.     var adContainerId = '%DIV_ID%';
  8.     var parentSelector = '#' + adContainerId + '.__lxG__multi:not(.__lxG__splash-container)';
  9.     var adContainer = document.querySelector(parentSelector);
  10.    
  11.     var viadsSelector = '.WfSayC[data-vads-ui-element="player"], div[data-vads-zone="6445"]';
  12.     var lowerIndex = "2147483646";
  13.  
  14.     if (!adContainer) return;
  15.  
  16.     var styleTagId = 'style-for-' + adContainerId;
  17.     if (!document.getElementById(styleTagId)) {
  18.         var cssRules = `
  19.             ${parentSelector} {
  20.                 visibility: hidden !important;
  21.                 opacity: 0 !important;
  22.             }
  23.             ${parentSelector}.splash-is-visible {
  24.                 visibility: visible !important;
  25.                 opacity: 1 !important;
  26.             }
  27.         `;
  28.         var styleElement = document.createElement('style');
  29.         styleElement.id = styleTagId;
  30.         styleElement.innerHTML = cssRules;
  31.         document.head.appendChild(styleElement);
  32.     }
  33.  
  34.     var fixViadsZIndex = function() {
  35.         var targetViads = document.querySelector(viadsSelector);
  36.         if (targetViads) {
  37.             targetViads.style.setProperty('--vads-player-z-index', lowerIndex, 'important');
  38.             targetViads.style.setProperty('z-index', lowerIndex, 'important');
  39.         }
  40.     };
  41.    
  42.     var showContainer = function() {
  43.         fixViadsZIndex();
  44.         adContainer.classList.add('splash-is-visible');
  45.     };
  46.  
  47.     if (adContainer.querySelector('.__lxG__not_empty_block')) {
  48.         showContainer();
  49.         return;
  50.     }
  51.  
  52.     var observer = new MutationObserver(function(mutations) {
  53.         fixViadsZIndex();
  54.         if (adContainer.querySelector('.__lxG__not_empty_block')) {
  55.             showContainer();
  56.         }
  57.     });
  58.  
  59.     observer.observe(document.body, {
  60.         childList: true,
  61.         subtree: true
  62.     });
  63.  
  64.     fixViadsZIndex();
  65. })();
  66. </script>
Advertisement
Add Comment
Please, Sign In to add comment