Minor fix to dark mode on img results
parent
e3d002f6c1
commit
afd5b9aa83
|
@ -78,7 +78,7 @@ class Filter:
|
||||||
# Special rebranding for image search results
|
# Special rebranding for image search results
|
||||||
if img_src.startswith(LOGO_URL):
|
if img_src.startswith(LOGO_URL):
|
||||||
img['src'] = '/static/img/logo.png'
|
img['src'] = '/static/img/logo.png'
|
||||||
img['height'] = 40
|
img['style'] = 'height:40px;width:162px'
|
||||||
else:
|
else:
|
||||||
img['src'] = BLANK_B64
|
img['src'] = BLANK_B64
|
||||||
|
|
||||||
|
@ -114,9 +114,15 @@ class Filter:
|
||||||
|
|
||||||
# Set up dark mode if active
|
# Set up dark mode if active
|
||||||
if self.dark:
|
if self.dark:
|
||||||
soup.find('html')['style'] = 'scrollbar-color: #333 #111;'
|
soup.find('html')['style'] = 'scrollbar-color: #333 #111;color:#fff !important;background:#000 !important'
|
||||||
for input_element in soup.findAll('input'):
|
for input_element in soup.findAll('input'):
|
||||||
input_element['style'] = 'color:#fff;'
|
input_element['style'] = 'color:#fff;background:#000;'
|
||||||
|
|
||||||
|
for span_element in soup.findAll('span'):
|
||||||
|
span_element['style'] = 'color: white;'
|
||||||
|
|
||||||
|
for href_element in soup.findAll('a'):
|
||||||
|
href_element['style'] = 'color: white' if href_element['href'].startswith('/search') else ''
|
||||||
|
|
||||||
def update_links(self, soup):
|
def update_links(self, soup):
|
||||||
# Replace hrefs with only the intended destination (no "utm" type tags)
|
# Replace hrefs with only the intended destination (no "utm" type tags)
|
||||||
|
|
Loading…
Reference in New Issue