From bec516cebd8e32e79e204bbac200f4de6a34d31f Mon Sep 17 00:00:00 2001 From: Sean Edmunds Date: Fri, 17 Dec 2021 16:36:20 -0600 Subject: [PATCH] enabled default theme to White --- node_modules/.cache/.eslintcache | 2 +- src/index.js | 24 +++++++++++++++++------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/node_modules/.cache/.eslintcache b/node_modules/.cache/.eslintcache index 8907521a..d88d8b2b 100644 --- a/node_modules/.cache/.eslintcache +++ b/node_modules/.cache/.eslintcache @@ -1 +1 @@ -[{"/home/seanedmunds/dev/home-page/src/index.js":"1"},{"size":27677,"mtime":1639779365084,"results":"2","hashOfConfig":"3"},{"filePath":"4","messages":"5","errorCount":0,"fatalErrorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"ikqo75","/home/seanedmunds/dev/home-page/src/index.js",["6","7","8","9"],{"ruleId":"10","severity":1,"message":"11","line":1,"column":10,"nodeType":"12","messageId":"13","endLine":1,"endColumn":16},{"ruleId":"10","severity":1,"message":"14","line":167,"column":10,"nodeType":"12","messageId":"13","endLine":167,"endColumn":19},{"ruleId":"15","severity":1,"message":"16","line":184,"column":11,"nodeType":"17","endLine":184,"endColumn":61},{"ruleId":"18","severity":1,"message":"19","line":885,"column":1,"nodeType":"20","messageId":"21","endLine":888,"endColumn":2},"no-unused-vars","'render' is defined but never used.","Identifier","unusedVar","'ModalMenu' is defined but never used.","jsx-a11y/anchor-is-valid","The href attribute requires a valid value to be accessible. Provide a valid, navigable address as the href value. If you cannot provide a valid href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/anchor-is-valid.md","JSXOpeningElement","no-extend-native","String prototype is read only, properties should not be added.","AssignmentExpression","unexpected"] \ No newline at end of file +[{"/home/seanedmunds/dev/home-page/src/index.js":"1"},{"size":28103,"mtime":1639780387588,"results":"2","hashOfConfig":"3"},{"filePath":"4","messages":"5","errorCount":0,"fatalErrorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"ikqo75","/home/seanedmunds/dev/home-page/src/index.js",["6","7","8","9"],{"ruleId":"10","severity":1,"message":"11","line":1,"column":10,"nodeType":"12","messageId":"13","endLine":1,"endColumn":16},{"ruleId":"10","severity":1,"message":"14","line":167,"column":10,"nodeType":"12","messageId":"13","endLine":167,"endColumn":19},{"ruleId":"15","severity":1,"message":"16","line":184,"column":11,"nodeType":"17","endLine":184,"endColumn":61},{"ruleId":"18","severity":1,"message":"19","line":895,"column":1,"nodeType":"20","messageId":"21","endLine":898,"endColumn":2},"no-unused-vars","'render' is defined but never used.","Identifier","unusedVar","'ModalMenu' is defined but never used.","jsx-a11y/anchor-is-valid","The href attribute requires a valid value to be accessible. Provide a valid, navigable address as the href value. If you cannot provide a valid href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/anchor-is-valid.md","JSXOpeningElement","no-extend-native","String prototype is read only, properties should not be added.","AssignmentExpression","unexpected"] \ No newline at end of file diff --git a/src/index.js b/src/index.js index 37d74154..035a2950 100644 --- a/src/index.js +++ b/src/index.js @@ -679,13 +679,23 @@ function updateTheme(e) { setTheme(); } function setTheme() { - setValueFromLocalStorage('image-background'); - setValueFromLocalStorage('color-background'); - setValueFromLocalStorage('color-search-background'); - setValueFromLocalStorage('color-text-pri'); - setValueFromLocalStorage('color-text-acc'); - setValueFromLocalStorage('color-border'); - setValueFromLocalStorage('content-display'); + if(localStorage.getItem("color-background") === null) { + localStorage.setItem("image-background", ""); + localStorage.setItem("color-background", "#ffffff"); + localStorage.setItem("color-search-background", "#22222220"); + localStorage.setItem("color-text-pri", "#222222"); + localStorage.setItem("color-text-acc", "#dddddd"); + localStorage.setItem("color-border", "#dddddd"); + } else { + setValueFromLocalStorage('image-background'); + setValueFromLocalStorage('color-background'); + setValueFromLocalStorage('color-search-background'); + setValueFromLocalStorage('color-text-pri'); + setValueFromLocalStorage('color-text-acc'); + setValueFromLocalStorage('color-border'); + setValueFromLocalStorage('content-display'); + } + } function handleKeyPress(e) { var sindex = 0;