井戸端を見れなくするUserScript
code:script.js
if (scrapbox.Project.name === "villagepump") {
blockOnIdobata()
scrapbox.on("project:changed", removeMessage)
}
function blockOnIdobata(message = "井戸端を見ている場合ですか?") {
const containers = []
containers.push(document.querySelector(".app > .container ~ .container"))
containers.push(document.querySelector(".app > .row-flex"))
for (const c of containers) {
if (c == null) continue
c.style = "display: none;"
}
const app = document.querySelector(".app")
const p = document.createElement("p")
p.textContent = message
p.style = `
font-size: 100px;
font-weight: bold;
display: inline-block;
margin: auto;
text-align: center;
width: 100%;
`
p.className = "why-looking-for-idobata"
const qualia = document.createElement("img")
qualia.src = "/api/pages/villagepump/Qualia-san/icon";
qualia.style = "margin: 0 0 0 calc(100% - 512px);"
qualia.className = "why-looking-for-idobata"
app.append(p, qualia)
}
function removeMessage(query = ".why-looking-for-idobata") {
const elms = document.querySelectorAll(query)
for (const e of elms) e.remove()
}