if(window.PvInternals.services_client) { console.log("pv.me has loaded correctly") } // custom rules (() => { const pv = window.PvInternals; class PvmeRulesModal extends pv.components_pv_popup_pv_popup { constructor() { super(); this.innerHTML = `
Rules
pianoverse.me rules are very simple.
  • Don't be annoying
  • Don't be racist
  • Do not argue punishments
That's it! :)
`; } } customElements.define("pvme-rules-modal", PvmeRulesModal); pv.Modal.RULES = "pvme-rules-modal"; let oldOpen = pv.PopupManager.open; pv.PopupManager.open = (e, ...t) => { if(pv.Modal.RULES == e) { let i = new PvmeRulesModal(); if (i == document.querySelector(e) && !i.querySelector("dialog").hasAttribute("closing")) return i.close(); document.body.append(i) i.open(...t) return i; } else { return oldOpen(e, ...t) } } class PvmeRules extends HTMLElement {} customElements.define("pvme-rules", PvmeRules); let g = document.querySelector("body > pv-header > div.left"); { let a = document.createElement("div"); a.className = "divider"; a.style.marginLeft = "20px"; g.appendChild(a); } { let a = document.createElement("pvme-rules"); a.innerHTML = `
`; a.addEventListener("click", () => { pv.PopupManager.open(pv.Modal.RULES, null); }) g.appendChild(a); } })(); // change title (() => { const pv = window.PvInternals; document.querySelector("pv-room").updateBrowserTab = function () { if(pv.services_client.room.id) { if(pv.services_client.isConnected()) { document.title = `pv.me - ${pv.services_client.room.id} (${1 + pv.services_client.users.length})` } else { document.title = `pv.me - ${pv.services_client.room.id}` } } else { document.title = "pv.me" } } document.querySelector("body > pv-header > div.left > div.pianoverse > span").innerText = "pv.me" })();