Last active
March 13, 2020 19:54
-
-
Save mpyw/240b40a9003cdc689f04941225033faa to your computer and use it in GitHub Desktop.
qiita_nonsense_lgtm_button_killer.user.js
ファイル名ww
LGTM 😎
コメントのいいねボタンのborderが縦長になっているのとthums up アイコンが小さすぎると思ったので修正案です(あとstyle.innerHTML
からstyle.textContent
に変えています).
(() => {
const style = document.createElement('style');
style.textContent = `
.it-Footer_like button, .co-Item_like button {
background-color: transparent !important;
flex-shrink: 0;
}
.it-Footer_like button[style="background-color: rgb(85, 197, 0);"] {
background-color: rgb(85, 197, 0) !important;
color: rgb(255, 255, 255);
}
`;
document.head.appendChild(style);
for (const button of document.querySelectorAll('.it-Actions_item-like button, .it-Footer_like button, .co-Item_like button')) {
button.innerHTML = '<i class="fa fa-fw fa-thumbs-up"></i>';
}
for (const button of document.querySelectorAll('.it-Footer_like button')) {
button.insertAdjacentHTML('beforeend', '<span>Like</span>');
}
for (const svg of document.querySelectorAll('.it-Header_like svg')) {
const parent = svg.parentNode;
parent.removeChild(svg);
parent.insertAdjacentHTML('beforeend', '<i class="fa fa-fw fa-thumbs-up" style="font-size: 16px; color: #999"></i>');
}
const comments = document.getElementById('comments');
if (comments) {
new MutationObserver(() => {
for (const button of document.querySelectorAll('.co-Item_like button')) {
button.innerHTML = '<i class="fa fa-fw fa-3x fa-thumbs-up"></i>';
}
}).observe(comments, { childList: true });
}
})();
ありがとうございます!適用しておきます
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ファイル名ww