UserScript
https://1.bp.blogspot.com/-SwkyGTlfbq0/UO_3erDTL2I/AAAAAAAAKt4/uiBsvk79-U8/s1600/scince_flask.png
==========================================
UserScript動作用CSS/編集ツール用CSS
UserScript生成物用CSS
code:script.js
import '/api/code/ci7lus/ricapitolare/svg.js';
code:script.js
import '/api/code/ci7lus/tweet2image-upload/script.js';
code:script.js
import '/api/code/rinsuki/nicothumb2img/nicothumb2img.js';
code:style.css
@import "/api/code/rinsuki/nicothumb2img/force-dpi-style.css";
code:script.js
import '/api/code/shokai/Tweet_Menu/script.js';
code:script.js
import "/api/code/scrasobox/見える文字数カウンター/script.js";
code:script.css
@import "/api/code/scrasobox/見える文字数カウンター/style.css";
code:script.css
@import "/api/code/scrasobox/ポップアップメニューをさっぱりさせてみる/style.css";
code:script.js
$('body').attr('data-daiiz-paste-url-title', 'alt')
code:script.js
import "/api/code/villagepump/Page_MenuからScrapbox_Readerに切り替えられるようにするUserScript/user.js";
code:script.js
//import '/api/code/scrasobox/プレゼン中にプログレスバーを表示する/script.js';
document.querySelector('.app')
.insertAdjacentHTML('beforeend', '<div id="presentation-progress" style="display:none"></div>')
document.querySelector('.app')
.insertAdjacentHTML('beforeend', `<style media="screen">
display: block !important;
z-index: 100; position: fixed; bottom: 0; left: 0; width: 100vw;
text-align: center; line-height: 1;
font-size: 20px; /* 📝バーの高さを変えたいときはフォントサイズを変えてね */
--bar-bgcolor: #eee; /* 📝プログレスバーの背景色 */ --complete: 0;
background: linear-gradient(to right,
var(--bar-color) var(--complete), var(--bar-bgcolor) var(--complete), var(--bar-bgcolor))
}
</style>`);
(() => {
const updateProgress = () => {
const sections = Array.from(document.querySelectorAll('.section-title'))
const currentPos = sections.findIndex(e => {
return window.getComputedStyle(e, null).getPropertyValue('display') != 'none'
}) + 1
const complete = currentPos / sections.length * 100
const progressBarElem = document.getElementById('presentation-progress')
progressBarElem.style.setProperty('--complete', complete + '%')
progressBarElem.innerText = ${currentPos} / ${sections.length}
}
const appObserver = new MutationObserver(mutations => {
mutations.forEach(mutation => {
const addedStyles = Array.from(mutation.addedNodes).filter(node => node.tagName == 'STYLE')
if (addedStyles.length) {
// プレゼンモード開始?
// STYLEタグも MutationObserver で監視したかったけど無理ぽいのでキーイベント拾います
window.addEventListener('keydown', updateProgress)
updateProgress()
}
const removedStyles = Array.from(mutation.removedNodes).filter(node => node.tagName == 'STYLE')
if (removedStyles.length) {
// プレゼンモード終了?
window.removeEventListener('keydown', updateProgress)
}
})
})
appObserver.observe(document.querySelector('.app'), { childList: true })
})()