ci7lus
https://gyazo.com/ee2c1598e2a7a6f747901da1d5d479d3
日記のfaviconを判別しやすいように反転
/ci7lus/ci7lus.iconの日記。アイコンを登場させたい場合に人物紹介が増えたり、何となく画像を貼りたいときに画像が増えたりする
code:style.css
body {
background-size: 20em;
}
code:script.js
code:diary-template.js
/* MIT License Copyright (c) 2020 ci7lus */
import { importExternalJs } from "/api/code/ci7lus/userscript-utils/import-external-js.js";
importExternalJs(
);
import { insertText } from "/api/code/customize/scrapbox-insert-text/script.js";
scrapbox.PageMenu.addMenu({
title: DailyReport,
onClick: () => {
if (!scrapbox.Page.lines || !scrapbox.Page.lines.length == 1) return
const input = prompt(
"日報テンプレートを展開したい日付を相対(d+)または絶対(2020-1-1)で(入力なしで今日)"
)
if (input === null) return
const diff = parseInt(input.trim() || 0)
const abs = input.split("-").length === 3 && dayjs(input)
if ((Number.isNaN(diff) && !abs) || (abs && !abs.isValid())) return
const today = abs
? abs.startOf("days")
: dayjs().startOf("days").add(diff, "days")
const yesterday = today.clone().subtract(1, "days")
const tomorrow = today.clone().add(1, "days")
console.log(today.format(), yesterday.format(), tomorrow.format())
const conf = confirm(対象の日付は ${today.format("YYYY.M.D")} ですか?)
if (!conf) return
insertText({
text: `${today.format("YYYY.M.D")}\n\n<- [${tomorrow.format(
"YYYY.M.D"
"YYYY.M.D"
)}] ->\n#日報`,
})
},
})