added background image
This commit is contained in:
parent
fdef37287d
commit
211b1a8576
8 changed files with 47 additions and 8 deletions
11
app/templates/activeBackground/activeBackground.css
Normal file
11
app/templates/activeBackground/activeBackground.css
Normal file
|
@ -0,0 +1,11 @@
|
|||
.background {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
height: 100%;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
.background > img {
|
||||
height: 100%;
|
||||
}
|
10
app/templates/activeBackground/index.js
Normal file
10
app/templates/activeBackground/index.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
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>`;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue