From 72760d6bb313fb6ad926876fbd98ba11452b5303 Mon Sep 17 00:00:00 2001 From: deadvey Date: Sat, 14 Dec 2024 21:17:19 +0000 Subject: [PATCH] initial commit --- README.md | 7 +++++++ icons/logo-48.png | Bin 0 -> 899 bytes main.js | 30 ++++++++++++++++++++++++++++++ manifest.json | 22 ++++++++++++++++++++++ theme.js | 32 ++++++++++++++++++++++++++++++++ 5 files changed, 91 insertions(+) create mode 100644 README.md create mode 100644 icons/logo-48.png create mode 100644 main.js create mode 100644 manifest.json create mode 100644 theme.js diff --git a/README.md b/README.md new file mode 100644 index 0000000..397fde4 --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +# What is this? +A firefox extension for loading custom colours from a config file and using them as css on a webpage + +# How to? +Edit theme.js for custom colours +For now it's not on firefox store so go to about:debugging -> This Firefox -> Load Temporary Add-on +then select any file in this directory :) diff --git a/icons/logo-48.png b/icons/logo-48.png new file mode 100644 index 0000000000000000000000000000000000000000..bb471ce839697353a9cb47cb556008283c9f6757 GIT binary patch literal 899 zcmeAS@N?(olHy`uVBq!ia0y~yU@!n-4kiW$h8qca7Z?~ATQZ%U13aCb6$*;-(=u~X z85lGs)=sqbIP4&EG(LE#QfPabz{?2>t!}!yT3yo;S?IJvG^*5K=NIl-TU0dl`kJy2 z9_&B5s=0gfI=*#H3O^Vhy?LoaETN=*s! zG@KqU%DkQQ`=ieL;`%X|?r!KX??^Xa zYxTVLk%9JUt&f%;mpF>6)IHht=#%vGNr#!v^GM%3V^cUILg(v-ONZCwWE?R*5*T_} zGycTRHAVLxtqGN0Q|$lmP=aH8` zpIAC!HIrK(>y-tLWq%&jf7l(p*~0dz8tY_-|J}LuJC={oW%3^s z9|U@NHYp@|c?L!(UQkllDd{y;S%6XL-0cac!@nHZsFxC+#(4I};?k3>^4#IuwdOy* zn!Qd=;ah_7nw{c}d{N;SIs^aDxNN*6$<@W6bCJRHYpR!5AD*)^{OSSW#h?4q3*LCD zaopv(Au7wMtz)&xJaMIuFQbvA$%Ab+{H{rtjz&+p@uitpX~xC3Q6VpUI%O*jXI(T* zPS;wqSAyLu|K6l~w{1)sUiL*@E7i4Ky5nEe4c*?)_LVOtHr(1>v-p5RVcyi;9WP$B z+r&=YEHRVqg59?#Qq}@}rs}6X@4i0wI_8*AO^(|)0fkM=(>x!@oD?;ckdRhkEso0a zj^54b5;)^-Y?Gh%Tj7vv(hnzeE;`*-b9nOk5Z%ufnj0ju>~m+tsD5KvvRB0S link.style.color = `#${linkText}`); +// Hover +document.querySelectorAll('a').forEach(link => { link.addEventListener('mouseover', () => link.style.color = `#${linkTextHover}`); link.addEventListener('mouseout', () => link.style.color = `#${linkText}`); }); +// Active +document.querySelectorAll('a').forEach(link => { link.addEventListener('mousedown', () => link.style.color = `#${linkTextActive}`); link.addEventListener('mouseup', () => link.style.color = `#${linkText}`); }); + + // Buttons +document.querySelectorAll('button').forEach(button => button.style.backgroundColor = `#${buttonBackground}`); +document.querySelectorAll('button').forEach(button => button.style.color = `#${buttonText}`); +document.querySelectorAll('button').forEach(button => button.style.borderColor = `#${buttonBorderColor}`); + + // Input +document.querySelectorAll('input').forEach(input => input.style.backgroundColor = `#${inputBackground}`); +document.querySelectorAll('input').forEach(input => input.style.color = `#${inputText}`); +document.querySelectorAll('input').forEach(input => input.style.borderColor = `#${inputBorderColor}`); + + // Text area +document.querySelectorAll('textarea').forEach(textarea => textarea.style.backgroundColor = `#${inputBackground}`); +document.querySelectorAll('textarea').forEach(textarea => textarea.style.color = `#${inputText}`); +document.querySelectorAll('textarea').forEach(textarea => textarea.style.borderColor = `#${inputBorderColor}`); diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..73b0d50 --- /dev/null +++ b/manifest.json @@ -0,0 +1,22 @@ +{ + "manifest_version": 2, + "name": "themedweb", + "version": "1.0", + + "description": "Loads custom colours into css from a config file", + + "icons": { + "48": "icons/logo-48.png" + }, + + "content_scripts": [ + { + "matches": [""], + "js": ["theme.js","main.js"] + } + ], + "permissions": [ + "activeTab", "storage" + ] +} + diff --git a/theme.js b/theme.js new file mode 100644 index 0000000..4267a92 --- /dev/null +++ b/theme.js @@ -0,0 +1,32 @@ +// Colors +let GRAY="93a1a1"; +let DARK_GRAY="586e75"; +let RED="dc322f"; +let DARK_RED="cb4b16"; +let GREEN="859900"; +let DARK_GREEN="859900"; +let YELLOW="b58900"; +let DARK_YELLOW="b58900"; +let BLUE="268bd2"; +let DARK_BLUE="268bd2"; +let PURPLE="6c71c4"; +let DARK_PURPLE="d33682"; +let CYAN="2aa198"; +let DARK_CYAN="2aa198"; +let BG = "073642" +let FG="fdf6e3"; + +let backgroundColor=BG; +let foregroundColor=FG; + +let linkText=BLUE; +let linkTextHover=CYAN; +let linkTextActive=RED; + +let buttonText=FG; +let buttonBackground=BG; +let buttonBorderColor=FG; + +let inputText=FG; +let inputBackground=BG; +let inputBorderColor=FG;