fox-send/app/templates/activeBackground/index.js

13 lines
319 B
JavaScript

const assets = require('../../../common/assets');
module.exports = function(state) {
if (!state.backgroundClass) {
const backgrounds = assets.match(/background_/);
state.backgroundClass = `background_${Math.floor(
Math.random() * backgrounds.length
) + 1}`;
}
return state.backgroundClass;
};