settings
特定ページを隠す
code:style.css
visibility: hidden;
height: 0;
width: 0;
margin: 0;
}
アイコン
code:style.css
.navbar-brand::before {
content: "";
width: 40px;
height: 40px;
position: absolute;
background-size: cover;
border-radius: 9999px;
}
外部リンクを分かりやすくする
code:style.css
.line a.link:not(.icon):after {
content: "\f35d";
font-family: "Font Awesome 5 Free";
font-weight: bold;
font-size: .8em;
margin-left: .2em;
text-decoration: none;
display: inline-block;
}
ピン留め記事と通常の記事の段を分けて表示
code:style.css
.page-list-item.pin + .page-list-item:not(.pin) {
clear: both;
}
ヘッダーに下線を引く
code:style.css
.line strong.level-1 {
background: linear-gradient(transparent 85%, #7fbfff 75%); font-weight: bold;
}
.line strong.level-2 {
background: linear-gradient(transparent 85%, #7fbfff 75%); font-weight: bold;
}
.line strong:not(class) { background: linear-gradient(transparent 85%, #b0c4de 75%); }
ヘッダーに下線を引く
code:style.css
.line strong.level-1 {
background: linear-gradient(transparent 85%, #7fbfff 75%); font-weight: bold;
}
.line strong.level-2 {
background: linear-gradient(transparent 85%, #7fbfff 75%); font-weight: bold;
}
.line strong:not(class) { background: linear-gradient(transparent 85%, #b0c4de 75%); }
コードブロックの行間を狭める
code:style.css
.line span.code-block {
line-height: 2rem;
}
ピン留めページにピンのアイコンを表示
code:style.css
.grid li.page-list-item a .pin {
background-color: transparent;
background-image: none;
}
.grid li.page-list-item a .pin::after {
content: "\f08d";
font-family: "Font Awesome 5 Free";
font-size: 20px;
bottom: 0;
display: inline-block;
transform: rotate(35deg);
font-weight: 900;
}
画像を大きくする
code:style.css
.line img.image {
max-height: none !important;
max-width: 50% !important;
}
存在しないページのリンクを点線で囲む
code:style.css
.line a.empty-page-link {
border: 1px dashed;
}
code:style.css
.table-block table { background-color: transparent; border-collapse: separate; border-spacing: 2px }
.table-block table tr td:nth-child(odd) { padding: .1em; background-color: rgba(0,0,0,0.04) }
.table-block table tr:nth-child(even) td { background-color: rgba(0,0,0,0.06) } /* 偶数行を濃くする */
.table-block table tr:first-child td { font-weight: bolder; text-align: center } /* 1行目だけ太字&中央揃え */
.table-block table tr td:first-child { padding: 0; background-color: transparent; border-width: 0 }
code:style.css
/* セル間に線を入れる */
.table-block .cell {
/* 全てのセルの右と下 */
}
.table-block .cell:first-child {
/* 1列目のセルの左 */
}
.section-title + .line .table-block .cell {
/* 1行目のセルの上 */
}
/* 1列目を太字・中央揃え */
.table-block-row > span.cell.col-1 {
font-weight: bolder;
text-align: center;
}
code:style.css
.line:not(.cursor-line) ahref$="/!":not(.icon) span, .line:not(.cursor-line) ahref$="/_":not(.icon) span, .line:not(.cursor-line) ahref$="/x":not(.icon) span, .line:not(.cursor-line) ahref$="/s":not(.icon) span, .line:not(.cursor-line) ahref$="/h":not(.icon) span { display: inline-block;
width: 0;
text-indent: -9999px;
}
.line:not(.cursor-line) ahref$="/!":not(.icon)::after, .line:not(.cursor-line) ahref$="/_":not(.icon)::after, .line:not(.cursor-line) ahref$="/x":not(.icon)::after, .line:not(.cursor-line) ahref$="/s":not(.icon)::after, .line:not(.cursor-line) ahref$="/h":not(.icon)::after { display: inline-block;
min-width: 1.15em;
padding-left: 1px;
font: normal 110%/normal "Font Awesome 5 Free";
text-align: center;
}
border: none;
}
.line:not(.cursor-line) ahref$="/!":not(.icon)::after { content: "\f06a"; color: #F6AE2D; font-weight: bold; }
content: "\f059"; color: #758E4F; font-weight: bold; }
.line:not(.cursor-line) ahref$="/_":not(.icon)::after { content: "\f0c8"; color: #666; }
.line:not(.cursor-line) ahref$="/x":not(.icon)::after { content: "\f14a"; color: #069; font-weight: bold; }
.line:not(.cursor-line) ahref$="/s":not(.icon)::after { }
.line:not(.cursor-line) ahref$="/h":not(.icon)::after { }
行番号を出す
code:style.css
/* 行番号を表示 -- ウィンドウ幅768px以上で適用 */
@media screen and (min-width: 768px) {
.lines {
counter-reset: line;
}
.line {
counter-increment: line;
}
.app:not(.presentation) .line::before {
content: counter(line);
position: absolute;
display: inline-block;
left: -110px;
z-index: 10;
min-width: 50px;
text-align: right;
vertical-align: middle;
/* 行番号のフォントとか色とかの指定はここ */
font-family: monospace;
color: grey;
}
/* カーソル行の行番号を濃く表示する */
.line:not(.line-title)::before {
opacity: .5;
}
.line.cursor-line:not(.line-title)::before {
opacity: 1;
font-weight: bolder;
}
}
ハッシュタグをおしゃれに
code:style.css
/* #で始まるタグをラベル風にする */
display: inline-block;
margin: 4px;
margin-bottom: 10px; // 下の余白を少し多めに取る
font-size: 14px;
height: 32px;
width: auto;
padding-left: 8px;
padding-right: 8px;
padding-top: 2px;
padding-bottom: 2px;
border-radius: 2px;
border-style: none;
background-color: rgba(12, 12, 13, 0.1);
}
background-color: rgba(12, 12, 13, 0.2);
}
background-color: rgba(12, 12, 13, 0.3);
}
コードブロックのコピーボタンを強調する
code:style.css
.code-block .tool-buttons {
position: absolute;
right: 0px;
font-size: 2em;
color: gray;
}
.code-block:hover .tool-buttons>*:after {
content: attr(title);
}
foo
code:style.css
.deco-\~ {
padding: 0.1em 0.2em 0.1em 0.2em;
}
Access Counter
code:style.css
.drag-and-drop-enter {
padding-bottom: 100px;
background-position: center bottom 20px;
background-repeat: no-repeat;
background-size: 184px 70px;
}
code:script.js
import '/api/code/iamtakagi/settings/github-card.js';
import '/api/code/iamtakagi/settings/word-count.js';
import '/api/code/iamtakagi/settings/tweet-share.js';
import '/api/code/iamtakagi/spotify2image/script.js';
import '/api/code/ci7lus/pdfの全てのページをGyazoにアップロードしてScrapboxに貼り付けるUserScript/script.js';
import '/api/code/rinsuki/nicothumb2img/nicothumb2img.js';
import '/api/code/ci7lus/ricapitolare/svg.js';
文字数カウント
code:word-count.js
scrapbox.PopupMenu.addButton({
title: function (text) {
const chars = text.replace(/\r\n/g, '').length const words = text.trim().split(/\r\n\s+/).length return ${chars}c ${words}w
},
onClick: () => null
})
ツイートシェア
code:tweet-share.js
scrapbox.PageMenu.addMenu({
title: 'ツイート',
onClick: () => window.open(https://twitter.com/intent/tweet?url=${encodeURIComponent(location.href)}&text=${encodeURIComponent(window.scrapbox.Page.title)})
})
code:github-card.js
scrapbox.PopupMenu.addButton({
title: text => regex.test(text) ? "GitHub Card" : null,
onClick: text => text.replace(
regex,
(_, repo) => [https://gh-card.dev/repos/${repo}.svg https://github.com/${repo}]
)
})