added striped box
This commit is contained in:
parent
211b1a8576
commit
207179484c
4 changed files with 50 additions and 19 deletions
|
@ -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>`;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue