UNPKG

@yuebai008/cli

Version:

Command line interface for rapid qg-minigame development

1 lines 1.27 kB
const PLATFORM_MAC_CLASS="platform-mac",PLATFORM_LINUX_CLASS="platform-linux",PLATFORM_WINDOWS_CLASS="platform-windows",urlParams=new URLSearchParams(window.location.search);export function init(){if(urlParams.has("fontFamily")){const t=document.createElement("div");return t.className="component-docs-ui",t.style.position="fixed",t.style.bottom="10px",t.style.right="230px",t.style.width="250px",t.style.fontSize="16px",t.style.padding="5px",t.innerText=`font-family: ${urlParams.get("fontFamily")}`,window.addEventListener("load",(()=>{document.body.appendChild(t)})),void(document.body.style.fontFamily=`${urlParams.get("fontFamily")}`)}document.body.classList.add("platform-linux");const t=document.createElement("button");t.className="component-docs-ui";const o=["platform-linux","platform-mac","platform-windows"];function e(){for(const t of o)t===o[0]?document.body.classList.add(t):document.body.classList.remove(t);o.push(o.shift()),t.innerText="Turn on "+o[0]+" fonts"}window.addEventListener("load",(()=>{e(),t.style.position="fixed",t.style.bottom="10px",t.style.right="230px",t.style.width="250px",t.style.fontSize="16px",t.style.padding="5px",t.style.cursor="pointer",t.addEventListener("click",(t=>{t.preventDefault(),e()})),document.body.appendChild(t)}))}