mirror of
https://gitlab.com/timvisee/send.git
synced 2025-12-09 08:15:11 +03:00
added background image
This commit is contained in:
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>`;
|
||||
};
|
||||
Reference in New Issue
Block a user