{"action":"created","comment":{"url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/pulls/comments/67535886","id":67535886,"diff_hunk":"@@ -775,6 +775,56 @@\n   window.Game = Game;\n   window.Game.Verdict = Verdict;\n \n+\n+  var setScrollMoveClouds = function() {\n+    var cloudsElement = document.querySelector('.header-clouds');\n+    var headerElement = document.querySelector('header');\n+    var headerPosition = headerElement.getBoundingClientRect();\n+    var gameBlock = document.querySelector('.demo');\n+    if (isVisible(gameBlock)) {\n+      cloudsElement.style.backgroundPosition = 50 + headerPosition.top / 10 + '%';\n+    }\n+  };\n+\n+  /**\n+   * Проверка видимости элемента\n+   * @param  {HTMLElement}  element Элемент который проверяем\n+   * @return {Boolean}\n+   */\n+  function isVisible(element) {\n+    var elementPosition = element.getBoundingClientRect();\n+    return elementPosition.bottom > 0;\n+  }\n+\n+  /**\n+   * Throttle\n+   * @param  {function} someFunction Функция которую нужно оптимизировать\n+   * @param  {number} timeDelay      Кол-во миллисекунд вызова функции\n+   * @return {function}              Оптимизированная функция\n+   */\n+  function throttle(someFunction, timeDelay) {\n+    var lastCall = Date.now();\n+    return function() {\n+      if (Date.now() - lastCall >= timeDelay) {\n+        someFunction();\n+        lastCall = Date.now();\n+      }\n+    };\n+  }\n+\n+  var optimizedScrollMoveClouds = throttle(setScrollMoveClouds, 100);\n+\n+  window.addEventListener('scroll', optimizedScrollMoveClouds);\n+\n+  var scrollPause = throttle(function() {\n+    if (!isVisible(document.querySelector('.demo'))) {","path":"src/game.js","position":46,"original_position":46,"commit_id":"fa2ca321ae8196af912a32314e9dd30ddfe36406","original_commit_id":"fa2ca321ae8196af912a32314e9dd30ddfe36406","user":{"login":"isqua","id":529247,"avatar_url":"https://avatars.githubusercontent.com/u/529247?v=3","gravatar_id":"","url":"https://api.github.com/users/isqua","html_url":"https://github.com/isqua","followers_url":"https://api.github.com/users/isqua/followers","following_url":"https://api.github.com/users/isqua/following{/other_user}","gists_url":"https://api.github.com/users/isqua/gists{/gist_id}","starred_url":"https://api.github.com/users/isqua/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isqua/subscriptions","organizations_url":"https://api.github.com/users/isqua/orgs","repos_url":"https://api.github.com/users/isqua/repos","events_url":"https://api.github.com/users/isqua/events{/privacy}","received_events_url":"https://api.github.com/users/isqua/received_events","type":"User","site_admin":false},"body":"А вот второй раз проверил, видно ли `.demo`.","created_at":"2016-06-17T16:12:59Z","updated_at":"2016-06-17T16:12:59Z","html_url":"https://github.com/htmlacademy-javascript/125911-code-and-magick/pull/10#discussion_r67535886","pull_request_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/pulls/comments/67535886"},"html":{"href":"https://github.com/htmlacademy-javascript/125911-code-and-magick/pull/10#discussion_r67535886"},"pull_request":{"href":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/pulls/10","id":74239455,"html_url":"https://github.com/htmlacademy-javascript/125911-code-and-magick/pull/10","diff_url":"https://github.com/htmlacademy-javascript/125911-code-and-magick/pull/10.diff","patch_url":"https://github.com/htmlacademy-javascript/125911-code-and-magick/pull/10.patch","issue_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/issues/10","number":10,"state":"open","locked":false,"title":"Больше модулей и событий","user":{"login":"mozolev","id":15260025,"avatar_url":"https://avatars.githubusercontent.com/u/15260025?v=3","gravatar_id":"","url":"https://api.github.com/users/mozolev","html_url":"https://github.com/mozolev","followers_url":"https://api.github.com/users/mozolev/followers","following_url":"https://api.github.com/users/mozolev/following{/other_user}","gists_url":"https://api.github.com/users/mozolev/gists{/gist_id}","starred_url":"https://api.github.com/users/mozolev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozolev/subscriptions","organizations_url":"https://api.github.com/users/mozolev/orgs","repos_url":"https://api.github.com/users/mozolev/repos","events_url":"https://api.github.com/users/mozolev/events{/privacy}","received_events_url":"https://api.github.com/users/mozolev/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-06-17T13:07:46Z","updated_at":"2016-06-17T16:12:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b58fb4de5b39fce29bd7a57a93bb75e713d16992","assignee":{"login":"isqua","id":529247,"avatar_url":"https://avatars.githubusercontent.com/u/529247?v=3","gravatar_id":"","url":"https://api.github.com/users/isqua","html_url":"https://github.com/isqua","followers_url":"https://api.github.com/users/isqua/followers","following_url":"https://api.github.com/users/isqua/following{/other_user}","gists_url":"https://api.github.com/users/isqua/gists{/gist_id}","starred_url":"https://api.github.com/users/isqua/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isqua/subscriptions","organizations_url":"https://api.github.com/users/isqua/orgs","repos_url":"https://api.github.com/users/isqua/repos","events_url":"https://api.github.com/users/isqua/events{/privacy}","received_events_url":"https://api.github.com/users/isqua/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/pulls/10/commits","review_comments_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/pulls/10/comments","review_comment_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/pulls/comments{/number}","comments_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/issues/10/comments","statuses_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/statuses/fa2ca321ae8196af912a32314e9dd30ddfe36406","head":{"label":"mozolev:module6-task2","ref":"module6-task2","sha":"fa2ca321ae8196af912a32314e9dd30ddfe36406","user":{"login":"mozolev","id":15260025,"avatar_url":"https://avatars.githubusercontent.com/u/15260025?v=3","gravatar_id":"","url":"https://api.github.com/users/mozolev","html_url":"https://github.com/mozolev","followers_url":"https://api.github.com/users/mozolev/followers","following_url":"https://api.github.com/users/mozolev/following{/other_user}","gists_url":"https://api.github.com/users/mozolev/gists{/gist_id}","starred_url":"https://api.github.com/users/mozolev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozolev/subscriptions","organizations_url":"https://api.github.com/users/mozolev/orgs","repos_url":"https://api.github.com/users/mozolev/repos","events_url":"https://api.github.com/users/mozolev/events{/privacy}","received_events_url":"https://api.github.com/users/mozolev/received_events","type":"User","site_admin":false},"repo":{"id":59600784,"name":"125911-code-and-magick","full_name":"mozolev/125911-code-and-magick","owner":{"login":"mozolev","id":15260025,"avatar_url":"https://avatars.githubusercontent.com/u/15260025?v=3","gravatar_id":"","url":"https://api.github.com/users/mozolev","html_url":"https://github.com/mozolev","followers_url":"https://api.github.com/users/mozolev/followers","following_url":"https://api.github.com/users/mozolev/following{/other_user}","gists_url":"https://api.github.com/users/mozolev/gists{/gist_id}","starred_url":"https://api.github.com/users/mozolev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozolev/subscriptions","organizations_url":"https://api.github.com/users/mozolev/orgs","repos_url":"https://api.github.com/users/mozolev/repos","events_url":"https://api.github.com/users/mozolev/events{/privacy}","received_events_url":"https://api.github.com/users/mozolev/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mozolev/125911-code-and-magick","description":"Andrey Mozolev","fork":true,"url":"https://api.github.com/repos/mozolev/125911-code-and-magick","forks_url":"https://api.github.com/repos/mozolev/125911-code-and-magick/forks","keys_url":"https://api.github.com/repos/mozolev/125911-code-and-magick/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozolev/125911-code-and-magick/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozolev/125911-code-and-magick/teams","hooks_url":"https://api.github.com/repos/mozolev/125911-code-and-magick/hooks","issue_events_url":"https://api.github.com/repos/mozolev/125911-code-and-magick/issues/events{/number}","events_url":"https://api.github.com/repos/mozolev/125911-code-and-magick/events","assignees_url":"https://api.github.com/repos/mozolev/125911-code-and-magick/assignees{/user}","branches_url":"https://api.github.com/repos/mozolev/125911-code-and-magick/branches{/branch}","tags_url":"https://api.github.com/repos/mozolev/125911-code-and-magick/tags","blobs_url":"https://api.github.com/repos/mozolev/125911-code-and-magick/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozolev/125911-code-and-magick/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozolev/125911-code-and-magick/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozolev/125911-code-and-magick/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozolev/125911-code-and-magick/statuses/{sha}","languages_url":"https://api.github.com/repos/mozolev/125911-code-and-magick/languages","stargazers_url":"https://api.github.com/repos/mozolev/125911-code-and-magick/stargazers","contributors_url":"https://api.github.com/repos/mozolev/125911-code-and-magick/contributors","subscribers_url":"https://api.github.com/repos/mozolev/125911-code-and-magick/subscribers","subscription_url":"https://api.github.com/repos/mozolev/125911-code-and-magick/subscription","commits_url":"https://api.github.com/repos/mozolev/125911-code-and-magick/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozolev/125911-code-and-magick/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozolev/125911-code-and-magick/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozolev/125911-code-and-magick/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozolev/125911-code-and-magick/contents/{+path}","compare_url":"https://api.github.com/repos/mozolev/125911-code-and-magick/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozolev/125911-code-and-magick/merges","archive_url":"https://api.github.com/repos/mozolev/125911-code-and-magick/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozolev/125911-code-and-magick/downloads","issues_url":"https://api.github.com/repos/mozolev/125911-code-and-magick/issues{/number}","pulls_url":"https://api.github.com/repos/mozolev/125911-code-and-magick/pulls{/number}","milestones_url":"https://api.github.com/repos/mozolev/125911-code-and-magick/milestones{/number}","notifications_url":"https://api.github.com/repos/mozolev/125911-code-and-magick/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozolev/125911-code-and-magick/labels{/name}","releases_url":"https://api.github.com/repos/mozolev/125911-code-and-magick/releases{/id}","deployments_url":"https://api.github.com/repos/mozolev/125911-code-and-magick/deployments","created_at":"2016-05-24T19:05:52Z","updated_at":"2016-05-24T19:05:53Z","pushed_at":"2016-06-17T13:07:22Z","git_url":"git://github.com/mozolev/125911-code-and-magick.git","ssh_url":"git@github.com:mozolev/125911-code-and-magick.git","clone_url":"https://github.com/mozolev/125911-code-and-magick.git","svn_url":"https://github.com/mozolev/125911-code-and-magick","homepage":null,"size":1068,"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":"htmlacademy-javascript:master","ref":"master","sha":"b8c134bf99fa5b236ab7d040673085e6ae102510","user":{"login":"htmlacademy-javascript","id":14179712,"avatar_url":"https://avatars.githubusercontent.com/u/14179712?v=3","gravatar_id":"","url":"https://api.github.com/users/htmlacademy-javascript","html_url":"https://github.com/htmlacademy-javascript","followers_url":"https://api.github.com/users/htmlacademy-javascript/followers","following_url":"https://api.github.com/users/htmlacademy-javascript/following{/other_user}","gists_url":"https://api.github.com/users/htmlacademy-javascript/gists{/gist_id}","starred_url":"https://api.github.com/users/htmlacademy-javascript/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/htmlacademy-javascript/subscriptions","organizations_url":"https://api.github.com/users/htmlacademy-javascript/orgs","repos_url":"https://api.github.com/users/htmlacademy-javascript/repos","events_url":"https://api.github.com/users/htmlacademy-javascript/events{/privacy}","received_events_url":"https://api.github.com/users/htmlacademy-javascript/received_events","type":"Organization","site_admin":false},"repo":{"id":59600760,"name":"125911-code-and-magick","full_name":"htmlacademy-javascript/125911-code-and-magick","owner":{"login":"htmlacademy-javascript","id":14179712,"avatar_url":"https://avatars.githubusercontent.com/u/14179712?v=3","gravatar_id":"","url":"https://api.github.com/users/htmlacademy-javascript","html_url":"https://github.com/htmlacademy-javascript","followers_url":"https://api.github.com/users/htmlacademy-javascript/followers","following_url":"https://api.github.com/users/htmlacademy-javascript/following{/other_user}","gists_url":"https://api.github.com/users/htmlacademy-javascript/gists{/gist_id}","starred_url":"https://api.github.com/users/htmlacademy-javascript/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/htmlacademy-javascript/subscriptions","organizations_url":"https://api.github.com/users/htmlacademy-javascript/orgs","repos_url":"https://api.github.com/users/htmlacademy-javascript/repos","events_url":"https://api.github.com/users/htmlacademy-javascript/events{/privacy}","received_events_url":"https://api.github.com/users/htmlacademy-javascript/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/htmlacademy-javascript/125911-code-and-magick","description":"Andrey Mozolev","fork":false,"url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick","forks_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/forks","keys_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/keys{/key_id}","collaborators_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/teams","hooks_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/hooks","issue_events_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/issues/events{/number}","events_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/events","assignees_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/assignees{/user}","branches_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/branches{/branch}","tags_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/tags","blobs_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/git/refs{/sha}","trees_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/git/trees{/sha}","statuses_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/statuses/{sha}","languages_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/languages","stargazers_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/stargazers","contributors_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/contributors","subscribers_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/subscribers","subscription_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/subscription","commits_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/commits{/sha}","git_commits_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/git/commits{/sha}","comments_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/comments{/number}","issue_comment_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/issues/comments{/number}","contents_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/contents/{+path}","compare_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/compare/{base}...{head}","merges_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/merges","archive_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/downloads","issues_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/issues{/number}","pulls_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/pulls{/number}","milestones_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/milestones{/number}","notifications_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/labels{/name}","releases_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/releases{/id}","deployments_url":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/deployments","created_at":"2016-05-24T19:05:35Z","updated_at":"2016-05-24T19:32:03Z","pushed_at":"2016-06-17T13:07:46Z","git_url":"git://github.com/htmlacademy-javascript/125911-code-and-magick.git","ssh_url":"git@github.com:htmlacademy-javascript/125911-code-and-magick.git","clone_url":"https://github.com/htmlacademy-javascript/125911-code-and-magick.git","svn_url":"https://github.com/htmlacademy-javascript/125911-code-and-magick","homepage":"https://github.com/mozolev/125911-code-and-magick","size":1112,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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/htmlacademy-javascript/125911-code-and-magick/pulls/10"},"html":{"href":"https://github.com/htmlacademy-javascript/125911-code-and-magick/pull/10"},"issue":{"href":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/issues/10"},"comments":{"href":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/htmlacademy-javascript/125911-code-and-magick/statuses/fa2ca321ae8196af912a32314e9dd30ddfe36406"}}}}
{"actor":{"display_login":"isqua"}}