From 25508eb2f37fc0e1d6c322aa0b8339536d11e9c2 Mon Sep 17 00:00:00 2001 From: Jack Date: Fri, 29 May 2020 16:29:27 +0100 Subject: [PATCH] updated the way themes are stored --- public/js/commandline.js | 8 +-- public/js/settings.js | 2 +- public/themes/list.json | 150 ++++++++++++++++++++++++++++++++------- 3 files changed, 130 insertions(+), 30 deletions(-) diff --git a/public/js/commandline.js b/public/js/commandline.js index 33904a451..6ea7c5543 100644 --- a/public/js/commandline.js +++ b/public/js/commandline.js @@ -389,13 +389,13 @@ $.getJSON("themes/list.json", function(data) { themesList = data.sort(); data.forEach(theme => { commandsThemes.list.push({ - id: "changeTheme" + capitalizeFirstLetter(theme), - display: theme.replace('_',' '), + id: "changeTheme" + capitalizeFirstLetter(theme.name), + display: theme.name.replace('_',' '), hover: () => { - previewTheme(theme); + previewTheme(theme.name); }, exec: () => { - setTheme(theme); + setTheme(theme.name); } }) }) diff --git a/public/js/settings.js b/public/js/settings.js index e965b9413..58cc9bc67 100644 --- a/public/js/settings.js +++ b/public/js/settings.js @@ -2,7 +2,7 @@ function updateSettingsPage(){ let themesEl = $(".pageSettings .section.themes .buttons").empty(); themesList.forEach(theme => { - themesEl.append(`
${theme.replace('_', ' ')}
`); + themesEl.append(`
${theme.name.replace('_', ' ')}
`); }) let langEl = $(".pageSettings .section.languages .buttons").empty(); diff --git a/public/themes/list.json b/public/themes/list.json index 0b4f99e21..7639a3580 100644 --- a/public/themes/list.json +++ b/public/themes/list.json @@ -1,27 +1,127 @@ [ - "light", - "dark", - "8008", - "carbon", - "dots", - "nautilus", - "serika", - "serika_dark", - "bushido", - "red_samurai", - "rgb", - "oblivion", - "laser", - "retro", - "dracula", - "nord", - "mr_sleeves", - "olivia", - "bliss", - "mizu", - "metaverse", - "shadow", - "mint", - "miami", - "miami_nights" + { + "name": "light", + "bgColor": "#fff", + "textColor": "#111" + }, + { + "name": "dark", + "bgColor": "#111", + "textColor": "#eee" + }, + { + "name": "8008", + "bgColor": "#3c4756", + "textColor": "#f44c7f" + }, + { + "name": "carbon", + "bgColor": "#575d5e", + "textColor": "#ed6b21" + }, + { + "name": "dots", + "bgColor": "#121520", + "textColor": "#7f88ab" + }, + { + "name": "nautilus", + "bgColor": "#20304a", + "textColor": "#eab622" + }, + { + "name": "serika", + "bgColor": "#e2b714", + "textColor": "#323437" + }, + { + "name": "serika_dark", + "bgColor": "#323437", + "textColor": "#e2b714" + }, + { + "name": "bushido", + "bgColor": "#414755", + "textColor": "#ec4c56" + }, + { + "name": "red_samurai", + "bgColor": "#84202c", + "textColor": "#c79e6e" + }, + { + "name": "rgb", + "bgColor": "#111", + "textColor": "#eee" + }, + { + "name": "oblivion", + "bgColor": "#313231", + "textColor": "#a5a096" + }, + { + "name": "laser", + "bgColor": "#221b44", + "textColor": "#b82356" + }, + { + "name": "retro", + "bgColor": "#b3b0a8", + "textColor": "#1d181a" + }, + { + "name": "dracula", + "bgColor": "#282a36", + "textColor": "#bd93f9" + }, + { + "name": "nord", + "bgColor": "#242933", + "textColor": "#617b94" + }, + { + "name": "mr_sleeves", + "bgColor": "#8fadc9", + "textColor": "#daa99b" + }, + { + "name": "olivia", + "bgColor": "#1c1b1d", + "textColor": "#deaf9d" + }, + { + "name": "bliss", + "bgColor": "#262727", + "textColor": "#665957" + }, + { + "name": "mizu", + "bgColor": "#afcbdd", + "textColor": "#1a2633" + }, + { + "name": "metaverse", + "bgColor": "#232323", + "textColor": "#d82934" + }, + { + "name": "shadow", + "bgColor": "#000", + "textColor": "#444" + }, + { + "name": "mint", + "bgColor": "#05385b", + "textColor": "#5cdb95" + }, + { + "name": "miami", + "bgColor": "#f35588", + "textColor": "#05dfd7" + }, + { + "name": "miami_nights", + "bgColor": "#18181a", + "textColor": "#e4609b" + } ]