forked from matrix/element-web
Merge pull request #13235 from TheStranjer/allow-random-welcome-bgs
Allow Riot Web to randomly pick welcome backgrounds
This commit is contained in:
commit
19130dc705
|
@ -32,7 +32,7 @@ For a good example, see https://riot.im/develop/config.json.
|
||||||
homeserver know what email template to use when talking to you.
|
homeserver know what email template to use when talking to you.
|
||||||
1. `branding`: Configures various branding and logo details, such as:
|
1. `branding`: Configures various branding and logo details, such as:
|
||||||
1. `welcomeBackgroundUrl`: An image to use as a wallpaper outside the app
|
1. `welcomeBackgroundUrl`: An image to use as a wallpaper outside the app
|
||||||
during authentication flows
|
during authentication flows. If an array is passed, an image is chosen randomly for each visit.
|
||||||
1. `authHeaderLogoUrl`: An logo image that is shown in the header during
|
1. `authHeaderLogoUrl`: An logo image that is shown in the header during
|
||||||
authentication flows
|
authentication flows
|
||||||
1. `authFooterLinks`: a list of links to show in the authentication page footer:
|
1. `authFooterLinks`: a list of links to show in the authentication page footer:
|
||||||
|
|
|
@ -29,8 +29,12 @@ export default class VectorAuthPage extends React.PureComponent {
|
||||||
const brandingConfig = SdkConfig.get().branding;
|
const brandingConfig = SdkConfig.get().branding;
|
||||||
let backgroundUrl = "themes/riot/img/backgrounds/valley.jpg";
|
let backgroundUrl = "themes/riot/img/backgrounds/valley.jpg";
|
||||||
if (brandingConfig && brandingConfig.welcomeBackgroundUrl) {
|
if (brandingConfig && brandingConfig.welcomeBackgroundUrl) {
|
||||||
|
if (Array.isArray(brandingConfig.welcomeBackgroundUrl)) {
|
||||||
|
backgroundUrl = brandingConfig.welcomeBackgroundUrl[Math.floor(Math.random() * brandingConfig.welcomeBackgroundUrl.length)];
|
||||||
|
} else {
|
||||||
backgroundUrl = brandingConfig.welcomeBackgroundUrl;
|
backgroundUrl = brandingConfig.welcomeBackgroundUrl;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const pageStyle = {
|
const pageStyle = {
|
||||||
background: `center/cover fixed url(${backgroundUrl})`,
|
background: `center/cover fixed url(${backgroundUrl})`,
|
||||||
|
|
Loading…
Reference in New Issue