fabio revised this gist . Go to revision
1 file changed, 53 insertions
wallabag-ui-fix.js(file created)
@@ -0,0 +1,53 @@ | |||
1 | + | // ==UserScript== | |
2 | + | // @name Wallabag UI fix | |
3 | + | // @namespace https://fabiomanganiello.com/ | |
4 | + | // @version 0.1 | |
5 | + | // @description Make the Wallabag UI better. | |
6 | + | // @author Fabio Manganiello | |
7 | + | // @match https://CHANGE_ME_WITH_YOUR_WALLABAG_URL/* | |
8 | + | // @icon | |
9 | + | // @grant none | |
10 | + | // ==/UserScript== | |
11 | + | ||
12 | + | (function() { | |
13 | + | 'use strict'; | |
14 | + | ||
15 | + | // Remove the footer | |
16 | + | const footer = document.getElementsByTagName('footer')[0]; | |
17 | + | if (footer) { | |
18 | + | footer.style.display = 'none'; | |
19 | + | } | |
20 | + | ||
21 | + | // Better header | |
22 | + | const nav = document.getElementsByTagName('nav')[0]; | |
23 | + | if (nav) { | |
24 | + | const header = document.getElementsByClassName('nav-panels')[0]; | |
25 | + | if (header) { | |
26 | + | header.style.background = 'white'; | |
27 | + | header.style.color = 'black'; | |
28 | + | [...header.querySelectorAll('a')].forEach((a) => a.style.color = 'black'); | |
29 | + | [...document.querySelectorAll('a.card-title')].forEach((link) => { link.style.color = '#808080'; link.style.fontWeight = '500'}); | |
30 | + | } | |
31 | + | } | |
32 | + | ||
33 | + | const content = document.getElementById('content'); | |
34 | + | if (content) { | |
35 | + | content.style.background = 'white'; | |
36 | + | } | |
37 | + | ||
38 | + | const articleContainer = document.getElementById('article'); | |
39 | + | if (articleContainer) { | |
40 | + | articleContainer.style.boxShadow = 'none'; | |
41 | + | } | |
42 | + | ||
43 | + | const article = document.getElementsByTagName('article')[0]; | |
44 | + | if (article) { | |
45 | + | article.style.fontFamily = '-apple-system, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Open Sans", "Droid Sans", "Helvetica Neue", Helvetica, Arial, sans-serif'; | |
46 | + | article.style.fontSize = '18px'; | |
47 | + | article.style.fontWeight = 400; | |
48 | + | article.style.textAlign = 'justify'; | |
49 | + | article.style.padding = '1.5em'; | |
50 | + | article.style.lineHeight = '1.75em'; | |
51 | + | article.style.textRendering = 'optimizeLegibility'; | |
52 | + | } | |
53 | + | })(); |
Newer
Older