-
Notifications
You must be signed in to change notification settings - Fork 8
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
List 1 #1
base: master
Are you sure you want to change the base?
List 1 #1
Conversation
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- remove empty lines
- the order of css rules should be first parent, then its childs/states like hover. For eg.
.card
should come first, then.card:hover
and.card image
as such. - You can use css variables for values like color which is used again and again.
main.js
Outdated
if(poster_path!=null){ | ||
htmlData+=`<img src="${imgUrl +poster_path}" alt="${title}">`; | ||
if(title.length>16){ | ||
htmlData+=`<h3 class="card-item"> ${title.substring(0,17)}...</h3>`; | ||
}else{ | ||
htmlData+=`<h3 class="card-item"> ${title}</h3>` | ||
} | ||
htmlData+=`<button class ="btn"> Read More </button>` | ||
|
||
div.innerHTML=htmlData |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although innerHTML is one of the ways you can directly add elements, it should be avoided due to various reasons..
You can create element and append it.
main.js
Outdated
|
||
|
||
async function getMovieFromApi(api) { | ||
const response= await axios.get(api); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Keep indentation consistent. You can use auto code formatters for that.
- Remove empty lines
main.js
Outdated
const query=event.target.value; | ||
|
||
if(query.length>0){ | ||
getMovieFromApi(searchUrl+"&query="+query); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can just pass query in this function since variables like api and searchUrl are globally scoped.
The getMovieFromApi function will be something like:
async function getMovieFromApi(query='') {
const url = query==='' ? api : searchUrl+"&query="+query;
const response = await axios.get(url);
// rest of the code
}
rel="stylesheet" | ||
/> | ||
<link rel="stylesheet" href="style.css" /> | ||
<title>Book Ticket</title> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Great attention to detail
@@ -1,8 +1,168 @@ | |||
:root { | |||
--light-grey: #626262; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
style.css
Outdated
.heading { | ||
font-family: "Roboto Mono"; | ||
font-size: 48px; | ||
font-weight: 250; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The font weight mentioned in the design in 400
Great work @mr-meetpatel PR approved and you have completed your JS assignment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but don't merge it
Completed JS assignment which is Movie LIst app using movie API.