Compare commits

...

18 Commits
1.1.0 ... main

Author SHA1 Message Date
Jean Viscogliosi-Pate fdcce37656 Add color update on install to background.js, tweak recent changes 2025-06-29 14:10:49 -07:00
Jean Viscogliosi-Pate 5dafbbc59c Add theme-and-state-adaptive icons, fixes #29 2025-06-29 13:10:54 -07:00
Jean Viscogliosi-Pate c36d9e9996 Add theme preview images 2025-06-29 13:09:03 -07:00
Jean Viscogliosi-Pate 7f7a0d4b68 Simplify process for getting tab URL 2025-06-29 13:07:39 -07:00
Jean Viscogliosi-Pate 135697a544 Update icons 2025-06-29 13:03:19 -07:00
Jean Viscogliosi-Pate cae5d95be0 Update build process to differ between Firefox and Chrome 2025-06-29 12:58:08 -07:00
Jean Viscogliosi-Pate 1cacf903dc Remake cut feature to be simpler to use and avoid bugs, fixes #35 2025-06-27 20:29:04 -07:00
Jean Viscogliosi-Pate 856240d944 Updating exc to support exceptions for all three point-of-views, fixes #33 2025-06-26 23:08:17 -07:00
Jean Viscogliosi-Pate 2a50830c7f Updating cut to support more configurations, fixes #34 2025-06-26 22:01:20 -07:00
Jean Viscogliosi-Pate 37dcd37e04 Adding mirror feature, resolves #31 2025-06-26 19:11:12 -07:00
Jean Viscogliosi-Pate 94b04337be Adding capitalization feature, resolves #30 2025-06-26 18:55:35 -07:00
Jean Viscogliosi-Pate 0f716a4332 Updating dependencies 2025-06-26 18:54:54 -07:00
Jean Viscogliosi-Pate 0a906d8432 Undo incrementing version number before release 2025-02-22 17:28:36 -08:00
Jean Viscogliosi-Pate eb660f3a3d Fixing using variables before initialization in popup script 2025-02-22 17:27:55 -08:00
Jean Viscogliosi-Pate 1c022e5180 Fixing second-person verb misconjugation due to missing breaks in switch statement 2025-02-22 17:21:01 -08:00
Jean Viscogliosi-Pate cb1302c6f6 Updating version to commemorate Google Chrome release 2025-02-22 16:19:51 -08:00
Jean Viscogliosi-Pate 30f76620c2 Adding Google Chrome support 2025-02-22 15:37:26 -08:00
Jean Viscogliosi-Pate 167da7c263 Updating manifest to version 3 2025-02-22 13:52:39 -08:00
62 changed files with 1267 additions and 977 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
node_modules
src/content-script.js
src/popup.js
dist

View File

@ -19,8 +19,11 @@ MetamorPOV includes Node packages for verb conjugation. You'll need [Node](https
# Install project dependencies
npm install
# Generate a .zip that can be loaded in a browser
# Generate a .zip that can be loaded in Firefox
npm run build
# Generate a .zip that can be loaded in Chromium-based browsers
npm run build-chrome
```
### Testing
@ -35,6 +38,13 @@ npm run test
npx rollup -c
```
To test for Chrome, you will need to have Chromium installed.
```sh
# Open a browser instance, you will need to go to chrome://extensions and open the source folder manually
npm run test-chrome
```
## Copyright and License
- Portions of MetamorPOV are derived from [InteractiveFics](https://github.com/interactivefics/interactive-fics), licensed under [MIT](third-party-licenses/LICENSE-InteractiveFics), copyrighted 2015-2023 by Mariam Maarouf.

BIN
dark-theme.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 KiB

View File

@ -14,6 +14,8 @@
default = pkgs.mkShell {
buildInputs = [
pkgs.nodejs_22
pkgs.firefox
pkgs.chromium
];
};
});

View File

