1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Add theme color support

This commit is contained in:
Bill Thornton 2021-09-23 23:33:05 -04:00
parent 965a8e203b
commit ae552337bc
3 changed files with 18 additions and 6 deletions

View file

@ -4,23 +4,29 @@
"themes": [ "themes": [
{ {
"name": "Apple TV", "name": "Apple TV",
"id": "appletv" "id": "appletv",
"color": "#bcbcbc"
}, { }, {
"name": "Blue Radiance", "name": "Blue Radiance",
"id": "blueradiance" "id": "blueradiance",
"color": "#011432"
}, { }, {
"name": "Dark", "name": "Dark",
"id": "dark", "id": "dark",
"color": "#202020",
"default": true "default": true
}, { }, {
"name": "Light", "name": "Light",
"id": "light" "id": "light",
"color": "#303030"
}, { }, {
"name": "Purple Haze", "name": "Purple Haze",
"id": "purplehaze" "id": "purplehaze",
"color": "#000420"
}, { }, {
"name": "WMC", "name": "WMC",
"id": "wmc" "id": "wmc",
"color": "#0c2450"
} }
], ],
"menuLinks": [], "menuLinks": [],

View file

@ -17,6 +17,9 @@
<meta property="og:url" content="http://jellyfin.org"> <meta property="og:url" content="http://jellyfin.org">
<meta property="og:description" content="The Free Software Media System"> <meta property="og:description" content="The Free Software Media System">
<meta property="og:type" content="article"> <meta property="og:type" content="article">
<meta id="themeColor" name="theme-color" content="#202020">
<link rel="apple-touch-icon" sizes="180x180" href="touchicon.png"> <link rel="apple-touch-icon" sizes="180x180" href="touchicon.png">
<!-- iPhone 5 --> <!-- iPhone 5 -->

View file

@ -31,7 +31,8 @@ function getThemeStylesheetInfo(id) {
return { return {
stylesheetPath: 'themes/' + theme.id + '/theme.css', stylesheetPath: 'themes/' + theme.id + '/theme.css',
themeId: theme.id themeId: theme.id,
color: theme.color
}; };
}); });
} }
@ -74,6 +75,8 @@ function setTheme(id) {
link.setAttribute('href', linkUrl); link.setAttribute('href', linkUrl);
themeStyleElement = link; themeStyleElement = link;
currentThemeId = info.themeId; currentThemeId = info.themeId;
document.getElementById('themeColor').content = info.color;
}); });
}); });
} }