drop.chapril.org-firefoxsend/app/templates/activeBackground/index.js

13 lines
319 B
JavaScript
Raw Normal View History

2018-06-19 21:58:42 +02:00
const assets = require('../../../common/assets');
2018-06-21 00:23:15 +02:00
module.exports = function(state) {
2018-06-21 20:28:31 +02:00
if (!state.backgroundClass) {
const backgrounds = assets.match(/background_/);
state.backgroundClass = `background_${Math.floor(
Math.random() * backgrounds.length
) + 1}`;
2018-06-21 00:23:15 +02:00
}
2018-06-21 20:28:31 +02:00
return state.backgroundClass;
2018-06-19 21:58:42 +02:00
};