@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
viewBox="0 0 512 512"
width="32"
height="32"
version="1.1"
id="svg1"
sodipodi:docname="icon-dark-state-disabled.svg"
inkscape:version="1.4 (e7c3feb100, 2024-10-09)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs1">
<linearGradient
id="linearGradient11"
inkscape:collect="always">
<stop
style="stop-color:#df443a;stop-opacity:1;"
offset="0"
id="stop12" />
<stop
style="stop-color:#df4439;stop-opacity:1;"
offset="0.45122612"
id="stop13" />
<stop
style="stop-color:#ba342c;stop-opacity:1;"
offset="1"
id="stop11" />
</linearGradient>
<linearGradient
id="linearGradient1"
inkscape:swatch="gradient">
<stop
style="stop-color:#27983a;stop-opacity:1;"
offset="0"
id="stop1" />
<stop
style="stop-color:#27983a;stop-opacity:0;"
offset="1"
id="stop2" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient11"
id="linearGradient12"
x1="256"
y1="4.7133198"
x2="256"
y2="516.71332"
gradientUnits="userSpaceOnUse" />
</defs>
<sodipodi:namedview
id="namedview1"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:zoom="14.230524"
inkscape:cx="15.143504"
inkscape:cy="10.435315"
inkscape:window-width="1277"
inkscape:window-height="864"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="0"
inkscape:current-layer="svg1" />
<path
id="path11"
style="fill:#df443a;fill-opacity:1;stroke:url(#linearGradient12);stroke-width:15.5153;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
d="m 215.22028,38.871995 c -4.34372,0.303826 -8.65502,1.096343 -12.79663,2.448948 -5.93985,1.922995 -11.53239,4.920956 -16.41582,8.811486 -1.76365,1.417918 -3.46026,2.919246 -5.01704,4.56358 -14.636,-3.798687 -29.75685,-5.860967 -44.88746,-5.742441 -14.68272,0.379878 -29.51967,2.710272 -43.033824,8.664817 -10.977835,4.822375 -20.961579,12.233426 -28.009521,22.005037 -7.050461,9.664813 -10.992922,21.550288 -11.066377,33.516658 -0.169287,14.92345 5.535781,29.70673 15.271568,40.96315 4.373745,5.08863 9.549047,9.48723 15.279627,12.97831 0.542441,5.29028 1.667985,10.52221 3.376926,15.55886 -23.221327,10.97251 -43.33471,28.4246 -57.436944,49.89292 -12.70417,19.22237 -20.483342,41.67752 -22.2863846,64.65411 -1.5554936,19.84165 0.9781838,40.10268 8.1825416,58.70009 6.210988,16.16091 15.894545,30.87732 27.739004,43.46312 16.487951,17.57083 36.752681,31.11853 57.877414,42.47694 0.75168,0.43906 1.59701,0.77511 2.29306,1.27388 2.86679,4.6313 5.37096,9.48946 8.52384,13.94228 5.45956,7.92277 12.65714,14.75439 21.2551,19.16193 9.6394,5.0174 20.71523,6.96599 31.51599,6.28795 10.90179,-0.83701 21.2892,-4.91931 30.77723,-10.18133 12.4166,-6.93812 23.56256,-15.98376 33.58249,-26.03914 9.96279,-10.0289 18.79496,-21.17022 26.39113,-33.0889 10.87699,16.91934 24.18793,32.34401 39.74938,45.12077 10.00713,8.14757 20.97471,15.31593 33.06537,19.95959 7.93816,3.03334 16.45952,4.79051 24.9827,4.29735 10.21404,-0.42126 20.38768,-3.4272 28.9131,-9.13093 7.64187,-5.02101 13.76108,-12.06794 18.51752,-19.82113 2.18351,-3.46929 4.05021,-7.12613 6.22223,-10.6015 19.47332,-10.29917 38.22477,-22.35497 54.16907,-37.65945 12.90338,-12.36533 23.80556,-26.96729 31.10415,-43.32695 7.42472,-16.45569 11.06132,-34.51755 11.17414,-52.54357 0.26042,-23.29706 -5.49528,-46.63235 -16.59853,-67.11795 -11.57326,-21.48158 -28.90977,-39.80528 -49.69952,-52.57602 -4.32446,-2.66803 -8.80214,-5.08501 -13.38779,-7.27285 1.71297,-5.08008 2.82802,-10.35954 3.34284,-15.69522 13.91733,-8.58279 24.37005,-22.65677 28.36297,-38.53166 3.18363,-12.38154 2.28224,-25.81377 -2.79783,-37.567954 C 448.76107,79.66973 440.5163,70.303487 430.53327,63.714302 419.01053,56.051725 405.46698,51.925294 391.83504,50.11818 c -7.83832,-1.029924 -15.76743,-1.426209 -23.66581,-1.013174 -12.38775,0.548433 -24.70857,2.456562 -36.70542,5.583427 -1.54528,-1.866107 -3.52301,-3.287056 -5.31823,-4.89588 -2.23763,-1.449855 -4.41243,-3.00815 -6.6898,-4.389415 -2.08719,-1.000821 -4.08801,-2.204635 -6.31907,-2.867257 -2.34646,-0.768464 -4.61216,-1.818471 -7.05535,-2.249609 -1.7561,-0.398382 -3.50633,-0.834055 -5.3136,-0.907448 -2.46607,-0.17371 -4.92244,-0.640087 -7.40012,-0.463166 -1.80034,0.04161 -3.60407,0.04563 -5.3749,0.414583 -2.43413,0.432272 -4.93022,0.578062 -7.29011,1.353554 -1.73521,0.47884 -3.48277,0.922329 -5.10986,1.710803 -2.25278,1.010618 -4.63539,1.758472 -6.73261,3.083917 -1.56702,0.887219 -3.15474,1.742947 -4.54121,2.904546 -1.94148,1.531076 -4.07302,2.83879 -5.78679,4.637466 -0.8085,0.794753 -1.6512,1.558226 -2.43839,2.372458 -6.54832,-7.042367 -15.07389,-12.223504 -24.35195,-14.760401 -4.45885,-1.22347 -9.08035,-1.881211 -13.70735,-1.838619 -0.93882,-0.03679 -1.87608,0.05046 -2.81419,0.07803 z"
inkscape:label="behind" />
<path
d="m 217.5,62.992572 a 21.875,21.875 0 0 0 -21.875,24.5 c -20.125,-9.625 -42.875,-14 -62.125,-14 -77,1.75 -59.5,66.499998 -21,67.374998 -4.375,20.125 -1.75,37.625 23.625,56.875 -57.75,4.375 -104.125,52.5 -104.125,111.125 0,55.125 37.625,87.5 84.875,112 15.75,8.75 14,35.875 42,35.875 27.125,0 98,-59.5 97.125,-148.75 0,89.25 70.875,148.75 98,148.75 27.125,0 25.375,-27.125 41.125,-35.875 47.25,-24.5 84.875,-56.875 84.875,-112 0,-58.625 -45.5,-106.75 -103.25,-111.125 24.5,-19.25 28,-36.75 22.75,-56.875 38.5,-0.875 56,-65.624998 -20.125,-67.374998 -20.125,0 -42,4.375 -63,14 l 0.875,-2.625 a 21.875,21.875 0 1 0 -28,20.999998 c -17.5,14.875 -30.625,36.75 -33.25,64.75 -1.75,-28 -14.875,-49.875 -33.25,-64.75 A 21.875,21.875 0 0 0 217.5,62.992572 Z m -77,174.999998 a 70,70 0 1 1 0,140 70,70 0 0 1 0,-140 z m 231,0 a 70,70 0 1 1 0,140 70,70 0 0 1 0,-140 z m -236.25,44.625 a 27.125,27.125 0 1 0 0,54.25 27.125,27.125 0 0 0 0,-54.25 z m 241.5,0 a 27.125,27.125 0 1 0 0,54.25 27.125,27.125 0 0 0 0,-54.25 z"
style="display:inline;fill:#ebd9c7;stroke:none;stroke-width:16;stroke-linecap:butt;stroke-linejoin:round;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke fill markers;fill-opacity:1"
id="path1" />
</svg>

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
viewBox="0 0 512 512"
width="32"
height="32"
version="1.1"
id="svg1"
sodipodi:docname="icon-dark-state-enabled.svg"
inkscape:version="1.4 (e7c3feb100, 2024-10-09)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs1">
<linearGradient
id="linearGradient11"
inkscape:collect="always">
<stop
style="stop-color:#108453;stop-opacity:1;"
offset="0"
id="stop12" />
<stop
style="stop-color:#108453;stop-opacity:1;"
offset="0.45122612"
id="stop13" />
<stop
style="stop-color:#105136;stop-opacity:1;"
offset="1"
id="stop11" />
</linearGradient>
<linearGradient
id="linearGradient1"
inkscape:swatch="gradient">
<stop
style="stop-color:#27983a;stop-opacity:1;"
offset="0"
id="stop1" />
<stop
style="stop-color:#27983a;stop-opacity:0;"
offset="1"
id="stop2" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient11"
id="linearGradient12"
x1="256"
y1="4.7133198"
x2="256"
y2="516.71332"
gradientUnits="userSpaceOnUse" />
</defs>
<sodipodi:namedview
id="namedview1"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:zoom="14.230524"
inkscape:cx="15.143504"
inkscape:cy="10.435315"
inkscape:window-width="1277"
inkscape:window-height="864"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="0"
inkscape:current-layer="svg1" />
<path
id="path11"
style="fill:#108453;fill-opacity:1;stroke:url(#linearGradient12);stroke-width:15.5153;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
d="m 215.22028,38.871995 c -4.34372,0.303826 -8.65502,1.096343 -12.79663,2.448948 -5.93985,1.922995 -11.53239,4.920956 -16.41582,8.811486 -1.76365,1.417918 -3.46026,2.919246 -5.01704,4.56358 -14.636,-3.798687 -29.75685,-5.860967 -44.88746,-5.742441 -14.68272,0.379878 -29.51967,2.710272 -43.033824,8.664817 -10.977835,4.822375 -20.961579,12.233426 -28.009521,22.005037 -7.050461,9.664813 -10.992922,21.550288 -11.066377,33.516658 -0.169287,14.92345 5.535781,29.70673 15.271568,40.96315 4.373745,5.08863 9.549047,9.48723 15.279627,12.97831 0.542441,5.29028 1.667985,10.52221 3.376926,15.55886 -23.221327,10.97251 -43.33471,28.4246 -57.436944,49.89292 -12.70417,19.22237 -20.483342,41.67752 -22.2863846,64.65411 -1.5554936,19.84165 0.9781838,40.10268 8.1825416,58.70009 6.210988,16.16091 15.894545,30.87732 27.739004,43.46312 16.487951,17.57083 36.752681,31.11853 57.877414,42.47694 0.75168,0.43906 1.59701,0.77511 2.29306,1.27388 2.86679,4.6313 5.37096,9.48946 8.52384,13.94228 5.45956,7.92277 12.65714,14.75439 21.2551,19.16193 9.6394,5.0174 20.71523,6.96599 31.51599,6.28795 10.90179,-0.83701 21.2892,-4.91931 30.77723,-10.18133 12.4166,-6.93812 23.56256,-15.98376 33.58249,-26.03914 9.96279,-10.0289 18.79496,-21.17022 26.39113,-33.0889 10.87699,16.91934 24.18793,32.34401 39.74938,45.12077 10.00713,8.14757 20.97471,15.31593 33.06537,19.95959 7.93816,3.03334 16.45952,4.79051 24.9827,4.29735 10.21404,-0.42126 20.38768,-3.4272 28.9131,-9.13093 7.64187,-5.02101 13.76108,-12.06794 18.51752,-19.82113 2.18351,-3.46929 4.05021,-7.12613 6.22223,-10.6015 19.47332,-10.29917 38.22477,-22.35497 54.16907,-37.65945 12.90338,-12.36533 23.80556,-26.96729 31.10415,-43.32695 7.42472,-16.45569 11.06132,-34.51755 11.17414,-52.54357 0.26042,-23.29706 -5.49528,-46.63235 -16.59853,-67.11795 -11.57326,-21.48158 -28.90977,-39.80528 -49.69952,-52.57602 -4.32446,-2.66803 -8.80214,-5.08501 -13.38779,-7.27285 1.71297,-5.08008 2.82802,-10.35954 3.34284,-15.69522 13.91733,-8.58279 24.37005,-22.65677 28.36297,-38.53166 3.18363,-12.38154 2.28224,-25.81377 -2.79783,-37.567954 C 448.76107,79.66973 440.5163,70.303487 430.53327,63.714302 419.01053,56.051725 405.46698,51.925294 391.83504,50.11818 c -7.83832,-1.029924 -15.76743,-1.426209 -23.66581,-1.013174 -12.38775,0.548433 -24.70857,2.456562 -36.70542,5.583427 -1.54528,-1.866107 -3.52301,-3.287056 -5.31823,-4.89588 -2.23763,-1.449855 -4.41243,-3.00815 -6.6898,-4.389415 -2.08719,-1.000821 -4.08801,-2.204635 -6.31907,-2.867257 -2.34646,-0.768464 -4.61216,-1.818471 -7.05535,-2.249609 -1.7561,-0.398382 -3.50633,-0.834055 -5.3136,-0.907448 -2.46607,-0.17371 -4.92244,-0.640087 -7.40012,-0.463166 -1.80034,0.04161 -3.60407,0.04563 -5.3749,0.414583 -2.43413,0.432272 -4.93022,0.578062 -7.29011,1.353554 -1.73521,0.47884 -3.48277,0.922329 -5.10986,1.710803 -2.25278,1.010618 -4.63539,1.758472 -6.73261,3.083917 -1.56702,0.887219 -3.15474,1.742947 -4.54121,2.904546 -1.94148,1.531076 -4.07302,2.83879 -5.78679,4.637466 -0.8085,0.794753 -1.6512,1.558226 -2.43839,2.372458 -6.54832,-7.042367 -15.07389,-12.223504 -24.35195,-14.760401 -4.45885,-1.22347 -9.08035,-1.881211 -13.70735,-1.838619 -0.93882,-0.03679 -1.87608,0.05046 -2.81419,0.07803 z"
inkscape:label="behind" />
<path
d="m 217.5,62.992572 a 21.875,21.875 0 0 0 -21.875,24.5 c -20.125,-9.625 -42.875,-14 -62.125,-14 -77,1.75 -59.5,66.499998 -21,67.374998 -4.375,20.125 -1.75,37.625 23.625,56.875 -57.75,4.375 -104.125,52.5 -104.125,111.125 0,55.125 37.625,87.5 84.875,112 15.75,8.75 14,35.875 42,35.875 27.125,0 98,-59.5 97.125,-148.75 0,89.25 70.875,148.75 98,148.75 27.125,0 25.375,-27.125 41.125,-35.875 47.25,-24.5 84.875,-56.875 84.875,-112 0,-58.625 -45.5,-106.75 -103.25,-111.125 24.5,-19.25 28,-36.75 22.75,-56.875 38.5,-0.875 56,-65.624998 -20.125,-67.374998 -20.125,0 -42,4.375 -63,14 l 0.875,-2.625 a 21.875,21.875 0 1 0 -28,20.999998 c -17.5,14.875 -30.625,36.75 -33.25,64.75 -1.75,-28 -14.875,-49.875 -33.25,-64.75 A 21.875,21.875 0 0 0 217.5,62.992572 Z m -77,174.999998 a 70,70 0 1 1 0,140 70,70 0 0 1 0,-140 z m 231,0 a 70,70 0 1 1 0,140 70,70 0 0 1 0,-140 z m -236.25,44.625 a 27.125,27.125 0 1 0 0,54.25 27.125,27.125 0 0 0 0,-54.25 z m 241.5,0 a 27.125,27.125 0 1 0 0,54.25 27.125,27.125 0 0 0 0,-54.25 z"
style="display:inline;fill:#ebd9c7;stroke:none;stroke-width:16;stroke-linecap:butt;stroke-linejoin:round;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke fill markers;fill-opacity:1"
id="path1" />
</svg>

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
viewBox="0 0 512 512"
width="32"
height="32"
version="1.1"
id="svg1"
sodipodi:docname="icon-dark-state-invalid.svg"
inkscape:version="1.4 (e7c3feb100, 2024-10-09)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs1">
<linearGradient
id="linearGradient11"
inkscape:collect="always">
<stop
style="stop-color:#51402f;stop-opacity:1;"
offset="0"
id="stop12" />
<stop
style="stop-color:#51402f;stop-opacity:1;"
offset="0.45122612"
id="stop13" />
<stop
style="stop-color:#2d2620;stop-opacity:1;"
offset="1"
id="stop11" />
</linearGradient>
<linearGradient
id="linearGradient1"
inkscape:swatch="gradient">
<stop
style="stop-color:#27983a;stop-opacity:1;"
offset="0"
id="stop1" />
<stop
style="stop-color:#27983a;stop-opacity:0;"
offset="1"
id="stop2" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient11"
id="linearGradient12"
x1="256"
y1="4.7133198"
x2="256"
y2="516.71332"
gradientUnits="userSpaceOnUse" />
</defs>
<sodipodi:namedview
id="namedview1"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:zoom="14.230524"
inkscape:cx="15.108368"
inkscape:cy="10.435315"
inkscape:window-width="1277"
inkscape:window-height="876"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="0"
inkscape:current-layer="svg1" />
<path
id="path11"
style="fill:#51402f;fill-opacity:1;stroke:url(#linearGradient12);stroke-width:15.5153;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
d="m 215.22028,38.871995 c -4.34372,0.303826 -8.65502,1.096343 -12.79663,2.448948 -5.93985,1.922995 -11.53239,4.920956 -16.41582,8.811486 -1.76365,1.417918 -3.46026,2.919246 -5.01704,4.56358 -14.636,-3.798687 -29.75685,-5.860967 -44.88746,-5.742441 -14.68272,0.379878 -29.51967,2.710272 -43.033824,8.664817 -10.977835,4.822375 -20.961579,12.233426 -28.009521,22.005037 -7.050461,9.664813 -10.992922,21.550288 -11.066377,33.516658 -0.169287,14.92345 5.535781,29.70673 15.271568,40.96315 4.373745,5.08863 9.549047,9.48723 15.279627,12.97831 0.542441,5.29028 1.667985,10.52221 3.376926,15.55886 -23.221327,10.97251 -43.33471,28.4246 -57.436944,49.89292 -12.70417,19.22237 -20.483342,41.67752 -22.2863846,64.65411 -1.5554936,19.84165 0.9781838,40.10268 8.1825416,58.70009 6.210988,16.16091 15.894545,30.87732 27.739004,43.46312 16.487951,17.57083 36.752681,31.11853 57.877414,42.47694 0.75168,0.43906 1.59701,0.77511 2.29306,1.27388 2.86679,4.6313 5.37096,9.48946 8.52384,13.94228 5.45956,7.92277 12.65714,14.75439 21.2551,19.16193 9.6394,5.0174 20.71523,6.96599 31.51599,6.28795 10.90179,-0.83701 21.2892,-4.91931 30.77723,-10.18133 12.4166,-6.93812 23.56256,-15.98376 33.58249,-26.03914 9.96279,-10.0289 18.79496,-21.17022 26.39113,-33.0889 10.87699,16.91934 24.18793,32.34401 39.74938,45.12077 10.00713,8.14757 20.97471,15.31593 33.06537,19.95959 7.93816,3.03334 16.45952,4.79051 24.9827,4.29735 10.21404,-0.42126 20.38768,-3.4272 28.9131,-9.13093 7.64187,-5.02101 13.76108,-12.06794 18.51752,-19.82113 2.18351,-3.46929 4.05021,-7.12613 6.22223,-10.6015 19.47332,-10.29917 38.22477,-22.35497 54.16907,-37.65945 12.90338,-12.36533 23.80556,-26.96729 31.10415,-43.32695 7.42472,-16.45569 11.06132,-34.51755 11.17414,-52.54357 0.26042,-23.29706 -5.49528,-46.63235 -16.59853,-67.11795 -11.57326,-21.48158 -28.90977,-39.80528 -49.69952,-52.57602 -4.32446,-2.66803 -8.80214,-5.08501 -13.38779,-7.27285 1.71297,-5.08008 2.82802,-10.35954 3.34284,-15.69522 13.91733,-8.58279 24.37005,-22.65677 28.36297,-38.53166 3.18363,-12.38154 2.28224,-25.81377 -2.79783,-37.567954 C 448.76107,79.66973 440.5163,70.303487 430.53327,63.714302 419.01053,56.051725 405.46698,51.925294 391.83504,50.11818 c -7.83832,-1.029924 -15.76743,-1.426209 -23.66581,-1.013174 -12.38775,0.548433 -24.70857,2.456562 -36.70542,5.583427 -1.54528,-1.866107 -3.52301,-3.287056 -5.31823,-4.89588 -2.23763,-1.449855 -4.41243,-3.00815 -6.6898,-4.389415 -2.08719,-1.000821 -4.08801,-2.204635 -6.31907,-2.867257 -2.34646,-0.768464 -4.61216,-1.818471 -7.05535,-2.249609 -1.7561,-0.398382 -3.50633,-0.834055 -5.3136,-0.907448 -2.46607,-0.17371 -4.92244,-0.640087 -7.40012,-0.463166 -1.80034,0.04161 -3.60407,0.04563 -5.3749,0.414583 -2.43413,0.432272 -4.93022,0.578062 -7.29011,1.353554 -1.73521,0.47884 -3.48277,0.922329 -5.10986,1.710803 -2.25278,1.010618 -4.63539,1.758472 -6.73261,3.083917 -1.56702,0.887219 -3.15474,1.742947 -4.54121,2.904546 -1.94148,1.531076 -4.07302,2.83879 -5.78679,4.637466 -0.8085,0.794753 -1.6512,1.558226 -2.43839,2.372458 -6.54832,-7.042367 -15.07389,-12.223504 -24.35195,-14.760401 -4.45885,-1.22347 -9.08035,-1.881211 -13.70735,-1.838619 -0.93882,-0.03679 -1.87608,0.05046 -2.81419,0.07803 z"
inkscape:label="behind" />
<path
d="m 217.5,62.992572 a 21.875,21.875 0 0 0 -21.875,24.5 c -20.125,-9.625 -42.875,-14 -62.125,-14 -77,1.75 -59.5,66.499998 -21,67.374998 -4.375,20.125 -1.75,37.625 23.625,56.875 -57.75,4.375 -104.125,52.5 -104.125,111.125 0,55.125 37.625,87.5 84.875,112 15.75,8.75 14,35.875 42,35.875 27.125,0 98,-59.5 97.125,-148.75 0,89.25 70.875,148.75 98,148.75 27.125,0 25.375,-27.125 41.125,-35.875 47.25,-24.5 84.875,-56.875 84.875,-112 0,-58.625 -45.5,-106.75 -103.25,-111.125 24.5,-19.25 28,-36.75 22.75,-56.875 38.5,-0.875 56,-65.624998 -20.125,-67.374998 -20.125,0 -42,4.375 -63,14 l 0.875,-2.625 a 21.875,21.875 0 1 0 -28,20.999998 c -17.5,14.875 -30.625,36.75 -33.25,64.75 -1.75,-28 -14.875,-49.875 -33.25,-64.75 A 21.875,21.875 0 0 0 217.5,62.992572 Z m -77,174.999998 a 70,70 0 1 1 0,140 70,70 0 0 1 0,-140 z m 231,0 a 70,70 0 1 1 0,140 70,70 0 0 1 0,-140 z m -236.25,44.625 a 27.125,27.125 0 1 0 0,54.25 27.125,27.125 0 0 0 0,-54.25 z m 241.5,0 a 27.125,27.125 0 1 0 0,54.25 27.125,27.125 0 0 0 0,-54.25 z"
style="display:inline;fill:#ebd9c7;stroke:none;stroke-width:16;stroke-linecap:butt;stroke-linejoin:round;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke fill markers;fill-opacity:1"
id="path1" />
</svg>

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
viewBox="0 0 512 512"
width="32"
height="32"
version="1.1"
id="svg1"
sodipodi:docname="icon-light-state-disabled.svg"
inkscape:version="1.4 (e7c3feb100, 2024-10-09)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs1">
<linearGradient
id="linearGradient11"
inkscape:collect="always">
<stop
style="stop-color:#df4439;stop-opacity:1;"
offset="0"
id="stop12" />
<stop
style="stop-color:#df4439;stop-opacity:1;"
offset="0.45122612"
id="stop13" />
<stop
style="stop-color:#ba352c;stop-opacity:1;"
offset="1"
id="stop11" />
</linearGradient>
<linearGradient
id="linearGradient1"
inkscape:swatch="gradient">
<stop
style="stop-color:#27983a;stop-opacity:1;"
offset="0"
id="stop1" />
<stop
style="stop-color:#27983a;stop-opacity:0;"
offset="1"
id="stop2" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient11"
id="linearGradient12"
x1="256"
y1="4.7133198"
x2="256"
y2="516.71332"
gradientUnits="userSpaceOnUse" />
</defs>
<sodipodi:namedview
id="namedview1"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:zoom="14.230524"
inkscape:cx="15.143504"
inkscape:cy="10.435315"
inkscape:window-width="1277"
inkscape:window-height="864"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="0"
inkscape:current-layer="svg1" />
<path
id="path11"
style="fill:#df4439;fill-opacity:1;stroke:url(#linearGradient12);stroke-width:15.5153;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
d="m 215.22028,38.871995 c -4.34372,0.303826 -8.65502,1.096343 -12.79663,2.448948 -5.93985,1.922995 -11.53239,4.920956 -16.41582,8.811486 -1.76365,1.417918 -3.46026,2.919246 -5.01704,4.56358 -14.636,-3.798687 -29.75685,-5.860967 -44.88746,-5.742441 -14.68272,0.379878 -29.51967,2.710272 -43.033824,8.664817 -10.977835,4.822375 -20.961579,12.233426 -28.009521,22.005037 -7.050461,9.664813 -10.992922,21.550288 -11.066377,33.516658 -0.169287,14.92345 5.535781,29.70673 15.271568,40.96315 4.373745,5.08863 9.549047,9.48723 15.279627,12.97831 0.542441,5.29028 1.667985,10.52221 3.376926,15.55886 -23.221327,10.97251 -43.33471,28.4246 -57.436944,49.89292 -12.70417,19.22237 -20.483342,41.67752 -22.2863846,64.65411 -1.5554936,19.84165 0.9781838,40.10268 8.1825416,58.70009 6.210988,16.16091 15.894545,30.87732 27.739004,43.46312 16.487951,17.57083 36.752681,31.11853 57.877414,42.47694 0.75168,0.43906 1.59701,0.77511 2.29306,1.27388 2.86679,4.6313 5.37096,9.48946 8.52384,13.94228 5.45956,7.92277 12.65714,14.75439 21.2551,19.16193 9.6394,5.0174 20.71523,6.96599 31.51599,6.28795 10.90179,-0.83701 21.2892,-4.91931 30.77723,-10.18133 12.4166,-6.93812 23.56256,-15.98376 33.58249,-26.03914 9.96279,-10.0289 18.79496,-21.17022 26.39113,-33.0889 10.87699,16.91934 24.18793,32.34401 39.74938,45.12077 10.00713,8.14757 20.97471,15.31593 33.06537,19.95959 7.93816,3.03334 16.45952,4.79051 24.9827,4.29735 10.21404,-0.42126 20.38768,-3.4272 28.9131,-9.13093 7.64187,-5.02101 13.76108,-12.06794 18.51752,-19.82113 2.18351,-3.46929 4.05021,-7.12613 6.22223,-10.6015 19.47332,-10.29917 38.22477,-22.35497 54.16907,-37.65945 12.90338,-12.36533 23.80556,-26.96729 31.10415,-43.32695 7.42472,-16.45569 11.06132,-34.51755 11.17414,-52.54357 0.26042,-23.29706 -5.49528,-46.63235 -16.59853,-67.11795 -11.57326,-21.48158 -28.90977,-39.80528 -49.69952,-52.57602 -4.32446,-2.66803 -8.80214,-5.08501 -13.38779,-7.27285 1.71297,-5.08008 2.82802,-10.35954 3.34284,-15.69522 13.91733,-8.58279 24.37005,-22.65677 28.36297,-38.53166 3.18363,-12.38154 2.28224,-25.81377 -2.79783,-37.567954 C 448.76107,79.66973 440.5163,70.303487 430.53327,63.714302 419.01053,56.051725 405.46698,51.925294 391.83504,50.11818 c -7.83832,-1.029924 -15.76743,-1.426209 -23.66581,-1.013174 -12.38775,0.548433 -24.70857,2.456562 -36.70542,5.583427 -1.54528,-1.866107 -3.52301,-3.287056 -5.31823,-4.89588 -2.23763,-1.449855 -4.41243,-3.00815 -6.6898,-4.389415 -2.08719,-1.000821 -4.08801,-2.204635 -6.31907,-2.867257 -2.34646,-0.768464 -4.61216,-1.818471 -7.05535,-2.249609 -1.7561,-0.398382 -3.50633,-0.834055 -5.3136,-0.907448 -2.46607,-0.17371 -4.92244,-0.640087 -7.40012,-0.463166 -1.80034,0.04161 -3.60407,0.04563 -5.3749,0.414583 -2.43413,0.432272 -4.93022,0.578062 -7.29011,1.353554 -1.73521,0.47884 -3.48277,0.922329 -5.10986,1.710803 -2.25278,1.010618 -4.63539,1.758472 -6.73261,3.083917 -1.56702,0.887219 -3.15474,1.742947 -4.54121,2.904546 -1.94148,1.531076 -4.07302,2.83879 -5.78679,4.637466 -0.8085,0.794753 -1.6512,1.558226 -2.43839,2.372458 -6.54832,-7.042367 -15.07389,-12.223504 -24.35195,-14.760401 -4.45885,-1.22347 -9.08035,-1.881211 -13.70735,-1.838619 -0.93882,-0.03679 -1.87608,0.05046 -2.81419,0.07803 z"
inkscape:label="behind" />
<path
d="m 217.5,62.992572 a 21.875,21.875 0 0 0 -21.875,24.5 c -20.125,-9.625 -42.875,-14 -62.125,-14 -77,1.75 -59.5,66.499998 -21,67.374998 -4.375,20.125 -1.75,37.625 23.625,56.875 -57.75,4.375 -104.125,52.5 -104.125,111.125 0,55.125 37.625,87.5 84.875,112 15.75,8.75 14,35.875 42,35.875 27.125,0 98,-59.5 97.125,-148.75 0,89.25 70.875,148.75 98,148.75 27.125,0 25.375,-27.125 41.125,-35.875 47.25,-24.5 84.875,-56.875 84.875,-112 0,-58.625 -45.5,-106.75 -103.25,-111.125 24.5,-19.25 28,-36.75 22.75,-56.875 38.5,-0.875 56,-65.624998 -20.125,-67.374998 -20.125,0 -42,4.375 -63,14 l 0.875,-2.625 a 21.875,21.875 0 1 0 -28,20.999998 c -17.5,14.875 -30.625,36.75 -33.25,64.75 -1.75,-28 -14.875,-49.875 -33.25,-64.75 A 21.875,21.875 0 0 0 217.5,62.992572 Z m -77,174.999998 a 70,70 0 1 1 0,140 70,70 0 0 1 0,-140 z m 231,0 a 70,70 0 1 1 0,140 70,70 0 0 1 0,-140 z m -236.25,44.625 a 27.125,27.125 0 1 0 0,54.25 27.125,27.125 0 0 0 0,-54.25 z m 241.5,0 a 27.125,27.125 0 1 0 0,54.25 27.125,27.125 0 0 0 0,-54.25 z"
style="display:inline;fill:#fcfaf8;stroke:none;stroke-width:16;stroke-linecap:butt;stroke-linejoin:round;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke fill markers;fill-opacity:1"
id="path1" />
</svg>

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
viewBox="0 0 512 512"
width="32"
height="32"
version="1.1"
id="svg1"
sodipodi:docname="icon-light-state-enabled.svg"
inkscape:version="1.4 (e7c3feb100, 2024-10-09)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs1">
<linearGradient
id="linearGradient11"
inkscape:collect="always">
<stop
style="stop-color:#3eb275;stop-opacity:1;"
offset="0"
id="stop12" />
<stop
style="stop-color:#3eb275;stop-opacity:1;"
offset="0.45122612"
id="stop13" />
<stop
style="stop-color:#3a835d;stop-opacity:1;"
offset="1"
id="stop11" />
</linearGradient>
<linearGradient
id="linearGradient1"
inkscape:swatch="gradient">
<stop
style="stop-color:#27983a;stop-opacity:1;"
offset="0"
id="stop1" />
<stop
style="stop-color:#27983a;stop-opacity:0;"
offset="1"
id="stop2" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient11"
id="linearGradient12"
x1="256"
y1="4.7133198"
x2="256"
y2="516.71332"
gradientUnits="userSpaceOnUse" />
</defs>
<sodipodi:namedview
id="namedview1"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:zoom="14.230524"
inkscape:cx="15.143504"
inkscape:cy="10.435315"
inkscape:window-width="1277"
inkscape:window-height="864"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="0"
inkscape:current-layer="svg1" />
<path
id="path11"
style="fill:#3eb275;fill-opacity:1;stroke:url(#linearGradient12);stroke-width:15.5153;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
d="m 215.22028,38.871995 c -4.34372,0.303826 -8.65502,1.096343 -12.79663,2.448948 -5.93985,1.922995 -11.53239,4.920956 -16.41582,8.811486 -1.76365,1.417918 -3.46026,2.919246 -5.01704,4.56358 -14.636,-3.798687 -29.75685,-5.860967 -44.88746,-5.742441 -14.68272,0.379878 -29.51967,2.710272 -43.033824,8.664817 -10.977835,4.822375 -20.961579,12.233426 -28.009521,22.005037 -7.050461,9.664813 -10.992922,21.550288 -11.066377,33.516658 -0.169287,14.92345 5.535781,29.70673 15.271568,40.96315 4.373745,5.08863 9.549047,9.48723 15.279627,12.97831 0.542441,5.29028 1.667985,10.52221 3.376926,15.55886 -23.221327,10.97251 -43.33471,28.4246 -57.436944,49.89292 -12.70417,19.22237 -20.483342,41.67752 -22.2863846,64.65411 -1.5554936,19.84165 0.9781838,40.10268 8.1825416,58.70009 6.210988,16.16091 15.894545,30.87732 27.739004,43.46312 16.487951,17.57083 36.752681,31.11853 57.877414,42.47694 0.75168,0.43906 1.59701,0.77511 2.29306,1.27388 2.86679,4.6313 5.37096,9.48946 8.52384,13.94228 5.45956,7.92277 12.65714,14.75439 21.2551,19.16193 9.6394,5.0174 20.71523,6.96599 31.51599,6.28795 10.90179,-0.83701 21.2892,-4.91931 30.77723,-10.18133 12.4166,-6.93812 23.56256,-15.98376 33.58249,-26.03914 9.96279,-10.0289 18.79496,-21.17022 26.39113,-33.0889 10.87699,16.91934 24.18793,32.34401 39.74938,45.12077 10.00713,8.14757 20.97471,15.31593 33.06537,19.95959 7.93816,3.03334 16.45952,4.79051 24.9827,4.29735 10.21404,-0.42126 20.38768,-3.4272 28.9131,-9.13093 7.64187,-5.02101 13.76108,-12.06794 18.51752,-19.82113 2.18351,-3.46929 4.05021,-7.12613 6.22223,-10.6015 19.47332,-10.29917 38.22477,-22.35497 54.16907,-37.65945 12.90338,-12.36533 23.80556,-26.96729 31.10415,-43.32695 7.42472,-16.45569 11.06132,-34.51755 11.17414,-52.54357 0.26042,-23.29706 -5.49528,-46.63235 -16.59853,-67.11795 -11.57326,-21.48158 -28.90977,-39.80528 -49.69952,-52.57602 -4.32446,-2.66803 -8.80214,-5.08501 -13.38779,-7.27285 1.71297,-5.08008 2.82802,-10.35954 3.34284,-15.69522 13.91733,-8.58279 24.37005,-22.65677 28.36297,-38.53166 3.18363,-12.38154 2.28224,-25.81377 -2.79783,-37.567954 C 448.76107,79.66973 440.5163,70.303487 430.53327,63.714302 419.01053,56.051725 405.46698,51.925294 391.83504,50.11818 c -7.83832,-1.029924 -15.76743,-1.426209 -23.66581,-1.013174 -12.38775,0.548433 -24.70857,2.456562 -36.70542,5.583427 -1.54528,-1.866107 -3.52301,-3.287056 -5.31823,-4.89588 -2.23763,-1.449855 -4.41243,-3.00815 -6.6898,-4.389415 -2.08719,-1.000821 -4.08801,-2.204635 -6.31907,-2.867257 -2.34646,-0.768464 -4.61216,-1.818471 -7.05535,-2.249609 -1.7561,-0.398382 -3.50633,-0.834055 -5.3136,-0.907448 -2.46607,-0.17371 -4.92244,-0.640087 -7.40012,-0.463166 -1.80034,0.04161 -3.60407,0.04563 -5.3749,0.414583 -2.43413,0.432272 -4.93022,0.578062 -7.29011,1.353554 -1.73521,0.47884 -3.48277,0.922329 -5.10986,1.710803 -2.25278,1.010618 -4.63539,1.758472 -6.73261,3.083917 -1.56702,0.887219 -3.15474,1.742947 -4.54121,2.904546 -1.94148,1.531076 -4.07302,2.83879 -5.78679,4.637466 -0.8085,0.794753 -1.6512,1.558226 -2.43839,2.372458 -6.54832,-7.042367 -15.07389,-12.223504 -24.35195,-14.760401 -4.45885,-1.22347 -9.08035,-1.881211 -13.70735,-1.838619 -0.93882,-0.03679 -1.87608,0.05046 -2.81419,0.07803 z"
inkscape:label="behind" />
<path
d="m 217.5,62.992572 a 21.875,21.875 0 0 0 -21.875,24.5 c -20.125,-9.625 -42.875,-14 -62.125,-14 -77,1.75 -59.5,66.499998 -21,67.374998 -4.375,20.125 -1.75,37.625 23.625,56.875 -57.75,4.375 -104.125,52.5 -104.125,111.125 0,55.125 37.625,87.5 84.875,112 15.75,8.75 14,35.875 42,35.875 27.125,0 98,-59.5 97.125,-148.75 0,89.25 70.875,148.75 98,148.75 27.125,0 25.375,-27.125 41.125,-35.875 47.25,-24.5 84.875,-56.875 84.875,-112 0,-58.625 -45.5,-106.75 -103.25,-111.125 24.5,-19.25 28,-36.75 22.75,-56.875 38.5,-0.875 56,-65.624998 -20.125,-67.374998 -20.125,0 -42,4.375 -63,14 l 0.875,-2.625 a 21.875,21.875 0 1 0 -28,20.999998 c -17.5,14.875 -30.625,36.75 -33.25,64.75 -1.75,-28 -14.875,-49.875 -33.25,-64.75 A 21.875,21.875 0 0 0 217.5,62.992572 Z m -77,174.999998 a 70,70 0 1 1 0,140 70,70 0 0 1 0,-140 z m 231,0 a 70,70 0 1 1 0,140 70,70 0 0 1 0,-140 z m -236.25,44.625 a 27.125,27.125 0 1 0 0,54.25 27.125,27.125 0 0 0 0,-54.25 z m 241.5,0 a 27.125,27.125 0 1 0 0,54.25 27.125,27.125 0 0 0 0,-54.25 z"
style="display:inline;fill:#fcfaf8;stroke:none;stroke-width:16;stroke-linecap:butt;stroke-linejoin:round;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke fill markers;fill-opacity:1"
id="path1" />
</svg>

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
viewBox="0 0 512 512"
width="32"
height="32"
version="1.1"
id="svg1"
sodipodi:docname="icon-light-state-invalid.svg"
inkscape:version="1.4 (e7c3feb100, 2024-10-09)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs1">
<linearGradient
id="linearGradient11"
inkscape:collect="always">
<stop
style="stop-color:#9d8062;stop-opacity:1;"
offset="0"
id="stop12" />
<stop
style="stop-color:#9d8062;stop-opacity:1;"
offset="0.45122612"
id="stop13" />
<stop
style="stop-color:#736659;stop-opacity:1;"
offset="1"
id="stop11" />
</linearGradient>
<linearGradient
id="linearGradient1"
inkscape:swatch="gradient">
<stop
style="stop-color:#27983a;stop-opacity:1;"
offset="0"
id="stop1" />
<stop
style="stop-color:#27983a;stop-opacity:0;"
offset="1"
id="stop2" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient11"
id="linearGradient12"
x1="256"
y1="4.7133198"
x2="256"
y2="516.71332"
gradientUnits="userSpaceOnUse" />
</defs>
<sodipodi:namedview
id="namedview1"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:zoom="14.230524"
inkscape:cx="15.143504"
inkscape:cy="10.435315"
inkscape:window-width="1277"
inkscape:window-height="864"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="0"
inkscape:current-layer="svg1" />
<path
id="path11"
style="fill:#9d8062;fill-opacity:1;stroke:url(#linearGradient12);stroke-width:15.5153;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
d="m 215.22028,38.871995 c -4.34372,0.303826 -8.65502,1.096343 -12.79663,2.448948 -5.93985,1.922995 -11.53239,4.920956 -16.41582,8.811486 -1.76365,1.417918 -3.46026,2.919246 -5.01704,4.56358 -14.636,-3.798687 -29.75685,-5.860967 -44.88746,-5.742441 -14.68272,0.379878 -29.51967,2.710272 -43.033824,8.664817 -10.977835,4.822375 -20.961579,12.233426 -28.009521,22.005037 -7.050461,9.664813 -10.992922,21.550288 -11.066377,33.516658 -0.169287,14.92345 5.535781,29.70673 15.271568,40.96315 4.373745,5.08863 9.549047,9.48723 15.279627,12.97831 0.542441,5.29028 1.667985,10.52221 3.376926,15.55886 -23.221327,10.97251 -43.33471,28.4246 -57.436944,49.89292 -12.70417,19.22237 -20.483342,41.67752 -22.2863846,64.65411 -1.5554936,19.84165 0.9781838,40.10268 8.1825416,58.70009 6.210988,16.16091 15.894545,30.87732 27.739004,43.46312 16.487951,17.57083 36.752681,31.11853 57.877414,42.47694 0.75168,0.43906 1.59701,0.77511 2.29306,1.27388 2.86679,4.6313 5.37096,9.48946 8.52384,13.94228 5.45956,7.92277 12.65714,14.75439 21.2551,19.16193 9.6394,5.0174 20.71523,6.96599 31.51599,6.28795 10.90179,-0.83701 21.2892,-4.91931 30.77723,-10.18133 12.4166,-6.93812 23.56256,-15.98376 33.58249,-26.03914 9.96279,-10.0289 18.79496,-21.17022 26.39113,-33.0889 10.87699,16.91934 24.18793,32.34401 39.74938,45.12077 10.00713,8.14757 20.97471,15.31593 33.06537,19.95959 7.93816,3.03334 16.45952,4.79051 24.9827,4.29735 10.21404,-0.42126 20.38768,-3.4272 28.9131,-9.13093 7.64187,-5.02101 13.76108,-12.06794 18.51752,-19.82113 2.18351,-3.46929 4.05021,-7.12613 6.22223,-10.6015 19.47332,-10.29917 38.22477,-22.35497 54.16907,-37.65945 12.90338,-12.36533 23.80556,-26.96729 31.10415,-43.32695 7.42472,-16.45569 11.06132,-34.51755 11.17414,-52.54357 0.26042,-23.29706 -5.49528,-46.63235 -16.59853,-67.11795 -11.57326,-21.48158 -28.90977,-39.80528 -49.69952,-52.57602 -4.32446,-2.66803 -8.80214,-5.08501 -13.38779,-7.27285 1.71297,-5.08008 2.82802,-10.35954 3.34284,-15.69522 13.91733,-8.58279 24.37005,-22.65677 28.36297,-38.53166 3.18363,-12.38154 2.28224,-25.81377 -2.79783,-37.567954 C 448.76107,79.66973 440.5163,70.303487 430.53327,63.714302 419.01053,56.051725 405.46698,51.925294 391.83504,50.11818 c -7.83832,-1.029924 -15.76743,-1.426209 -23.66581,-1.013174 -12.38775,0.548433 -24.70857,2.456562 -36.70542,5.583427 -1.54528,-1.866107 -3.52301,-3.287056 -5.31823,-4.89588 -2.23763,-1.449855 -4.41243,-3.00815 -6.6898,-4.389415 -2.08719,-1.000821 -4.08801,-2.204635 -6.31907,-2.867257 -2.34646,-0.768464 -4.61216,-1.818471 -7.05535,-2.249609 -1.7561,-0.398382 -3.50633,-0.834055 -5.3136,-0.907448 -2.46607,-0.17371 -4.92244,-0.640087 -7.40012,-0.463166 -1.80034,0.04161 -3.60407,0.04563 -5.3749,0.414583 -2.43413,0.432272 -4.93022,0.578062 -7.29011,1.353554 -1.73521,0.47884 -3.48277,0.922329 -5.10986,1.710803 -2.25278,1.010618 -4.63539,1.758472 -6.73261,3.083917 -1.56702,0.887219 -3.15474,1.742947 -4.54121,2.904546 -1.94148,1.531076 -4.07302,2.83879 -5.78679,4.637466 -0.8085,0.794753 -1.6512,1.558226 -2.43839,2.372458 -6.54832,-7.042367 -15.07389,-12.223504 -24.35195,-14.760401 -4.45885,-1.22347 -9.08035,-1.881211 -13.70735,-1.838619 -0.93882,-0.03679 -1.87608,0.05046 -2.81419,0.07803 z"
inkscape:label="behind" />
<path
d="m 217.5,62.992572 a 21.875,21.875 0 0 0 -21.875,24.5 c -20.125,-9.625 -42.875,-14 -62.125,-14 -77,1.75 -59.5,66.499998 -21,67.374998 -4.375,20.125 -1.75,37.625 23.625,56.875 -57.75,4.375 -104.125,52.5 -104.125,111.125 0,55.125 37.625,87.5 84.875,112 15.75,8.75 14,35.875 42,35.875 27.125,0 98,-59.5 97.125,-148.75 0,89.25 70.875,148.75 98,148.75 27.125,0 25.375,-27.125 41.125,-35.875 47.25,-24.5 84.875,-56.875 84.875,-112 0,-58.625 -45.5,-106.75 -103.25,-111.125 24.5,-19.25 28,-36.75 22.75,-56.875 38.5,-0.875 56,-65.624998 -20.125,-67.374998 -20.125,0 -42,4.375 -63,14 l 0.875,-2.625 a 21.875,21.875 0 1 0 -28,20.999998 c -17.5,14.875 -30.625,36.75 -33.25,64.75 -1.75,-28 -14.875,-49.875 -33.25,-64.75 A 21.875,21.875 0 0 0 217.5,62.992572 Z m -77,174.999998 a 70,70 0 1 1 0,140 70,70 0 0 1 0,-140 z m 231,0 a 70,70 0 1 1 0,140 70,70 0 0 1 0,-140 z m -236.25,44.625 a 27.125,27.125 0 1 0 0,54.25 27.125,27.125 0 0 0 0,-54.25 z m 241.5,0 a 27.125,27.125 0 1 0 0,54.25 27.125,27.125 0 0 0 0,-54.25 z"
style="display:inline;fill:#fcfaf8;stroke:none;stroke-width:16;stroke-linecap:butt;stroke-linejoin:round;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke fill markers;fill-opacity:1"
id="path1" />
</svg>

