{"action":"created","comment":{"url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/pulls/comments/90762615","pull_request_review_id":11281836,"id":90762615,"diff_hunk":"@@ -3,23 +3,49 @@\n  */\n import getElementFromTemplate from './getElement.js';\n import insertBlock from './page.js';\n-import stats from './templates/status.js';\n-import header from './templates/header.js';\n+import renderStats from './templates/status.js';\n+import renderHeader from './templates/header.js';\n+import renderQuestion from './templates/questions.js';\n+import {gameState, setScreen, getScreen, setTime} from './data/process.js';\n+import statsScreen from './stats.js';\n \n-export default (data, question, nextScreen) => {\n-  const screen = `\n-    ${header}\n-      <div class=\"game\">\n-        ${question(data)}\n-       <div class=\"stats\">\n-        ${stats}\n-       </div>\n-      </div>`;\n+let currentState = gameState;\n+let interval = null;\n \n-  const gameElement = getElementFromTemplate(screen);\n+const gameElement = getElementFromTemplate('');\n+const headerElement = renderHeader(currentState);\n+const questionElement = renderQuestion(getScreen(currentState.currentQuestion));\n+const statsElement = renderStats();\n \n-  const container = gameElement.querySelector('.game');\n+gameElement.appendChild(headerElement);\n+gameElement.appendChild(questionElement);\n+questionElement.appendChild(statsElement);\n \n+const updateHeader = (state) => {\n+  renderHeader(state);","path":"js/game.js","position":36,"original_position":36,"commit_id":"79931c9c27bb4bbda104c5a834948b9f22bdc814","original_commit_id":"79931c9c27bb4bbda104c5a834948b9f22bdc814","user":{"login":"slavassh","id":3304910,"avatar_url":"https://avatars.githubusercontent.com/u/3304910?v=3","gravatar_id":"","url":"https://api.github.com/users/slavassh","html_url":"https://github.com/slavassh","followers_url":"https://api.github.com/users/slavassh/followers","following_url":"https://api.github.com/users/slavassh/following{/other_user}","gists_url":"https://api.github.com/users/slavassh/gists{/gist_id}","starred_url":"https://api.github.com/users/slavassh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slavassh/subscriptions","organizations_url":"https://api.github.com/users/slavassh/orgs","repos_url":"https://api.github.com/users/slavassh/repos","events_url":"https://api.github.com/users/slavassh/events{/privacy}","received_events_url":"https://api.github.com/users/slavassh/received_events","type":"User","site_admin":false},"body":"Вот тут мне не понятно, как это работает. Почему данные динамически меняются?","created_at":"2016-12-03T18:50:11Z","updated_at":"2016-12-03T18:50:11Z","html_url":"https://github.com/htmlacademy-ecmascript/131014-pixel-hunter/pull/8#discussion_r90762615","pull_request_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/pulls/comments/90762615"},"html":{"href":"https://github.com/htmlacademy-ecmascript/131014-pixel-hunter/pull/8#discussion_r90762615"},"pull_request":{"href":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/pulls/8","id":96406540,"html_url":"https://github.com/htmlacademy-ecmascript/131014-pixel-hunter/pull/8","diff_url":"https://github.com/htmlacademy-ecmascript/131014-pixel-hunter/pull/8.diff","patch_url":"https://github.com/htmlacademy-ecmascript/131014-pixel-hunter/pull/8.patch","issue_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/issues/8","number":8,"state":"open","locked":false,"title":"Module4 task2","user":{"login":"slavassh","id":3304910,"avatar_url":"https://avatars.githubusercontent.com/u/3304910?v=3","gravatar_id":"","url":"https://api.github.com/users/slavassh","html_url":"https://github.com/slavassh","followers_url":"https://api.github.com/users/slavassh/followers","following_url":"https://api.github.com/users/slavassh/following{/other_user}","gists_url":"https://api.github.com/users/slavassh/gists{/gist_id}","starred_url":"https://api.github.com/users/slavassh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slavassh/subscriptions","organizations_url":"https://api.github.com/users/slavassh/orgs","repos_url":"https://api.github.com/users/slavassh/repos","events_url":"https://api.github.com/users/slavassh/events{/privacy}","received_events_url":"https://api.github.com/users/slavassh/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-12-03T18:44:49Z","updated_at":"2016-12-03T18:50:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"290be467c951ecd7896a5869c28959abe6c151d3","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/pulls/8/commits","review_comments_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/pulls/8/comments","review_comment_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/pulls/comments{/number}","comments_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/issues/8/comments","statuses_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/statuses/79931c9c27bb4bbda104c5a834948b9f22bdc814","head":{"label":"slavassh:module4-task2","ref":"module4-task2","sha":"79931c9c27bb4bbda104c5a834948b9f22bdc814","user":{"login":"slavassh","id":3304910,"avatar_url":"https://avatars.githubusercontent.com/u/3304910?v=3","gravatar_id":"","url":"https://api.github.com/users/slavassh","html_url":"https://github.com/slavassh","followers_url":"https://api.github.com/users/slavassh/followers","following_url":"https://api.github.com/users/slavassh/following{/other_user}","gists_url":"https://api.github.com/users/slavassh/gists{/gist_id}","starred_url":"https://api.github.com/users/slavassh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slavassh/subscriptions","organizations_url":"https://api.github.com/users/slavassh/orgs","repos_url":"https://api.github.com/users/slavassh/repos","events_url":"https://api.github.com/users/slavassh/events{/privacy}","received_events_url":"https://api.github.com/users/slavassh/received_events","type":"User","site_admin":false},"repo":{"id":73882842,"name":"pixel-hunter","full_name":"slavassh/pixel-hunter","owner":{"login":"slavassh","id":3304910,"avatar_url":"https://avatars.githubusercontent.com/u/3304910?v=3","gravatar_id":"","url":"https://api.github.com/users/slavassh","html_url":"https://github.com/slavassh","followers_url":"https://api.github.com/users/slavassh/followers","following_url":"https://api.github.com/users/slavassh/following{/other_user}","gists_url":"https://api.github.com/users/slavassh/gists{/gist_id}","starred_url":"https://api.github.com/users/slavassh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slavassh/subscriptions","organizations_url":"https://api.github.com/users/slavassh/orgs","repos_url":"https://api.github.com/users/slavassh/repos","events_url":"https://api.github.com/users/slavassh/events{/privacy}","received_events_url":"https://api.github.com/users/slavassh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/slavassh/pixel-hunter","description":"Вячеслав Шестаков","fork":true,"url":"https://api.github.com/repos/slavassh/pixel-hunter","forks_url":"https://api.github.com/repos/slavassh/pixel-hunter/forks","keys_url":"https://api.github.com/repos/slavassh/pixel-hunter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/slavassh/pixel-hunter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/slavassh/pixel-hunter/teams","hooks_url":"https://api.github.com/repos/slavassh/pixel-hunter/hooks","issue_events_url":"https://api.github.com/repos/slavassh/pixel-hunter/issues/events{/number}","events_url":"https://api.github.com/repos/slavassh/pixel-hunter/events","assignees_url":"https://api.github.com/repos/slavassh/pixel-hunter/assignees{/user}","branches_url":"https://api.github.com/repos/slavassh/pixel-hunter/branches{/branch}","tags_url":"https://api.github.com/repos/slavassh/pixel-hunter/tags","blobs_url":"https://api.github.com/repos/slavassh/pixel-hunter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/slavassh/pixel-hunter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/slavassh/pixel-hunter/git/refs{/sha}","trees_url":"https://api.github.com/repos/slavassh/pixel-hunter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/slavassh/pixel-hunter/statuses/{sha}","languages_url":"https://api.github.com/repos/slavassh/pixel-hunter/languages","stargazers_url":"https://api.github.com/repos/slavassh/pixel-hunter/stargazers","contributors_url":"https://api.github.com/repos/slavassh/pixel-hunter/contributors","subscribers_url":"https://api.github.com/repos/slavassh/pixel-hunter/subscribers","subscription_url":"https://api.github.com/repos/slavassh/pixel-hunter/subscription","commits_url":"https://api.github.com/repos/slavassh/pixel-hunter/commits{/sha}","git_commits_url":"https://api.github.com/repos/slavassh/pixel-hunter/git/commits{/sha}","comments_url":"https://api.github.com/repos/slavassh/pixel-hunter/comments{/number}","issue_comment_url":"https://api.github.com/repos/slavassh/pixel-hunter/issues/comments{/number}","contents_url":"https://api.github.com/repos/slavassh/pixel-hunter/contents/{+path}","compare_url":"https://api.github.com/repos/slavassh/pixel-hunter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/slavassh/pixel-hunter/merges","archive_url":"https://api.github.com/repos/slavassh/pixel-hunter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/slavassh/pixel-hunter/downloads","issues_url":"https://api.github.com/repos/slavassh/pixel-hunter/issues{/number}","pulls_url":"https://api.github.com/repos/slavassh/pixel-hunter/pulls{/number}","milestones_url":"https://api.github.com/repos/slavassh/pixel-hunter/milestones{/number}","notifications_url":"https://api.github.com/repos/slavassh/pixel-hunter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/slavassh/pixel-hunter/labels{/name}","releases_url":"https://api.github.com/repos/slavassh/pixel-hunter/releases{/id}","deployments_url":"https://api.github.com/repos/slavassh/pixel-hunter/deployments","created_at":"2016-11-16T04:07:36Z","updated_at":"2016-11-21T11:19:09Z","pushed_at":"2016-12-03T18:43:01Z","git_url":"git://github.com/slavassh/pixel-hunter.git","ssh_url":"git@github.com:slavassh/pixel-hunter.git","clone_url":"https://github.com/slavassh/pixel-hunter.git","svn_url":"https://github.com/slavassh/pixel-hunter","homepage":null,"size":596,"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-ecmascript:master","ref":"master","sha":"9a9f70627f70c1c1aa1a246d8a75da1d8b82214a","user":{"login":"htmlacademy-ecmascript","id":22890904,"avatar_url":"https://avatars.githubusercontent.com/u/22890904?v=3","gravatar_id":"","url":"https://api.github.com/users/htmlacademy-ecmascript","html_url":"https://github.com/htmlacademy-ecmascript","followers_url":"https://api.github.com/users/htmlacademy-ecmascript/followers","following_url":"https://api.github.com/users/htmlacademy-ecmascript/following{/other_user}","gists_url":"https://api.github.com/users/htmlacademy-ecmascript/gists{/gist_id}","starred_url":"https://api.github.com/users/htmlacademy-ecmascript/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/htmlacademy-ecmascript/subscriptions","organizations_url":"https://api.github.com/users/htmlacademy-ecmascript/orgs","repos_url":"https://api.github.com/users/htmlacademy-ecmascript/repos","events_url":"https://api.github.com/users/htmlacademy-ecmascript/events{/privacy}","received_events_url":"https://api.github.com/users/htmlacademy-ecmascript/received_events","type":"Organization","site_admin":false},"repo":{"id":73843401,"name":"131014-pixel-hunter","full_name":"htmlacademy-ecmascript/131014-pixel-hunter","owner":{"login":"htmlacademy-ecmascript","id":22890904,"avatar_url":"https://avatars.githubusercontent.com/u/22890904?v=3","gravatar_id":"","url":"https://api.github.com/users/htmlacademy-ecmascript","html_url":"https://github.com/htmlacademy-ecmascript","followers_url":"https://api.github.com/users/htmlacademy-ecmascript/followers","following_url":"https://api.github.com/users/htmlacademy-ecmascript/following{/other_user}","gists_url":"https://api.github.com/users/htmlacademy-ecmascript/gists{/gist_id}","starred_url":"https://api.github.com/users/htmlacademy-ecmascript/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/htmlacademy-ecmascript/subscriptions","organizations_url":"https://api.github.com/users/htmlacademy-ecmascript/orgs","repos_url":"https://api.github.com/users/htmlacademy-ecmascript/repos","events_url":"https://api.github.com/users/htmlacademy-ecmascript/events{/privacy}","received_events_url":"https://api.github.com/users/htmlacademy-ecmascript/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/htmlacademy-ecmascript/131014-pixel-hunter","description":"Вячеслав Шестаков","fork":false,"url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter","forks_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/forks","keys_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/teams","hooks_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/hooks","issue_events_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/issues/events{/number}","events_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/events","assignees_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/assignees{/user}","branches_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/branches{/branch}","tags_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/tags","blobs_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/git/refs{/sha}","trees_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/statuses/{sha}","languages_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/languages","stargazers_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/stargazers","contributors_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/contributors","subscribers_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/subscribers","subscription_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/subscription","commits_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/commits{/sha}","git_commits_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/git/commits{/sha}","comments_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/comments{/number}","issue_comment_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/issues/comments{/number}","contents_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/contents/{+path}","compare_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/merges","archive_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/downloads","issues_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/issues{/number}","pulls_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/pulls{/number}","milestones_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/milestones{/number}","notifications_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/labels{/name}","releases_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/releases{/id}","deployments_url":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/deployments","created_at":"2016-11-15T18:32:12Z","updated_at":"2016-11-21T11:16:35Z","pushed_at":"2016-12-03T18:44:49Z","git_url":"git://github.com/htmlacademy-ecmascript/131014-pixel-hunter.git","ssh_url":"git@github.com:htmlacademy-ecmascript/131014-pixel-hunter.git","clone_url":"https://github.com/htmlacademy-ecmascript/131014-pixel-hunter.git","svn_url":"https://github.com/htmlacademy-ecmascript/131014-pixel-hunter","homepage":"https://github.com/slavassh/pixel-hunter","size":636,"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-ecmascript/131014-pixel-hunter/pulls/8"},"html":{"href":"https://github.com/htmlacademy-ecmascript/131014-pixel-hunter/pull/8"},"issue":{"href":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/issues/8"},"comments":{"href":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/htmlacademy-ecmascript/131014-pixel-hunter/statuses/79931c9c27bb4bbda104c5a834948b9f22bdc814"}}}}
{"actor":{"display_login":"slavassh"}}