Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

accidentally closed the previous pull request #29

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
responsive design
  • Loading branch information
KateMhq committed Sep 23, 2018
commit 3641b146d517e4d57135e8543a5213f5a2f759c7
1 change: 1 addition & 0 deletions favorite.js
Original file line number Diff line number Diff line change
@@ -78,5 +78,6 @@ function shift(event,number){
const currentIndex= event.target.parentNode.getAttribute("value");
localData[parseInt(currentIndex)-number].index=currentIndex;
localData[currentIndex].index=parseInt(currentIndex)-number;
localStorage.setItem("favList", JSON.stringify(localData));
return localData
}
5 changes: 4 additions & 1 deletion movie.js
Original file line number Diff line number Diff line change
@@ -9,7 +9,10 @@ const body = document.querySelector("body");

let localData;
let totalSearchResults = 0;
let n=0;
let n= 0;
if (JSON.parse(localStorage.getItem("favList"))!==null){
n=JSON.parse(localStorage.getItem("favList")).length
}
//this is to insert search results using dom
function searchResult(body) {
body.Search.forEach(movie => {
24 changes: 21 additions & 3 deletions style.css
Original file line number Diff line number Diff line change
@@ -77,8 +77,9 @@ input.search-area-submit{
.pagination{
display:grid;

grid-template-columns: repeat(10,1fr);
grid-template-columns: repeat(10,8pw);
align-items: center;
justify-content: center;
grid-gap: 0.25em;
margin:0;
padding-bottom: 1em;
@@ -100,15 +101,14 @@ input.search-area-submit{
display: none;
}

.search-result-list{
.search-result-list, .favorite-list{
display: grid;
grid-gap: 1em;
grid-template-columns: 99%;
grid-template-rows: repeat(minmax(200px,1fr));
justify-content: start;
align-items: start;


}

.movie{
@@ -121,3 +121,21 @@ input.search-area-submit{
p{
padding-bottom: 0.3em;
}

@media(min-width:768px) {
.search-result-list,.favorite-list{
grid-template-columns: 50% 50%;
}
}

@media(min-width:960px) {
.search-result-list,.favorite-list{
grid-template-columns: 33% 33% 33%;
}
}

@media(min-width:1200px) {
.search-result-list,.favorite-list{
grid-template-columns: 20% 20% 20% 20% 20%;
}
}