Conversation
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
| <title>Book Shop</title> | ||
| <link rel="stylesheet" href="./dist/style.css"> | ||
| <link rel="stylesheet" href="./dist/normalize.css"> |
There was a problem hiding this comment.
I'm pretty sure "normalize.css" should come first (before style.css)
| async function getBooks() { | ||
| let result = await fetch("./books.json"); | ||
| let array = await result.json(); | ||
| books = await array; |
| async function shopInit() { | ||
| createHeader(); | ||
| createMain(); | ||
| await getBooks(); |
There was a problem hiding this comment.
await expects a Promise, I don't see you return Promise from 'getBooks' function
| import ddInit from "./scripts/dragndrop.js"; | ||
|
|
||
| async function getBooks() { | ||
| let result = await fetch("./books.json"); |
| createFooter(); | ||
| createPopUp(); | ||
| loadedPage.append(wrapper); | ||
| loadedPage.append(createFooter()); |
There was a problem hiding this comment.
do you need to execute "createFooter()" function twice?
| label.innerHTML = labelName; | ||
| input.type = "radio"; | ||
| input.name = "Payment"; | ||
| if (checked) { |
There was a problem hiding this comment.
| if (checked) { | |
| input.checked = checked |
| fastView.innerHTML = "Fast View"; | ||
| card.append(fastView); | ||
|
|
||
| fastView.onclick = function () { |
There was a problem hiding this comment.
I would recommend you to use event delegation
| let fieldFlatNumber = document.getElementById('flat-number'); | ||
| let fieldDeliveryDate = document.getElementById('delivery-date'); | ||
|
|
||
| fieldFlatNumber.onblur = function() { |
There was a problem hiding this comment.
the best practice is to use addEventListener instead of inline handlers
| import createElement from "./createElement.js"; | ||
| import {cart} from "./cart.js"; | ||
|
|
||
| export default function checkForms() { |
There was a problem hiding this comment.
the function looks to long, it's better to split it by logical pieces to improve readability
| let fieldFlatNumber = document.getElementById('flat-number'); | ||
| let fieldDeliveryDate = document.getElementById('delivery-date'); | ||
|
|
||
| fieldFlatNumber.onblur = function() { |
There was a problem hiding this comment.
I would recommend you to use "focusout" event + event delegation. It will help you to avoid boilerplate
https://learn.javascript.ru/focus-blur#sobytiya-focusin-focusout
|
Things to improve:
|

https://github.com/rolling-scopes-school/js-fe-course-en/blob/main/tasks/books-shop/books-shop.md
3. Deploy: https://birbwatcher.github.io/Book-Shop/
4. Done 13.09.2022
5. Score: 100 / 100