Made theme colors session variable, and changed card color
This commit is contained in:
parent
0c84d9acb6
commit
5281bf4117
@ -11,7 +11,7 @@ var openValues = {
|
|||||||
"options": "-20%"
|
"options": "-20%"
|
||||||
};
|
};
|
||||||
|
|
||||||
var themeColors = {
|
Session.set('themeColors', {
|
||||||
"light": {
|
"light": {
|
||||||
"background": "White.jpg",
|
"background": "White.jpg",
|
||||||
"header": "#EBEBEB",
|
"header": "#EBEBEB",
|
||||||
@ -31,13 +31,13 @@ var themeColors = {
|
|||||||
"funcButton": "#5d75A2",
|
"funcButton": "#5d75A2",
|
||||||
"statusIcons": "#33ADFF",
|
"statusIcons": "#33ADFF",
|
||||||
"highlightText": "#FF1A1A",
|
"highlightText": "#FF1A1A",
|
||||||
"cards": "#050505",
|
"cards": "#151A2B",
|
||||||
"classes":"#46396E",
|
"classes":"#46396E",
|
||||||
"calendar": "#000",
|
"calendar": "#000",
|
||||||
//30313B
|
//30313B
|
||||||
"text": "#F6F6F6"
|
"text": "#F6F6F6"
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
|
||||||
var workColors = {
|
var workColors = {
|
||||||
"normal": "#2E4F74",
|
"normal": "#2E4F74",
|
||||||
@ -78,11 +78,11 @@ Session.set("classDisp",[]);
|
|||||||
Session.set("classDispHover",null);
|
Session.set("classDispHover",null);
|
||||||
|
|
||||||
Template.registerHelper('divColor', (div) => {
|
Template.registerHelper('divColor', (div) => {
|
||||||
return themeColors[Meteor.user().profile.preferences.theme][div];
|
return Session.get("themeColors")[Meteor.user().profile.preferences.theme][div];
|
||||||
});
|
});
|
||||||
|
|
||||||
Template.registerHelper("textColor", () => {
|
Template.registerHelper("textColor", () => {
|
||||||
document.getElementsByTagName("body")[0].style.color = themeColors[Meteor.user().profile.preferences.theme].text;
|
document.getElementsByTagName("body")[0].style.color = Session.get("themeColors")[Meteor.user().profile.preferences.theme].text;
|
||||||
return;
|
return;
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -91,7 +91,7 @@ Template.registerHelper('overlayDim', (part) => {
|
|||||||
var width = "width:" + dim[0].toString() + "px;";
|
var width = "width:" + dim[0].toString() + "px;";
|
||||||
var height = "height:" + dim[1].toString() + "px;";
|
var height = "height:" + dim[1].toString() + "px;";
|
||||||
var margin = "margin-left:" + (-dim[0] / 2).toString() + "px;";
|
var margin = "margin-left:" + (-dim[0] / 2).toString() + "px;";
|
||||||
var bg = "background-color:" + themeColors[Cookie.get("theme")].header + ";";
|
var bg = "background-color:" + Session.get("themeColors")[Meteor.user().profile.preferences.theme].header + ";";
|
||||||
return width + height + margin + bg;
|
return width + height + margin + bg;
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -174,9 +174,9 @@ Template.main.helpers({
|
|||||||
},
|
},
|
||||||
iconColor(icon) {
|
iconColor(icon) {
|
||||||
if (Session.get("sidebar") === icon + "Container") {
|
if (Session.get("sidebar") === icon + "Container") {
|
||||||
return themeColors[Meteor.user().profile.preferences.theme].statusIcons;
|
return Session.get("themeColors")[Meteor.user().profile.preferences.theme].statusIcons;
|
||||||
} else if (Session.get("sidebar") === "both") {
|
} else if (Session.get("sidebar") === "both") {
|
||||||
return themeColors[Meteor.user().profile.preferences.theme].statusIcons;
|
return Session.get("themeColors")[Meteor.user().profile.preferences.theme].statusIcons;
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -190,7 +190,7 @@ Template.main.helpers({
|
|||||||
},
|
},
|
||||||
bgSrc() {
|
bgSrc() {
|
||||||
var dim = [window.innerWidth, window.innerHeight];
|
var dim = [window.innerWidth, window.innerHeight];
|
||||||
var pic = "Backgrounds/"+themeColors[Meteor.user().profile.preferences.theme].background;
|
var pic = "Backgrounds/"+Session.get("themeColors")[Meteor.user().profile.preferences.theme].background;
|
||||||
return pic;
|
return pic;
|
||||||
},
|
},
|
||||||
menuStatus() {
|
menuStatus() {
|
||||||
@ -213,7 +213,7 @@ Template.main.helpers({
|
|||||||
},
|
},
|
||||||
modeStatus(status) {
|
modeStatus(status) {
|
||||||
if (status === Session.get("mode")) {
|
if (status === Session.get("mode")) {
|
||||||
return themeColors[Cookie.get("theme")].highlightText;
|
return Session.get("themeColors")[Meteor.user().profile.preferences.theme].highlightText;
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -307,7 +307,7 @@ Template.main.helpers({
|
|||||||
return "width:" + width.toString() + "px;margin-left:" + (0.5 * window.innerWidth - 0.5 * width).toString() + "px;";
|
return "width:" + width.toString() + "px;margin-left:" + (0.5 * window.innerWidth - 0.5 * width).toString() + "px;";
|
||||||
},
|
},
|
||||||
calColor() {
|
calColor() {
|
||||||
return "color:"+themeColors[Meteor.user().profile.preferences.theme].calendar;
|
return "color:"+Session.get("themeColors")[Meteor.user().profile.preferences.theme].calendar;
|
||||||
},
|
},
|
||||||
calbg() {
|
calbg() {
|
||||||
var width = window.innerWidth * 0.865;
|
var width = window.innerWidth * 0.865;
|
||||||
|
|||||||
@ -19,22 +19,6 @@ Session.set("code",null);
|
|||||||
Session.set("noclass",null);
|
Session.set("noclass",null);
|
||||||
Session.set("notfound",null);
|
Session.set("notfound",null);
|
||||||
|
|
||||||
|
|
||||||
// Colors of the theme
|
|
||||||
|
|
||||||
var themeColors = {
|
|
||||||
"light": {
|
|
||||||
"header": "#EBEBEB",
|
|
||||||
"sidebar": "#65839A",
|
|
||||||
"statusIcons": "#33ADFF",
|
|
||||||
"highlightText": "#FF1A1A",
|
|
||||||
"cards": "#FEFEFE"
|
|
||||||
},
|
|
||||||
"dark": {
|
|
||||||
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Template.profile.helpers({
|
Template.profile.helpers({
|
||||||
classsettings: function() {
|
classsettings: function() {
|
||||||
return {
|
return {
|
||||||
@ -168,7 +152,7 @@ Template.profile.helpers({
|
|||||||
},
|
},
|
||||||
profClassTabColor(status) { // Change this [Supposed to show the current mode that's selected via color]
|
profClassTabColor(status) { // Change this [Supposed to show the current mode that's selected via color]
|
||||||
if (status === Session.get("profClassTab")) {
|
if (status === Session.get("profClassTab")) {
|
||||||
return themeColors[Cookie.get("theme")].highlightText;
|
return Session.get("themeColors")[Meteor.user().profile.preferences.theme].highlightText;
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user