Skip to content

Commit

Permalink
full screen background img changes
Browse files Browse the repository at this point in the history
  • Loading branch information
met18001 committed Apr 22, 2020
1 parent 12e9263 commit f29d6e6
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 26 deletions.
34 changes: 20 additions & 14 deletions final_project/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@ body {
margin: 0;
padding: 0;
overflow: hidden;
background-position: center;
background-size: cover;
background-repeat: no-repeat;
min-height: 100vh;

}

img{

}
#img{
max-width: 100vw;
max-height: 100vh;
}

/* Google font */
@import url('https://fonts.googleapis.com/css?family=Orbitron');
Expand All @@ -20,19 +17,28 @@ body {
font-family: 'Orbitron', sans-serif;
color: #66ff99;
font-size: 56px;
position: absolute;
top: 50%;
left: 34%;



}
p{
position: absolute;
top: 40%;
left: 34%;

font-family: 'Orbitron', sans-serif;
color: #66ff99;
font-size: 20px;
}

.wrapper{
display: -webkit-box;
display: flex;
-webkit-box-pack: center;
justify-content: center;
-webkit-box-align: center;
align-items: center;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
flex-direction: column;
min-height: 100vh;

}


8 changes: 5 additions & 3 deletions final_project/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div id="clock"></div>
<p id="good"> <span> <input type="text" editable name></span></p>
<div class="wrapper">
<div id="clock"></div>
<p id="good"> Good <span id="morning"> </span><span contenteditable=true id="name">Person</span></p>

<div id="img"></div>
<div id="img"></div>
</div>



Expand Down
18 changes: 9 additions & 9 deletions final_project/js/this.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ const numItemsToGenerate = 1;

function renderItem(){
fetch(`https://source.unsplash.com/1600x900/?morning`).then((response)=> {
let item = document.getElementById("img");
item.classList.add('item');
item.innerHTML = `
<img class="morning-image" src="${response.url}" alt="morning image"/>
`
document.documentElement.appendChild(item);
document.body.style.backgroundImage = `url(${response.url})`
// item.classList.add('item');
//item.innerHTML = `
// <img class="morning-image" src="${response.url}" alt="morning image"/>
// `
// document.documentElement.appendChild(item);
})
}
for(let i=0;i<numItemsToGenerate;i++){
Expand Down Expand Up @@ -52,9 +52,9 @@ var curHr = today.getHours()
//}

if (curHr < 12) {
document.write('good morning')
document.getElementById('morning').innerText ='morning'
} else if (curHr < 18) {
document.write('good afternoon')
document.getElementById('morning').innerText ='afternoon'
} else {
document.write('good evening')
document.getElementById('morning').innerText ='night'
}

0 comments on commit f29d6e6

Please sign in to comment.