mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-11-28 17:07:55 +01:00
cherry pick from previously broken and abandoned branch
colorize buttons and ratio bar Resolves #218 Using user options (#387) edit color schemes logistics for the added options handles storage, change, initialize
This commit is contained in:
1 parent
510c083c77
commit
b476c60fe0
7 files changed
+210
-8
No files matched your search
@@ -1,3 +1,7 @@
|
||||
import {
|
||||
extConfig,
|
||||
} from "./state";
|
||||
|
||||
function roundDown(num) {
|
||||
if (num < 1000) return num;
|
||||
const int = Math.floor(Math.log10(num) - 2);
|
||||
@@ -67,4 +71,32 @@ function cLog(message, writer) {
|
||||
}
|
||||
}
|
||||
|
||||
function getColorFromTheme(voteIsLike) {
|
||||
let colorString;
|
||||
switch(extConfig.colorTheme) {
|
||||
case 'accessible':
|
||||
if (voteIsLike === true) {
|
||||
colorString = 'dodgerblue';
|
||||
} else {
|
||||
colorString = 'gold';
|
||||
}
|
||||
break;
|
||||
case 'neon':
|
||||
if (voteIsLike === true) {
|
||||
colorString = 'aqua';
|
||||
} else {
|
||||
colorString = 'magenta';
|
||||
}
|
||||
break;
|
||||
case 'classic':
|
||||
default:
|
||||
if (voteIsLike === true) {
|
||||
colorString = 'lime';
|
||||
} else {
|
||||
colorString = 'red';
|
||||
}
|
||||
}
|
||||
return colorString;
|
||||
}
|
||||
|
||||
export { numberFormat, getBrowser, getVideoId, isVideoLoaded, cLog }
|
||||
Reference in new issue
Block a user