Give 'Mark Read' link background correct alpha on non-4chan sites.

This commit is contained in:
ccd0 2018-11-04 00:58:01 -07:00
parent 78f0cf9e78
commit 460bc87a5a

View File

@ -257,15 +257,20 @@ Main =
div.style.visibility = 'hidden';
$.add d.body, div
bgColor = window.getComputedStyle(div).backgroundColor
c.log(bgColor)
$.rm div
rgb = bgColor.match(/[\d.]+/g)
# Use body background if reply background is transparent
unless /^rgb\(/.test(bgColor)
s = window.getComputedStyle(d.body)
bgColor = "#{s.backgroundColor} #{s.backgroundImage} #{s.backgroundRepeat} #{s.backgroundPosition}"
Main.bgColorStyle.textContent = """
.dialog, .suboption-list > div:last-of-type, :root.catalog-hover-expand .catalog-container:hover > .post, .unread-mark-read {
.dialog, .suboption-list > div:last-of-type, :root.catalog-hover-expand .catalog-container:hover > .post {
background: #{bgColor};
}
.unread-mark-read {
background-color: rgba(#{rgb[...3].join(', ')}, #{0.5*(rgb[3] || 1)});
}
"""
$.after $.id('fourchanx-css'), Main.bgColorStyle
setStyle()