{"action":"created","comment":{"url":"https://api.github.com/repos/up-htmlacademy/63294-pink/pulls/comments/31819410","id":31819410,"diff_hunk":"@@ -1,49 +1,220 @@\n (function() {\r\n 'use strict';\r\n \r\n-  //добавление интерактивной карты\r\n+  //Переключение видимости навигационного меню  \r\n+  var toggleMenu = document.querySelector('.nav-toggle');\r\n+  var navMenu = document.querySelector('.page-nav');\r\n+\r\n+  toggleMenu.addEventListener('click', function(event) {\r\n+    event.preventDefault();\r\n+    event.stopPropagation();\r\n+    navMenu.classList.toggle('nav-menu-show');\r\n+  });\r\n+\r\n+  document.addEventListener('click', function() {\r\n+    if (navMenu.classList.contains('nav-menu-show')) {\r\n+      navMenu.classList.remove('nav-menu-show');        \r\n+    }      \r\n+  });\r\n+\r\n+\r\n+  //оживление слайдеров\r\n+  var tableSlider = document.querySelector('.slider-price');\r\n+  var reviewSlider = document.querySelector('.slider-reviews');\r\n+  \r\n   (function(){\r\n-    function initialize() {  \r\n-      var centerLatlng = new google.maps.LatLng(59.938910, 30.323031);\r\n-      var mapOptions = {\r\n-        zoom: 17,\r\n-        center: centerLatlng\r\n-      };\r\n-      var map = new google.maps.Map(document.getElementById('google-map'), mapOptions);\r\n-      \r\n-      var image = 'img/map-marker.svg';\r\n-      var myLatlng = new google.maps.LatLng(59.938641, 30.323010);\r\n-      new google.maps.Marker({\r\n-          position: myLatlng,\r\n-          map: map,      \r\n-          icon: image\r\n+    if (!(tableSlider) && !(reviewSlider)) {\r\n+      return;\r\n+    }\r\n+\r\n+    function resetActive (slidePoint) {\r\n+      for (var i = 0; i < slidePoint.length; i++) {\r\n+        slidePoint[i].classList.remove('is-slide-active');\r\n+      }\r\n+    }\r\n+\r\n+    function initPos (i, slidePoint, slideObject, step) {\r\n+      slidePoint[i].addEventListener('click', function() {        \r\n+        slideObject.style.left = step*i + '%';\r\n+        resetActive (slidePoint);\r\n+        this.classList.add('is-slide-active');\r\n       });\r\n     }\r\n \r\n-    if(document.querySelector('#google-map')) {\r\n-      google.maps.event.addDomListener(window, 'load', initialize);\r\n-    }  \r\n-  })();\r\n+    function moveControl(operation, slideObject, step, prev, next) {\r\n+      var valuePos = parseInt(slideObject.style.left, 10);\r\n+      \r\n+      prev.classList.remove('disabled');\r\n+      next.classList.remove('disabled');\r\n+\r\n+      if (isNaN(valuePos)) {\r\n+        valuePos = 0;\r\n+      }\r\n+\r\n+      if (operation) {\r\n+        valuePos = valuePos + step;\r\n+      } else {\r\n+        valuePos = valuePos - step;\r\n+      }\r\n+\r\n+      if ( valuePos >= 0) {\r\n+        valuePos = 0;\r\n+        prev.classList.add('disabled');\r\n+      }\r\n+      if ( valuePos <= 3*step-step) {\r\n+        valuePos = 3*step-step;\r\n+        next.classList.add('disabled');\r\n+      }\r\n+\r\n+      slideObject.style.left = valuePos + '%';\r\n+    }\r\n+\r\n+    //слайдер таблицы \r\n+    var slideTable = tableSlider.querySelector('.price-table');    \r\n+    var pointTable = tableSlider.querySelectorAll('.slider-pagination li');\r\n+    var stepTable = -85;    \r\n+\r\n+    for (var i = 0; i < pointTable.length; i++) {\r\n+      initPos(i, pointTable, slideTable, stepTable);\r\n+    }\r\n+\r\n+    //слайдер отзывов\r\n+    var slideReview = reviewSlider.querySelector('.slider-wrap');    \r\n+    var pointReview = reviewSlider.querySelectorAll('.slider-pagination li');\r\n+    var stepReview = -100;\r\n+\r\n+\r\n+    for (var i = 0; i < pointReview.length; i++) {\r\n+      initPos(i, pointReview, slideReview, stepReview);\r\n+    }\r\n+\r\n+    var slidePrev = reviewSlider.querySelector('.prev-btn');\r\n+    var slideNext = reviewSlider.querySelector('.next-btn');    \r\n+\r\n+    slidePrev.addEventListener('click', function() {\r\n+      moveControl(false, slideReview, stepReview, slidePrev, slideNext);\r\n+    });\r\n+    slideNext.addEventListener('click', function() {\r\n+      moveControl(true, slideReview, stepReview, slidePrev, slideNext);\r\n+    });\r\n+\r\n+  }());\r\n+  \r\n+\r\n+\r\n+\r\n+  //добавление интерактивной карты  \r\n+  function initialize() {  \r\n+    var centerLatlng = new google.maps.LatLng(59.938910, 30.323031);\r\n+    var mapOptions = {\r\n+      zoom: 17,\r\n+      center: centerLatlng\r\n+    };\r\n+    var map = new google.maps.Map(document.getElementById('google-map'), mapOptions);\r\n+    \r\n+    var image = 'img/map-marker.svg';\r\n+    var myLatlng = new google.maps.LatLng(59.938641, 30.323010);\r\n+    new google.maps.Marker({\r\n+        position: myLatlng,\r\n+        map: map,      \r\n+        icon: image\r\n+    });\r\n+  }\r\n+\r\n+  if(document.querySelector('#google-map')) {\r\n+    google.maps.event.addDomListener(window, 'load', initialize);\r\n+  }  \r\n+  \r\n+  //работа с формой\r\n+  var form = document.querySelector('#form-contest');\r\n \r\n-  //Изменение значений числовых полей\r\n   (function(){\r","path":"js/script.js","position":151,"original_position":151,"commit_id":"e09f769cb6ab05262d49e5066c4e110ada07a343","original_commit_id":"e09f769cb6ab05262d49e5066c4e110ada07a343","user":{"login":"juwain","id":928081,"avatar_url":"https://avatars.githubusercontent.com/u/928081?v=3","gravatar_id":"","url":"https://api.github.com/users/juwain","html_url":"https://github.com/juwain","followers_url":"https://api.github.com/users/juwain/followers","following_url":"https://api.github.com/users/juwain/following{/other_user}","gists_url":"https://api.github.com/users/juwain/gists{/gist_id}","starred_url":"https://api.github.com/users/juwain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juwain/subscriptions","organizations_url":"https://api.github.com/users/juwain/orgs","repos_url":"https://api.github.com/users/juwain/repos","events_url":"https://api.github.com/users/juwain/events{/privacy}","received_events_url":"https://api.github.com/users/juwain/received_events","type":"User","site_admin":false},"body":"Тож из анонимной функции можно вытащить.","created_at":"2015-06-05T14:56:49Z","updated_at":"2015-06-05T14:56:49Z","html_url":"https://github.com/up-htmlacademy/63294-pink/pull/13#discussion_r31819410","pull_request_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/pulls/13","_links":{"self":{"href":"https://api.github.com/repos/up-htmlacademy/63294-pink/pulls/comments/31819410"},"html":{"href":"https://github.com/up-htmlacademy/63294-pink/pull/13#discussion_r31819410"},"pull_request":{"href":"https://api.github.com/repos/up-htmlacademy/63294-pink/pulls/13"}}},"pull_request":{"url":"https://api.github.com/repos/up-htmlacademy/63294-pink/pulls/13","id":37031359,"html_url":"https://github.com/up-htmlacademy/63294-pink/pull/13","diff_url":"https://github.com/up-htmlacademy/63294-pink/pull/13.diff","patch_url":"https://github.com/up-htmlacademy/63294-pink/pull/13.patch","issue_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/issues/13","number":13,"state":"open","locked":false,"title":"Module9 task2","user":{"login":"first-wanderer","id":12188815,"avatar_url":"https://avatars.githubusercontent.com/u/12188815?v=3","gravatar_id":"","url":"https://api.github.com/users/first-wanderer","html_url":"https://github.com/first-wanderer","followers_url":"https://api.github.com/users/first-wanderer/followers","following_url":"https://api.github.com/users/first-wanderer/following{/other_user}","gists_url":"https://api.github.com/users/first-wanderer/gists{/gist_id}","starred_url":"https://api.github.com/users/first-wanderer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/first-wanderer/subscriptions","organizations_url":"https://api.github.com/users/first-wanderer/orgs","repos_url":"https://api.github.com/users/first-wanderer/repos","events_url":"https://api.github.com/users/first-wanderer/events{/privacy}","received_events_url":"https://api.github.com/users/first-wanderer/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-06-05T13:31:31Z","updated_at":"2015-06-05T14:56:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"11a18e2f7ee7dfac55d448d74ed237e4d59749e0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/pulls/13/commits","review_comments_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/pulls/13/comments","review_comment_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/pulls/comments{/number}","comments_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/issues/13/comments","statuses_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/statuses/e09f769cb6ab05262d49e5066c4e110ada07a343","head":{"label":"first-wanderer:module9-task2","ref":"module9-task2","sha":"e09f769cb6ab05262d49e5066c4e110ada07a343","user":{"login":"first-wanderer","id":12188815,"avatar_url":"https://avatars.githubusercontent.com/u/12188815?v=3","gravatar_id":"","url":"https://api.github.com/users/first-wanderer","html_url":"https://github.com/first-wanderer","followers_url":"https://api.github.com/users/first-wanderer/followers","following_url":"https://api.github.com/users/first-wanderer/following{/other_user}","gists_url":"https://api.github.com/users/first-wanderer/gists{/gist_id}","starred_url":"https://api.github.com/users/first-wanderer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/first-wanderer/subscriptions","organizations_url":"https://api.github.com/users/first-wanderer/orgs","repos_url":"https://api.github.com/users/first-wanderer/repos","events_url":"https://api.github.com/users/first-wanderer/events{/privacy}","received_events_url":"https://api.github.com/users/first-wanderer/received_events","type":"User","site_admin":false},"repo":{"id":34898226,"name":"63294-pink","full_name":"first-wanderer/63294-pink","owner":{"login":"first-wanderer","id":12188815,"avatar_url":"https://avatars.githubusercontent.com/u/12188815?v=3","gravatar_id":"","url":"https://api.github.com/users/first-wanderer","html_url":"https://github.com/first-wanderer","followers_url":"https://api.github.com/users/first-wanderer/followers","following_url":"https://api.github.com/users/first-wanderer/following{/other_user}","gists_url":"https://api.github.com/users/first-wanderer/gists{/gist_id}","starred_url":"https://api.github.com/users/first-wanderer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/first-wanderer/subscriptions","organizations_url":"https://api.github.com/users/first-wanderer/orgs","repos_url":"https://api.github.com/users/first-wanderer/repos","events_url":"https://api.github.com/users/first-wanderer/events{/privacy}","received_events_url":"https://api.github.com/users/first-wanderer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/first-wanderer/63294-pink","description":"Андрей Кованов","fork":true,"url":"https://api.github.com/repos/first-wanderer/63294-pink","forks_url":"https://api.github.com/repos/first-wanderer/63294-pink/forks","keys_url":"https://api.github.com/repos/first-wanderer/63294-pink/keys{/key_id}","collaborators_url":"https://api.github.com/repos/first-wanderer/63294-pink/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/first-wanderer/63294-pink/teams","hooks_url":"https://api.github.com/repos/first-wanderer/63294-pink/hooks","issue_events_url":"https://api.github.com/repos/first-wanderer/63294-pink/issues/events{/number}","events_url":"https://api.github.com/repos/first-wanderer/63294-pink/events","assignees_url":"https://api.github.com/repos/first-wanderer/63294-pink/assignees{/user}","branches_url":"https://api.github.com/repos/first-wanderer/63294-pink/branches{/branch}","tags_url":"https://api.github.com/repos/first-wanderer/63294-pink/tags","blobs_url":"https://api.github.com/repos/first-wanderer/63294-pink/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/first-wanderer/63294-pink/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/first-wanderer/63294-pink/git/refs{/sha}","trees_url":"https://api.github.com/repos/first-wanderer/63294-pink/git/trees{/sha}","statuses_url":"https://api.github.com/repos/first-wanderer/63294-pink/statuses/{sha}","languages_url":"https://api.github.com/repos/first-wanderer/63294-pink/languages","stargazers_url":"https://api.github.com/repos/first-wanderer/63294-pink/stargazers","contributors_url":"https://api.github.com/repos/first-wanderer/63294-pink/contributors","subscribers_url":"https://api.github.com/repos/first-wanderer/63294-pink/subscribers","subscription_url":"https://api.github.com/repos/first-wanderer/63294-pink/subscription","commits_url":"https://api.github.com/repos/first-wanderer/63294-pink/commits{/sha}","git_commits_url":"https://api.github.com/repos/first-wanderer/63294-pink/git/commits{/sha}","comments_url":"https://api.github.com/repos/first-wanderer/63294-pink/comments{/number}","issue_comment_url":"https://api.github.com/repos/first-wanderer/63294-pink/issues/comments{/number}","contents_url":"https://api.github.com/repos/first-wanderer/63294-pink/contents/{+path}","compare_url":"https://api.github.com/repos/first-wanderer/63294-pink/compare/{base}...{head}","merges_url":"https://api.github.com/repos/first-wanderer/63294-pink/merges","archive_url":"https://api.github.com/repos/first-wanderer/63294-pink/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/first-wanderer/63294-pink/downloads","issues_url":"https://api.github.com/repos/first-wanderer/63294-pink/issues{/number}","pulls_url":"https://api.github.com/repos/first-wanderer/63294-pink/pulls{/number}","milestones_url":"https://api.github.com/repos/first-wanderer/63294-pink/milestones{/number}","notifications_url":"https://api.github.com/repos/first-wanderer/63294-pink/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/first-wanderer/63294-pink/labels{/name}","releases_url":"https://api.github.com/repos/first-wanderer/63294-pink/releases{/id}","created_at":"2015-05-01T10:24:51Z","updated_at":"2015-05-01T10:24:52Z","pushed_at":"2015-06-05T13:29:19Z","git_url":"git://github.com/first-wanderer/63294-pink.git","ssh_url":"git@github.com:first-wanderer/63294-pink.git","clone_url":"https://github.com/first-wanderer/63294-pink.git","svn_url":"https://github.com/first-wanderer/63294-pink","homepage":null,"size":10894,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"up-htmlacademy:master","ref":"master","sha":"ad9066f1a9109bd5fdb267f1d04393d69f446608","user":{"login":"up-htmlacademy","id":9918669,"avatar_url":"https://avatars.githubusercontent.com/u/9918669?v=3","gravatar_id":"","url":"https://api.github.com/users/up-htmlacademy","html_url":"https://github.com/up-htmlacademy","followers_url":"https://api.github.com/users/up-htmlacademy/followers","following_url":"https://api.github.com/users/up-htmlacademy/following{/other_user}","gists_url":"https://api.github.com/users/up-htmlacademy/gists{/gist_id}","starred_url":"https://api.github.com/users/up-htmlacademy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/up-htmlacademy/subscriptions","organizations_url":"https://api.github.com/users/up-htmlacademy/orgs","repos_url":"https://api.github.com/users/up-htmlacademy/repos","events_url":"https://api.github.com/users/up-htmlacademy/events{/privacy}","received_events_url":"https://api.github.com/users/up-htmlacademy/received_events","type":"Organization","site_admin":false},"repo":{"id":34866250,"name":"63294-pink","full_name":"up-htmlacademy/63294-pink","owner":{"login":"up-htmlacademy","id":9918669,"avatar_url":"https://avatars.githubusercontent.com/u/9918669?v=3","gravatar_id":"","url":"https://api.github.com/users/up-htmlacademy","html_url":"https://github.com/up-htmlacademy","followers_url":"https://api.github.com/users/up-htmlacademy/followers","following_url":"https://api.github.com/users/up-htmlacademy/following{/other_user}","gists_url":"https://api.github.com/users/up-htmlacademy/gists{/gist_id}","starred_url":"https://api.github.com/users/up-htmlacademy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/up-htmlacademy/subscriptions","organizations_url":"https://api.github.com/users/up-htmlacademy/orgs","repos_url":"https://api.github.com/users/up-htmlacademy/repos","events_url":"https://api.github.com/users/up-htmlacademy/events{/privacy}","received_events_url":"https://api.github.com/users/up-htmlacademy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/up-htmlacademy/63294-pink","description":"Андрей Кованов","fork":false,"url":"https://api.github.com/repos/up-htmlacademy/63294-pink","forks_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/forks","keys_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/keys{/key_id}","collaborators_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/teams","hooks_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/hooks","issue_events_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/issues/events{/number}","events_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/events","assignees_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/assignees{/user}","branches_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/branches{/branch}","tags_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/tags","blobs_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/git/refs{/sha}","trees_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/git/trees{/sha}","statuses_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/statuses/{sha}","languages_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/languages","stargazers_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/stargazers","contributors_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/contributors","subscribers_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/subscribers","subscription_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/subscription","commits_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/commits{/sha}","git_commits_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/git/commits{/sha}","comments_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/comments{/number}","issue_comment_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/issues/comments{/number}","contents_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/contents/{+path}","compare_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/compare/{base}...{head}","merges_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/merges","archive_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/downloads","issues_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/issues{/number}","pulls_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/pulls{/number}","milestones_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/milestones{/number}","notifications_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/labels{/name}","releases_url":"https://api.github.com/repos/up-htmlacademy/63294-pink/releases{/id}","created_at":"2015-04-30T17:01:24Z","updated_at":"2015-05-31T08:30:50Z","pushed_at":"2015-06-05T13:31:31Z","git_url":"git://github.com/up-htmlacademy/63294-pink.git","ssh_url":"git@github.com:up-htmlacademy/63294-pink.git","clone_url":"https://github.com/up-htmlacademy/63294-pink.git","svn_url":"https://github.com/up-htmlacademy/63294-pink","homepage":"https://github.com/first-wanderer/63294-pink","size":11178,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/up-htmlacademy/63294-pink/pulls/13"},"html":{"href":"https://github.com/up-htmlacademy/63294-pink/pull/13"},"issue":{"href":"https://api.github.com/repos/up-htmlacademy/63294-pink/issues/13"},"comments":{"href":"https://api.github.com/repos/up-htmlacademy/63294-pink/issues/13/comments"},"review_comments":{"href":"https://api.github.com/repos/up-htmlacademy/63294-pink/pulls/13/comments"},"review_comment":{"href":"https://api.github.com/repos/up-htmlacademy/63294-pink/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/up-htmlacademy/63294-pink/pulls/13/commits"},"statuses":{"href":"https://api.github.com/repos/up-htmlacademy/63294-pink/statuses/e09f769cb6ab05262d49e5066c4e110ada07a343"}}}}