After

Width:  |  Height:  |  Size: 6.6 KiB

3
icons/metamorpov.svg Normal file
View File

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="32" height="32">
<path d="M166 75a25 25 0 0 0-25 28c-23-11-49-16-71-16-88 2-68 76-24 77-5 23-2 43 27 65-66 5-119 60-119 127 0 63 43 100 97 128 18 10 16 41 48 41 31 0 112-68 111-170 0 102 81 170 112 170s29-31 47-41c54-28 97-65 97-128 0-67-52-122-118-127 28-22 32-42 26-65 44-1 64-75-23-77-23 0-48 5-72 16l1-3a25 25 0 1 0-32 24c-20 17-35 42-38 74-2-32-17-57-38-74a25 25 0 0 0-6-49zM78 275a80 80 0 1 1 0 160 80 80 0 0 1 0-160zm264 0a80 80 0 1 1 0 160 80 80 0 0 1 0-160zM72 326a31 31 0 1 0 0 62 31 31 0 0 0 0-62zm276 0a31 31 0 1 0 0 62 31 31 0 0 0 0-62z" style="fill:currentColor" transform="translate(46 -44)"/>
</svg>

After

Width:  |  Height:  |  Size: 687 B

12
icons/svg-to-png.sh Executable file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p inkscape
# Uses Inkscape to generate .png files from the provided input
name=$(basename $1 .svg)
inkscape -o $name-16x.png -w 16 $1
inkscape -o $name-32x.png -w 32 $1
inkscape -o $name-48x.png -w 48 $1
inkscape -o $name-64x.png -w 64 $1
inkscape -o $name-96x.png -w 96 $1
inkscape -o $name-128x.png -w 128 $1

