diff --git a/main/_front/src/html/components.html b/main/_front/src/html/components.html index 5cb64da..a3bc569 100644 --- a/main/_front/src/html/components.html +++ b/main/_front/src/html/components.html @@ -9,10 +9,10 @@ Document - + - +
@@ -201,7 +201,7 @@

Комплектующие

-
-
- -
-
ЦП AMD Ryzen 7 2700
-
8 500 ₽
- -
-
-
- -
-
ЦП AMD Ryzen 7 2700
-
8 500 ₽
- -
-
-
- -
-
ЦП AMD Ryzen 7 2700
-
8 500 ₽
- -
-
-
- -
-
ЦП AMD Ryzen 7 2700
-
8 500 ₽
- -
-
-
- -
-
ЦП AMD Ryzen 7 2700
-
8 500 ₽
- -
-
+
+
diff --git a/main/_front/src/js/components.js b/main/_front/src/js/components.js index 48a5f5b..55a5f23 100644 --- a/main/_front/src/js/components.js +++ b/main/_front/src/js/components.js @@ -1,5 +1,5 @@ const choiceLists = document.querySelectorAll(".choice"); - + choiceLists.forEach((choiceList) => { const choiceItems = choiceList.querySelectorAll(".choice__elem"); choiceItems.forEach((choice) => { @@ -20,3 +20,27 @@ choiceLists.forEach((choiceList) => { }); }); }) + +const cards_place = document.querySelector("#cards_place"); + +const addCards = () => { + fetch("http://localhost:4444/components") + .then(res => res.json()) + .then(data => { + data.forEach((item) => { + cards_place.insertAdjacentHTML("beforeend", ` +
+ +
+
${item.name}
+
${item.price} ₽
+ +
+
+ `) + }) + }) +} + +addCards(); + \ No newline at end of file