Skip to content

Commit

Permalink
Update via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
ogurinkaben committed May 21, 2019
1 parent 54c253c commit da3416a
Show file tree
Hide file tree
Showing 21 changed files with 8 additions and 27 deletions.
Binary file added img/bg/bg-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/bg/bg-2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/bg/bg-3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/bg/bg-4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/bg/bg-5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed img/day/day1.jpg
Binary file not shown.
Binary file removed img/day/day2.jpg
Binary file not shown.
Binary file removed img/day/day3.jpg
Binary file not shown.
Binary file removed img/day/day4.jpg
Binary file not shown.
Binary file removed img/day/day5.jpg
Binary file not shown.
Binary file removed img/morning/morning1.jpg
Binary file not shown.
Binary file removed img/morning/morning2.jpg
Binary file not shown.
Binary file removed img/morning/morning3.jpg
Binary file not shown.
Binary file removed img/morning/morning4.jpg
Binary file not shown.
Binary file removed img/morning/morning5.jpg
Binary file not shown.
Binary file removed img/night/mojave-night.jpg
Binary file not shown.
Binary file removed img/night/night-bg.jpg
Binary file not shown.
Binary file removed img/night/night1.jpg
Binary file not shown.
Binary file removed img/night/night2.jpg
Binary file not shown.
Binary file removed img/night/night3.jpg
Binary file not shown.
35 changes: 8 additions & 27 deletions js/script.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,11 @@
var morningBg = [
'img/morning/morning1.jpg',
'img/morning/morning2.jpg',
'img/morning/morning3.jpg',
'img/morning/morning4.jpg',
'img/morning/morning5.jpg',
var bg =
['/img/bg/bg-1.jpg',
'/img/ng/bg-2.jpg',
'img/bg/bg-3.jpg',
'img/bg/bg-4.jpg',
'img/bg/bg-5.jpg'];


]
var dayBg = [
'img/day/day1.jpg',
'img/day/day2.jpg',
'img/day/day3.jpg',
'img/day/day4.jpg',
'img/day/day5.jpg',

]


var nightBackground =
['/img/night/night-bg.jpg',
'/img/night/mojave-night.jpg',
'img/night/night1.jpg',
'img/night/night2.jpg',
'img/night/night3.jpg']
document.querySelector("body").style.backgroundImage = "url(" + bg[Math.floor(Math.random() * bg.length)] + ")";



Expand Down Expand Up @@ -62,13 +45,11 @@ function checkTime(i) {
var ch = time.getHours();
if (ch >= 18 && ch <= 23) {
document.getElementById("msg").innerHTML = "Having a sublime night?";
document.querySelector("body").style.backgroundImage = "url(" + nightBackground[Math.floor(Math.random() * nightBackground.length)] + ")";

}
else if (ch >= 12 && ch < 18) {
document.getElementById("msg").innerHTML = "Having a good day?";
document.querySelector("body").style.backgroundImage = "url(" + dayBg[Math.floor(Math.random() * dayBg.length)] + ")";
}
else {
document.getElementById("msg").innerHTML = "Good Morning";
document.querySelector("body").style.backgroundImage = "url(" + morningBg[Math.floor(Math.random() * morningBg.length)] + ")";
}

0 comments on commit da3416a

Please sign in to comment.