BIN
light-theme.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 KiB

1113
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
{
"name": "metamorpov",
"title": "MetamorPOV",
"version": "0.1.0",
"version": "1.2.0",
"description": "Enables customization of reader-insert stories by replacing author-provided hooks such as Y/n, pov/s, and vrb/do/present/.",
"type": "module",
"repository": {
@ -11,17 +11,20 @@
"author": "Jean Viscogliosi-Pate",
"license": "GPL-3.0-or-later",
"scripts": {
"test": "npx rollup -c && npx web-ext run -s src",
"build": "npx rollup -c && npx web-ext build -s src -a dist --ignore-files replace-words.js -o"
"test": "cp src/manifest-firefox.json src/manifest.json && npx rollup -c && npx web-ext run -s src && rm src/manifest.json",
"test-chrome": "cp src/manifest-chrome.json src/manifest.json && npx rollup -c && chromium && rm src/manifest.json",
"build": "cp src/manifest-firefox.json src/manifest.json && npx rollup -c && npx web-ext build -s src -a dist --ignore-files replace-words.js save-load-options.js manifest-* service-worker* -n {name}-{version}.xpi -o && rm src/manifest.json",
"build-chrome": "cp src/manifest-chrome.json src/manifest.json && npx rollup -c && npx web-ext build -s src -a dist --ignore-files replace-words.js save-load-options.js manifest-* background.js -n {name}-{version}-chrome.zip -o && rm src/manifest.json"
},
"devDependencies": {
"@rollup/plugin-commonjs": "28.0.2",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "15.3.0",
"english-verbs-gerunds": "3.3.1",
"english-verbs-helper": "3.3.1",
"english-verbs-irregular": "3.3.1",
"rollup": "^4.27.3",
"web-ext": "^8.3.0",
"@rollup/plugin-json": "^6.1.0"
"webextension-polyfill": "^0.12.0"
}
}

View File

@ -2,12 +2,24 @@ import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import json from '@rollup/plugin-json';
export default {
input: 'src/replace-words.js',
output: {
file: 'src/content-script.js',
format: 'iife',
name: 'contentScript'
export default [
{
input: 'src/save-load-options.js',
output: {
file: 'src/popup.js',
format: 'iife',
name: 'popup'
},
plugins: [resolve(), commonjs(), json()]
},
plugins: [resolve(), commonjs(), json()]
};
{
input: 'src/replace-words.js',
output: {
file: 'src/content-script.js',
format: 'iife',
name: 'contentScript'
},
plugins: [resolve(), commonjs(), json()]
}
];

88
src/background.js Normal file
View File

@ -0,0 +1,88 @@
let colorScheme = "light";
let state = "neutral";
/* Update the extension's icon by color scheme and state */
function updateIcon(event) {
browser.action.setIcon({
path: {
16: "icons/" + colorScheme + "-state-" + state + "-16x.png",
32: "icons/" + colorScheme + "-state-" + state + "-32x.png",
48: "icons/" + colorScheme + "-state-" + state + "-48x.png",
64: "icons/" + colorScheme + "-state-" + state + "-64x.png",
96: "icons/" + colorScheme + "-state-" + state + "-96x.png",
128: "icons/" + colorScheme + "-state-" + state + "-128x.png"
},
});
}
/* Listen for color scheme changes */
browser.runtime.onInstalled.addListener(updateColorSchemeOnInstall);
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', updateColorScheme);
/* Update the color scheme to light or dark */
function updateColorScheme(event) {
const isDark = event.matches;
if (isDark) {
colorScheme = "dark";
} else {
colorScheme = "light";
}
updateIcon();
}
/* Updatw the color scheme on install */
function updateColorSchemeOnInstall() {
updateColorScheme(window.matchMedia('(prefers-color-scheme: dark)'));
}
/* Listen for tab changes */
window.addEventListener("load", updateState());
browser.tabs.onUpdated.addListener(updateStateOnReload, {urls: ["*://*/*"]});
browser.tabs.onActivated.addListener(updateState);
/* Update whether the extension is enabled for a host */
function updateState() {
let tabs = browser.tabs.query({ active: true, currentWindow: true });
tabs.then((tabs) => {
const tab = tabs[0];
const url = new URL(tab.url);
const isAllowedProtocol = url.protocol == "https:" || url.protocol == "http:";
if (!isAllowedProtocol) {
state = "neutral";
updateIcon();
return;
}
let storage = browser.storage.local.get("domains");
storage.then((storage) => {
const hostname = url.host;
const domains = storage.domains;
if (domains === undefined) {
state = "disabled";
}
else if (domains.includes(hostname)) {
state = "enabled";
} else {
state = "disabled";
}
}, logError).then(() => {
updateIcon();
}, logError);
}, logError);
}
/* Only update the state if the page was reloaded */
function updateStateOnReload(tabIs, changeInfo, tab) {
if (changeInfo.url && tab.url.host === changeInfo.url.host) {
return;
} else {
updateState();
}
}
/* Required by then */
function logError(error) {
console.log(`Error: ${error}`);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 874 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 913 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 909 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 907 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 919 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 917 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

60
src/manifest-chrome.json Normal file
View File

@ -0,0 +1,60 @@
{
"manifest_version": 3,
"name": "MetamorPOV",
"author": "Jean Viscogliosi-Pate",
"version": "1.3.0",
"description": "Enables customization of reader-insert stories by replacing author-provided hooks such as Y/n, pov/s, and vrb/do/present/.",
"action": {
"default_title": "MetamorPOV",
"default_popup": "popup.html",
"default_icon": {
"16": "icons/light-state-neutral-16x.png",
"32": "icons/light-state-neutral-32x.png",
"48": "icons/light-state-neutral-48x.png",
"64": "icons/light-state-neutral-64x.png",
"96": "icons/light-state-neutral-96x.png",
"128": "icons/light-state-neutral-128x.png"
}
},
"permissions": [
"storage",
"tabs",
"offscreen"
],
"host_permissions": [
"http://*/*",
"https://*/*"
],
"icons": {
"16": "icons/light-state-neutral-16x.png",
"32": "icons/light-state-neutral-32x.png",
"48": "icons/light-state-neutral-48x.png",
"64": "icons/light-state-neutral-64x.png",
"96": "icons/light-state-neutral-96x.png",
"128": "icons/light-state-neutral-128x.png"
},
"content_scripts": [
{
"js": [
"content-script.js"
],
"run_at": "document_idle",
"matches": [
"*://*/*"
]
}
],
"background": {
"service_worker": "service-worker.js",
"type": "module"
},
"homepage_url": "https://git.viscogliosi-pate.com/jean/metamorpov"
}

93
src/manifest-firefox.json Normal file
View File

@ -0,0 +1,93 @@
{
"manifest_version": 3,
"name": "MetamorPOV",
"author": "Jean Viscogliosi-Pate",
"version": "1.3.0",
"description": "Enables customization of reader-insert stories by replacing author-provided hooks such as Y/n, pov/s, and vrb/do/present/.",
"browser_specific_settings": {
"gecko": {
"id": "metamorpov@viscogliosi-pate.com",
"strict_min_version": "113.0"
},
"gecko_android": {}
},
"action": {
"default_title": "MetamorPOV",
"default_popup": "popup.html",
"default_icon": {
"16": "icons/light-state-neutral-16x.png",
"32": "icons/light-state-neutral-32x.png",
"48": "icons/light-state-neutral-48x.png",
"64": "icons/light-state-neutral-64x.png",
"96": "icons/light-state-neutral-96x.png",
"128": "icons/light-state-neutral-128x.png"
},
"theme_icons": [{
"light": "icons/light-state-neutral-16x.png",
"dark": "icons/dark-state-neutral-16x.png",
"size": 16
}, {
"light": "icons/light-state-neutral-32x.png",
"dark": "icons/dark-state-neutral-32x.png",
"size": 32
}, {
"light": "icons/light-state-neutral-48x.png",
"dark": "icons/dark-state-neutral-48x.png",
"size": 48
}, {
"light": "icons/light-state-neutral-64x.png",
"dark": "icons/dark-state-neutral-64x.png",
"size": 64
}, {
"light": "icons/light-state-neutral-96x.png",
"dark": "icons/dark-state-neutral-96x.png",
"size": 96
}, {
"light": "icons/light-state-neutral-128x.png",
"dark": "icons/dark-state-neutral-128x.png",
"size": 128
}]
},
"permissions": [
"storage",
"tabs"
],
"host_permissions": [
"http://*/*",
"https://*/*"
],
"icons": {
"16": "icons/light-state-neutral-16x.png",
"32": "icons/light-state-neutral-32x.png",
"48": "icons/light-state-neutral-48x.png",
"64": "icons/light-state-neutral-64x.png",
"96": "icons/light-state-neutral-96x.png",
"128": "icons/light-state-neutral-128x.png"
},
"content_scripts": [
{
"js": [
"content-script.js"
],
"run_at": "document_idle",
"matches": [
"*://*/*"
]
}
],
"background": {
"scripts": [
"background.js"
]
},
"homepage_url": "https://git.viscogliosi-pate.com/jean/metamorpov"
}

View File

@ -1,62 +0,0 @@
{
"manifest_version": 2,
"name": "MetamorPOV",
"author": "Jean Viscogliosi-Pate",
"version": "1.1.0",
"license": "GPL-3.0-or-later",
"description": "Enables customization of reader-insert stories by replacing author-provided hooks such as Y/n, pov/s, and vrb/do/present/.",
"browser_specific_settings": {
"gecko": {
"id": "metamorpov@viscogliosi-pate.com",
"strict_min_version": "113.0"
},
"gecko_android": {}
},
"browser_action": {
"default_title": "MetamorPOV",
"default_icon": {
"16": "metamorpov.svg",
"32": "metamorpov.svg",
"48": "metamorpov.svg",
"64": "metamorpov.svg",
"96": "metamorpov.svg",
"128": "metamorpov.svg"
},
"default_popup": "popup.html"
},
"permissions": [
"storage",
"tabs"
],
"icons": {
"16": "metamorpov.svg",
"32": "metamorpov.svg",
"48": "metamorpov.svg",
"64": "metamorpov.svg",
"96": "metamorpov.svg",
"128": "metamorpov.svg"
},
"content_scripts": [
{
"js": [
"content-script.js"
],
"run_at": "document_idle",
"matches": [
"*://*/*"
]
}
],
"background": {
"page": "popup.html"
},
"homepage_url": "https://git.viscogliosi-pate.com/jean/metamorpov"
}

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 6.6 KiB

View File

@ -1,3 +1,4 @@
var browser = require("webextension-polyfill");
const verbsHelper = require("english-verbs-helper");
const verbsIrregular = require("english-verbs-irregular/dist/verbs.json");
const verbsGerunds = require("english-verbs-gerunds/dist/gerunds.json");
@ -5,7 +6,8 @@ const verbsData = verbsHelper.mergeVerbsData(verbsIrregular, verbsGerunds);
/* Replaces verbs, point-of-view, name, pronouns, and "also" terms */
function replaceAll() {
browser.storage.local.get(null, (options) => {
let options = browser.storage.local.get();
options.then((options) => {
const hostname = window.location.hostname;
const isEnabled = !(options.domains === undefined) && options.domains.includes(hostname);
if (!isEnabled) { return; }
@ -38,6 +40,8 @@ function replaceAll() {
if (isAllSet) {
replaceExceptions(options);
replaceCuts();
replaceCapitals();
replaceMirror();
}
});
}
@ -220,17 +224,28 @@ function replaceAlso(options) {
/* Replaces exception statements by POV */
function replaceExceptions(options) {
const searchTerm = /exc\/([^\/]*)\/([^\/]*)\//i;
const searchTerm = /exc\/([^\/]*)\/([^\/]*)\/(?:([^\/]*)\/)?/i;
walk(document.body, searchTerm, options, exceptionMethod);
}
/* Replaces cut statements with cuts */
function replaceCuts() {
const searchTerm = /cut\/([^\/]+)\/(-?[\d]+)\//i;
const searchTerm = /cut\/([^\/]+)\/(off|only) (first|last) ([1-9][0-9]*)\//i;
walk(document.body, searchTerm, null, cutMethod);
}
/* Replaces capital statements statements with requested casing */
function replaceCapitals() {
const searchTerm = /(cap|Cap|CAP)\/([^\/]+)\//i;
walk(document.body, searchTerm, null, capitalMethod);
}
/* Replaces mirror statements with reversed phrases */
function replaceMirror() {
const searchTerm = /mrr\/([^\/]+)\//i;
walk(document.body, searchTerm, null, mirrorMethod);
}
/* Turns a term into regexp format and uses that to replace it */
function escapeAndReplace(searchTerm, replaceValue, caseSensitive) {
let searchTermEscaped = searchTerm.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
@ -308,10 +323,13 @@ function verbMethod(node, searchTerm, options) {
} else {
povIndex = getPovIndex(options.pov, options);
}
break;
case "b":
povIndex = getPovIndex(options.pov, options);
break;
case "N": /* N and n are always third-person */
povIndex = getPovIndex("third-singular", null);
break;
case "n":
povIndex = getPovIndex("third", options);
}
@ -326,44 +344,105 @@ function verbMethod(node, searchTerm, options) {
verbMethod(node, searchTerm, options);
}
/* Allows for custom words to be cut off */
/* Allows for first, second, and third-person POV to read differently */
function exceptionMethod(node, searchTerm, options) {
const match = node.nodeValue.match(searchTerm);
if (match == null) { return; }
let replaceValue;
const isFirstSecondSame = match[3] == null;
if (isFirstSecondSame) {
if (options.pov == "third") {
replaceValue = match[2];
} else {
replaceValue = match[1];
}
} else {
if (options.pov == "third") {
replaceValue = match[3];
} else if (options.pov == "second") {
replaceValue = match[2];
} else {
replaceValue = match[1];
}
}
node.nodeValue = node.nodeValue.replace(searchTerm, replaceValue);
exceptionMethod(node, searchTerm, options);
}
/* Allows for custom words to be truncated */
function cutMethod(node, searchTerm, unused) {
const match = node.nodeValue.match(searchTerm);
if (match == null) { return; }
const target = match[1];
const amount = match[2];
const length = target.length
const isOnly = match[2] == "only";
const isFirst = match[3] == "first";
const index = Number(match[4]);
if (target.length <= Math.abs(amount)) {
node.nodeValue = node.nodeValue.replace(searchTerm, target);
cutMethod(node, searchTerm, unused);
return;
}
let replaceValue;
if (amount < 0) {
replaceValue = target.slice(0, amount);
let start, end;
if (isOnly) {
if (isFirst) { // only first n
start = 0;
end = Math.min(index, length - 1);
} else { // only last n
start = Math.max(length - index, 1);
end = length;
}
} else {
replaceValue = target.slice(amount);
if (isFirst) { // off first n
start = Math.min(index, length - 1);;
end = length;
} else { // off last n
start = 0;
end = Math.max(length - index, 1);
}
}
const replaceValue = target.slice(start, end);
node.nodeValue = node.nodeValue.replace(searchTerm, replaceValue);
cutMethod(node, searchTerm, unused);
}
/* Allows for custom words to be cut off */
function exceptionMethod(node, searchTerm, options) {
/* Allows for custom words to be capitalized */
function capitalMethod(node, searchTerm, unused) {
const match = node.nodeValue.match(searchTerm);
if (match == null) { return; }
const style = match[1];
const target = match[2];
const isLowerCase = /c/.test(style.slice(0,1)); // cap
let replaceValue;
if (options.pov == "third") {
replaceValue = match[2];
if (isLowerCase) {
replaceValue = target.toLowerCase();
} else {
replaceValue = match[1];
const isStartCase = /a/.test(style.slice(1,2)); // Cap
if (isStartCase) {
replaceValue = capitalize(target);
} else { // CAP
replaceValue = target.toUpperCase();
}
}
node.nodeValue = node.nodeValue.replace(searchTerm, replaceValue);
exceptionMethod(node, searchTerm, options);
capitalMethod(node, searchTerm, unused);
}
/* Allows for custom words to be mirrored */
function mirrorMethod(node, searchTerm, unused) {
const match = node.nodeValue.match(searchTerm);
if (match == null) { return; }
const target = match[1];
let replaceValue = target.split('').reverse().join('');
node.nodeValue = node.nodeValue.replace(searchTerm, replaceValue);
mirrorMethod(node, searchTerm, unused);
}
/* Returns the input word, capitalized */

View File

@ -1,3 +1,5 @@
var browser = require("webextension-polyfill");
document.addEventListener("DOMContentLoaded", init);
function init() {
@ -14,17 +16,19 @@ function init() {
function loadDomain() {
let tabs = browser.tabs.query({ active: true, currentWindow: true });
tabs.then((tabs) => {
const hostname = new URL(tabs[0].url).hostname;
document.querySelector("#domain").textContent = hostname;
const tab = tabs[0];
const url = new URL(tab.url);
const isAllowedProtocol = url.protocol == "https:" || url.protocol == "http:";
if (!hostname) {
if (!isAllowedProtocol) {
disableToggle();
return;
}
document.querySelector("#domain").textContent = url.host;
let storage = browser.storage.local.get("domains");
storage.then((storage) => {
const hostname = document.querySelector("#domain").innerHTML;
const hostname = url.host;
const domains = storage.domains;
if (domains === undefined) {
browser.storage.local.set({"domains": []});
@ -252,15 +256,15 @@ async function removeLi() {
also.removeChild(this.parentNode);
let list = also.querySelectorAll("li");
list.forEach((li, index) => {
lhs = li.querySelector(".lhs");
let lhs = li.querySelector(".lhs");
lhs.id = "lhs-" + index;
lhs.name = lhs.id;
rhs = li.querySelector(".rhs");
let rhs = li.querySelector(".rhs");
rhs.id = "rhs-" + index;
rhs.name = rhs.id;
rhsLabel = li.querySelector("label");
let rhsLabel = li.querySelector("label");
rhsLabel.for = rhs.id;
});
}

View File

@ -0,0 +1,8 @@
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<script src="service-worker-window.js"></script>
</body>
</html>

View File

@ -0,0 +1,18 @@
/* Broadcast color scheme on browser start, because no change event is fired */
updateColorScheme(window.matchMedia('(prefers-color-scheme: dark)'));
function updateColorScheme(event) {
chrome.runtime.sendMessage({
content: "colorScheme",
isDark: event.matches
});
}
/* Broadcast when page is loaded */
window.addEventListener("load", updateState);
function updateState() {
chrome.runtime.sendMessage({
content: "updateState"
});
}

99
src/service-worker.js Normal file
View File

@ -0,0 +1,99 @@
let colorScheme = "light";
let state = "neutral";
/* Update the extension's icon by color scheme and state */
function updateIcon(event) {
chrome.action.setIcon({
path: {
16: "icons/" + colorScheme + "-state-" + state + "-16x.png",
32: "icons/" + colorScheme + "-state-" + state + "-32x.png",
48: "icons/" + colorScheme + "-state-" + state + "-48x.png",
64: "icons/" + colorScheme + "-state-" + state + "-64x.png",
96: "icons/" + colorScheme + "-state-" + state + "-96x.png",
128: "icons/" + colorScheme + "-state-" + state + "-128x.png"
},
});
}
/* Track CSS media feature offscreen */
chrome.offscreen.createDocument({
url: "service-worker-window.html",
reasons: ["MATCH_MEDIA"],
justification: "Update icon by color scheme",
})
/* Listen for color scheme changes */
chrome.runtime.onMessage.addListener(
function(request, sender, sendResponse) {
if (request.content === "colorScheme") {
updateColorScheme(request.isDark);
}
}
)
/* Update the color scheme to light or dark */
function updateColorScheme(isDark) {
if (isDark) {
colorScheme = "dark";
} else {
colorScheme = "light";
}
updateIcon();
}
/* Listen for tab changes */
chrome.tabs.onUpdated.addListener(updateStateOnReload);
chrome.tabs.onActivated.addListener(updateState);
/* Update whether the extension is enabled for a host */
function updateState() {
let tabs = chrome.tabs.query({ active: true, currentWindow: true });
tabs.then((tabs) => {
const tab = tabs[0];
if (tab.url === "") {
state = "neutral";
updateIcon();
return;
}
const url = new URL(tab.url);
const isAllowedProtocol = url.protocol == "https:" || url.protocol == "http:";
if (!isAllowedProtocol) {
state = "neutral";
updateIcon();
return;
}
let storage = chrome.storage.local.get("domains");
storage.then((storage) => {
const hostname = url.host;
const domains = storage.domains;
if (domains === undefined) {
state = "disabled";
}
else if (domains.includes(hostname)) {
state = "enabled";
} else {
state = "disabled";
}
}, logError).then(() => {
updateIcon();
}, logError);
}, logError);
}
/* Only update the state if the page was reloaded */
function updateStateOnReload(tabIs, changeInfo, tab) {
if (changeInfo.url && tab.url.host === changeInfo.url.host) {
return;
} else {
updateState();
}
}
/* Required by then */
function logError(error) {
console.log(`Error: ${error}`);
}