Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- var domain = "vemale";
- var topframe_style_fix = "";
- function topframeFix() {
- switch (domain) {
- case "vemale":
- topframe_style_fix = '\
- <sty' + 'le>\
- body > div:first-of-type{\
- background:none !important;\
- }\
- </sty' + 'le>';
- break;
- case "merdeka":
- topframe_style_fix = '\
- <sty' + 'le>\
- #div-gpt-ad-merdeka-topfrm-oop{\
- background:none !important;\
- }\
- .navbar{\
- margin-bottom:-20px;\
- }\
- .navbar-header {\
- background: #FFF;\
- }\
- #mdk-content {\
- background: #FFF;\
- }\
- #mbreaking-news{\
- display: block;\
- padding: 20px 0;\
- background: #FFF;\
- }\
- #mdk-content{\
- margin-top: -20px;\
- }\
- #mdk-footers{\
- margin-bottom:-5px;\
- padding-bottom:60px;\
- }\
- #mdk-news-detail{\
- background:#FFF;\
- }\
- .box-promo-apps{padding-top: 23px;margin-top: -23px;}\
- #mdk-to-top{padding-top: 15px !important;margin-top: -5px !important;}\
- .box-promo-apps,#mdk-to-top,br.clear{background: #FFF;}\
- .widget-email-app{margin-top: -40px !important;}\
- </sty' + 'le>';
- break;
- case "bola":
- topframe_style_fix = '\
- <sty' + 'le>\
- #div-gpt-ad-bola-topfrm-oop{\
- background:transparent !important;\
- }\
- #main_top {\
- background: #FFF;\
- padding-top: 15px;\
- }\
- .a2{\
- background: #FFF;\
- padding-bottom: 50px;\
- margin-bottom: -25px;\
- }\
- </sty' + 'le>';
- break;
- case "dream":
- topframe_style_fix = '\
- <sty' + 'le>\
- #div-gpt-ad-dream-topfrm-oop{\
- background:none !important;\
- }\
- .navbar{\
- background: #FFF;\
- }\
- .section {\
- background: #FFF;\
- }\
- </sty' + 'le>';
- break;
- default:
- topframe_style_fix = '\
- <sty' + 'le>\
- #div-gpt-ad-' + domain + '-topfrm-oop{\
- background:none !important;\
- }\
- </sty' + 'le>';
- break;
- }
- }
- topframeFix();
- var topframe_style = '\
- <sty' + 'le>\
- #topframe{\
- position: fixed;\
- overflow: hidden;\
- width: 100%;\
- z-index:0;\
- top : 0;\
- }\
- #topframe-ox{\
- position:relative;\
- text-align:center;\
- width: 100%;\
- height:100%;\
- overflow: hidden;\
- transition: padding .5s .25s;\
- -webkit-transition:padding .5s .25s;\
- -moz-transition: padding .5s .25s;\
- -o-transition: padding .5s .25s;\
- z-index: -1;\
- }\
- #topframe.expand #topframe-ox{\
- transition: padding .5s;\
- -webkit-transition:padding .5s;\
- -moz-transition: padding .5s;\
- -o-transition: padding .5s;\
- }\
- #topframe-img-container-absolute{\
- position: absolute;\
- top:0;\
- left: 0;\
- width: 100%;\
- z-index:-99;\
- }\
- #topframe-img-container{\
- position:fixed;\
- left:0;\
- z-index:-99;\
- width: 100%;\
- overflow: hidden;\
- transform: translate3d(0,0,0);\
- -webkit-transform: translate3d(0,0,0);\
- -moz-transform: translate3d(0,0,0);\
- -o-transform: translate3d(0,0,0);\
- -webkit-transition: top .5s .25s;\
- -moz-transition: top .5s .25s;\
- -o-transition: top .5s .25s;\
- transition: top .5s .25s;\
- }\
- #topframe.expand #topframe-img-container{\
- -webkit-transition: top .5s;\
- -moz-transition: top .5s;\
- -o-transition: top .5s;\
- transition: top .5s;\
- }\
- .topframe-img{\
- position:relative;\
- max-width:100%;\
- margin: 0 auto;\
- display:block;\
- }\
- #topframe-close-btn {\
- background-color: #F44336;\
- color:#fff;\
- height: 42px;\
- padding: 0;\
- margin: 0;\
- font-size: 0;\
- width: 42px;\
- box-sizing: border-box;\
- position: absolute;\
- bottom: -150px;\
- right:0;\
- white-space: nowrap;\
- font-family:arial,sans-serif;\
- z-index: 2;\
- text-align: center;\
- transition: bottom .5s;\
- -webkit-transition:bottom .5s;\
- -moz-transition: bottom .5s;\
- -o-transition: bottom .5s;\
- }\
- #topframe-close-btn:after{\
- content: "";\
- display: inline-block;\
- vertical-align: middle;\
- width: 0;\
- height: 100%;\
- padding: 0;\
- margin: 0;\
- position: relative;\
- }\
- #topframe-close-btn img{\
- width: 18px;\
- display:inline-block;\
- vertical-align:middle;\
- }\
- #topframe.expand #topframe-close-btn{\
- bottom: 0;\
- transition: bottom .5s .25s;\
- -webkit-transition:bottom .5s .25s;\
- -moz-transition: bottom .5s .25s;\
- -o-transition: bottom .5s .25s;\
- }\
- #topframe-desturl{\
- position: absolute;\
- top:0;\
- left:0;\
- width: 100%;\
- z-index:1;\
- }\
- .container.header-menu.text-center {\
- position: relative;\
- background: #fff;\
- width: 100%;\
- }\
- ul.menu-second.list-inline {\
- margin: 0;\
- background: #fff;\
- padding: 0 14px 0 12px;\
- }\
- div#mdk-body {\
- position: relative;\
- background: #fff !important;\
- }\
- .container.add-topframe {\
- position: relative;\
- }\
- div#mdk-body {\
- position: relative;\
- background: #fff !important;\
- }\
- \
- div#mdk-footers {\
- position: relative;\
- }\
- div.container.add-topframe:before {\
- content: "";\
- position: absolute;\
- left: 0;\
- top: -100px;\
- height: 100vh;\
- background: #fff;\
- z-index: -1;\
- width: 100%;\
- }\
- \
- img#topframe-img-big-pulse {\
- position: relative;\
- width: 100%;\
- max-width: unset !important;\
- max-height: unset !important;\
- }\
- .oto-menu-v2.text-center ,\
- div#mdk-content ,\
- div#main_top ,\
- .a2 {\
- position: relative;\
- background: #fff;\
- }\
- .mdk-container .navbar {\
- background: #fff;\
- }\
- .wrapper .container{\
- position : relative;\
- }\
- div#topframe iframe {\
- max-height: unset !important;\
- }\
- .widget-email-app {\
- position: relative;\
- background: #fff;\
- padding: 20px;\
- }\
- \
- div#mdk-to-top {\
- position: relative;\
- background: #fff;\
- padding: 10px;\
- margin-top: -5px;\
- }\
- </sty' + 'le>';
- var billScreenWidth = (window.screen.width > window.screen.height) ? window.screen.height : window.screen.width;
- var screenWidth = (billScreenWidth ? billScreenWidth : 480);
- var docScale = screenWidth / 320;
- var topframe_template = `
- <div id="topframe">
- <div id="topframe-ox">
- <div id="topframe-img-container-absolute">
- <div id="topframe-img-container">
- <div id="topframe-img-wrapper-big">
- <iframe srcdoc="" id="topframe-img-big" class="topframe-img" frameborder="0" scrolling="no" alt=""></iframe>
- </div>
- </div>
- </div>
- <div id="beacon_topframe" style="position: absolute; left: 0px; top: 0px; visibility: hidden;">
- <img id="mobileBillboardImpression" src="" style="display:none; visibility:hidden;" width="0" height="0">
- <img src="//id-gmtdmp.mookie1.com/t/v2/imp?tagid=V2_100501&src.rand=%n&src.campaignID=%ebuy!&src.placementID=%epid!"/>
- <img src="//id-gmtdmp.mookie1.com/t/v2/activity?tagid=V2_851533&src.rand=%%CACHEBUSTER%%&" style="display:none;"/>
- </div>
- </div>
- </div>
- `;
- topframe_template = topframe_style_fix + topframe_style + topframe_template;
- var topframe_script =`
- var dfp_useTracker = true ;
- var dfP_topframeImpression = "%%VIEW_URL_UNESC%%https://cdns.klimg.com/d.kapanlaginetwork.com/banner/asset/img/pixel.png";
- var dfp_imageBig = "<html><body style=\'transform: scale(`+docScale+`, `+docScale+`); transform-origin: 0px 0px 0px;margin:0;padding:0;\'><ins data-dcm-click-tracker=\'%%CLICK_URL_UNESC%%\' class=\'dcmads\' style=\'display:inline-block;width:320px;height:480px\' data-dcm-placement=\'N1108606.3525704SYMPHONYIMPACT/B23913372.270318453\' data-dcm-rendering-mode=\'script\' data-dcm-https-only data-dcm-resettable-device-id=\'\' data-dcm-app-id=\'\'> <script src=\'https://fw.adsafeprotected.com/rjss/www.googletagservices.com/424628/44144588/dcm/dcmads.js\'><\/script> <\/ins><\/body><\/html>";
- var dfp_topframeCloseTracker = "";
- var close_btn_src = "https://cdns.klimg.com/d.kapanlaginetwork.com/banner/asset/img/close.png";
- /*CONST*/
- var topFrameMaxWidth = 480;
- var topFrameClosedMaxHeight = 150;
- var topFrameExpandedMaxHeight = 480;
- var defaultCookieDuration = 10;
- /*REFERENCES*/
- var topFrame = document.getElementById("topframe");
- var topFrameOX = document.getElementById("topframe-ox");
- var topFrameClose = document.getElementById("topframe-img-big-pulse");
- var topFrameImageContainer = document.getElementById("topframe-img-container");
- var topFrameImageContainerAbsolute = document.getElementById("topframe-img-container-absolute");
- var topFrameImageBig = document.getElementById("topframe-img-big");
- var mobileBillboardImpression = document.getElementById("mobileBillboardImpression");
- /*STATE*/
- var deviceOrientation = (window.innerHeight < window.innerWidth ? "landscape" : "portrait");
- var dfp_isTopframeClosed = false;
- var topframeState = "expand";
- var klmain = document.querySelector(".main-kl");
- var isIos = navigator.platform.match(/iPhone|iPod|iPad/);
- /*CODE*/
- topFrameImageBig.srcdoc = dfp_imageBig;
- if (klmain) {
- klmain.parentElement.classList.add("add-topframe");
- }
- if (!isIos) {
- topframe.style.zIndex = "-9999";
- }
- topframeVisualCallback();
- mobileBillboardImpression.setAttribute("src", dfP_topframeImpression);
- function getDomainName() {
- hostName = window.location.hostname;
- rHN = hostName.substring(hostName.lastIndexOf(".", hostName.lastIndexOf(".") - 1) + 1);
- return (rHN == "kapanlaginetwork.com") ? "kapanlagi.com" : rHN;
- }
- function topframeVisualCallback() {
- var orientation = (isIos) ? window.orientation : screen.orientation.angle;
- var heighresponsive = Math.round((topFrameClosedMaxHeight / topFrameMaxWidth * window.innerWidth));
- /*console.log(window.screen.height);*/
- var billScreenWidth = (window.screen.width > window.screen.height) ? window.screen.height : window.screen.width;
- var screenWidth = (billScreenWidth < 480 ? billScreenWidth : 480) ;
- topFrameImageBig.style.height = Math.round(screenWidth+205.5) + "px";
- topFrameImageBig.style.width = screenWidth + "px";
- if (orientation !== 0) {
- deviceOrientation = "landscape";
- } else {
- deviceOrientation = "portrait";
- }
- if (topframeState == "closed") {
- if (orientation == 0) {
- TFVSetMarginValue(heighresponsive);
- topFrameOX.style.height = heighresponsive + "px";
- } else {
- TFVSetMarginValue(0);
- topFrameOX.style.height ="0px";
- }
- } else if (topframeState == "expand") {
- if (orientation == 0) {
- TFVSetMarginValue(topFrameMaxWidth*screenWidth/320);
- topFrameOX.style.height = Math.round(topFrameMaxWidth*screenWidth/320) + "px";
- } else {
- TFVSetMarginValue(0);
- topFrameOX.style.height ="0px";
- }
- }
- var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
- var topFrameImageContainerTop;
- if (scrollTop > -1) {
- topFrameImageContainer.style.transition = "";
- if (topframeState == "closed") {
- topFrameImageContainerTop = 0;
- } else if (topframeState == "expand") {
- if (window.innerWidth < topFrameMaxWidth) {
- topFrameImageContainerTop = 0;
- /*console.log(topFrameImageContainerTop);*/
- } else {
- topFrameImageContainerTop = -topFrameClosedMaxHeight;
- }
- }
- } else {
- topFrameImageContainer.style.transition = "none";
- if (topframeState == "closed") {
- topFrameImageContainerTop = -scrollTop;
- } else if (topframeState == "expand") {
- if (window.innerWidth < topFrameMaxWidth) {
- topFrameImageContainerTop = -scrollTop - Math.round((topFrameClosedMaxHeight / topFrameMaxWidth * window.innerWidth));
- } else {
- topFrameImageContainerTop = -scrollTop - topFrameClosedMaxHeight;
- }
- }
- }
- topFrameImageContainer.style.top = topFrameImageContainerTop + "px";
- }
- function closeTopFrame(e) {
- /*console.log("clicked close button");*/
- e ? e.preventDefault() : "";
- topFrame.className = "";
- topframeState = "closed";
- topframeVisualCallback();
- var smallTracker = document.createElement("img");
- smallTracker.style.display = "none";
- smallTracker.src = "https://bit.ly/2JLAugw";
- document.body.appendChild(smallTracker);
- }
- function expandTopFrame(e) {
- e ? e.preventDefault() : "";
- topFrame.className = "expand";
- topframeState = "expand";
- topframeVisualCallback();
- }
- function showTopFrame() {
- if (typeof dfp_IsSledLive != "undefined" && dfp_IsSledLive == false) {
- topframeState = dfp_isTopframeClosed ? "closed" : "expand";
- }
- topFrameImageBig.src = dfp_imageBig;
- /*console.log(topframeState + " " + dfp_isTopframeClosed);*/
- if (topframeState == "expand") {
- expandTopFrame();
- } else {
- closeTopFrame();
- }
- }
- window.addEventListener("orientationchange", function() {
- topframeVisualCallback();
- setTimeout(function() {
- topframeVisualCallback();
- }, 1000);
- topFrameOrientation();
- });
- window.addEventListener("resize", function() {
- topframeVisualCallback();
- setTimeout(function() {
- topframeVisualCallback();
- }, 1000);
- });
- document.addEventListener("scroll", function(e) {
- topframeVisualCallback();
- });
- function topFrameOrientation() {
- var ios = navigator.platform.match(/iPhone|iPod|iPad/);
- var orientation = (ios) ? window.orientation : screen.orientation.angle;
- document.querySelector('.banner-lb') && (document.querySelector('.banner-lb').querySelector('iframe').style = 'width:'+screen.width+'px !important;' );
- if (orientation == 0) {
- topFrame.style.display = "block";
- } else {
- topFrame.style.display = "none";
- }
- }
- topFrameOrientation();
- showTopFrame();
- setTimeout(function () {
- topframeVisualCallback();
- }, 1500);
- function TFVSetMarginValue(marginvalue) {
- var sitename = document.location.origin;
- switch (sitename) {
- case "https://m.kapanlagi.com":
- document.getElementsByTagName("body")[0].style.marginTop = marginvalue + "px";
- document.getElementsByTagName("body")[0].style.transition = "margin-top .25s ease";
- break;
- case "https://m.vemale.com":
- document.querySelector(".vemale-header").style.marginTop = marginvalue + "px";
- document.querySelector(".vemale-header").style.transition = "margin-top .25s ease";
- break;
- case "https://m.merdeka.com":
- document.querySelector(".navbar").style.marginTop = marginvalue + "px";
- document.querySelector(".navbar").style.transition = "margin-top .25s ease";
- document.querySelector(".mdk-container").style.overflow = "";
- document.querySelector("#detail_news #mdk-news_img_det") && (document.querySelector("#detail_news #mdk-news_img_det").style.margin = "unset");
- document.querySelector("#detail_news #mdk-news_img_det") && (document.querySelector("#detail_news #mdk-news_img_det").style.padding = "unset");
- document.querySelector("ul.read-comment__nav") && (document.querySelector("ul.read-comment__nav").style.marginRight = "unset");
- break;
- case "https://planet.merdeka.com":
- document.querySelector(".section-merdeka") && (document.querySelector(".section-merdeka").style = "position:relative;margin-top: "+ screen.width +"px;");
- break;
- case "https://m.bola.net":
- document.querySelector("#main_top").style.marginTop = marginvalue + "px";
- document.querySelector("#main_top").style.transition = "margin-top .25s ease";
- break;
- case "https://m.otosia.com":
- document.querySelector(".navbar").style.marginTop = marginvalue + "px";
- document.querySelector(".navbar").style.transition = "margin-top .25s ease";
- break;
- case "https://m.fimela.com":
- document.querySelector("#back-to-top").style.marginTop = marginvalue + "px";
- document.querySelector("#back-to-top").style.transition = "margin-top .25s ease";
- break;
- case "https://m.dream.co.id":
- document.querySelector(".navbar").style.marginTop = marginvalue + "px";
- document.querySelector(".navbar").style.transition = "margin-top .25s ease";
- break;
- case "https://m.bintang.com":
- document.querySelector("#back-to-top").style.marginTop = marginvalue + "px";
- document.querySelector("#back-to-top").style.transition = "margin-top .25s ease";
- document.querySelector(".layout__ads").style.height = "0";
- break;
- case "https://m.bola.com":
- document.querySelector("#back-to-top").style.marginTop = marginvalue + "px";
- document.querySelector("#back-to-top").style.transition = "margin-top .25s ease";
- document.querySelector(".layout__ads").style.height = "0";
- break;
- case "https://m.liputan6.com":
- document.querySelector("#back-to-top").style.marginTop = marginvalue + "px";
- document.querySelector("#back-to-top").style.transition = "margin-top .25s ease";
- document.querySelector(".layout__ads").style.height = "0";
- break;
- default :
- document.getElementsByTagName("body")[0].style.marginTop = marginvalue + "px";
- document.getElementsByTagName("body")[0].style.transition = "margin-top .25s ease";
- break;
- }
- }
- `;
- /*get frame*/
- var iframeEl = window.frameElement;
- //get frame parent
- var iframeParentEl = iframeEl.parentElement;
- //create popup element to containing skinad template
- var containerEl = document.createElement('div');
- containerEl.innerHTML = topframe_template;
- containerEl.style.position = 'relative';
- containerEl.style.width = '100%';
- //add skinad element to parent frame
- iframeParentEl.appendChild(containerEl);
- //create container for skinad script
- var containerScript = document.createElement('script');
- containerScript.setAttribute('type', 'text/javascript');
- //assign script to script container, note in firefox innerText not available so use textContent instead
- if (typeof containerScript.innerText == 'undefined') {
- containerScript.textContent = topframe_script;
- } else
- containerScript.innerText = topframe_script;
- //add popup script container to skinad element
- containerEl.appendChild(containerScript);
- var iframeTFEl = window.frameElement;
- iframeTFEl.style.display = "none";
- </script>
Add Comment
Please, Sign In to add comment