themeColors.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551
  1. const handleThemeUpdate = (cssVars) => {
  2. const root = document.querySelector(':root');
  3. const keys = Object.keys(cssVars);
  4. keys.forEach(key => {
  5. root.style.setProperty(key, cssVars[key]);
  6. });
  7. }
  8. const hex2rgb = (hex) => {
  9. const r = parseInt(hex.slice(1, 3), 16)
  10. const g = parseInt(hex.slice(3, 5), 16)
  11. const b = parseInt(hex.slice(5, 7), 16)
  12. return [r, g, b]
  13. }
  14. function dynamicPrimaryColor(primaryColor) {
  15. 'use strict'
  16. primaryColor.forEach((item) => {
  17. item.addEventListener('input', (e) => {
  18. document.querySelector('html').style.setProperty('--primary-rgb', hex2rgb(e.target.value));
  19. });
  20. });
  21. }
  22. function darkdynamicPrimaryColor(darkprimaryColor) {
  23. 'use strict'
  24. darkprimaryColor.forEach((item) => {
  25. item.addEventListener('input', (e) => {
  26. document.querySelector('html').style.setProperty('--primary-rgb', hex2rgb(e.target.value));
  27. });
  28. });
  29. }
  30. function imageBgdynamicPrimaryColor(imageprimaryColor) {
  31. 'use strict'
  32. imageprimaryColor.forEach((item) => {
  33. item.addEventListener('input', (e) => {
  34. document.querySelector('html').style.setProperty('--transparent-bg-rgb', hex2rgb(e.target.value));
  35. });
  36. });
  37. }
  38. function transparentdynamicPrimaryColor(primaryColor) {
  39. 'use strict'
  40. primaryColor.forEach((item) => {
  41. item.addEventListener('input', (e) => {
  42. document.querySelector('html').style.setProperty('--primary-rgb', hex2rgb(e.target.value));
  43. });
  44. });
  45. }
  46. (function () {
  47. 'use strict'
  48. // Light theme color picker
  49. const dynamicPrimaryLight = document.querySelectorAll('input.color-primary-light');
  50. dynamicPrimaryColor(dynamicPrimaryLight);
  51. // dark theme color picker
  52. const DarkDynamicPrimaryLight = document.querySelectorAll('input.color-primary-dark');
  53. darkdynamicPrimaryColor(DarkDynamicPrimaryLight);
  54. // tranparent theme color picker
  55. const transparentDynamicPrimaryLight = document.querySelectorAll('input.color-primary-transparent');
  56. transparentdynamicPrimaryColor(transparentDynamicPrimaryLight);
  57. // tranparent theme bgcolor picker
  58. const transparentDynamicPBgLight = document.querySelectorAll('input.color-bg-transparent');
  59. imageBgdynamicPrimaryColor(transparentDynamicPBgLight);
  60. localStorageBackup();
  61. $('#myonoffswitch1').on('click', function () {
  62. document.querySelector('body')?.classList.remove('dark-mode');
  63. document.querySelector('body')?.classList.remove('transparent-mode');
  64. document.querySelector('body')?.classList.remove('bg-img1');
  65. document.querySelector('body')?.classList.remove('bg-img2');
  66. document.querySelector('body')?.classList.remove('bg-img3');
  67. document.querySelector('body')?.classList.remove('bg-img4');
  68. localStorage.removeItem('sashBgImage');
  69. $('#myonoffswitch1').prop('checked', true);
  70. localStorage.setItem('sashlightMode', true);
  71. localStorage.removeItem('sashdarkMode');
  72. localStorage.removeItem('sashtransparentMode');
  73. })
  74. $('#myonoffswitch2').on('click', function () {
  75. document.querySelector('body')?.classList.remove('light-mode');
  76. document.querySelector('body')?.classList.remove('transparent-mode');
  77. document.querySelector('body')?.classList.remove('bg-img1');
  78. document.querySelector('body')?.classList.remove('bg-img2');
  79. document.querySelector('body')?.classList.remove('bg-img3');
  80. document.querySelector('body')?.classList.remove('bg-img4');
  81. localStorage.setItem('sashdarkMode', true);
  82. localStorage.removeItem('sashlightMode');
  83. localStorage.removeItem('sashtransparentMode');
  84. localStorage.removeItem('sashBgImage');
  85. $('#myonoffswitch2').prop('checked', true);
  86. })
  87. $('#myonoffswitchTransparent').on('click', function () {
  88. document.querySelector('body')?.classList.remove('dark-mode');
  89. document.querySelector('body')?.classList.remove('light-mode');
  90. document.querySelector('body')?.classList.remove('bg-img1');
  91. document.querySelector('body')?.classList.remove('bg-img2');
  92. document.querySelector('body')?.classList.remove('bg-img3');
  93. document.querySelector('body')?.classList.remove('bg-img4');
  94. localStorage.removeItem('sashBgImage');
  95. $('#myonoffswitchTransparent').prop('checked', true);
  96. localStorage.setItem('sashtransparentMode', true);
  97. localStorage.removeItem('sashlightMode');
  98. localStorage.removeItem('sashdarkMode');
  99. })
  100. })();
  101. // triggers on changing the color picker
  102. function changePrimaryColor() {
  103. 'use strict'
  104. $('#myonoffswitch3').prop('checked', true);
  105. $('#myonoffswitch6').prop('checked', true);
  106. checkOptions();
  107. var userColor = document.getElementById('colorID').value;
  108. localStorage.setItem('sashprimaryColor', hex2rgb(userColor));
  109. // removing dark theme properties
  110. localStorage.removeItem('sashdarkPrimary')
  111. localStorage.removeItem('sashtransparentBgColor');
  112. localStorage.removeItem('sashtransparentThemeColor');
  113. localStorage.removeItem('sashtransparentPrimary');
  114. localStorage.removeItem('sashtransparentBgImgPrimary');
  115. localStorage.removeItem('sashtransparentBgImgprimaryTransparent');
  116. localStorage.removeItem('sashdarkprimaryTransparent');
  117. document.querySelector('body').classList.add('light-mode');
  118. document.querySelector('body').classList.remove('transparent-mode');
  119. document.querySelector('body').classList.remove('dark-mode');
  120. localStorage.removeItem('sashBgImage');
  121. $('#myonoffswitch1').prop('checked', true);
  122. names()
  123. localStorage.setItem('sashlightMode', true);
  124. localStorage.removeItem('sashdarkMode');
  125. localStorage.removeItem('sashtransparentMode');
  126. }
  127. function darkPrimaryColor() {
  128. 'use strict'
  129. var userColor = document.getElementById('darkPrimaryColorID').value;
  130. localStorage.setItem('sashdarkPrimary', hex2rgb(userColor));
  131. $('#myonoffswitch5').prop('checked', true);
  132. $('#myonoffswitch8').prop('checked', true);
  133. checkOptions();
  134. // removing light theme data
  135. localStorage.removeItem('sashprimaryColor')
  136. localStorage.removeItem('sashprimaryHoverColor')
  137. localStorage.removeItem('sashprimaryBorderColor')
  138. localStorage.removeItem('sashprimaryTransparent');
  139. localStorage.removeItem('sashtransparentBgImgPrimary');
  140. localStorage.removeItem('sashtransparentBgImgprimaryTransparent');
  141. localStorage.removeItem('sashtransparentBgColor');
  142. localStorage.removeItem('sashtransparentThemeColor');
  143. localStorage.removeItem('sashtransparentPrimary');
  144. localStorage.removeItem('sashBgImage');
  145. document.querySelector('body').classList.add('dark-mode');
  146. document.querySelector('body').classList.remove('light-mode');
  147. document.querySelector('body').classList.remove('transparent-mode');
  148. $('#myonoffswitch2').prop('checked', true);
  149. names()
  150. localStorage.setItem('sashdarkMode', true);
  151. localStorage.removeItem('sashlightMode');
  152. localStorage.removeItem('sashtransparentMode');
  153. }
  154. function transparentPrimaryColor() {
  155. 'use strict'
  156. $('#myonoffswitch3').prop('checked', false);
  157. $('#myonoffswitch6').prop('checked', false);
  158. $('#myonoffswitch5').prop('checked', false);
  159. $('#myonoffswitch8').prop('checked', false);
  160. var userColor = document.getElementById('transparentPrimaryColorID').value;
  161. localStorage.setItem('sashtransparentPrimary', hex2rgb(userColor));
  162. // removing light theme data
  163. localStorage.removeItem('sashdarkPrimary');
  164. localStorage.removeItem('sashprimaryColor')
  165. localStorage.removeItem('sashprimaryHoverColor')
  166. localStorage.removeItem('sashprimaryBorderColor')
  167. localStorage.removeItem('sashprimaryTransparent');
  168. localStorage.removeItem('sashtransparentBgImgPrimary');
  169. localStorage.removeItem('sashtransparentBgImgprimaryTransparent');
  170. document.querySelector('body').classList.add('transparent-mode');
  171. document.querySelector('body').classList.remove('light-mode');
  172. document.querySelector('body').classList.remove('dark-mode');
  173. document.querySelector('body')?.classList.remove('bg-img1');
  174. document.querySelector('body')?.classList.remove('bg-img2');
  175. document.querySelector('body')?.classList.remove('bg-img3');
  176. document.querySelector('body')?.classList.remove('bg-img4');
  177. $('#myonoffswitchTransparent').prop('checked', true);
  178. checkOptions();
  179. names()
  180. localStorage.setItem('sashtransparentMode', true);
  181. localStorage.removeItem('sashlightMode');
  182. localStorage.removeItem('sashdarkMode');
  183. }
  184. function transparentBgImgPrimaryColor() {
  185. 'use strict'
  186. $('#myonoffswitch3').prop('checked', false);
  187. $('#myonoffswitch6').prop('checked', false);
  188. $('#myonoffswitch5').prop('checked', false);
  189. $('#myonoffswitch8').prop('checked', false);
  190. var userColor = document.getElementById('transparentBgImgPrimaryColorID').value;
  191. localStorage.setItem('sashtransparentBgImgPrimary', hex2rgb(userColor));
  192. if (
  193. document.querySelector('body')?.classList.contains('bg-img1') == false &&
  194. document.querySelector('body')?.classList.contains('bg-img2') == false &&
  195. document.querySelector('body')?.classList.contains('bg-img3') == false &&
  196. document.querySelector('body')?.classList.contains('bg-img4') == false
  197. ) {
  198. document.querySelector('body')?.classList.add('bg-img1');
  199. localStorage.setItem('sashBgImage', 'bg-img1')
  200. }
  201. // removing light theme data
  202. localStorage.removeItem('sashdarkPrimary');
  203. localStorage.removeItem('sashprimaryColor')
  204. localStorage.removeItem('sashprimaryHoverColor')
  205. localStorage.removeItem('sashprimaryBorderColor')
  206. localStorage.removeItem('sashprimaryTransparent');
  207. localStorage.removeItem('sashdarkprimaryTransparent');
  208. localStorage.removeItem('sashtransparentPrimary')
  209. localStorage.removeItem('sashtransparentprimaryTransparent');
  210. document.querySelector('body').classList.add('transparent-mode');
  211. document.querySelector('body')?.classList.remove('light-mode');
  212. document.querySelector('body')?.classList.remove('dark-mode');
  213. $('#myonoffswitchTransparent').prop('checked', true);
  214. checkOptions();
  215. names();
  216. localStorage.setItem('sashtransparentMode', true);
  217. localStorage.removeItem('sashlightMode');
  218. localStorage.removeItem('sashdarkMode');
  219. }
  220. function transparentBgColor() {
  221. 'use strict'
  222. $('#myonoffswitch3').prop('checked', false);
  223. $('#myonoffswitch6').prop('checked', false);
  224. $('#myonoffswitch5').prop('checked', false);
  225. $('#myonoffswitch8').prop('checked', false);
  226. var userColor = document.getElementById('transparentBgColorID').value;
  227. localStorage.setItem('sashtransparentBgColor', hex2rgb(userColor));
  228. localStorage.removeItem('sashtransparentBgImgPrimary');
  229. localStorage.removeItem('sashtransparentBgImgprimaryTransparent');
  230. // removing light theme data
  231. localStorage.removeItem('sashdarkPrimary');
  232. localStorage.removeItem('sashprimaryColor')
  233. localStorage.removeItem('sashprimaryHoverColor')
  234. localStorage.removeItem('sashprimaryBorderColor')
  235. localStorage.removeItem('sashprimaryTransparent');
  236. localStorage.removeItem('sashBgImage');
  237. document.querySelector('body').classList.add('transparent-mode');
  238. document.querySelector('body').classList.remove('light-mode');
  239. document.querySelector('body').classList.remove('dark-mode');
  240. document.querySelector('body')?.classList.remove('bg-img1');
  241. document.querySelector('body')?.classList.remove('bg-img2');
  242. document.querySelector('body')?.classList.remove('bg-img3');
  243. document.querySelector('body')?.classList.remove('bg-img4');
  244. $('#myonoffswitchTransparent').prop('checked', true);
  245. checkOptions();
  246. localStorage.setItem('sashtransparentMode', true);
  247. localStorage.removeItem('sashlightMode');
  248. localStorage.removeItem('sashdarkMode');
  249. }
  250. function bgImage(e) {
  251. 'use strict'
  252. $('#myonoffswitch3').prop('checked', false);
  253. $('#myonoffswitch6').prop('checked', false);
  254. $('#myonoffswitch5').prop('checked', false);
  255. $('#myonoffswitch8').prop('checked', false);
  256. let imgID = e.getAttribute('class');
  257. localStorage.setItem('sashBgImage', imgID);
  258. // removing light theme data
  259. localStorage.removeItem('sashdarkPrimary');
  260. localStorage.removeItem('sashprimaryColor')
  261. localStorage.removeItem('sashtransparentBgColor');
  262. localStorage.removeItem('sashtransparentThemeColor');
  263. localStorage.removeItem('sashtransparentprimaryTransparent');
  264. document.querySelector('body').classList.add('transparent-mode');
  265. document.querySelector('body')?.classList.remove('light-mode');
  266. document.querySelector('body')?.classList.remove('dark-mode');
  267. $('#myonoffswitchTransparent').prop('checked', true);
  268. checkOptions();
  269. localStorage.setItem('sashtransparentMode', true);
  270. localStorage.removeItem('sashlightMode');
  271. localStorage.removeItem('sashdarkMode');
  272. }
  273. function localStorageBackup() {
  274. 'use strict'
  275. // if there is a value stored, update color picker and background color
  276. // Used to retrive the data from local storage
  277. if (localStorage.sashprimaryColor) {
  278. if (document.getElementById('colorID')) {
  279. document.getElementById('colorID').value = localStorage.sashprimaryColor;
  280. }
  281. document.querySelector('html').style.setProperty('--primary-rgb', localStorage.sashprimaryColor);
  282. document.querySelector('body')?.classList.add('light-mode');
  283. document.querySelector('body')?.classList.remove('dark-mode');
  284. document.querySelector('body')?.classList.remove('transparent-mode');
  285. $('#myonoffswitch3').prop('checked', true);
  286. $('#myonoffswitch6').prop('checked', true);
  287. $('#myonoffswitch1').prop('checked', true);
  288. }
  289. if (localStorage.sashdarkPrimary) {
  290. if (document.getElementById('darkPrimaryColorID')) {
  291. document.getElementById('darkPrimaryColorID').value = localStorage.sashdarkPrimary;
  292. }
  293. document.querySelector('html').style.setProperty('--primary-rgb', localStorage.sashdarkPrimary);
  294. document.querySelector('body')?.classList.add('dark-mode');
  295. document.querySelector('body')?.classList.remove('light-mode');
  296. document.querySelector('body')?.classList.remove('transparent-mode');
  297. $('#myonoffswitch2').prop('checked', true);
  298. }
  299. if (localStorage.sashtransparentPrimary) {
  300. if (document.getElementById('transparentPrimaryColorID')) {
  301. document.getElementById('transparentPrimaryColorID').value = localStorage.sashtransparentPrimary;
  302. }
  303. document.querySelector('html').style.setProperty('--primary-rgb', localStorage.sashtransparentPrimary);
  304. document.querySelector('body')?.classList.add('transparent-mode');
  305. document.querySelector('body')?.classList.remove('dark-mode');
  306. document.querySelector('body')?.classList.remove('light-mode');
  307. $('#myonoffswitchTransparent').prop('checked', true);
  308. }
  309. if (localStorage.sashtransparentBgImgPrimary) {
  310. if (document.getElementById('transparentBgImgPrimaryColorID')) {
  311. document.getElementById('transparentBgImgPrimaryColorID').value = localStorage.sashtransparentBgImgPrimary;
  312. }
  313. document.querySelector('html').style.setProperty('--primary-rgb', localStorage.sashtransparentBgImgPrimary);
  314. document.querySelector('body')?.classList.add('transparent-mode');
  315. document.querySelector('body')?.classList.remove('dark-mode');
  316. document.querySelector('body')?.classList.remove('light-mode');
  317. $('#myonoffswitchTransparent').prop('checked', true);
  318. }
  319. if (localStorage.sashtransparentBgColor) {
  320. if (document.getElementById('transparentBgColorID')) {
  321. document.getElementById('transparentBgColorID').value = localStorage.sashtransparentBgColor;
  322. }
  323. document.querySelector('html').style.setProperty('--transparent-bg-rgb', localStorage.sashtransparentBgColor);
  324. document.querySelector('body').classList.add('transparent-mode');
  325. document.querySelector('body').classList.remove('dark-mode');
  326. document.querySelector('body').classList.remove('light-mode');
  327. $('#myonoffswitchTransparent').prop('checked', true);
  328. }
  329. if (localStorage.sashBgImage) {
  330. document.querySelector('body')?.classList.add('transparent-mode');
  331. let bgImg = localStorage.sashBgImage.split(' ')[0];
  332. document.querySelector('body')?.classList.add(bgImg);
  333. document.querySelector('body')?.classList.remove('dark-mode');
  334. document.querySelector('body')?.classList.remove('light-mode');
  335. $('#myonoffswitchTransparent').prop('checked', true);
  336. }
  337. if (localStorage.sashlightMode) {
  338. document.querySelector('body')?.classList.add('light-mode');
  339. document.querySelector('body')?.classList.remove('dark-mode');
  340. document.querySelector('body')?.classList.remove('transparent-mode');
  341. $('#myonoffswitch1').prop('checked', true);
  342. $('#myonoffswitch3').prop('checked', true);
  343. $('#myonoffswitch6').prop('checked', true);
  344. }
  345. if (localStorage.sashdarkMode) {
  346. document.querySelector('body')?.classList.remove('light-mode');
  347. document.querySelector('body')?.classList.add('dark-mode');
  348. document.querySelector('body')?.classList.remove('transparent-mode');
  349. $('#myonoffswitch2').prop('checked', true);
  350. $('#myonoffswitch5').prop('checked', true);
  351. $('#myonoffswitch8').prop('checked', true);
  352. }
  353. if (localStorage.sashtransparentMode) {
  354. document.querySelector('body')?.classList.remove('light-mode');
  355. document.querySelector('body')?.classList.remove('dark-mode');
  356. document.querySelector('body')?.classList.add('transparent-mode');
  357. $('#myonoffswitchTransparent').prop('checked', true);
  358. $('#myonoffswitch3').prop('checked', false);
  359. $('#myonoffswitch6').prop('checked', false);
  360. $('#myonoffswitch5').prop('checked', false);
  361. $('#myonoffswitch8').prop('checked', false);
  362. }
  363. if (localStorage.sashhorizontal) {
  364. document.querySelector('body').classList.add('horizontal')
  365. }
  366. if (localStorage.sashhorizontalHover) {
  367. document.querySelector('body').classList.add('horizontal-hover')
  368. }
  369. if (localStorage.sashrtl) {
  370. document.querySelector('body').classList.add('rtl')
  371. }
  372. if (localStorage.sashclosedmenu) {
  373. document.querySelector('body').classList.add('closed-leftmenu')
  374. }
  375. if (localStorage.sashicontextmenu) {
  376. document.querySelector('body').classList.add('icontext-menu')
  377. }
  378. if (localStorage.sashsideiconmenu) {
  379. document.querySelector('body').classList.add('icon-overlay')
  380. }
  381. if (localStorage.sashhoversubmenu) {
  382. document.querySelector('body').classList.add('hover-submenu')
  383. }
  384. if (localStorage.sashhoversubmenu1) {
  385. document.querySelector('body').classList.add('hover-submenu1')
  386. }
  387. if (localStorage.sashdoublemenu) {
  388. document.querySelector('body').classList.add('double-menu')
  389. }
  390. if (localStorage.sashdoublemenutabs) {
  391. document.querySelector('body').classList.add('double-menu-tabs')
  392. }
  393. if (localStorage.sashscrollable) {
  394. document.querySelector('body').classList.add('scrollable-layout')
  395. }
  396. if (localStorage.sashboxedwidth) {
  397. document.querySelector('body').classList.add('layout-boxed')
  398. }
  399. if (localStorage.sashlightheader) {
  400. document.querySelector('body').classList.add('header-light')
  401. }
  402. if (localStorage.sashcolorheader) {
  403. document.querySelector('body').classList.add('color-header')
  404. }
  405. if (localStorage.sashdarkheader) {
  406. document.querySelector('body').classList.add('dark-header')
  407. }
  408. if (localStorage.sashgradientheader) {
  409. document.querySelector('body').classList.add('gradient-header')
  410. }
  411. if (localStorage.sashlightmenu) {
  412. document.querySelector('body').classList.add('light-menu')
  413. }
  414. if (localStorage.sashcolormenu) {
  415. document.querySelector('body').classList.add('color-menu')
  416. }
  417. if (localStorage.sashdarkmenu) {
  418. document.querySelector('body').classList.add('dark-menu')
  419. }
  420. if (localStorage.sashgradientmenu) {
  421. document.querySelector('body').classList.add('gradient-menu')
  422. }
  423. if (localStorage.sashdefaultlogo) {
  424. document.querySelector('body').classList.add('default-logo')
  425. }
  426. if (localStorage.sashcenterlogo) {
  427. document.querySelector('body').classList.add('center-logo')
  428. }
  429. }
  430. // to check the value is hexa or not
  431. const isValidHex = (hexValue) => /^#([A-Fa-f0-9]{3,4}){1,2}$/.test(hexValue)
  432. const getChunksFromString = (st, chunkSize) => st.match(new RegExp(`.{${chunkSize}}`, "g"))
  433. // convert hex value to 256
  434. const convertHexUnitTo256 = (hexStr) => parseInt(hexStr.repeat(2 / hexStr.length), 16)
  435. // get alpha value is equla to 1 if there was no value is asigned to alpha in function
  436. const getAlphafloat = (a, alpha) => {
  437. if (typeof a !== "undefined") { return a / 255 }
  438. if ((typeof alpha != "number") || alpha < 0 || alpha > 1) {
  439. return 1
  440. }
  441. return alpha
  442. }
  443. // convertion of hex code to rgba code
  444. function hexToRgba(hexValue, alpha) {
  445. 'use strict'
  446. if (!isValidHex(hexValue)) { return null }
  447. const chunkSize = Math.floor((hexValue.length - 1) / 3)
  448. const hexArr = getChunksFromString(hexValue.slice(1), chunkSize)
  449. const [r, g, b, a] = hexArr.map(convertHexUnitTo256)
  450. return `rgba(${r}, ${g}, ${b}, ${getAlphafloat(a, alpha)})`
  451. }
  452. let myVarVal, myVarVal1, myVarVal2, myVarVal3,primaryColorVal
  453. function names() {
  454. 'use strict'
  455. primaryColorVal = getComputedStyle(document.documentElement).getPropertyValue('--primary-rgb').trim();
  456. //get variable
  457. myVarVal = localStorage.getItem("sashprimaryColor") || localStorage.getItem("sashdarkPrimary") || localStorage.getItem("sashtransparentPrimary") || localStorage.getItem("sashtransparentBgImgPrimary") ||primaryColorVal;
  458. myVarVal1 = localStorage.getItem("sashprimaryColor") || localStorage.getItem("sashdarkPrimary") || localStorage.getItem("sashtransparentPrimary") || localStorage.getItem("sashtransparentBgImgPrimary") || "#05c3fb";
  459. if (document.querySelector('#transactions') !== null) {
  460. index(myVarVal, myVarVal1);
  461. }
  462. }
  463. names();