diff --git a/js/003-data/miscData.js b/js/003-data/miscData.js index edbe529ea86d206fb4c53e2937d89c7f07980e3c..1501a342fa2a80c2db6dcbca1e10ba9f7b2c651f 100644 --- a/js/003-data/miscData.js +++ b/js/003-data/miscData.js @@ -2575,134 +2575,6 @@ App.Data.misc = { whoringAssignments: [Job.WHORE, Job.BROTHEL, Job.PUBLIC, Job.CLUB], secExCombatPrestige: ["$He is well known for being a great commander.", "$He is famous for being an incredible commander.", "$He is known as a legendary commander all over the world."], - - lightColorMap: { - "rgb(0, 0, 0)": "rgb(255, 255, 255)", - "rgb(255, 255, 0)": "rgb(255, 255, 0)", - "rgb(238, 238, 238)": "rgb(17, 17, 17)", - "rgb(17, 17, 17)": "rgb(238, 238, 238)", - "linear-gradient(90deg, rgb(17, 17, 17), rgba(17, 17, 17, 0.8) 60%, rgba(17, 17, 17, 0))": "linear-gradient(90deg, rgb(238, 238, 238), rgba(238, 238, 238, 0.8) 60%, rgba(238, 238, 238, 0))", - "red": "red", - "rgb(102, 136, 221)": "rgb(102, 136, 221)", - "rgb(136, 170, 255)": "rgb(136, 170, 255)", - "rgb(204, 34, 34)": "rgb(204, 34, 34)", - "rgb(238, 68, 68)": "rgb(238, 68, 68)", - "rgb(170, 170, 170)": "rgb(170, 170, 170)", - "rgb(51, 85, 170)": "rgb(118, 145, 214)", - "rgb(85, 119, 204)": "rgb(85, 119, 204)", - "rgb(68, 68, 68)": "rgb(187, 187, 187)", - "rgb(51, 51, 51)": "rgb(204, 204, 204)", - "rgb(85, 17, 17)": "rgb(85, 17, 17)", - "rgb(187, 68, 68)": "rgb(187, 68, 68)", - "rgb(153, 153, 153)": "rgb(153, 153, 153)", - "rgb(34, 136, 34)": "rgb(34, 136, 34)", - "rgb(68, 170, 68)": "rgb(68, 170, 68)", - "rgb(34, 34, 34)": "rgb(221, 221, 221)", - "rgb(34, 51, 68)": "rgb(34, 51, 68)", - "rgb(85, 85, 85)": "rgb(170, 170, 170)", - "rgba(0, 0, 0, 0.25)": "rgba(0, 0, 0, 0.25)", - "rgb(46, 46, 46)": "rgb(209, 209, 208)", - "rgb(119, 119, 119)": "rgb(136, 136, 136)", - "rgb(0, 30, 0)": "rgb(220, 245, 220)", - "rgb(15, 40, 15)": "rgb(245, 255, 245)", - "green": "green", - "aquamarine": "lightseagreen", - "coral": "coral", - "cyan": "darkcyan", - "darkgoldenrod": "darkgoldenrod", - "darkred": "darkred", - "darkviolet": "darkviolet", - "deeppink": "deeppink", - "deepskyblue": "deepskyblue", - "gold": "gold", - "goldenrod": "goldenrod", - "gray": "gray", - "hotpink": "hotpink", - "lawngreen": "darkgreen", - "lightblue": "lightblue", - "lightcoral": "lightcoral", - "lightgreen": "lightgreen", - "lightpink": "lightpink", - "lightsalmon": "lightsalmon", - "lime": "green", - "limegreen": "limegreen", - "magenta": "magenta", - "mediumaquamarine": "mediumaquamarine", - "mediumorchid": "mediumorchid", - "mediumseagreen": "mediumseagreen", - "orange": "orange", - "orangered": "orangered", - "orchid": "orchid", - "pink": "deeppink", - "seagreen": "seagreen", - "springgreen": "green", - "tan": "brown", - "yellow": "orange", - "yellowgreen": "yellowgreen" - }, - - defaultColorMap: { - "rgb(0, 0, 0)": "rgb(0, 0, 0)", - "rgb(255, 255, 0)": "rgb(255, 255, 0)", - "rgb(238, 238, 238)": "rgb(238, 238, 238)", - "rgb(17, 17, 17)": "rgb(17, 17, 17)", - "linear-gradient(90deg, rgba(17,17,17,1), rgba(17,17,17,0.8) 60%, rgba(17,17,17,0))": "linear-gradient(90deg, rgba(17,17,17,1), rgba(17,17,17,0.8) 60%, rgba(17,17,17,0))", - "red": "red", - "rgb(102, 136, 221)": "rgb(102, 136, 221)", - "rgb(136, 170, 255)": "rgb(136, 170, 255)", - "rgb(204, 34, 34)": "rgb(204, 34, 34)", - "rgb(238, 68, 68)": "rgb(238, 68, 68)", - "rgb(170, 170, 170)": "rgb(170, 170, 170)", - "rgb(51, 85, 170)": "rgb(51, 85, 170)", - "rgb(85, 119, 204)": "rgb(85, 119, 204)", - "rgb(68, 68, 68)": "rgb(68, 68, 68)", - "rgb(51, 51, 51)": "rgb(51, 51, 51)", - "rgb(85, 17, 17)": "rgb(85, 17, 17)", - "rgb(187, 68, 68)": "rgb(187, 68, 68)", - "rgb(153, 153, 153)": "rgb(153, 153, 153)", - "rgb(34, 136, 34)": "rgb(34, 136, 34)", - "rgb(68, 170, 68)": "rgb(68, 170, 68)", - "rgb(34, 34, 34)": "rgb(34, 34, 34)", - "rgb(34, 51, 68)": "rgb(34, 51, 68)", - "rgb(85, 85, 85)": "rgb(85, 85, 85)", - "rgba(0, 0, 0, 0.25)": "rgba(0, 0, 0, 0.25)", - "rgb(46, 46, 46)": "rgb(46, 46, 46)", - "rgb(119, 119, 119)": "rgb(119, 119, 119)", - "green": "green", - "aquamarine": "aquamarine", - "coral": "coral", - "cyan": "cyan", - "darkgoldenrod": "darkgoldenrod", - "darkred": "darkred", - "darkviolet": "darkviolet", - "deeppink": "deeppink", - "deepskyblue": "deepskyblue", - "gold": "gold", - "goldenrod": "goldenrod", - "gray": "gray", - "hotpink": "hotpink", - "lawngreen": "lawngreen", - "lightblue": "lightblue", - "lightcoral": "lightcoral", - "lightgreen": "lightgreen", - "lightpink": "lightpink", - "lightsalmon": "lightsalmon", - "lime": "lime", - "limegreen": "limegreen", - "magenta": "magenta", - "mediumaquamarine": "mediumaquamarine", - "mediumorchid": "mediumorchid", - "mediumseagreen": "mediumseagreen", - "orange": "orange", - "orangered": "orangered", - "orchid": "orchid", - "pink": "pink", - "seagreen": "seagreen", - "springgreen": "springgreen", - "tan": "tan", - "yellow": "yellow", - "yellowgreen": "yellowgreen" - } }; /* Nationalities based on $continent value. Note that $continent can be undefined! */ diff --git a/src/gui/options/options.tw b/src/gui/options/options.tw index b4a305781af4eb26b7c34102061c6a0d2b9cd43c..8a642e8a0059a78f6730e7fde9c27ccec89d15d7 100644 --- a/src/gui/options/options.tw +++ b/src/gui/options/options.tw @@ -114,8 +114,6 @@ <<set _options = new App.UI.OptionsGroup()>> - <<run _options.addOption("Color Control").customButton("Flip lighting", () => flipColors(setup.lightColorMap))>> - <<run _options.addOption("Main menu leadership controls displayed", "positionMainLinks") .addValueList([["Above", 1], ["Above and below", 0], ["Below", -1]])>> @@ -158,6 +156,11 @@ <<includeDOM _options.render()>> + <p> + UI theme selector. Allows to select a single CSS file to be loaded. <span class="red">The file has to be located in the same directory as the HTML file otherwise it will simply not load at all.</span> + <<includeDOM App.UI.Theme.selector()>> + </p> + <h2>Sidebar</h2> <<set _options = new App.UI.OptionsGroup()>> @@ -711,11 +714,6 @@ Experimental means just that: experimental. Options below are likely to be in an <span class="yellow">even more incomplete or broken state than usual.</span> <span class="red">THEY MAY NOT WORK AT ALL.</span> Make sure you back up your save before enabling any of these, and if you are that interested, consider helping to improve them. </div> - <p> - UI theme selector. Allows to select a single CSS file to be loaded. <span class="red">The file has to be located in the same directory as the HTML file otherwise it will simply not load at all.</span> - <<includeDOM App.UI.Theme.selector()>> - </p> - <<set _options = new App.UI.OptionsGroup()>> <<if $seePreg !== 0>> diff --git a/src/js/colorModeJS.js b/src/js/colorModeJS.js deleted file mode 100644 index 7a44f54f894ca31e7c47b6c891f0530a815d8267..0000000000000000000000000000000000000000 --- a/src/js/colorModeJS.js +++ /dev/null @@ -1,51 +0,0 @@ -globalThis.flipColors = function(lightColorMap) { - if (!globalThis.savedColorMap) { - globalThis.savedColorMap = setColors(lightColorMap); - } else { - restoreColors(globalThis.savedColorMap); - globalThis.savedColorMap = null; - } -}; - -globalThis.setColors = function(colorMap) { - let originalState = []; - let props = ["color", "backgroundColor", "backgroundImage"]; - let styleSheetArray = Array.from(document.styleSheets); - styleSheetArray.forEach(styleSheet => { - try { - let cssRules = Array.from(styleSheet.cssRules); - cssRules.forEach(cssRule => { - if (cssRule.type === 1) { - props.forEach(propName => { - let currentValue = cssRule.style[propName]; - if ( - currentValue !== "" && - currentValue !== "inherit" && - currentValue !== "transparent") { - let newVal = colorMap[currentValue]; - if (typeof newVal !== "undefined") { - cssRule.style[propName] = newVal; - originalState.push({ - element: cssRule, - propName: propName, - value: currentValue - }); - } - } - }); - } - }); - } catch (error) { - // No need to do anthing, this is expected when there are user style sheets. - } - }); - return originalState; -}; - -globalThis.restoreColors = function(styleMap) { - styleMap.forEach( - item => { - item.element.style[item.propName] = item.value; - } - ); -};