send/app/templates/activeBackground/index.js

11 lines
317 B
JavaScript
Raw Normal View History

2018-06-19 19:58:42 +00:00
const html = require('choo/html');
const assets = require('../../../common/assets');
module.exports = function() {
const backgrounds = assets.match(/background/);
const src = backgrounds[Math.floor(Math.random() * backgrounds.length)];
return html`<div class="background">
<img src="${src}">
</div>`;
};