added striped box

This commit is contained in:
Danny Coates 2018-06-20 15:23:15 -07:00
parent 211b1a8576
commit 207179484c
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB
4 changed files with 50 additions and 19 deletions

View file

@ -1,10 +1,14 @@
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)];
module.exports = function(state) {
if (!state.backgroundUrl) {
const backgrounds = assets.match(/background/);
state.backgroundUrl =
backgrounds[Math.floor(Math.random() * backgrounds.length)];
}
return html`<div class="background">
<img src="${src}">
<img src="${state.backgroundUrl}">
</div>`;
};