Private
Public Access
1
0

alternating background images

This commit is contained in:
Sander Roosendaal
2017-04-11 19:18:31 +02:00
parent 153e2b3d25
commit f6ceb46f6a
4 changed files with 46 additions and 2 deletions

View File

@@ -1,4 +1,30 @@
#main {
background-color: transparent;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
min-height: 759px;
min-width: 1024px;
width: 100%;
height: auto;
}
.one {
background-image: url("/static/img/landing1.jpg");
}
.two {
background-image: url("/static/img/landing2.jpg");
}
.three {
background-image: url("/static/img/landing1.jpg");
}
.four {
background-image: url("/static/img/landing2.jpg");
}
html {
font-size: 62.5%;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 518 KiB

After

Width:  |  Height:  |  Size: 335 KiB

8
static/js/background.js Normal file
View File

@@ -0,0 +1,8 @@
var num = (Math.floor(Math.random()*4));
var array = ['one', 'two', 'three', 'four'];
var elem = document.getElementById('main');
elem.classList.add(array[num]);