Переглянути джерело

added hometasks and pizza task

Ata 4 роки тому
батько
коміт
bd91ef9de4
95 змінених файлів з 2347 додано та 20 видалено
  1. 3 4
      hw11/11.2/script.js
  2. 7 5
      hw11/11.3/script.js
  3. 14 0
      hw12/12.1/index.html
  4. 35 0
      hw12/12.1/script.js
  5. 14 0
      hw12/12.2/index.html
  6. 32 0
      hw12/12.2/script.js
  7. 3 0
      hw12/12.3/.vscode/settings.json
  8. 14 0
      hw12/12.3/index.html
  9. 39 0
      hw12/12.3/script.js
  10. 3 0
      hw13/.vscode/settings.json
  11. 12 8
      hw13/task1/script.js
  12. 15 1
      hw13/task2/script.js
  13. 1 1
      hw14(Promise, asyncawait)/task3/script.js
  14. 10 1
      hw15(REST API, HTTP, Promise, async await)/task1/script.js
  15. 22 0
      hw17(Pizza)-part2/.editorconfig
  16. 12 0
      hw17(Pizza)-part2/.gitignore
  17. BIN
      hw17(Pizza)-part2/img/1.png
  18. BIN
      hw17(Pizza)-part2/img/10.jpg
  19. BIN
      hw17(Pizza)-part2/img/11.png
  20. BIN
      hw17(Pizza)-part2/img/12.png
  21. BIN
      hw17(Pizza)-part2/img/13.jpeg
  22. BIN
      hw17(Pizza)-part2/img/14.png
  23. BIN
      hw17(Pizza)-part2/img/15.png
  24. BIN
      hw17(Pizza)-part2/img/16.png
  25. BIN
      hw17(Pizza)-part2/img/17.png
  26. BIN
      hw17(Pizza)-part2/img/18.jpg
  27. BIN
      hw17(Pizza)-part2/img/18.png
  28. BIN
      hw17(Pizza)-part2/img/19.png
  29. BIN
      hw17(Pizza)-part2/img/2.jpg
  30. BIN
      hw17(Pizza)-part2/img/20.jpg
  31. BIN
      hw17(Pizza)-part2/img/21.jpg
  32. BIN
      hw17(Pizza)-part2/img/3.jpg
  33. BIN
      hw17(Pizza)-part2/img/4.jpg
  34. BIN
      hw17(Pizza)-part2/img/5.png
  35. BIN
      hw17(Pizza)-part2/img/6.jpeg
  36. BIN
      hw17(Pizza)-part2/img/7.png
  37. BIN
      hw17(Pizza)-part2/img/8.jpeg
  38. BIN
      hw17(Pizza)-part2/img/9.jpeg
  39. 48 0
      hw17(Pizza)-part2/index.html
  40. 51 0
      hw17(Pizza)-part2/main.css
  41. 210 0
      hw17(Pizza)-part2/pizzaList.js
  42. 97 0
      hw17(Pizza)-part2/script.js
  43. 22 0
      hw18PizzaFullVersion/.editorconfig
  44. 5 0
      hw18PizzaFullVersion/.eslintrc.yml
  45. 12 0
      hw18PizzaFullVersion/.gitignore
  46. 92 0
      hw18PizzaFullVersion/cart.html
  47. BIN
      hw18PizzaFullVersion/img/1.png
  48. BIN
      hw18PizzaFullVersion/img/10.jpg
  49. BIN
      hw18PizzaFullVersion/img/11.png
  50. BIN
      hw18PizzaFullVersion/img/12.png
  51. BIN
      hw18PizzaFullVersion/img/13.jpeg
  52. BIN
      hw18PizzaFullVersion/img/14.png
  53. BIN
      hw18PizzaFullVersion/img/15.png
  54. BIN
      hw18PizzaFullVersion/img/16.png
  55. BIN
      hw18PizzaFullVersion/img/17.png
  56. BIN
      hw18PizzaFullVersion/img/18.jpg
  57. BIN
      hw18PizzaFullVersion/img/18.png
  58. BIN
      hw18PizzaFullVersion/img/19.png
  59. BIN
      hw18PizzaFullVersion/img/2.jpg
  60. BIN
      hw18PizzaFullVersion/img/20.jpg
  61. BIN
      hw18PizzaFullVersion/img/21.jpg
  62. BIN
      hw18PizzaFullVersion/img/3.jpg
  63. BIN
      hw18PizzaFullVersion/img/4.jpg
  64. BIN
      hw18PizzaFullVersion/img/5.png
  65. BIN
      hw18PizzaFullVersion/img/6.jpeg
  66. BIN
      hw18PizzaFullVersion/img/7.png
  67. BIN
      hw18PizzaFullVersion/img/8.jpeg
  68. BIN
      hw18PizzaFullVersion/img/9.jpeg
  69. BIN
      hw18PizzaFullVersion/img/a-level-logo.png
  70. BIN
      hw18PizzaFullVersion/img/cart.png
  71. 1 0
      hw18PizzaFullVersion/img/cart.svg
  72. BIN
      hw18PizzaFullVersion/img/closed.png
  73. BIN
      hw18PizzaFullVersion/img/heart.png
  74. 40 0
      hw18PizzaFullVersion/img/heart.svg
  75. 163 0
      hw18PizzaFullVersion/index.html
  76. 574 0
      hw18PizzaFullVersion/main.css
  77. 5 0
      hw18PizzaFullVersion/src/cart.js
  78. 37 0
      hw18PizzaFullVersion/src/data/compositionList.js
  79. 173 0
      hw18PizzaFullVersion/src/data/pizzaList.js
  80. 29 0
      hw18PizzaFullVersion/src/script.js
  81. 77 0
      hw18PizzaFullVersion/src/servises/cart.servises/cart.servises.js
  82. 12 0
      hw18PizzaFullVersion/src/servises/cart.servises/pizza.servises.js
  83. 18 0
      hw18PizzaFullVersion/src/servises/local.storage.servises/favorites.js
  84. 39 0
      hw18PizzaFullVersion/src/servises/local.storage.servises/localStorageLogick.js
  85. 89 0
      hw18PizzaFullVersion/src/servises/own.card.servises/own.pizza.creating.js
  86. 45 0
      hw18PizzaFullVersion/src/servises/own.card.servises/photo.js
  87. 9 0
      hw18PizzaFullVersion/src/servises/own.card.servises/reset.own.card.js
  88. 41 0
      hw18PizzaFullVersion/src/servises/search.servises/filter.js
  89. 10 0
      hw18PizzaFullVersion/src/servises/search.servises/search.js
  90. 17 0
      hw18PizzaFullVersion/src/servises/search.servises/sort.js
  91. 9 0
      hw18PizzaFullVersion/src/utils/dom.elements.js
  92. 34 0
      hw18PizzaFullVersion/src/view/cart.render.js
  93. 31 0
      hw18PizzaFullVersion/src/view/modal.card.js
  94. 61 0
      hw18PizzaFullVersion/src/view/render.js
  95. 60 0
      hw18PizzaFullVersion/src/view/render.own.card.js

+ 3 - 4
hw11/11.2/script.js

@@ -1,4 +1,5 @@
 let log = {};
