井戸端を見ようとした人をバルスするUserScript
script.jsexport function blockOnIdobata(
message = "まずはゆっくり休みましょう。",
imgSrc = "/api/pages/villagepump/Qualia-san/icon",
styleSrc = "/api/code/Mijinko-other/井戸端を見ようとした人をバルスするUserScript/style.css",
) {
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 rootDiv = document.createElement("div")
rootDiv.id = "why-looking-for-scrapbox"
app.appendChild(rootDiv)
const styleLink = document.createElement("link")
styleLink.rel = "stylesheet"
styleLink.href = styleSrc
const p = document.createElement("p")
p.textContent = message
const img = document.createElement("img")
img.src = imgSrc
rootDiv.append(p, img, styleLink)
}
export function removeMessage(query = "#why-looking-for-scrapbox") {
const elms = document.querySelectorAll(query)
for (const e of elms) e.remove()
}
style.css#why-looking-for-scrapbox {
display: flex;
width: 100%;
padding: 0 1em;
flex-direction: column;
align-items: center;
}
#why-looking-for-scrapbox p {
font-size: 100px;
font-weight: bold;
display: inline-block;
margin: auto;
text-align: center;
width: 100%;
}
#why-looking-for-scrapbox img {
position: absolute;
right: 0;
bottom: 0;
width: 100%;
max-width: 54em;
padding: 0 1em;
}
.btn.project-home {
pointer-events: none;
}