3
.gitignore
vendored
@ -1,2 +1,3 @@
|
||||
build
|
||||
node_modules
|
||||
node_modules
|
||||
.idea
|
BIN
data/previews/chan-theme.png
Normal file
After Width: | Height: | Size: 426 KiB |
BIN
data/previews/dark-theme.png
Normal file
After Width: | Height: | Size: 56 KiB |
BIN
data/previews/darkchans-theme.png
Normal file
After Width: | Height: | Size: 381 KiB |
BIN
data/previews/forest-theme.png
Normal file
After Width: | Height: | Size: 169 KiB |
BIN
data/previews/fruit-sorbet.png
Normal file
After Width: | Height: | Size: 123 KiB |
BIN
data/previews/ocean-breeze.png
Normal file
After Width: | Height: | Size: 76 KiB |
BIN
data/previews/orange-dark-theme.png
Normal file
After Width: | Height: | Size: 66 KiB |
BIN
data/previews/orange-theme.png
Normal file
After Width: | Height: | Size: 64 KiB |
@ -1,20 +1,67 @@
|
||||
{
|
||||
"themes": {
|
||||
"dark" : {
|
||||
"themes": [
|
||||
{
|
||||
"name": "Chan",
|
||||
"id": "chan",
|
||||
"sha256": "b252dc551c292fb70984e05f48758547ffd417185c7eb810d4eae42ae94b7fe3",
|
||||
"size": "61.8 MB",
|
||||
"previewImageUrl": "https://themes.stackwallet.com/previews/chan-theme.png"
|
||||
},
|
||||
{
|
||||
"name": "Chan Dark",
|
||||
"id": "dark_chan",
|
||||
"sha256": "0d599eae5200c02df42e45cfa1bc016f6e2d8a5fa771e54c08a59cb4d1f8d2c3",
|
||||
"size": "61.8 MB",
|
||||
"previewImageUrl": "https://themes.stackwallet.com/previews/darkchans-theme.png"
|
||||
},
|
||||
{
|
||||
"name": "Dark",
|
||||
"id": "dark",
|
||||
"description": "Dark",
|
||||
"primary_color": "0xFF2A2D34",
|
||||
"secondary_color": "0xFF4C86E9",
|
||||
"tertiary_color": "0xFFFFFFFF",
|
||||
"background": "0xFF2A2D34",
|
||||
"overlay": "0xFF111215",
|
||||
"accentColorBlue": "0xFF4C86E9",
|
||||
"accentColorGreen": "0xFF4CC0A0",
|
||||
"accentColorYellow": "0xFFF7D65D",
|
||||
"accentColorRed": "0xFFD34E50",
|
||||
"accentColorOrange": "0xFFFEA68D",
|
||||
"accentColorDark": "0xFFF3F3F3"
|
||||
"sha256": "12699563c238b04af9576ffdf6c3e57587fa697faf860f3792fcecd45d3178ac",
|
||||
"size": "475.8 kB",
|
||||
"previewImageUrl": "https://themes.stackwallet.com/previews/dark-theme.png"
|
||||
},
|
||||
{
|
||||
"name": "Forest",
|
||||
"id": "forest",
|
||||
"sha256": "23c72db0989efe705a77a46d60e60252ae8a49df5b5774896a0f3f6c6fdc3c4f",
|
||||
"size": "762.7 kB",
|
||||
"previewImageUrl": "https://themes.stackwallet.com/previews/forest-theme.png"
|
||||
},
|
||||
{
|
||||
"name": "Fruit Sorbet",
|
||||
"id": "fruit_sorbet",
|
||||
"sha256": "053b434ab6ba79d2e113aa484eb73e0bc2439c22a62e56d8edf25dd5edc2970c",
|
||||
"size": "582.9 kB",
|
||||
"previewImageUrl": "https://themes.stackwallet.com/previews/fruit-sorbet.png"
|
||||
},
|
||||
{
|
||||
"name": "Light",
|
||||
"id": "light",
|
||||
"sha256": "0e17e6caccf4b0561786f6cd59c94777157ee4570ec7b83a2fc7a3720a291d7f",
|
||||
"size": "474.9 kB",
|
||||
"previewImageUrl": ""
|
||||
},
|
||||
{
|
||||
"name": "Ocean Breeze",
|
||||
"id": "ocean_breeze",
|
||||
"sha256": "f9e64cf9855d4dd22201b7686ffc68936b500b034527f0d0006f1dbc8f5a6472",
|
||||
"size": "2.8 MB",
|
||||
"previewImageUrl": "https://themes.stackwallet.com/previews/ocean-breeze.png"
|
||||
},
|
||||
{
|
||||
"name": "OLED Black",
|
||||
"id": "oled_black",
|
||||
"sha256": "d6201c3374ca52a0ffeddb5425b5b2f3d6c1c23efe9da17b342061b212fdb0bf",
|
||||
"size": "476.4 kB",
|
||||
"previewImageUrl": "https://themes.stackwallet.com/previews/orange-dark-theme.png"
|
||||
},
|
||||
{
|
||||
"name": "Orange",
|
||||
"id": "orange",
|
||||
"sha256": "0f5d749b2a5285564c2a7f7a1d6b4fbf633144745f16098aeccf5689cccdd38c",
|
||||
"size": "107.6 kB",
|
||||
"previewImageUrl": "https://themes.stackwallet.com/previews/orange-theme.png"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
BIN
data/themes/chan.zip
Normal file
BIN
data/themes/chan_dark.zip
Normal file
BIN
data/themes/dark.zip
Normal file
BIN
data/themes/forest.zip
Normal file
BIN
data/themes/fruit_sorbet.zip
Normal file
BIN
data/themes/light.zip
Normal file
BIN
data/themes/ocean_breeze.zip
Normal file
BIN
data/themes/oled_black.zip
Normal file
BIN
data/themes/orange.zip
Normal file
@ -1,15 +1,7 @@
|
||||
function getThemeDetails(id : string) {
|
||||
const fs = require("fs");
|
||||
const json_file = fs.readFileSync("data/themes.json");
|
||||
const json = JSON.parse(json_file);
|
||||
const themes = json.themes;
|
||||
var theme = {};
|
||||
Object.entries(themes).map(([key, value]) => {
|
||||
if (key == id){
|
||||
theme = (themes[key])
|
||||
}
|
||||
});
|
||||
return theme
|
||||
const theme_file = fs.readFileSync("data/themes/" + id + ".zip");
|
||||
return theme_file;
|
||||
}
|
||||
|
||||
module.exports = getThemeDetails;
|
@ -3,20 +3,7 @@ function getThemeList() {
|
||||
const json_file = fs.readFileSync("data/themes.json");
|
||||
const json = JSON.parse(json_file);
|
||||
const themes = json.themes;
|
||||
var themeArray : Array<Object> = [];
|
||||
// For loop that will look for all the themes in the themes.json file
|
||||
Object.entries(themes).map(([key, value]) => {
|
||||
var theme : Object = {
|
||||
"name": themes[key].name,
|
||||
"id": themes[key].id,
|
||||
"description": themes[key].description,
|
||||
"primary_color": themes[key].primary_color, // Primary color is background color in the theme
|
||||
"secondary_color": themes[key].secondary_color, // Secondary color is the color of the buttonBackPrimary in the theme
|
||||
"tertiary_color": themes[key].tertiary_color, // Tertiary color is the color of the buttonTextPrimary in the theme
|
||||
}
|
||||
themeArray.push(theme);
|
||||
})
|
||||
return themeArray;
|
||||
return themes;
|
||||
}
|
||||
|
||||
module.exports = getThemeList;
|
@ -8,17 +8,19 @@ function startServer(port : number) {
|
||||
|
||||
app.use(cors());
|
||||
|
||||
app.use("/previews", express.static("data/previews"));
|
||||
|
||||
var themeListReqCounter = 0;
|
||||
app.get("/themelist", (req : any, res : any) => {
|
||||
app.get("/themes", (req : any, res : any) => {
|
||||
themeListReqCounter++;
|
||||
console.log("Got request on /themelist, request number " + themeListReqCounter)
|
||||
console.log("Got request on /themes, request number " + themeListReqCounter)
|
||||
res.send(getThemeList());
|
||||
});
|
||||
|
||||
var themeDetailsReqCounter = 0;
|
||||
app.get("/themedetails/:id", (req : any, res : any) => {
|
||||
app.get("/theme/:id", (req : any, res : any) => {
|
||||
themeDetailsReqCounter++;
|
||||
console.log("Got request on /themedetails/" + req.params.id + ", request number " + themeDetailsReqCounter)
|
||||
console.log("Got request on /theme/" + req.params.id + ", request number " + themeDetailsReqCounter)
|
||||
res.send(getThemeDetails(req.params.id));
|
||||
});
|
||||
|
||||
|