From b7c6af27659a93e6607fedebe09d3e615e19a484 Mon Sep 17 00:00:00 2001 From: Grason Chan Date: Tue, 6 Jul 2021 23:36:30 +0800 Subject: [PATCH] feat(Turntable): remove the billboard in the Full App Display to improve user experience --- Turntable/rotateTurntable.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Turntable/rotateTurntable.js b/Turntable/rotateTurntable.js index a8740a4..fd57a3d 100644 --- a/Turntable/rotateTurntable.js +++ b/Turntable/rotateTurntable.js @@ -6,6 +6,14 @@ window.addEventListener("load", rotateTurntable = () => { return; } + const adModalStyle = document.createElement("style"); + const STYLE_FOR_AD_MODAL = ` +.ReactModalPortal { + display: none +} +`; + adModalStyle.innerHTML = STYLE_FOR_AD_MODAL; + let playState; function handleRotate(fromEvent) { @@ -57,8 +65,11 @@ window.addEventListener("load", rotateTurntable = () => { const mainInterface = document.querySelector("#main"); const mainPlayBtn = document.querySelector(".main-playButton-PlayButton"); const mainTopbarTitle = document.querySelector(".main-entityHeader-topbarTitle"); + const billboard = document.querySelector("#view-billboard-ad"); mainInterface.style.display = "block"; + if (billboard) billboard.closest(".ReactModalPortal").remove(); + adModalStyle.remove(); setTimeout(() => { mainPlayBtn.style.removeProperty("opacity"); @@ -90,6 +101,7 @@ window.addEventListener("load", rotateTurntable = () => { } mainInterface.style.display = "none"; + document.body.append(adModalStyle); fullAppDisplay.addEventListener("contextmenu", handleContextMenu);