feat: finish quick links, start weather widget, bug fixes etc

Co-authored-by: Alex Sparkes <turbomarshmello@gmail.com>
This commit is contained in:
David Ralph
2021-04-09 14:44:18 +01:00
parent 75fea391f0
commit 2f21b5b5c2
20 changed files with 285 additions and 43 deletions

View File

@@ -24,11 +24,13 @@ export default class Background extends React.PureComponent {
gradientStyleBuilder(gradientSettings) {
const { type, angle, gradient } = gradientSettings;
let style = `background: ${gradient[0].colour};`;
if (gradient.length > 1) {
// Note: Append the gradient for additional browser support.
const stepStyles = gradient.map(g => ` ${g.colour} ${g.stop}%`).join();
style += ` background: ${type}-gradient(${(type === 'linear' ? (`${angle}deg,`) : '')}${stepStyles})`;
}
this.setState({
style: style
});
@@ -132,7 +134,7 @@ export default class Background extends React.PureComponent {
case 'colour':
// background colour
const customBackgroundColour = localStorage.getItem('customBackgroundColour');
const customBackgroundColour = localStorage.getItem('customBackgroundColour') || {"angle":"180","gradient":[{"colour":"#ffb032","stop":0}],"type":"linear"};
let gradientSettings = '';
try {
gradientSettings = JSON.parse(customBackgroundColour);