FanFictionNavigator

Mark and hide fanfics or authors

< Feedback on FanFictionNavigator

Question/comment

Andy ScullAuthor
§
Posted: 2018-01-22

Customizing colors

Recently I wanted to add some kind of customization/configuration page and well... I failed. I am not a web programmer and all that mumbo jumbo is way over my head.
So, found another way to change colors and keep them regardless of script updates: just add another GM script after FFN which overrides CSS styles for elements.
Instructions:
1. Create new script, with this header (change name and site as appropriate):
// ==UserScript==
// @name CSS - Fanfiction.net
// @include https://www.fanfiction.net/*
// @grant GM_addStyle
// ==/UserScript==
2. in FFN script, copy GMM_AddStyle lines and paste them into new script
3. change colors as you see fit.
4. in your GM extension, check that this CSS script is lower than FFN in load order
5. profit! If you know basics of CSS you can even make separate styles for liked-author-disliked-fic combinations, example script:
// ==UserScript==
// @name CSS - Fanfiction.net
// @include https://www.fanfiction.net/*
// @grant GM_addStyle
// ==/UserScript==
GM_addStyle(".ffn_like_author:not(a) {background-color:#7ad611 !important;}"); // liked author color
GM_addStyle(".ffn_like_author.ffn_like_fic:not(a) {background-color:#edeb90 !important;}"); // liked author and fic color

Here in this example I omitted pasting styles for liked_fic, disliked_fic, etc. Overall you should paste them so you have a clear understanding which style takes precedence in mixed cases (liked-fic-disliked-author could be red or green depending on order of commands).

Note: I used chromium with ViolentMonkey extension, this 'hack' may not work in some other browsers/extensions
Added separate fic/author classes for HTML elements in v.25 of FFN which I uploaded just now, older versions have only generic 'like' and 'dislike' classes.

Post reply

Sign in to post a reply.