+
 let messages = [
   "backspace",
   "enter",
@@ -8,13 +9,13 @@ let messages = [
   "space",
   "subtract"
 ];
+
 messages.getKey = () => {
   let key = new Date().toLocaleTimeString(), x = 0
   while ( log [ `${key}[${x}]` ] ) { x++ }
   return `${key}[${x}]`
 };
 
-
 const sendMessage = message => new Promise (
   (resolve) => {setTimeout (
       () => resolve ( message ),
@@ -23,11 +24,9 @@ const sendMessage = message => new Promise (
 )
 
 messages.forEach (
-  message => sendMessage ( message).then(res=>{
+  message => sendMessage (message).then(res => {
     let key = messages.getKey();
     return log[key]=res;
   })
 );
 
-
-console.log(log)

+ 7 - 5
hw11/11.3/script.js

@@ -1,4 +1,5 @@
 let log = {};
+
 let messages = [
   "backspace",
   "enter",
@@ -8,8 +9,8 @@ let messages = [
   "space",
   "subtract"
 ];
-messages.getKey = () => new Date().toLocaleTimeString();
 
+messages.getKey = () => new Date().toLocaleTimeString();
 
 const sendMessage = message => new Promise (
   (resolve) => {setTimeout (
@@ -18,15 +19,16 @@ const sendMessage = message => new Promise (
   )}
 );
 
-var sendAll = () => {
-  var index = 0
+const sendAll = () => {
+  let index = 0
   function recursive () {
     sendMessage(messages[index])
-    .then(res=>{
-      if(res){
+    .then(res => {
+      if(res) {
         let key =  messages.getKey();
         log[key] = messages[index];
         index++;
+      
         recursive();
       }
     })

+ 14 - 0
hw12/12.1/index.html

@@ -0,0 +1,14 @@
+<!DOCTYPE html>   
+<html lang="zxx">
+    <head>
+        <meta charset="utf-8">
+        <meta name="viewport" content="width=device-width, initial-scale=1.0">
+        <title>Homework 12.1</title>
+        <link rel="icon" href="https://camo.githubusercontent.com/eb8b5f9caa4b4765b222e961729eadb775ac710b/68747470733a2f2f67617265766e612e6769746875622e696f2f6a732d73616d706c65732f696d616765732f612d6c6576656c2d69636f2e706e67" >
+       
+    </head>
+    <body>
+       
+        <script type="text/javascript" src="./script.js"></script>
+    </body>
+</html>

+ 35 - 0
hw12/12.1/script.js

@@ -0,0 +1,35 @@
+
+function parseCookie() {
+    let cookies = Array.from(document.cookie.split(";"));
+    
+    for (let i = 0; i < cookies.length; i++) {
+        let cook = cookies[i].split("=");      
+        cookies[decodeURIComponent(cook[0].trim())] = decodeURIComponent(cook[1].trim());
+        //console.log(cookies)
+     }
+    return cookies;
+ }
+ 
+ function setCookie() {
+    
+     let expireDate = new Date();
+     let currentDate = new Date();
+     expireDate.setDate(10 + expireDate.getDate());
+     document.cookie = "LastVisit=" + encodeURIComponent(currentDate.toLocaleString()) + "; "+
+                       "expires=" + encodeURIComponent(expireDate.toGMTString()) + ";";
+     console.log(document.cookie);
+ }
+ 
+     if ("" === document.cookie) {
+        setCookie();
+        document.write("<H3>Поздравляю Вас с первым посещением моего сайта.</H3>");
+     }
+     else {
+        // Анализ cookie.
+        let cookies = parseCookie();
+       
+        // Вывод даты последнего посещения.
+        document.write("<H4>Последний раз Вы были у меня на сайте: " + cookies.LastVisit + ".</H4>");
+        // Обновление cookie.
+        setCookie(cookies.visits);
+     }

+ 14 - 0
hw12/12.2/index.html

@@ -0,0 +1,14 @@
+<!DOCTYPE html>   
+<html lang="zxx">
+    <head>
+        <meta charset="utf-8">
+        <meta name="viewport" content="width=device-width, initial-scale=1.0">
+        <title>Homework 11.2</title>
+        <link rel="icon" href="https://camo.githubusercontent.com/eb8b5f9caa4b4765b222e961729eadb775ac710b/68747470733a2f2f67617265766e612e6769746875622e696f2f6a732d73616d706c65732f696d616765732f612d6c6576656c2d69636f2e706e67" >
+       
+    </head>
+    <body>
+      
+        <script type="text/javascript" src="./script.js"></script>
+    </body>
+</html>

+ 32 - 0
hw12/12.2/script.js

@@ -0,0 +1,32 @@
+let log = {};
+
+let messages = [
+  "backspace",
+  "enter",
+  "shift",
+  "control",
+  "delete",
+  "space",
+  "subtract"
+];
+
+messages.getKey = () => {
+  let key = new Date().toLocaleTimeString(), x = 0
+  while ( log [ `${key}[${x}]` ] ) { x++ }
+  return `${key}[${x}]`
+};
+
+const sendMessage = message => new Promise (
+  (resolve) => {setTimeout (
+      () => resolve ( message ),
+      Math.random () * 7000
+  )}
+)
+
+messages.forEach (
+  message => sendMessage (message).then(res => {
+    let key = messages.getKey();
+    return log[key]=res;
+  })
+);
+

+ 3 - 0
hw12/12.3/.vscode/settings.json

@@ -0,0 +1,3 @@
+{
+    "liveServer.settings.port": 5502
+}

+ 14 - 0
hw12/12.3/index.html

@@ -0,0 +1,14 @@
+<!DOCTYPE html>   
+<html lang="zxx">
+    <head>
+        <meta charset="utf-8">
+        <meta name="viewport" content="width=device-width, initial-scale=1.0">
+        <title>Homework 11.3</title>
+        <link rel="icon" href="https://camo.githubusercontent.com/eb8b5f9caa4b4765b222e961729eadb775ac710b/68747470733a2f2f67617265766e612e6769746875622e696f2f6a732d73616d706c65732f696d616765732f612d6c6576656c2d69636f2e706e67" >
+       
+    </head>
+    <body>
+        
+        <script type="text/javascript" src="./script.js"></script>
+    </body>
+</html>

+ 39 - 0
hw12/12.3/script.js

@@ -0,0 +1,39 @@
+let log = {};
+
+let messages = [
+  "backspace",
+  "enter",
+  "shift",
+  "control",
+  "delete",
+  "space",
+  "subtract"
+];
+
+messages.getKey = () => new Date().toLocaleTimeString();
+
+const sendMessage = message => new Promise (
+  (resolve) => {setTimeout (
+      () => resolve ( message ),
+      Math.random () * 7000
+  )}
+);
+
+const sendAll = () => {
+  let index = 0
+  function recursive () {
+    sendMessage(messages[index])
+    .then(res => {
+      if(res) {
+        let key =  messages.getKey();
+        log[key] = messages[index];
+        index++;
+      
+        recursive();
+      }
+    })
+  }
+  recursive ()
+}
+
+sendAll()

+ 3 - 0
hw13/.vscode/settings.json

@@ -0,0 +1,3 @@
+{
+    "liveServer.settings.port": 5501
+}

+ 12 - 8
hw13/task1/script.js

@@ -85,13 +85,13 @@ const ratingPointThreshold = 800;
 
 const budgetStudentsLimit = 5;
 
-let counter = 0;
+
 
 class CreateStudent {
 
    constructor(student) {
      
-     CreateStudent.id.call(this);
+    this.id = CreateStudent.id++;
      this.name = student.name;
      this.surname = student.surname;
      this.ratingPoint = student.ratingPoint;
@@ -103,9 +103,7 @@ class CreateStudent {
     this.checkBudgetOrNot();
     this.createNewStudentsArr();
    };
-   static id = function() {
-      
-      return this.id = counter++; 
+   static id = 1; 
    };
   
    checkBudgetOrNot = function(){
@@ -136,8 +134,8 @@ class CreateStudent {
   getRankedPlace = function (){
     let ratedStudentsArr =  studentList.slice().sort((a, b) => {return b.ratingPoint-a.ratingPoint || b.schoolPoint-a.schoolPoint});
      
-    return ratedStudentsArr.indexOf(this) + 1
-  } 
+     return ++ratedStudentsArr.findIndex((item) =>{ return item.id === this.id})
+  
 }
 
 studentArr.forEach((elem) => {
@@ -152,7 +150,13 @@ studentArr.forEach((elem) => {
     getFullInternInfo(){
        return `${this.getFullInfo()}, интерн в компании ${this.companyName}`
     }
-    
+    get currentCourse(){
+
+    }
+    set currentCourse(course){
+      startYear
+      
+    }
  }
  const internExample = {
       name: 'Dan',

+ 15 - 1
hw13/task2/script.js

@@ -31,4 +31,18 @@ const myString = new CustomString();
 
 console.log(myString.reverse('qwerty')); //выведет 'ytrewq'
 console.log(myString.ucFirst('qwerty')); //выведет 'Qwerty'
-console.log(myString.ucWords('qwerty qwerty qwerty')); //выведет 'Qwerty Qwerty Qwerty
+console.log(myString.ucWords('qwerty qwerty qwerty')); //выведет 'Qwerty Qwerty Qwerty
+const reverse = new Promise((res, reject) => {
+       string = res.split(' ')                     
+   if (string.length < 2) {
+     return string;
+   }
+   const lastLetter = string.length - 1;
+   const last = string[lastLetter];
+   newString[lastLetter] = string[0];
+   string[0] = last;
+ 
+   return newString.join(' ');
+
+})
+console.log(reverse('guuu jhhh okkkk'))

+ 1 - 1
hw14(Promise, asyncawait)/task3/script.js

@@ -9,7 +9,7 @@ const bookList = [];
 
 
 const getBookResultList = function(){
-    for (let i = 0; i < numberOfTensBooks; i++) {
+    for (let i = 1; i <= numberOfTensBooks; i++) {
     bookList.push(getBooks(i))
 }
 }

+ 10 - 1
hw15(REST API, HTTP, Promise, async await)/task1/script.js

@@ -1,10 +1,13 @@
 let allUsers = [];
 let allFilms = [];
+let allUsersAlboms = [];
 let url = 'https://api-f22.herokuapp.com/';
+let url2 = 'http://jsonplaceholder.typicode.com/'
 let userUrl = 'users/';
 let films = 'films/';
 let addFilm = 'addFilm/';
-
+let albums = 'albums';
+let photos = 'photos';
 
 class User {
   constructor(name, filmId){
@@ -112,4 +115,10 @@ getAllFilms();
 console.log(allFilms);
 getNewUsers();
 
+const getFullInfo = function (){
+  axios.get(url2+userUrl)
+  .then(res => allUsersAlboms.push(res.data));
+  axios.get(url2+albums)
+  .then(res => allUsersAlboms.push)
 
+}

+ 22 - 0
hw17(Pizza)-part2/.editorconfig

@@ -0,0 +1,22 @@
+# Файл с настройками для редактора.
+#
+# Если вы разрабатываете в редакторе WebStorm, BBEdit, Coda или SourceLair
+# этот файл уже поддерживается и не нужно производить никаких дополнительных
+# действий.
+#
+# Если вы ведёте разработку в другом редакторе, зайдите
+# на https://editorconfig.org и в разделе «Download a Plugin»
+# скачайте дополнение для вашего редактора.
+
+root = true
+
+[*]
+charset = utf-8
+end_of_line = lf
+indent_size = 2
+indent_style = space
+insert_final_newline = true
+trim_trailing_whitespace = true
+
+[*.md]
+trim_trailing_whitespace = false

+ 12 - 0
hw17(Pizza)-part2/.gitignore

@@ -0,0 +1,12 @@
+.DS_Store
+.idea
+.vscode
+*.ai
+*.log
+*.pdf
+*.psd
+*.sublime*
+node_modules/
+npm-debug.*
+build/
+Thumbs.db

BIN
hw17(Pizza)-part2/img/1.png


BIN
hw17(Pizza)-part2/img/10.jpg


BIN
hw17(Pizza)-part2/img/11.png


BIN
hw17(Pizza)-part2/img/12.png


BIN
hw17(Pizza)-part2/img/13.jpeg


BIN
hw17(Pizza)-part2/img/14.png


BIN
hw17(Pizza)-part2/img/15.png


BIN
hw17(Pizza)-part2/img/16.png


BIN
hw17(Pizza)-part2/img/17.png


BIN
hw17(Pizza)-part2/img/18.jpg


BIN
hw17(Pizza)-part2/img/18.png


BIN
hw17(Pizza)-part2/img/19.png


BIN
hw17(Pizza)-part2/img/2.jpg


BIN
hw17(Pizza)-part2/img/20.jpg


BIN
hw17(Pizza)-part2/img/21.jpg


BIN
hw17(Pizza)-part2/img/3.jpg


BIN
hw17(Pizza)-part2/img/4.jpg


BIN
hw17(Pizza)-part2/img/5.png


BIN
hw17(Pizza)-part2/img/6.jpeg


BIN
hw17(Pizza)-part2/img/7.png


BIN
hw17(Pizza)-part2/img/8.jpeg


BIN
hw17(Pizza)-part2/img/9.jpeg


+ 48 - 0
hw17(Pizza)-part2/index.html

@@ -0,0 +1,48 @@
+<!DOCTYPE html>   
+<html lang="zxx">
+    <head>
+        <meta charset="utf-8">
+        <meta name="viewport" content="width=device-width, initial-scale=1.0">
+        <meta http-equiv="X-UA-Compatible" content="ie=edge">
+        <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
+        <link rel="stylesheet" href="main.css">
+        <link rel="icon" href="https://camo.githubusercontent.com/eb8b5f9caa4b4765b222e961729eadb775ac710b/68747470733a2f2f67617265766e612e6769746875622e696f2f6a732d73616d706c65732f696d616765732f612d6c6576656c2d69636f2e706e67" >
+        <title>Pizza Store</title>
+    </head>
+    <body>
+        <div class="sidebar">
+            <form action="#" class="seekForm" autocomplete="off">
+                <select name="price-sort" id="price-type" class="price__sort">
+                  <option value="default" selected>Популярные</option>
+                  <option  value="increase">Сначала дешевле</option>
+                  <option  value="decrease">Сначала дороже</option>
+                </select>
+                <fieldset id="filter-price" class="filter-price">
+                    
+                  
+                        <input type="text" name="price-min" value="0" id="price-min" placeholder="от ... грн">
+                 
+                        <input type="text" name="price-max" value="0" id="price-max" placeholder="до ... грн">
+               
+                </fieldset>
+                <fieldset id="filter-calories" class="filter-calories">
+                    
+                    <input type="text" name="price-min" value="0" id="calories-min" placeholder="от ... Ккал">
+                 
+                    <input type="text" name="price-max" value="0" id="calories-max" placeholder="до ... Ккал">
+
+                </fieldset>
+               
+            <input type="text" id="search" placeholder="Для поиска введите название пиццы или любой ингредиент...">
+            <fieldset class="">
+                <button class="submit" type="button" id="find">Искать</button>
+                <button class="submit" type="reset" id="reset">Очистить...</button>
+              </fieldset>
+            
+            </form>
+        </div> 
+        <main class="container"></main> 
+     
+        <script type="module" src="./script.js"></script>
+    </body>
+</html>

+ 51 - 0
hw17(Pizza)-part2/main.css

@@ -0,0 +1,51 @@
+body, .container {
+    width: 100%;
+    display: flex;
+    flex-wrap: wrap;
+    justify-content: space-around;
+}
+
+img {
+    max-width: 100%;
+    height: auto;
+  }
+
+a:active,
+  a:hover,
+  a {
+    text-decoration: none;
+    color: inherit;
+  }
+  
+input {
+    width: 500px;
+}
+.sidebar {
+    margin: 10px 0 30px;
+    width: 100%;
+}
+
+.card {
+    margin: 0 0 10px;
+    padding: 20px 20px;
+    
+    width: 20%;
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    border: 1px solid red;
+    text-align: center;
+}
+.card img {
+    flex-grow: 1;
+}
+.card p{
+    display: flex;
+    flex-wrap: wrap;
+    width: 80%;
+    justify-content: center;
+}
+.card * {
+    padding: 10px;
+}
+

+ 210 - 0
hw17(Pizza)-part2/pizzaList.js

@@ -0,0 +1,210 @@
+const pizzaList = [{
+        id: 1,
+        img: "1.png",
+        name: "Супер гриль",
+        composition: ["охотничьи колбаски", "сосиски", "моцарелла", "баклажан", "томаты", "лук", "перец", "соус томатный", "соус BBQ", "зеленый соус", "майонез"],
+        caloricity: 1569,
+        price: 249,
+    },
+    {
+        id: 2,
+        img: "2.jpg",
+        name: "Маргарита",
+        composition: ["томаты", "моцарелла", "орегано", "базилик", "соус Pomodoro"],
+        caloricity: 1042,
+        price: 70,
+        priceOfTheDay: true,
+    },
+    {
+        id: 3,
+        img: "3.jpg",
+        name: "Карбонара",
+        composition: ["ветчина", "шампиньоны", "пармезан", "моцарелла", "томаты", "яйцо перепелиное", "смесь перцев", "соус Carbonara"],
+        caloricity: 1369,
+        price: 119,
+    },
+    {
+        id: 4,
+        img: "4.jpg",
+        name: "C сырным бортиком",
+        composition: ["хамон", "моцарелла", "сливочный сыр", "персик", "сливки", "руккола"],
+        caloricity: 1140,
+        price: 139,
+    },
+    {
+        id: 5,
+        img: "5.png",
+        name: "Полло",
+        composition: ["куриное филе sous-vide", "ананас", "моцарелла", "орегано", "перец чили", "соус Pomodoro"],
+        caloricity: 1232,
+        price: 99,
+        priceOfTheDay: true,
+    },
+    {
+        id: 6,
+        img: "6.jpeg",
+        name: "Пепперони",
+        composition: ["Салями Пепперони", "моцарелла", "орегано", "соус Pomodoro"],
+        caloricity: 1280,
+        price: 119,
+    },
+    {
+        id: 7,
+        img: "7.png",
+        name: "Гурмео",
+        composition: ["охотничьи колбаски", "салями пепперони", "ветчина", "куриное филе sous-vide", "шампиньоны", "орегано", "соус BBQ"],
+        caloricity: 1343,
+        price: 149,
+    },
+    {
+        id: 8,
+        img: "8.jpeg",
+        name: "Четыре сыра",
+        composition: ["пармезан", "дор блю", "чеддер", "моцарелла", "груша", "грецкий орех", "соус сливочный"],
+        caloricity: 1220,
+        price: 109,
+    },
+    {
+        id: 9,
+        img: "9.jpeg",
+        name: "Американо",
+        composition: ["куриное филе sous-vide", "салями", "пепперони", "охотничьи колбаски", "кукуруза", "моцарелла", "лук", "орегано", "соус Pomodoro", "соус BBQ"],
+        caloricity: 1422,
+        price: 149,
+    },
+    {
+        id: 10,
+        img: "10.jpg",
+        name: "Кальцоне",
+        composition: ["ветчина", "шампиньоны", "дор блю", "моцарелла", "томаты", "орегано"],
+        caloricity: 1056,
+        price: 99,
+        priceOfTheDay: true,
+    },
+    {
+        id: 11,
+        img: "11.png",
+        name: "Берлускони",
+        composition: ["сливочный соус из белых грибов и шампиньонов с трюфельным маслом", "моцарелла", "дор блю", "орегано", "лук"],
+        caloricity: 1293,
+        price: 125,
+    },
+    {
+        id: 12,
+        img: "12.png",
+        name: "Супер гриль",
+        composition: ["охотничьи колбаски", "сосиски", "сыр моцарелла", "баклажан", "томаты", "лук", "перец", "соус томатный"],
+        caloricity: 1410,
+        price: 132,
+    },
+    {
+        id: 13,
+        img: "13.jpeg",
+        name: "Кампанья",
+        composition: ["охотничьи колбаски", "ветчина", "салями пепперони", "куриное филе sous-vide", "шампиньоны", "моцарелла", "томаты"],
+        caloricity: 1510,
+        price: 144,
+    },
+    {
+        id: 14,
+        img: "14.png",
+        name: "Дьявола",
+        composition: ["горчичный соус", "моцарелла", "молочные сосиски", "бекон", "помидор", "зелень"],
+        caloricity: 1180,
+        price: 107,
+    },
+    {
+        id: 15,
+        img: "15.png",
+        name: "Бекон ранч",
+        composition: ["фирменный пицца-соус", "моцарелла", "бекон", "ветчина", "телятина", "помидор", "перец болгарский", "соус ранч"],
+        caloricity: 1322,
+        price: 113,
+    },
+    {
+        id: 16,
+        img: "16.png",
+        name: "Гроссето",
+        composition: ["фирменный пицца-соус", "моцарелла", "лосось", "креветки", "сладкий перец", "маслины", "лимон", "базилик", "орегано"],
+        caloricity: 980,
+        price: 159,
+    },
+    {
+        id: 17,
+        img: "17.png",
+        name: "Тоскана",
+        composition: ["фирменный пицца-соус", "моцарелла", "ветчина", "бекон", "салями-пеперони", "сладкий перец", "сыр «Пармезан»", "базилик", "орегано"],
+        caloricity: 1310,
+        price: 139,
+    },
+    {
+        id: 18,
+        img: "18.png",
+        name: "Грибная",
+        composition: ["фирменный пицца-соус", "моцарелла", "шампиньоны", "опята", "маслины", "лук", "базилик", "орегано", "зелень"],
+        caloricity: 1451,
+        price: 132,
+    },
+    {
+        id: 19,
+        img: "19.png",
+        name: "Туринская",
+        composition: ["горчичный соус", "моцарелла", "салями", "охотничьи колбаски", "огурцы маринованные", "зелень"],
+        caloricity: 1140,
+        price: 138,
+    },
+    {
+        id: 20,
+        img: "20.jpg",
+        name: "Венецианская",
+        composition: ["фирменный пицца-соус", "моцарелла", "телятина", "куриная грудка", "бекон", "шампиньоны", "помидор", "перец", "пармезан", "зелень"],
+        caloricity: 1341,
+        price: 142,
+    },
+    {
+        id: 21,
+        img: "21.jpg",
+        name: "Четыре сезона",
+        composition: ["фирменный пицца-соус", "моцарелла", "опята", "куриная грудка", "помидор", "перец", "лук", "шампиньоны", "пармезан", "зелень"],
+        caloricity: 1479,
+        price: 145,
+    },
+];
+
+const compositionList = [{
+        id: 1,
+        name: "Моцарела",
+        caloricity: 28,
+        price: 15,
+    },
+    {
+        id: 2,
+        name: "Крветки",
+        caloricity: 37,
+        price: 35,
+    },
+    {
+        id: 3,
+        name: "Салями",
+        caloricity: 42,
+        price: 25,
+    },
+    {
+        id: 4,
+        name: "Лук",
+        caloricity: 13,
+        price: 7,
+    },
+    {
+        id: 5,
+        name: "Томаты",
+        caloricity: 21,
+        price: 17,
+    },
+    {
+        id: 6,
+        name: "Ветчина",
+        caloricity: 37,
+        price: 35,
+    },
+];

+ 97 - 0
hw17(Pizza)-part2/script.js

@@ -0,0 +1,97 @@
+const searchInput = document.getElementById('search');
+const priceSortElem = document.getElementById('price-type');
+//const filterContainer = document.querySelector('.sidebar')
+
+const searchBtn = document.getElementById('find');
+
+
+const renderCard = item => {
+  const card = document.createElement('div');
+  card.className = 'card'
+  const button = document.createElement('button');
+  button.innerText = 'Добавить в корзину';
+  button.onclick = function() {
+      console.log(item)
+  }
+  let food = item.composition;
+  food = food.join(', ')
+  card.innerHTML = `
+      <img src="img/${item.img}" alt="">
+      <h2>${item.name }</h2>
+      <p>${item.price } грн</p>
+      <p><b>Ингредиенты:</b> ${food} </p>
+      <p>${ item.caloricity}Ккал</p>
+  `;
+  card.appendChild(button)
+  return card;
+}
+
+
+const renderCards = data => {
+  document.querySelector('.container').innerHTML = '';
+  data.forEach(item => {
+      const card = renderCard(item);
+      document.querySelector('.container').appendChild(card)
+  })
+}
+
+renderCards(pizzaList)
+
+const sortByPrice = function () {
+  
+  if(priceSortElem.value === 'increase'){
+    const result = pizzaList.slice().sort((a,b)=>  a.price - b.price)
+    return renderCards(result)
+  }
+  if(priceSortElem.value === 'decrease'){
+    const result = pizzaList.slice().sort((a,b)=>  b.price - a.price)
+    return renderCards(result)
+  }
+  return renderCards(pizzaList)
+};
+const searchPizzas = (item) => {
+const value = document.getElementById('search').value;
+ return item.name.toLocaleLowerCase().includes(value.toLocaleLowerCase()) || item.composition.includes(value)
+
+}
+
+const searchPizzasByChangeInput = () => {
+  let result = pizzaList.filter(pizza => {
+    return searchPizzas(pizza)    
+   });
+
+   return renderCards(result) 
+}
+
+const filterByPrice = function(item){
+  const priceMinValue = document.getElementById('price-min');
+  const priceMaxValue = document.getElementById('price-max');
+  if(+priceMinValue.value === 0 || +priceMaxValue.value === 0){
+    return item
+  }
+  return (item.price >= priceMinValue.value) && (item.price <= priceMaxValue.value) 
+
+}
+
+const filterByCalories = function(item){
+  const caloriesMinValue = document.getElementById('calories-min');
+  const caloriesMaxValue = document.getElementById('calories-max');
+  if(+caloriesMinValue.value === 0 || +caloriesMaxValue.value === 0){
+    return item
+  }
+  return (item.caloricity >= caloriesMinValue.value) && (item.caloricity <= caloriesMaxValue.value) 
+}
+
+
+const filterAll = function (){
+  let result = pizzaList.filter(pizza => {
+   return filterByCalories(pizza)
+         && searchPizzas(pizza)
+         && filterByPrice(pizza)
+  });
+  console.log(result)
+  return renderCards(result) 
+};
+priceSortElem.oninput = sortByPrice
+searchInput.addEventListener('change',searchPizzasByChangeInput);
+searchBtn.addEventListener('click', filterAll);

+ 22 - 0
hw18PizzaFullVersion/.editorconfig

@@ -0,0 +1,22 @@
+# Файл с настройками для редактора.
+#
+# Если вы разрабатываете в редакторе WebStorm, BBEdit, Coda или SourceLair
+# этот файл уже поддерживается и не нужно производить никаких дополнительных
+# действий.
+#
+# Если вы ведёте разработку в другом редакторе, зайдите
+# на https://editorconfig.org и в разделе «Download a Plugin»
+# скачайте дополнение для вашего редактора.
+
+root = true
+
+[*]
+charset = utf-8
+end_of_line = lf
+indent_size = 2
+indent_style = space
+insert_final_newline = true
+trim_trailing_whitespace = true
+
+[*.md]
+trim_trailing_whitespace = false

+ 5 - 0
hw18PizzaFullVersion/.eslintrc.yml

@@ -0,0 +1,5 @@
+ extends:
+   - 'airbnb-base'
+ env:
+   node: true
+   browser: true

+ 12 - 0
hw18PizzaFullVersion/.gitignore

@@ -0,0 +1,12 @@
+.DS_Store
+.idea
+.vscode
+*.ai
+*.log
+*.pdf
+*.psd
+*.sublime*
+node_modules/
+npm-debug.*
+build/
+Thumbs.db

+ 92 - 0
hw18PizzaFullVersion/cart.html

@@ -0,0 +1,92 @@
+<!DOCTYPE html>   
+<html lang="zxx">
+    <head>
+        <meta charset="utf-8">
+        <meta name="viewport" content="width=device-width, initial-scale=1.0">
+        <meta http-equiv="X-UA-Compatible" content="ie=edge">
+        <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
+        <link rel="stylesheet" href="main.css">
+        <link rel="icon" href="https://camo.githubusercontent.com/eb8b5f9caa4b4765b222e961729eadb775ac710b/68747470733a2f2f67617265766e612e6769746875622e696f2f6a732d73616d706c65732f696d616765732f612d6c6576656c2d69636f2e706e67" >
+        
+        <title>Pizza Store</title>
+    </head>
+    <body>
+       
+            <header class="header ">
+              
+ 
+              
+                <div class="header-btn">
+                  <a class="favorite-list"href="index.html">Вернуться к выбору пиццы</a>
+                  
+                   
+                </div>
+              </div>
+              
+            </header>
+        
+
+        
+        
+        <main class="container">
+           
+        </main> 
+        <div class="res"></div>
+       
+      <footer class="main-footer">
+        <h2 class="visually-hidden">Наши контакты в социальных сетях</h2>
+        <div class="footer-wrapper">
+          <div class="instagram-container">
+            <a class="instagram" href="insta.html">#pizzaHighLevel</a>
+          </div>
+          <div class="footer-social">
+            <ul>
+              <li>
+                <a class="social-button" href="#">
+                  <svg version="1.1" id="Layer_1_4" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="17px" height="15px" viewBox="0 0 17 15" enable-background="new 0 0 17 15" xml:space="preserve">
+                    <g id="W6EeEF_1_">
+                      <g>
+                        <path fill="#FFFFFF" d="M10.95,0.144c1.685-0.496,2.984,0.27,3.577,1.179c0.673-0.231,1.331-0.481,2.011-0.708
+                          c-0.004,0.861-0.522,1.513-0.857,1.768c0.685,0.17,1.304-0.491,1.304-0.491c-0.169,1-1.006,1.788-1.563,2.024
+                          c-0.231,6.75-3.175,11.217-10.077,11.082c-0.522,0,0.075,0-0.446,0c-0.41,0-4.164-0.46-4.898-1.887
+                          c2.271,0.196,3.893-0.422,4.693-1.177c-0.96-0.3-2.679-0.477-2.979-2.95C2.064,9.09,2.279,9.212,2.905,9.103
+                          C1.705,8.247,0.374,7.53,0.448,5.33c0.285,0.328,1.067,0.536,1.34,0.472c-0.703-0.241-1.97-3.36-0.894-4.952
+                          c1.818,1.854,3.735,3.606,7.152,3.773C8.254,2.33,9.183,0.793,10.95,0.144z"/>
+                      </g>
+                    </g>
+                  </svg>
+                  <h3 class="visually-hidden">Twitter</h3>
+                </a>
+              </li>
+              <li>
+                <a class="social-button" href="#">
+                  <svg xmlns="http://www.w3.org/2000/svg" width="12" height="22" viewBox="0 0 12 22">
+                    <path fill="#FFF" d="M12 4V0H8a4 4 0 0 0-4 4v4H0v4h4v10h4V12h4V8H8V4h4z"/>
+                  </svg>
+                  <h3 class="visually-hidden">Facebook</h3>
+                </a>
+              </li>
+              <li>
+                <a class="social-button" href="#">
+                  <svg version="1.1" id="Layer_1_3" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="20px" height="16px" viewBox="0 0 20 16" enable-background="new 0 0 20 16" xml:space="preserve">
+                    <path fill="#FFFFFF" d="M17,0H3C1.35,0,0,1.35,0,3v10c0,1.65,1.35,3,3,3h14c1.65,0,3-1.35,3-3V3C20,1.35,18.65,0,17,0z
+                      M6.027,11.998V4.002L15.014,8L6.027,11.998z"/>
+                  </svg>
+                  <h3 class="visually-hidden">Youtube</h3>
+                </a>
+              </li>
+            </ul>
+          </div>
+          <div class="copyright">
+            <h3 class="visually-hidden">Логотип A-level</h3>
+            <a class="logo-a-level" href="https://a-level.com.ua/">   
+            </a>
+          </div>
+        </div>
+      </footer>
+    </div> 
+    <div class="modal" id="modal"></div>
+  
+        <script type="module" src="./src/cart.js"></script>
+    </body>
+</html>

BIN
hw18PizzaFullVersion/img/1.png


BIN
hw18PizzaFullVersion/img/10.jpg


BIN
hw18PizzaFullVersion/img/11.png


BIN
hw18PizzaFullVersion/img/12.png


BIN
hw18PizzaFullVersion/img/13.jpeg


BIN
hw18PizzaFullVersion/img/14.png


BIN
hw18PizzaFullVersion/img/15.png


BIN
hw18PizzaFullVersion/img/16.png


BIN
hw18PizzaFullVersion/img/17.png


BIN
hw18PizzaFullVersion/img/18.jpg


BIN
hw18PizzaFullVersion/img/18.png


BIN
hw18PizzaFullVersion/img/19.png


BIN
hw18PizzaFullVersion/img/2.jpg


BIN
hw18PizzaFullVersion/img/20.jpg


BIN
hw18PizzaFullVersion/img/21.jpg


BIN
hw18PizzaFullVersion/img/3.jpg


BIN
hw18PizzaFullVersion/img/4.jpg


BIN
hw18PizzaFullVersion/img/5.png


BIN
hw18PizzaFullVersion/img/6.jpeg


BIN
hw18PizzaFullVersion/img/7.png


BIN
hw18PizzaFullVersion/img/8.jpeg


BIN
hw18PizzaFullVersion/img/9.jpeg


BIN
hw18PizzaFullVersion/img/a-level-logo.png


BIN
hw18PizzaFullVersion/img/cart.png


Різницю між файлами не показано, бо вона завелика
+ 1 - 0
hw18PizzaFullVersion/img/cart.svg


BIN
hw18PizzaFullVersion/img/closed.png


BIN
hw18PizzaFullVersion/img/heart.png


+ 40 - 0
hw18PizzaFullVersion/img/heart.svg

@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+	 viewBox="0 0 391.837 391.837" style="enable-background:new 0 0 391.837 391.837;" xml:space="preserve">
+<g>
+	<path style="fill:#D7443E;" d="M285.257,35.528c58.743,0.286,106.294,47.836,106.58,106.58
+		c0,107.624-195.918,214.204-195.918,214.204S0,248.165,0,142.108c0-58.862,47.717-106.58,106.58-106.58l0,0
+		c36.032-0.281,69.718,17.842,89.339,48.065C215.674,53.517,249.273,35.441,285.257,35.528z"/>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+</svg>

+ 163 - 0
hw18PizzaFullVersion/index.html

@@ -0,0 +1,163 @@
+<!DOCTYPE html>   
+<html lang="zxx">
+    <head>
+        <meta charset="utf-8">
+        <meta name="viewport" content="width=device-width, initial-scale=1.0">
+        <meta http-equiv="X-UA-Compatible" content="ie=edge">
+        <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
+        <link rel="stylesheet" href="main.css">
+        <link rel="icon" href="https://camo.githubusercontent.com/eb8b5f9caa4b4765b222e961729eadb775ac710b/68747470733a2f2f67617265766e612e6769746875622e696f2f6a732d73616d706c65732f696d616765732f612d6c6576656c2d69636f2e706e67" >
+        
+        <title>Pizza Store</title>
+    </head>
+    <body>
+       
+            <header class="header ">
+                <div class="header-btn">
+                  
+                    <button class="favorite-list">Мои пиццы</button>
+                    <button class="create-btn">Создать пиццу</button>
+                    <a class="btn-cart btn-card--header" href="cart.html"></a>
+                </div>
+              </div>
+              
+            </header>
+        
+
+        <div class="sidebar main-wrapper">
+            <form action="#" class="seekForm" autocomplete="off">
+                <div class="search-wrapper">
+                <input type="text" id="search" placeholder="Для поиска введите название пиццы или любой ингредиент...">
+                <select name="price-sort" id="price-type" class="price__sort">
+                  <option value="default" selected>Популярные</option>
+                  <option  value="increase">Сначала дешевле</option>
+                  <option  value="decrease">Сначала дороже</option>
+                </select>
+            </div>
+                <div class="fieldset-wrapper">
+                <fieldset id="filter-price" class="filter">
+                    <span>Цена пицы: </span>
+                    <div class="filter-wrapper">
+                  <label for="price-min">от
+                        <input type="text" name="price-min" value="0" id="price-min" >
+                    </label>
+                    <label for="price-max">до
+                        <input type="text" name="price-max" value="0" id="price-max" >
+                    </label>
+                </div>
+                </fieldset>
+                <fieldset id="filter-calories" class="filter">
+                    <span>Калорийность пиццы:</span>
+                    <div class="filter-wrapper">
+                  <label for="calories-min">от
+                        <input type="text" name="calories-min" value="0" id="calories-min" >
+                    </label>
+                    <label for="calories-max">до
+                        <input type="text" name="calories-max" value="0" id="calories-max" >
+                    </label>
+                </div>
+                </fieldset>
+            </div>
+            
+            <fieldset class="">
+                <button class="submit" type="button" id="find">Искать</button>
+                <button class="submit" type="reset" id="reset">Очистить...</button>
+              </fieldset>
+            
+            </form>
+        
+        <main class="container">
+           
+        </main> 
+        <div class="res"></div>
+       
+      <footer class="main-footer">
+        <h2 class="visually-hidden">Наши контакты в социальных сетях</h2>
+        <div class="footer-wrapper">
+          <div class="instagram-container">
+            <a class="instagram" href="insta.html">#pizzaHighLevel</a>
+          </div>
+          <div class="footer-social">
+            <ul>
+              <li>
+                <a class="social-button" href="#">
+                  <svg version="1.1" id="Layer_1_4" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="17px" height="15px" viewBox="0 0 17 15" enable-background="new 0 0 17 15" xml:space="preserve">
+                    <g id="W6EeEF_1_">
+                      <g>
+                        <path fill="#FFFFFF" d="M10.95,0.144c1.685-0.496,2.984,0.27,3.577,1.179c0.673-0.231,1.331-0.481,2.011-0.708
+                          c-0.004,0.861-0.522,1.513-0.857,1.768c0.685,0.17,1.304-0.491,1.304-0.491c-0.169,1-1.006,1.788-1.563,2.024
+                          c-0.231,6.75-3.175,11.217-10.077,11.082c-0.522,0,0.075,0-0.446,0c-0.41,0-4.164-0.46-4.898-1.887
+                          c2.271,0.196,3.893-0.422,4.693-1.177c-0.96-0.3-2.679-0.477-2.979-2.95C2.064,9.09,2.279,9.212,2.905,9.103
+                          C1.705,8.247,0.374,7.53,0.448,5.33c0.285,0.328,1.067,0.536,1.34,0.472c-0.703-0.241-1.97-3.36-0.894-4.952
+                          c1.818,1.854,3.735,3.606,7.152,3.773C8.254,2.33,9.183,0.793,10.95,0.144z"/>
+                      </g>
+                    </g>
+                  </svg>
+                  <h3 class="visually-hidden">Twitter</h3>
+                </a>
+              </li>
+              <li>
+                <a class="social-button" href="#">
+                  <svg xmlns="http://www.w3.org/2000/svg" width="12" height="22" viewBox="0 0 12 22">
+                    <path fill="#FFF" d="M12 4V0H8a4 4 0 0 0-4 4v4H0v4h4v10h4V12h4V8H8V4h4z"/>
+                  </svg>
+                  <h3 class="visually-hidden">Facebook</h3>
+                </a>
+              </li>
+              <li>
+                <a class="social-button" href="#">
+                  <svg version="1.1" id="Layer_1_3" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="20px" height="16px" viewBox="0 0 20 16" enable-background="new 0 0 20 16" xml:space="preserve">
+                    <path fill="#FFFFFF" d="M17,0H3C1.35,0,0,1.35,0,3v10c0,1.65,1.35,3,3,3h14c1.65,0,3-1.35,3-3V3C20,1.35,18.65,0,17,0z
+                      M6.027,11.998V4.002L15.014,8L6.027,11.998z"/>
+                  </svg>
+                  <h3 class="visually-hidden">Youtube</h3>
+                </a>
+              </li>
+            </ul>
+          </div>
+          <div class="copyright">
+            <h3 class="visually-hidden">Логотип A-level</h3>
+            <a class="logo-a-level" href="https://a-level.com.ua/">   
+            </a>
+          </div>
+        </div>
+      </footer>
+    </div> 
+    <div class="modal" id="modal"></div>
+    <form class="own-pizza modal" id="own-pizza"  method="post" enctype="multipart/form-data" action="" autocomplete="off">
+      <div class="own-pizza__card">
+        <div>
+        <legend class="own-pizza__title">Добавьте фотографию вашей пиццы</legend>
+        <div class="own-pizza__element">
+         
+          <div class="own-pizza__photo-container">
+       
+            <div class="own-pizza__upload">
+              <input type="file" id="images" name="images" class="own-pizza__input">
+              
+            </div>
+            <div class="own-pizza__photo"></div>
+          </div>
+        </div>
+      </div>
+      <div class="own-pizza__element ">
+        <label class="own-pizza__label" for="title">Введите название пиццы</label>
+        <input id="title" class="own-pizza__name" name="titlePizza" type="text" placeholder="Моя пицца" minlength="4" maxlength="100" required>
+      </div>
+      <div>Вы можете создать пиццу из предложенных ингредиентов:</div>
+      <div class="own-pizza__checkbox-container">
+      
+
+      </div>
+      <div class="own-pizza-caloricity"></div>
+      <div class="own-pizza-price"></div>
+  
+      <div class="own-pizza__element own-pizza__element--submit">
+        <button class="own-pizza__submit" type="button">Создать</button>
+        или <button class="own-pizza__reset" type="reset">очистить</button>
+      </div>
+    </div>
+    </form>
+        <script type="module" src="./src/script.js"></script>
+    </body>
+</html>

+ 574 - 0
hw18PizzaFullVersion/main.css

@@ -0,0 +1,574 @@
+
+body {
+    width: 100%;
+    display: flex;
+    flex-wrap: wrap;
+    margin: 0 auto;
+    max-width: 1300px;
+    background: #ffffff;
+    font-size: 14px;
+  line-height: 18px;
+  font-family:  "Arial", sans-serif;
+  color: #444444;
+  font-style: normal;
+  border: 1px solid  #a8aeaf;
+  box-shadow: 5px 0 15px 0 rgba(0, 0, 0,0.2 ),-5px 0 15px 0 rgba(0, 0, 0,0.2 );
+
+}
+.visually-hidden:not(:focus):not(:active),
+input[type="checkbox"].visually-hidden {
+  position: absolute;
+
+  width: 1px;
+  height: 1px;
+  margin: -1px;
+  padding: 0;
+  overflow: hidden;
+
+  white-space: nowrap;
+
+  border: 0;
+
+  clip: rect(0 0 0 0);
+  -webkit-clip-path: inset(100%);
+  clip-path: inset(100%);
+}
+.container {
+    width: 100%;
+    display: flex;
+    flex-wrap: wrap;
+    justify-content: space-around;
+    margin: 0 auto;
+}
+.button {
+    font: inherit;
+    vertical-align: middle;
+    text-align: center;
+    color: #ffffff;
+    text-transform: uppercase;
+  
+   
+    border: none;
+  }
+  
+  .button:hover,
+  .button:focus,
+  .button:active {
+    background-color: #663d15;
+    outline: none;
+  }
+img {
+    max-width: 100%;
+    height: auto;
+  }
+
+a:active,
+  a:hover,
+  a {
+    text-decoration: none;
+    color: inherit;
+  }
+.header {
+    width: 100%;
+    background-color: #A7B5B7;
+      display: flex;
+      justify-content:flex-end;
+      align-items: center;
+      margin: 0 auto;
+      padding: 30px;
+  }
+
+
+
+input {
+    width: 400px;
+    height: 30px;
+}
+.main-wrapper {
+    display: flex;
+    flex-direction: column;
+    width: 100%;
+    
+}
+.favorite-list, .create-btn {
+ 
+    display: inline-block;
+    color: black;
+    font-size: 125%;
+    font-weight: 700;
+    text-decoration: none;
+    user-select: none;
+    padding: .25em .5em;
+    outline: none;
+    border: 1px solid rgb(250,172,17);
+    border-radius: 7px;
+    background: rgb(255,212,3) linear-gradient(rgb(255,212,3), rgb(248,157,23));
+    box-shadow: inset 0 -2px 1px rgba(0,0,0,0), inset 0 1px 2px rgba(0,0,0,0), inset 0 0 0 60px rgba(255,255,0,0);
+    transition: box-shadow .2s, border-color .2s;
+    margin: 0 10px;
+  } 
+  .favorite-list:hover, .create-btn:hover {
+    box-shadow: inset 0 -1px 1px rgba(0,0,0,0), inset 0 1px 2px rgba(0,0,0,0), inset 0 0 0 60px rgba(255,255,0,.5);
+  }
+  .favorite-list:active, .create-btn:active {
+    padding: calc(.25em + 1px) .5em calc(.25em - 1px);
+    border-color: rgba(177,159,0,1);
+    box-shadow: inset 0 -1px 1px rgba(0,0,0,.1), inset 0 1px 2px rgba(0,0,0,.3), inset 0 0 0 60px rgba(255,255,0,.45);
+  }
+
+.seekForm {
+    width: 100%;
+    box-shadow: 1px -7px 5px 0px #DCE6ED;
+    background-color: #d6dadd;
+}
+
+.seekForm fieldset{
+    border: none;
+}
+.search-wrapper {
+    display: flex;
+    justify-content: space-between;
+    padding: 0 10px;
+}
+.fieldset-wrapper {
+    display: flex;
+}
+.filter {
+    display: flex;
+    flex-direction: column;
+}
+.filter label input {
+    width: 50px;
+}
+.card {
+    margin: 10px 10px;
+    padding: 20px 20px;
+    width: 300px;
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    border: 1px solid  #BFB7B9;
+    border-radius: 15px;
+    box-shadow: 5px -5px 5px 0px #BFB7B9;
+    text-align: center;
+}
+.card img {
+    flex-grow: 1;
+}
+.card p{
+    display: flex;
+    flex-wrap: wrap;
+  
+    justify-content: center;
+    padding: 10px;
+}
+.card * {
+    padding: 10px;
+}
+
+.noResult {
+    font-size: 25px;
+    font-weight: 700;
+    line-height: 35px;
+    margin: 20px auto;
+    width: 70%;
+    text-align: center;
+}
+.icon {
+    background-image: url(img/heart.png);
+    background-repeat: no-repeat;
+    background-position: center;
+    background-color: #c5bfab;
+    opacity: 0.3;
+    width: 60px;
+    height: 60px;
+    border: none;
+    text-decoration: none;
+    padding: 0;
+    border: none;
+    font: inherit;
+    color: inherit;
+    background-color: transparent;
+    cursor: pointer;
+}
+.favorite {
+    opacity: 1;
+   
+}
+.header-btn {
+  display: flex;
+  flex-wrap: wrap;
+  
+}
+.btn-cart {
+    background-color:#21B1C4;
+    background-image: url(img/cart.png);
+    background-repeat: no-repeat;
+    background-position: center;
+    opacity: 0.5;
+    width: 60px;
+    height: 60px;
+    border: none;
+    text-decoration: none;
+    padding: 0;
+    border: none;
+    font: inherit;
+    color: inherit;
+    background-color: transparent;
+    cursor: pointer;
+}
+.btn-wrapper {
+    display: flex;
+}
+
+.cart-wrapper {
+    display: flex;
+    align-content: center;
+    border: 1px solid#21B1C4;
+    border-radius: 25px;
+    box-shadow: 11px -6px 5px 0px #EFF8F9;
+}
+
+.cart-wrapper {
+    font-size: 30px;
+    color: #21B1C4;
+}
+
+  
+  .main-footer {
+    position: relative;
+    width: 100%;
+  }
+  
+  .footer-wrapper {
+    display: -webkit-box;
+    display: -ms-flexbox;
+    display: flex;
+    -webkit-box-pack: justify;
+    -ms-flex-pack: justify;
+    justify-content: space-between;
+    margin: 0;
+    padding: 37px 0;
+    padding-bottom: 30px;
+  }
+  
+  .main-footer .footer-wrapper {
+    background-color: rgba( 255,255,255, 0.5);
+  }
+  
+  .inner-footer .footer-wrapper {
+    padding: 37px 0;
+    padding-bottom: 30px;
+  }
+  
+  .instagram-container {
+    display: -webkit-box;
+    display: -ms-flexbox;
+    display: flex;
+    -webkit-box-pack: center;
+    -ms-flex-pack: center;
+    justify-content: center;
+    width: 33.3%;
+    margin: 0;
+    margin-left: auto;
+  
+    vertical-align: middle;
+  }
+  
+  .instagram  {
+    font-weight: 700;
+    font-size: 21px;
+    line-height: 26px;
+    color: #000000;
+    -webkit-box-align: center;
+        -ms-flex-align: center;
+            align-items: center;
+            margin-top: 9px;
+  }
+  
+  .social-button {
+    display: -webkit-box;
+    display: -ms-flexbox;
+    display: flex;
+    -webkit-box-pack: center;
+    -ms-flex-pack: center;
+    justify-content: center;
+    -webkit-box-align: center;
+    -ms-flex-align: center;
+    align-items: center;
+    width: 46px;
+    height: 48px;
+    margin-right: 1px;
+  
+    color: #ffffff;
+  
+    background-color: #81b3d2;
+  }
+  
+  .social-button:hover,
+  .social-button:focus {
+    background-color: #669ec0;
+  }
+  
+  .social-button:active {
+    background-color: #5496bd;
+  }
+  
+  .social-button path:active {
+    background-color: #5496bd;
+  
+    fill: #88b6d1;
+  }
+  
+  .footer-social {
+    width: 33.4%;
+  }
+  
+  .footer-social ul {
+    
+    display: flex;
+    -ms-flex-wrap: wrap;
+        flex-wrap: wrap;
+    -webkit-box-pack: justify;
+    -ms-flex-pack: justify;
+    justify-content: space-between;
+    width: 150px;
+    margin: 0 auto;
+    padding: 0;
+  
+    list-style: none;
+  }
+  
+  .copyright {
+    display: -webkit-box;
+    display: -ms-flexbox;
+    display: flex;
+    -webkit-box-pack: center;
+    -ms-flex-pack: center;
+    justify-content: center;
+    width: 33.3%;
+    height: 50px;
+    margin: 0;
+  
+    font-weight: 400;
+    font-size: 14px;
+    line-height: 26px;
+    color: #333333;
+    -webkit-box-align: center;
+        -ms-flex-align: center;
+            align-items: center;
+  }
+  
+  .copyright:hover path,
+  .copyright:focus path {
+    fill: #a8cbe0;
+  }
+  
+  .copyright:active path {
+    fill: #bdbbbc;
+  }
+  
+  .copyright p {
+    display: block;
+    margin: 0;
+    margin-right: 9px;
+    padding: 0;
+    padding-bottom: 5px;
+  
+    list-style: none;
+  }
+.logo-a-level {
+    background-image: url('./img/a-level-logo.png');
+    background-repeat: no-repeat;
+    background-position: center;
+    width: 200px;
+    height: 150px;
+}
+.modal {
+  position:fixed;
+  top: 50%;
+  left: 50%;
+
+ 
+  transform: translate(-50%, -50%);
+  width: 100%;
+  max-width: 100%;
+  height: 100%;
+  max-height: 100%;
+  z-index: 8;
+  display: none;
+  background-color: rgba(221, 234, 243, 0.7);
+  padding:40px;
+  color: #000000;
+
+ 
+
+  -webkit-box-shadow: 5px 0 15px 0 rgba(0, 0, 0,0.1 ),-5px 0 15px 0 rgba(0, 0, 0,0.1 );
+          box-shadow: 5px 0 15px 0 rgba(0, 0, 0,0.1 ),-5px 0 15px 0 rgba(0, 0, 0,0.1 );
+  background-position: 0 0;
+  
+}
+
+  .opened {
+    display: flex;
+    justify-content: center;
+    align-items: center;
+  } 
+  
+  @keyframes slide-down {
+    0% {
+      -webkit-transform: translateY(-10%);
+              transform: translateY(-10%);
+    }
+    50% {
+      -webkit-transform: translateY(8%);
+              transform: translateY(8%);
+    }
+    65% {
+      -webkit-transform: translateY(-4%);
+              transform: translateY(-4%);
+    }
+    80% {
+      -webkit-transform: translateY(4%);
+              transform: translateY(4%);
+    }
+    95% {
+      -webkit-transform: translateY(-2%);
+              transform: translateY(-2%);
+    }
+    100% {
+      -webkit-transform: translateY(0%);
+              transform: translateY(0%);
+    }
+  }
+  .modal-card {
+    position: absolute;
+  z-index: 9;
+  width: 50%;
+  justify-content: center;
+  align-items: center;
+  background-color: #ffff;
+  box-sizing: content-box;
+    -webkit-animation: slide-down 2s;
+  animation: slide-down 2s;
+
+  }
+ 
+  .close-btn {
+    position: absolute;
+    top: 10%;
+    left: 90%;
+    z-index: 10;
+    width: 50px;
+    height: 50px;
+    background-image: url('./img/closed.png');
+    border: none;
+    text-decoration: none;
+    padding: 0;
+    border: none;
+    font: inherit;
+    color: inherit;
+    background-color: transparent;
+    cursor: pointer;
+  }
+
+  .own-pizza__name {
+    width: 40%;
+  }
+
+  .own-pizza__card {
+    display: flex;
+    flex-direction: column;
+    background-color: #f5fbff;
+    border-radius: 20px;
+    width: 80%;
+    padding: 1%;
+  }
+
+  .own-pizza__checkbox-container {
+    display: flex;
+    flex-direction: row;
+    flex-wrap: wrap;
+    
+    
+  }
+  .own-pizza__checkbox-wrapper{
+    display: flex;
+    align-items: center;
+    margin: 10px;
+    width: 40%;
+  }
+  
+
+  .own-pizza__composition {
+    width: 70px;
+  }
+
+  .own-pizza__photo {
+    margin-right: 10px;
+    margin-bottom: 10px;
+    width: 70px;
+    height: 70px;
+    background-color: #e4e4de;
+    border-radius: 5px;
+  }
+
+  .cart-info {
+    width: 100%;
+    text-align: center;
+    font-size: 32px;
+    line-height: 40px;
+    color: rgb(97, 32, 218);
+
+
+  }
+  .cart-list {
+    list-style: none;
+    display: flex;
+    flex-direction: column;
+    justify-content:space-between;
+    align-items: baseline;
+    width: 100%;
+
+  }
+  .cart-list li{
+    width: 100%;
+    display: flex;
+    align-items: center;
+    justify-content:space-between;
+    font-size: 25px;
+    line-height: 35px;
+    color: rgb(101, 82, 136);
+  }
+  .cart-list img {
+    width: 150px;
+  }
+  .cart-btn-reset, .cart-link {
+    appearance: none;
+    border: 0;
+    border-radius: 5px;
+    background: #e77c5c;
+    color: #fff;
+    padding: 8px 16px;
+    font-size: 16px;
+  }
+  .cart-btn-reset:hover {
+    background: #d1461b;
+  }
+  
+  .cart-btn-reset:focus {
+    outline: none;
+    box-shadow: 0 0 0 4px #f1cbb2;
+  }
+  .cart-link {
+    background: #44aa6e;
+  }
+  .cart-link:hover {
+    background: #1dee0a;
+  }
+  
+  .cart-link:focus {
+    outline: none;
+    box-shadow: 0 0 0 4px #57774d;
+  }
+  

+ 5 - 0
hw18PizzaFullVersion/src/cart.js

@@ -0,0 +1,5 @@
+import {CartContents} from './servises/cart.servises/cart.servises.js';
+
+
+
+CartContents.renderCart();

+ 37 - 0
hw18PizzaFullVersion/src/data/compositionList.js

@@ -0,0 +1,37 @@
+export const compositionList = [{
+    id: 1,
+    name: "Моцарела",
+    caloricity: 28,
+    price: 15,
+},
+{
+    id: 2,
+    name: "Креветки",
+    caloricity: 37,
+    price: 35,
+},
+{
+    id: 3,
+    name: "Салями",
+    caloricity: 42,
+    price: 25,
+},
+{
+    id: 4,
+    name: "Лук",
+    caloricity: 13,
+    price: 7,
+},
+{
+    id: 5,
+    name: "Томаты",
+    caloricity: 21,
+    price: 17,
+},
+{
+    id: 6,
+    name: "Ветчина",
+    caloricity: 37,
+    price: 35,
+},
+];

+ 173 - 0
hw18PizzaFullVersion/src/data/pizzaList.js

@@ -0,0 +1,173 @@
+export const pizzaList = [{
+        id: 1,
+        img: "1.png",
+        name: "Супер гриль",
+        composition: ["охотничьи колбаски", "сосиски", "моцарелла", "баклажан", "томаты", "лук", "перец", "соус томатный", "соус BBQ", "зеленый соус", "майонез"],
+        caloricity: 1569,
+        price: 249,
+    },
+    {
+        id: 2,
+        img: "2.jpg",
+        name: "Маргарита",
+        composition: ["томаты", "моцарелла", "орегано", "базилик", "соус Pomodoro"],
+        caloricity: 1042,
+        price: 70,
+        priceOfTheDay: true,
+    },
+    {
+        id: 3,
+        img: "3.jpg",
+        name: "Карбонара",
+        composition: ["ветчина", "шампиньоны", "пармезан", "моцарелла", "томаты", "яйцо перепелиное", "смесь перцев", "соус Carbonara"],
+        caloricity: 1369,
+        price: 119,
+    },
+    {
+        id: 4,
+        img: "4.jpg",
+        name: "C сырным бортиком",
+        composition: ["хамон", "моцарелла", "сливочный сыр", "персик", "сливки", "руккола"],
+        caloricity: 1140,
+        price: 139,
+    },
+    {
+        id: 5,
+        img: "5.png",
+        name: "Полло",
+        composition: ["куриное филе sous-vide", "ананас", "моцарелла", "орегано", "перец чили", "соус Pomodoro"],
+        caloricity: 1232,
+        price: 99,
+        priceOfTheDay: true,
+    },
+    {
+        id: 6,
+        img: "6.jpeg",
+        name: "Пепперони",
+        composition: ["Салями Пепперони", "моцарелла", "орегано", "соус Pomodoro"],
+        caloricity: 1280,
+        price: 119,
+    },
+    {
+        id: 7,
+        img: "7.png",
+        name: "Гурмео",
+        composition: ["охотничьи колбаски", "салями пепперони", "ветчина", "куриное филе sous-vide", "шампиньоны", "орегано", "соус BBQ"],
+        caloricity: 1343,
+        price: 149,
+    },
+    {
+        id: 8,
+        img: "8.jpeg",
+        name: "Четыре сыра",
+        composition: ["пармезан", "дор блю", "чеддер", "моцарелла", "груша", "грецкий орех", "соус сливочный"],
+        caloricity: 1220,
+        price: 109,
+    },
+    {
+        id: 9,
+        img: "9.jpeg",
+        name: "Американо",
+        composition: ["куриное филе sous-vide", "салями", "пепперони", "охотничьи колбаски", "кукуруза", "моцарелла", "лук", "орегано", "соус Pomodoro", "соус BBQ"],
+        caloricity: 1422,
+        price: 149,
+    },
+    {
+        id: 10,
+        img: "10.jpg",
+        name: "Кальцоне",
+        composition: ["ветчина", "шампиньоны", "дор блю", "моцарелла", "томаты", "орегано"],
+        caloricity: 1056,
+        price: 99,
+        priceOfTheDay: true,
+    },
+    {
+        id: 11,
+        img: "11.png",
+        name: "Берлускони",
+        composition: ["сливочный соус из белых грибов и шампиньонов с трюфельным маслом", "моцарелла", "дор блю", "орегано", "лук"],
+        caloricity: 1293,
+        price: 125,
+    },
+    {
+        id: 12,
+        img: "12.png",
+        name: "Супер гриль",
+        composition: ["охотничьи колбаски", "сосиски", "сыр моцарелла", "баклажан", "томаты", "лук", "перец", "соус томатный"],
+        caloricity: 1410,
+        price: 132,
+    },
+    {
+        id: 13,
+        img: "13.jpeg",
+        name: "Кампанья",
+        composition: ["охотничьи колбаски", "ветчина", "салями пепперони", "куриное филе sous-vide", "шампиньоны", "моцарелла", "томаты"],
+        caloricity: 1510,
+        price: 144,
+    },
+    {
+        id: 14,
+        img: "14.png",
+        name: "Дьявола",
+        composition: ["горчичный соус", "моцарелла", "молочные сосиски", "бекон", "помидор", "зелень"],
+        caloricity: 1180,
+        price: 107,
+    },
+    {
+        id: 15,
+        img: "15.png",
+        name: "Бекон ранч",
+        composition: ["фирменный пицца-соус", "моцарелла", "бекон", "ветчина", "телятина", "помидор", "перец болгарский", "соус ранч"],
+        caloricity: 1322,
+        price: 113,
+    },
+    {
+        id: 16,
+        img: "16.png",
+        name: "Гроссето",
+        composition: ["фирменный пицца-соус", "моцарелла", "лосось", "креветки", "сладкий перец", "маслины", "лимон", "базилик", "орегано"],
+        caloricity: 980,
+        price: 159,
+    },
+    {
+        id: 17,
+        img: "17.png",
+        name: "Тоскана",
+        composition: ["фирменный пицца-соус", "моцарелла", "ветчина", "бекон", "салями-пеперони", "сладкий перец", "сыр «Пармезан»", "базилик", "орегано"],
+        caloricity: 1310,
+        price: 139,
+    },
+    {
+        id: 18,
+        img: "18.png",
+        name: "Грибная",
+        composition: ["фирменный пицца-соус", "моцарелла", "шампиньоны", "опята", "маслины", "лук", "базилик", "орегано", "зелень"],
+        caloricity: 1451,
+        price: 132,
+    },
+    {
+        id: 19,
+        img: "19.png",
+        name: "Туринская",
+        composition: ["горчичный соус", "моцарелла", "салями", "охотничьи колбаски", "огурцы маринованные", "зелень"],
+        caloricity: 1140,
+        price: 138,
+    },
+    {
+        id: 20,
+        img: "20.jpg",
+        name: "Венецианская",
+        composition: ["фирменный пицца-соус", "моцарелла", "телятина", "куриная грудка", "бекон", "шампиньоны", "помидор", "перец", "пармезан", "зелень"],
+        caloricity: 1341,
+        price: 142,
+    },
+    {
+        id: 21,
+        img: "21.jpg",
+        name: "Четыре сезона",
+        composition: ["фирменный пицца-соус", "моцарелла", "опята", "куриная грудка", "помидор", "перец", "лук", "шампиньоны", "пармезан", "зелень"],
+        caloricity: 1479,
+        price: 145,
+    },
+];
+

+ 29 - 0
hw18PizzaFullVersion/src/script.js

@@ -0,0 +1,29 @@
+import {pizzaList} from './data/pizzaList.js';
+import {renderCards} from './view/render.js';
+import {sortByPrice, priceSortElem} from './servises/search.servises/sort.js';
+import {filterAll} from './servises/search.servises/filter.js';
+import {getFavoritePizzas} from './servises/local.storage.servises/localStorageLogick.js';
+import {addCardEventListeners} from './view/modal.card.js'
+import {ownPizzaForm, onFormListen} from './servises/own.card.servises/own.pizza.creating.js';
+import { getOwnPizzas} from './view/render.own.card.js';
+import { removePhotos } from './servises/own.card.servises/reset.own.card.js';
+
+const searchBtn = document.getElementById('find');
+const searchInput = document.getElementById('search');
+const resetBtn = document.getElementById('reset');
+getOwnPizzas();
+renderCards(pizzaList);
+
+
+resetBtn.onclick = removePhotos;
+priceSortElem.oninput = sortByPrice;
+searchInput.addEventListener('change',filterAll);
+searchBtn.addEventListener('click', filterAll);
+document.querySelector('.favorite-list').onclick = getFavoritePizzas;
+document.addEventListener('click',addCardEventListeners);
+
+ownPizzaForm.addEventListener('change', onFormListen);
+
+
+
+

+ 77 - 0
hw18PizzaFullVersion/src/servises/cart.servises/cart.servises.js

@@ -0,0 +1,77 @@
+import PizzaService from './pizza.servises.js';
+import * as Render from '../../view/cart.render.js';
+
+const initialData = {
+    totalPrice : 0,
+    totalAmount : 0,
+    items: []
+};
+
+const getDataFromLocalStorage = ()=> {
+    const data = JSON.parse(localStorage.getItem('cartData'));
+    return data || initialData;
+};
+
+class CartService extends PizzaService{
+    constructor(){
+        super();
+        const data = getDataFromLocalStorage();
+        Object.assign(this, data);
+        
+    }
+    addPizzaToCart(id){
+        const pizza = this.initialList.find(pizza => pizza.id === id);
+        const indexOfPizzaInItem = this.items.findIndex(pizza=> pizza.id ===id)
+        if (indexOfPizzaInItem >= 0){
+            this.items[indexOfPizzaInItem].count +=1;
+            CartService.setTotalPriceAndAmount.call(this);
+            CartService.setToLocalStorage.call(this);
+            CartService.renderCart.call(this);
+            return;
+        };
+        this.items.push({id:pizza.id, count: 1});
+        CartService.setTotalPriceAndAmount.call(this);
+        CartService.setToLocalStorage.call(this);
+        CartService.renderCart.call(this);
+    }
+
+    static setTotalPriceAndAmount(){
+        const result = this.items.reduce((acc, item)=>{
+            const pizza = this.initialList.find(pizza => pizza.id === item.id);
+            return {
+                totalPrice: acc.totalPrice + (pizza.price + item.count),
+                totalAmount: acc.totalAmount + item.count,
+            }
+            
+        },{totalPrice: 0, totalAmount: 0})
+        this.totalPrice = result.totalPrice;
+        this.totalAmount = result.totalAmount;
+       
+
+    }
+    static setToLocalStorage (){
+        localStorage.setItem('cartData', JSON.stringify(this))
+    }
+    renderCart (){
+        const {items, ...otherData} = this;
+        const data = {...otherData, items: []};
+        for(let key in this.items){
+            const pizzaInCart = this.items[key];
+            const pizzaData = this.initialList.find(item=> item.id === pizzaInCart.id);
+            data.items.push({
+                name: pizzaData.name,
+                count:pizzaInCart.count,
+                price: pizzaData.price,
+                img:pizzaData.img 
+            })
+        }
+        Render.renderCart(data)
+    }
+    
+   
+    
+            
+}
+      
+
+export const CartContents = new CartService();

+ 12 - 0
hw18PizzaFullVersion/src/servises/cart.servises/pizza.servises.js

@@ -0,0 +1,12 @@
+import{pizzaList} from '../../data/pizzaList.js'
+export default class PizzaService {
+    constructor(){}
+    get initialList (){
+        return [...pizzaList]
+    }
+    filterByName(name){
+        return this.initialList.filter(item=> {
+            item.name.toLocaleLowerCase().includes(name.toLocaleLowerCase())
+        })
+    }
+}

+ 18 - 0
hw18PizzaFullVersion/src/servises/local.storage.servises/favorites.js

@@ -0,0 +1,18 @@
+export const checkIsFavorite = function (item){
+    let isFavorite = localStorage.getItem(`pizza${item.id}`)
+    if (isFavorite === null){
+        return false
+    }
+    return true
+};
+
+
+export const applyFavoriteStyle = function(item, btn){
+    
+    if (checkIsFavorite(item) === true) {
+      return  btn.className = 'icon favorite';
+    }
+    else{
+      return  btn.className = 'icon';
+    }
+}

+ 39 - 0
hw18PizzaFullVersion/src/servises/local.storage.servises/localStorageLogick.js

@@ -0,0 +1,39 @@
+import {renderCards} from '../../view/render.js';
+let pizzasKeys = JSON.parse(localStorage.getItem('array'))||[];
+export const addPizzaToFavorite = (item)=> (evt)=> {      
+    if(item.isFavorite === false){
+        let pizzaObj = JSON.stringify(item);
+        localStorage.setItem(`pizza${item.id}`,pizzaObj);
+        pizzasKeys.push(item.id);
+        localStorage.setItem('array',JSON.stringify(pizzasKeys));
+        item.isFavorite = true;
+        evt.target.classList.add('favorite');
+    }else{
+        item.isFavorite = false;
+        evt.target.classList.remove('favorite');
+        localStorage.removeItem(`pizza${item.id}`);
+        localStorage.removeItem('array',JSON.stringify(pizzasKeys));
+        let indexId = pizzasKeys.findIndex(elem => elem === item.id)
+        pizzasKeys.splice(indexId, 1);
+        localStorage.setItem('array',JSON.stringify(pizzasKeys))
+        
+    }
+ 
+};
+export const  getFavoritePizzas =function(){
+  
+    let favoritePizzas = [];
+    if (pizzasKeys  === null|| pizzasKeys.length === 0 ){
+        document.querySelector('.container').innerHTML ='';
+        return  document.querySelector('.container').innerHTML = ` <div class="noResult">
+        К сожалению, у вас нет пицц в избранном
+      </div>`;
+      
+    }else{
+        for(let i=0; i<pizzasKeys.length; i++) {
+            favoritePizzas.push(JSON.parse(localStorage.getItem(`pizza${pizzasKeys[i]}`)))
+            
+        }
+    }
+    renderCards(favoritePizzas);
+}

+ 89 - 0
hw18PizzaFullVersion/src/servises/own.card.servises/own.pizza.creating.js

@@ -0,0 +1,89 @@
+
+import { compositionList } from '../../data/compositionList.js';
+import {closeBtn} from '../../utils/dom.elements.js';
+import {onPhotoLoad, chooserElem} from './photo.js';
+
+export const ownPizzaForm = document.querySelector('#own-pizza');
+
+const createPizzaBtn = document.querySelector('.create-btn');
+const checkboxWrapper = document.querySelector('.own-pizza__checkbox-container');
+const caloricity = document.querySelector('.own-pizza-caloricity');
+const price = document.querySelector('.own-pizza-price');
+
+const createCheckboxContents = (item)=>{
+  const checkBoxes = document.createElement('input');
+ 
+  const checkBoxesContainer = document.createElement('div');
+  checkBoxesContainer.className = 'own-pizza__checkbox-wrapper'
+  
+  checkBoxes.type = 'checkbox';
+  checkBoxes.className = 'own-pizza__composition'
+  checkBoxes.id = `${item.id}`;
+  checkBoxes.value = `${item.name}`;
+  const checkBoxesLabel = document.createElement('label');
+  checkBoxesLabel.htmlFor = `${item.id}`;
+  checkBoxesLabel.innerHTML = `<b>${item.name}</b>,  цена: ${item.price} грн за порцию`;
+  checkBoxesContainer.appendChild(checkBoxes);
+  checkBoxesContainer.appendChild(checkBoxesLabel);
+  checkboxWrapper.appendChild(checkBoxesContainer);
+}
+
+const createCheckBoxes = ()=> {
+  checkboxWrapper.innerHTML = '';
+  compositionList.forEach(item => {
+  
+    createCheckboxContents(item);
+      
+    })
+};
+
+export const onFormListen = function(){
+ const info = getCheckBoxInfo()
+ const priceN = info.price;
+ const caloricityN = info.caloricity;
+ caloricity.innerText = `Общая калорийность пиццы: ${caloricityN} кКал`;
+ price.innerText = `Цена пиццы: ${priceN} грн`;
+ return
+};
+
+export const getCheckBoxInfo = function(){
+    let selectedCheckBoxes = document.querySelectorAll('.own-pizza__composition');
+    const checkedValues = Array.from(selectedCheckBoxes).filter(elem =>elem.checked === true).map(elem => elem.defaultValue); 
+    let namesArr = checkedValues.slice();
+    const checkedIngredients = []
+    checkedValues.forEach(elem => {
+      const ingredient = compositionList.find(item => item.name === elem);
+      checkedIngredients.push(ingredient)
+    })
+ 
+    let initialValue = 0;
+
+    const getCaloricity = checkedIngredients.reduce((accumulator, currentValue) => accumulator + currentValue.caloricity, initialValue);
+    const getPrice = checkedIngredients.reduce((accumulator, currentValue) => accumulator + currentValue.price, initialValue);
+
+    let info = {
+      checkedIngredients: namesArr,
+      price: getPrice,
+      caloricity: getCaloricity
+    };
+
+  return info
+};
+
+
+createPizzaBtn.onclick = function(){
+  
+  ownPizzaForm.classList.add('opened');
+  const closeButton = ownPizzaForm.querySelector('.close-btn');
+  if(!closeButton){
+    closeBtn(ownPizzaForm);
+  }
+   
+   createCheckBoxes ();
+   
+   
+
+};
+
+
+chooserElem.addEventListener('change', onPhotoLoad);

+ 45 - 0
hw18PizzaFullVersion/src/servises/own.card.servises/photo.js

@@ -0,0 +1,45 @@
+import { removePhotos } from "./reset.own.card.js";
+
+export const  chooserElem = document.querySelector('input[type=file]');
+export const  photoContainer = document.querySelector('.own-pizza__photo');
+const fileTypes = ['gif', 'jpg', 'jpeg', 'png'];
+const imageWidth = 70;
+const imageHeight = 70;
+
+const createPhoto = function () {
+    const elementPicture = document.createElement('img');
+    elementPicture.width = imageWidth;
+    elementPicture.height = imageHeight;
+    elementPicture.alt = 'Фотография';
+    return elementPicture;
+  };
+
+ const loadFile = function (chooser, photo) {
+   var file = chooser.files[0];
+    if (file) {
+     const fileName = file.name.toLowerCase();
+     const matches = fileTypes.some(function (it) {
+        return fileName.endsWith(it);
+      });
+
+      if (matches) {
+       const reader = new FileReader();
+        reader.addEventListener('load', function () {
+          photo.src = reader.result;
+        });
+
+        reader.readAsDataURL(file);
+      }
+    }
+  };
+
+ 
+
+
+ export const onPhotoLoad = function () {
+   removePhotos();
+    loadFile(chooserElem, photoContainer.appendChild(createPhoto()));
+  };
+
+
+

+ 9 - 0
hw18PizzaFullVersion/src/servises/own.card.servises/reset.own.card.js

@@ -0,0 +1,9 @@
+
+export const removePhotos = function () {
+    const pictures = document.querySelectorAll('.own-pizza__photo img');
+    if (pictures) {
+        pictures.forEach(function (picture) {
+          picture.remove();
+        });
+      }
+    };

+ 41 - 0
hw18PizzaFullVersion/src/servises/search.servises/filter.js

@@ -0,0 +1,41 @@
+import {renderCards} from '../../view/render.js';
+import {searchPizzas} from './search.js';
+import {pizzaList} from '../../data/pizzaList.js';
+ const filterByPrice = function(item){
+    const priceMinValue = document.getElementById('price-min');
+    const priceMaxValue = document.getElementById('price-max');
+    if(+priceMinValue.value === 0 || +priceMaxValue.value === 0){
+      return item
+    }
+    return (item.price >= priceMinValue.value) && (item.price <= priceMaxValue.value) 
+  
+  }
+  
+  const filterByCalories = function(item){
+    const caloriesMinValue = document.getElementById('calories-min');
+    const caloriesMaxValue = document.getElementById('calories-max');
+    if(+caloriesMinValue.value === 0 || +caloriesMaxValue.value === 0){
+      return item
+    }
+    return (item.caloricity >= caloriesMinValue.value) && (item.caloricity <= caloriesMaxValue.value) 
+  }
+export const filterAll = function (){
+    let result = pizzaList.filter(pizza => {
+     return filterByCalories(pizza)
+           && searchPizzas(pizza)
+           && filterByPrice(pizza)
+    });
+   
+   if (result.length === 0){
+   return  document.querySelector('.container').innerHTML = ` <div class="noResult">
+    К сожалению, по вашему запросу ничего не найдено, попробуйте изменить запрос или создать свою пиццу
+  </div>`;
+  
+   }
+  
+  else {
+     return renderCards(result)}
+  };
+  export const resetAll = ()=>{
+    return renderCards(pizzaList)
+  }

+ 10 - 0
hw18PizzaFullVersion/src/servises/search.servises/search.js

@@ -0,0 +1,10 @@
+
+export const searchPizzas = (item) => {
+    const value = document.getElementById('search').value;
+     return item.name.toLocaleLowerCase().includes(value.toLocaleLowerCase()) || item.composition.includes(value)
+    
+    }
+
+      
+      
+      

+ 17 - 0
hw18PizzaFullVersion/src/servises/search.servises/sort.js

@@ -0,0 +1,17 @@
+
+import {renderCards} from '../../view/render.js';
+import {pizzaList} from '../../data/pizzaList.js'
+export const priceSortElem = document.getElementById('price-type');
+export const sortByPrice = function () {
+    
+    if(priceSortElem.value === 'increase'){
+      const result = pizzaList.slice().sort((a,b)=>  a.price - b.price)
+      return renderCards(result)
+    }
+    if(priceSortElem.value === 'decrease'){
+      const result = pizzaList.slice().sort((a,b)=>  b.price - a.price)
+      return renderCards(result)
+    }
+    return renderCards(pizzaList)
+  };
+  

+ 9 - 0
hw18PizzaFullVersion/src/utils/dom.elements.js

@@ -0,0 +1,9 @@
+export const modal = document.querySelector("#modal");
+export const  closeBtn = function(elem){
+    const closeBtn = document.createElement('button');
+    closeBtn.className = 'close-btn';
+    closeBtn.onclick = function(){
+     elem.classList.remove('opened')
+    }
+    elem.appendChild(closeBtn);
+}

+ 34 - 0
hw18PizzaFullVersion/src/view/cart.render.js

@@ -0,0 +1,34 @@
+
+export const renderCart = (data) => {
+    const main = document.querySelector('main');
+    main.innerHTML = '';
+    const totalElem = document.createElement('p');
+    totalElem.className = 'cart-info'
+    totalElem.innerText = `Сумма к оплате: ${data.totalPrice} грн.  Количество: ${data.totalAmount}шт.`;
+    main.appendChild(totalElem);
+
+    const itemElem = document.createElement('ul');
+    itemElem.className = 'cart-list'; 
+    itemElem.innerHTML = data.items.reduce((acc, item) => {
+        return acc+`<li><img src="img/${item.img}" alt="">
+        <span>  ${item.name}</span><span> ${item.price}грн </span>* <span>${item.count}шт</span></li>`
+
+    }, '');
+    main.appendChild(itemElem);
+    const itemLink = document.createElement('a');
+    itemLink.className = 'cart-link';
+    itemLink.innerText = 'Купить'
+    const itemBtn = document.createElement('button');
+    itemBtn.className = 'cart-btn-reset'
+    itemBtn.innerText = 'Очистить корзину';
+    const cleanCart = function(){
+        
+    main.innerHTML = '';
+    localStorage.removeItem(`cartData`);
+    }
+    itemBtn.onclick = cleanCart;
+    main.appendChild(itemLink);
+    main.appendChild(itemBtn);
+
+}
+

+ 31 - 0
hw18PizzaFullVersion/src/view/modal.card.js

@@ -0,0 +1,31 @@
+import { pizzaList } from '../data/pizzaList.js';
+import {renderCard} from './render.js';
+import {modal, closeBtn} from '../utils/dom.elements.js'
+
+const createModalWindow = (evt)=>{
+ modal.classList.add('opened');
+ modal.innerHTML='';
+ let id = +(evt.currentTarget.id);
+ let indexId = pizzaList.findIndex(pizza => pizza.id === id)
+ const modalPizza =renderCard(pizzaList[indexId]);
+ modalPizza.classList.add('modal-card');
+ closeBtn(modal);
+ modal.appendChild(modalPizza);
+
+}
+  
+const showPizzaInfo = function(evt){
+ createModalWindow(evt);
+ evt.stopPropagation();
+
+} 
+
+export const addCardEventListeners = function () {
+const cards = document.querySelectorAll('.card');
+ cards.forEach(function (elem) {
+   if (elem.className === 'card') {
+     elem.onclick = showPizzaInfo;
+   }
+ });
+};
+ 

+ 61 - 0
hw18PizzaFullVersion/src/view/render.js

@@ -0,0 +1,61 @@
+
+import {checkIsFavorite, applyFavoriteStyle} from '../servises/local.storage.servises/favorites.js';
+import {addPizzaToFavorite} from '../servises/local.storage.servises/localStorageLogick.js';
+import {CartContents} from '../servises/cart.servises/cart.servises.js'
+
+
+export const renderCard = item => {
+    const card = document.createElement('div');
+    const btnWrapper = document.createElement('div');
+    btnWrapper.className = 'btn-wrapper';
+    const pizzasPrice = document.createElement('span');
+    pizzasPrice.innerHTML =`${item.price } грн`
+    const cartWrapper = document.createElement('div');
+    cartWrapper.className = 'cart-wrapper';
+    const buttonHeart = document.createElement('button');
+    card.className = 'card'
+    const cartBtn = document.createElement('button');
+   cartBtn.className = 'btn-cart'
+    card.id = item.id
+    
+    cartBtn.onclick = function() {
+        CartContents.addPizzaToCart(item.id)
+    };
+    
+    item.isFavorite = checkIsFavorite(item);
+    applyFavoriteStyle(item, buttonHeart);
+    buttonHeart.addEventListener('click', addPizzaToFavorite(item));
+    let food = item.composition;
+    food = food.join(', ')
+    
+    card.innerHTML = `
+        <img src="img/${item.img}" alt="">
+       <div> <h2>${item.name }</h2>
+        <p><b>Ингредиенты:</b> ${ food}</p>
+        <p>${ item.caloricity}Ккал</p></div>
+        
+    `;
+    cartWrapper.appendChild(pizzasPrice)
+    cartWrapper.appendChild(cartBtn)
+    btnWrapper.appendChild(cartWrapper)
+    btnWrapper.appendChild(buttonHeart)
+   
+    card.appendChild(btnWrapper)
+    return card;
+  }
+  
+  
+  export const renderCards = data => {
+    document.querySelector('.container').innerHTML = '';
+    data.forEach(item => {
+        const card = renderCard(item);
+        document.querySelector('.container').appendChild(card)
+    })
+  };
+
+
+
+ 
+
+  
+

+ 60 - 0
hw18PizzaFullVersion/src/view/render.own.card.js

@@ -0,0 +1,60 @@
+import {ownPizzaForm, getCheckBoxInfo} from '../servises/own.card.servises/own.pizza.creating.js';
+import { pizzaList } from '../data/pizzaList.js';
+import { removePhotos } from '../servises/own.card.servises/reset.own.card.js';
+
+const btnSubmit = ownPizzaForm.querySelector('.own-pizza__submit');
+const btnReset = ownPizzaForm.querySelector('.own-pizza__reset');
+let pizzasKeys = JSON.parse(localStorage.getItem('myPizzaArr'))||[];
+let counter = 0;
+
+const createOwnCard = function(){
+    const name =  ownPizzaForm.querySelector('.own-pizza__name').value;
+    const some = getCheckBoxInfo()
+    const price = some.price;
+    const caloricity = some.caloricity; 
+    const ingredients = some.checkedIngredients;
+
+    return {
+        img: `1.png`,   
+        name: `${name}, created by myself`,
+        composition:ingredients,
+        caloricity: caloricity,
+        price: price,
+        selfCreated: true,
+    }
+};
+
+const addOwnPizzaToStorage = (item)=> {      
+    // const photoUrl = document.querySelector('.own-pizza__photo img').src
+    // let photoObj = JSON.stringify(`${photoUrl}`);
+        let pizzaObj = JSON.stringify(item);
+        localStorage.setItem(`myPizza${++counter}`,pizzaObj);
+        pizzasKeys.push(counter);
+       localStorage.setItem('myPizzaArr',JSON.stringify(pizzasKeys));
+    //    localStorage.setItem(`myPizzaImage${counter}`, photoUrl);
+ 
+};
+
+const addOwnPizzaCard = function(){
+    let card = createOwnCard();
+    addOwnPizzaToStorage(card);
+    ownPizzaForm.classList.remove('opened');
+};
+
+export const  getOwnPizzas =function(){
+  
+   
+        for(let i=0; i<pizzasKeys.length; i++) {
+            let card = JSON.parse(localStorage.getItem(`myPizza${pizzasKeys[i]}`));
+            // let image = localStorage.getItem(`myPizzaImage${pizzasKeys[i]}`);
+            // let imgSrc = image
+            // card.img = imgSrc
+           pizzaList.push(card)
+            
+        }
+    }
+    
+
+btnSubmit.addEventListener('click', addOwnPizzaCard);
+btnReset.addEventListener('click', removePhotos)
+