{"action":"created","comment":{"url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/pulls/comments/240424630","pull_request_review_id":183452026,"id":240424630,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MDQyNDYzMA==","diff_hunk":"@@ -0,0 +1,148 @@\n+let images = [\n+    'img/Amy.jpg',\n+    'img/Bender.png',\n+    'img/Fry.png',\n+    'img/Hubert.jpg',\n+    'img/Zapp.jpg',\n+    'img/Zoidberg.png',\n+];\n+\n+function randomArr(arr) {\n+    arr.sort(function () {\n+        return 0.5 - Math.random();\n+    });\n+    return arr;\n+}\n+\n+class Game {\n+\n+    constructor(images) {\n+        this.form = document.querySelector('#Game');\n+        this.cardItems = document.getElementsByClassName('cardItem');\n+        this.cardsNumber = 6;\n+        this.imageArr = images;\n+        this.cards = [];\n+\n+        this.canRotate = 2;  //count of possible clicks in this moment\n+\n+        this.collisionToWin = 6;  //count of collision to win game\n+\n+        this.initGame();  //initial game\n+\n+        this.moves = []; //array of player clicked cards\n+\n+        this.checkCollision = this.checkCollision.bind(this);\n+        this.rotateCard = this.rotateCard.bind(this);\n+        this.addEventListeners();\n+\n+\n+        //timers\n+        this.beforeShowTimer = 300;\n+        this.showTimer = 2000;\n+        this.timerBeforeNextMove = 1000;\n+        this.showWinMessageTimer = 2500;\n+    }\n+\n+    initGame() {\n+        this.render();\n+    }\n+\n+    render() {\n+        this.imageArr = this.imageArr.concat(this.imageArr);\n+        randomArr(this.imageArr);\n+        for (let i = 0; i < this.cardsNumber * 2; i++) {\n+            this.cards.push(new Card(this.imageArr[i]));\n+            let cardItem = document.createElement('div');\n+            cardItem.classList.add('cardItem');\n+            let cardImage = document.createElement('img');\n+            cardImage.classList.add('hidden');\n+            cardImage.setAttribute('src', this.cards[i].img);\n+            cardItem.appendChild(cardImage);\n+            this.form.appendChild(cardItem);\n+        }\n+    }\n+\n+    rotateCard(e) {\n+        let clickedItem = e.target.closest('div');\n+\n+        if (this.canRotate > 0) {\n+            this.moves.push(clickedItem);\n+            this.canRotate--;\n+            this.checkCollision();\n+\n+            clickedItem.classList.add('flip');\n+\n+\n+            setTimeout(() => {\n+                clickedItem.querySelector('img').classList.remove('hidden');","path":"submissions/Zihfred/memory-game/js/main.js","position":77,"original_position":77,"commit_id":"44d2a1fb000376f7896ad2a2fbf9da7c52d50feb","original_commit_id":"44d2a1fb000376f7896ad2a2fbf9da7c52d50feb","user":{"login":"AMashoshyna","id":17703790,"node_id":"MDQ6VXNlcjE3NzAzNzkw","avatar_url":"https://avatars0.githubusercontent.com/u/17703790?v=4","gravatar_id":"","url":"https://api.github.com/users/AMashoshyna","html_url":"https://github.com/AMashoshyna","followers_url":"https://api.github.com/users/AMashoshyna/followers","following_url":"https://api.github.com/users/AMashoshyna/following{/other_user}","gists_url":"https://api.github.com/users/AMashoshyna/gists{/gist_id}","starred_url":"https://api.github.com/users/AMashoshyna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AMashoshyna/subscriptions","organizations_url":"https://api.github.com/users/AMashoshyna/orgs","repos_url":"https://api.github.com/users/AMashoshyna/repos","events_url":"https://api.github.com/users/AMashoshyna/events{/privacy}","received_events_url":"https://api.github.com/users/AMashoshyna/received_events","type":"User","site_admin":false},"body":"Please fix inconsistent indentations in your code","created_at":"2018-12-10T23:41:19Z","updated_at":"2018-12-10T23:44:13Z","html_url":"https://github.com/kottans/frontend-2019-homeworks/pull/86#discussion_r240424630","pull_request_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/pulls/86","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/kottans/frontend-2019-homeworks/pulls/comments/240424630"},"html":{"href":"https://github.com/kottans/frontend-2019-homeworks/pull/86#discussion_r240424630"},"pull_request":{"href":"https://api.github.com/repos/kottans/frontend-2019-homeworks/pulls/86"}}},"pull_request":{"url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/pulls/86","id":237135304,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM3MTM1MzA0","html_url":"https://github.com/kottans/frontend-2019-homeworks/pull/86","diff_url":"https://github.com/kottans/frontend-2019-homeworks/pull/86.diff","patch_url":"https://github.com/kottans/frontend-2019-homeworks/pull/86.patch","issue_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/issues/86","number":86,"state":"open","locked":false,"title":"Memory-game(RELoad After big fail)","user":{"login":"Zihfred","id":20110426,"node_id":"MDQ6VXNlcjIwMTEwNDI2","avatar_url":"https://avatars2.githubusercontent.com/u/20110426?v=4","gravatar_id":"","url":"https://api.github.com/users/Zihfred","html_url":"https://github.com/Zihfred","followers_url":"https://api.github.com/users/Zihfred/followers","following_url":"https://api.github.com/users/Zihfred/following{/other_user}","gists_url":"https://api.github.com/users/Zihfred/gists{/gist_id}","starred_url":"https://api.github.com/users/Zihfred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zihfred/subscriptions","organizations_url":"https://api.github.com/users/Zihfred/orgs","repos_url":"https://api.github.com/users/Zihfred/repos","events_url":"https://api.github.com/users/Zihfred/events{/privacy}","received_events_url":"https://api.github.com/users/Zihfred/received_events","type":"User","site_admin":false},"body":"_Complete the form below and remove this line._\r\n\r\n### Memory-game\r\n\r\n[Demo](https://zihfred.github.io/memory-game/) |\r\n[Code base](https://github.com/Zihfred/memory-game)\r\n\r\nThe code is submitted in a dedicated feature branch.\r\nPlease, review.\r\n","created_at":"2018-12-09T14:48:53Z","updated_at":"2018-12-10T23:44:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a6a39def2aca56fa7161e82327d970dc704f0d21","assignee":{"login":"AMashoshyna","id":17703790,"node_id":"MDQ6VXNlcjE3NzAzNzkw","avatar_url":"https://avatars0.githubusercontent.com/u/17703790?v=4","gravatar_id":"","url":"https://api.github.com/users/AMashoshyna","html_url":"https://github.com/AMashoshyna","followers_url":"https://api.github.com/users/AMashoshyna/followers","following_url":"https://api.github.com/users/AMashoshyna/following{/other_user}","gists_url":"https://api.github.com/users/AMashoshyna/gists{/gist_id}","starred_url":"https://api.github.com/users/AMashoshyna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AMashoshyna/subscriptions","organizations_url":"https://api.github.com/users/AMashoshyna/orgs","repos_url":"https://api.github.com/users/AMashoshyna/repos","events_url":"https://api.github.com/users/AMashoshyna/events{/privacy}","received_events_url":"https://api.github.com/users/AMashoshyna/received_events","type":"User","site_admin":false},"assignees":[{"login":"AMashoshyna","id":17703790,"node_id":"MDQ6VXNlcjE3NzAzNzkw","avatar_url":"https://avatars0.githubusercontent.com/u/17703790?v=4","gravatar_id":"","url":"https://api.github.com/users/AMashoshyna","html_url":"https://github.com/AMashoshyna","followers_url":"https://api.github.com/users/AMashoshyna/followers","following_url":"https://api.github.com/users/AMashoshyna/following{/other_user}","gists_url":"https://api.github.com/users/AMashoshyna/gists{/gist_id}","starred_url":"https://api.github.com/users/AMashoshyna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AMashoshyna/subscriptions","organizations_url":"https://api.github.com/users/AMashoshyna/orgs","repos_url":"https://api.github.com/users/AMashoshyna/repos","events_url":"https://api.github.com/users/AMashoshyna/events{/privacy}","received_events_url":"https://api.github.com/users/AMashoshyna/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/pulls/86/commits","review_comments_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/pulls/86/comments","review_comment_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/issues/86/comments","statuses_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/statuses/44d2a1fb000376f7896ad2a2fbf9da7c52d50feb","head":{"label":"Zihfred:memory-game","ref":"memory-game","sha":"44d2a1fb000376f7896ad2a2fbf9da7c52d50feb","user":{"login":"Zihfred","id":20110426,"node_id":"MDQ6VXNlcjIwMTEwNDI2","avatar_url":"https://avatars2.githubusercontent.com/u/20110426?v=4","gravatar_id":"","url":"https://api.github.com/users/Zihfred","html_url":"https://github.com/Zihfred","followers_url":"https://api.github.com/users/Zihfred/followers","following_url":"https://api.github.com/users/Zihfred/following{/other_user}","gists_url":"https://api.github.com/users/Zihfred/gists{/gist_id}","starred_url":"https://api.github.com/users/Zihfred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zihfred/subscriptions","organizations_url":"https://api.github.com/users/Zihfred/orgs","repos_url":"https://api.github.com/users/Zihfred/repos","events_url":"https://api.github.com/users/Zihfred/events{/privacy}","received_events_url":"https://api.github.com/users/Zihfred/received_events","type":"User","site_admin":false},"repo":{"id":159046081,"node_id":"MDEwOlJlcG9zaXRvcnkxNTkwNDYwODE=","name":"frontend-2019-homeworks","full_name":"Zihfred/frontend-2019-homeworks","private":false,"owner":{"login":"Zihfred","id":20110426,"node_id":"MDQ6VXNlcjIwMTEwNDI2","avatar_url":"https://avatars2.githubusercontent.com/u/20110426?v=4","gravatar_id":"","url":"https://api.github.com/users/Zihfred","html_url":"https://github.com/Zihfred","followers_url":"https://api.github.com/users/Zihfred/followers","following_url":"https://api.github.com/users/Zihfred/following{/other_user}","gists_url":"https://api.github.com/users/Zihfred/gists{/gist_id}","starred_url":"https://api.github.com/users/Zihfred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zihfred/subscriptions","organizations_url":"https://api.github.com/users/Zihfred/orgs","repos_url":"https://api.github.com/users/Zihfred/repos","events_url":"https://api.github.com/users/Zihfred/events{/privacy}","received_events_url":"https://api.github.com/users/Zihfred/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Zihfred/frontend-2019-homeworks","description":"Repo for students' homework reviews","fork":true,"url":"https://api.github.com/repos/Zihfred/frontend-2019-homeworks","forks_url":"https://api.github.com/repos/Zihfred/frontend-2019-homeworks/forks","keys_url":"https://api.github.com/repos/Zihfred/frontend-2019-homeworks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Zihfred/frontend-2019-homeworks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Zihfred/frontend-2019-homeworks/teams","hooks_url":"https://api.github.com/repos/Zihfred/frontend-2019-homeworks/hooks","issue_events_url":"https://api.github.com/repos/Zihfred/frontend-2019-homeworks/issues/events{/number}","events_url":"https://api.github.com/repos/Zihfred/frontend-2019-homeworks/events","assignees_url":"https://api.github.com/repos/Zihfred/frontend-2019-homeworks/assignees{/user}","branches_url":"https://api.github.com/repos/Zihfred/frontend-2019-homeworks/branches{/branch}","tags_url":"https://api.github.com/repos/Zihfred/frontend-2019-homeworks/tags","blobs_url":"https://api.github.com/repos/Zihfred/frontend-2019-homeworks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Zihfred/frontend-2019-homeworks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Zihfred/frontend-2019-homeworks/git/refs{/sha}","trees_url":"https://api.github.com/repos/Zihfred/frontend-2019-homeworks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Zihfred/frontend-2019-homeworks/statuses/{sha}","languages_url":"https://api.github.com/repos/Zihfred/frontend-2019-homeworks/languages","stargazers_url":"https://api.github.com/repos/Zihfred/frontend-2019-homeworks/stargazers","contributors_url":"https://api.github.com/repos/Zihfred/frontend-2019-homeworks/contributors","subscribers_url":"https://api.github.com/repos/Zihfred/frontend-2019-homeworks/subscribers","subscription_url":"https://api.github.com/repos/Zihfred/frontend-2019-homeworks/subscription","commits_url":"https://api.github.com/repos/Zihfred/frontend-2019-homeworks/commits{/sha}","git_commits_url":"https://api.github.com/repos/Zihfred/frontend-2019-homeworks/git/commits{/sha}","comments_url":"https://api.github.com/repos/Zihfred/frontend-2019-homeworks/comments{/number}","issue_comment_url":"https://api.github.com/repos/Zihfred/frontend-2019-homeworks/issues/comments{/number}","contents_url":"https://api.github.com/repos/Zihfred/frontend-2019-homeworks/contents/{+path}","compare_url":"https://api.github.com/repos/Zihfred/frontend-2019-homeworks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Zihfred/frontend-2019-homeworks/merges","archive_url":"https://api.github.com/repos/Zihfred/frontend-2019-homeworks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Zihfred/frontend-2019-homeworks/downloads","issues_url":"https://api.github.com/repos/Zihfred/frontend-2019-homeworks/issues{/number}","pulls_url":"https://api.github.com/repos/Zihfred/frontend-2019-homeworks/pulls{/number}","milestones_url":"https://api.github.com/repos/Zihfred/frontend-2019-homeworks/milestones{/number}","notifications_url":"https://api.github.com/repos/Zihfred/frontend-2019-homeworks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Zihfred/frontend-2019-homeworks/labels{/name}","releases_url":"https://api.github.com/repos/Zihfred/frontend-2019-homeworks/releases{/id}","deployments_url":"https://api.github.com/repos/Zihfred/frontend-2019-homeworks/deployments","created_at":"2018-11-25T15:28:20Z","updated_at":"2018-11-25T15:28:22Z","pushed_at":"2018-12-09T14:45:15Z","git_url":"git://github.com/Zihfred/frontend-2019-homeworks.git","ssh_url":"git@github.com:Zihfred/frontend-2019-homeworks.git","clone_url":"https://github.com/Zihfred/frontend-2019-homeworks.git","svn_url":"https://github.com/Zihfred/frontend-2019-homeworks","homepage":null,"size":8641,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kottans:master","ref":"master","sha":"d00e9bf80eca1c91c819ed266fc1d5a972def101","user":{"login":"kottans","id":6013442,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYwMTM0NDI=","avatar_url":"https://avatars1.githubusercontent.com/u/6013442?v=4","gravatar_id":"","url":"https://api.github.com/users/kottans","html_url":"https://github.com/kottans","followers_url":"https://api.github.com/users/kottans/followers","following_url":"https://api.github.com/users/kottans/following{/other_user}","gists_url":"https://api.github.com/users/kottans/gists{/gist_id}","starred_url":"https://api.github.com/users/kottans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kottans/subscriptions","organizations_url":"https://api.github.com/users/kottans/orgs","repos_url":"https://api.github.com/users/kottans/repos","events_url":"https://api.github.com/users/kottans/events{/privacy}","received_events_url":"https://api.github.com/users/kottans/received_events","type":"Organization","site_admin":false},"repo":{"id":155096157,"node_id":"MDEwOlJlcG9zaXRvcnkxNTUwOTYxNTc=","name":"frontend-2019-homeworks","full_name":"kottans/frontend-2019-homeworks","private":false,"owner":{"login":"kottans","id":6013442,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYwMTM0NDI=","avatar_url":"https://avatars1.githubusercontent.com/u/6013442?v=4","gravatar_id":"","url":"https://api.github.com/users/kottans","html_url":"https://github.com/kottans","followers_url":"https://api.github.com/users/kottans/followers","following_url":"https://api.github.com/users/kottans/following{/other_user}","gists_url":"https://api.github.com/users/kottans/gists{/gist_id}","starred_url":"https://api.github.com/users/kottans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kottans/subscriptions","organizations_url":"https://api.github.com/users/kottans/orgs","repos_url":"https://api.github.com/users/kottans/repos","events_url":"https://api.github.com/users/kottans/events{/privacy}","received_events_url":"https://api.github.com/users/kottans/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/kottans/frontend-2019-homeworks","description":"Repo for students' homework reviews","fork":false,"url":"https://api.github.com/repos/kottans/frontend-2019-homeworks","forks_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/forks","keys_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/teams","hooks_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/hooks","issue_events_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/issues/events{/number}","events_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/events","assignees_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/assignees{/user}","branches_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/branches{/branch}","tags_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/tags","blobs_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/git/refs{/sha}","trees_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/statuses/{sha}","languages_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/languages","stargazers_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/stargazers","contributors_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/contributors","subscribers_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/subscribers","subscription_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/subscription","commits_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/commits{/sha}","git_commits_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/git/commits{/sha}","comments_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/comments{/number}","issue_comment_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/issues/comments{/number}","contents_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/contents/{+path}","compare_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/merges","archive_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/downloads","issues_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/issues{/number}","pulls_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/pulls{/number}","milestones_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/milestones{/number}","notifications_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/labels{/name}","releases_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/releases{/id}","deployments_url":"https://api.github.com/repos/kottans/frontend-2019-homeworks/deployments","created_at":"2018-10-28T17:21:19Z","updated_at":"2018-12-09T18:34:44Z","pushed_at":"2018-12-10T23:30:16Z","git_url":"git://github.com/kottans/frontend-2019-homeworks.git","ssh_url":"git@github.com:kottans/frontend-2019-homeworks.git","clone_url":"https://github.com/kottans/frontend-2019-homeworks.git","svn_url":"https://github.com/kottans/frontend-2019-homeworks","homepage":null,"size":9267,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":30,"mirror_url":null,"archived":false,"open_issues_count":16,"license":null,"forks":30,"open_issues":16,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kottans/frontend-2019-homeworks/pulls/86"},"html":{"href":"https://github.com/kottans/frontend-2019-homeworks/pull/86"},"issue":{"href":"https://api.github.com/repos/kottans/frontend-2019-homeworks/issues/86"},"comments":{"href":"https://api.github.com/repos/kottans/frontend-2019-homeworks/issues/86/comments"},"review_comments":{"href":"https://api.github.com/repos/kottans/frontend-2019-homeworks/pulls/86/comments"},"review_comment":{"href":"https://api.github.com/repos/kottans/frontend-2019-homeworks/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kottans/frontend-2019-homeworks/pulls/86/commits"},"statuses":{"href":"https://api.github.com/repos/kottans/frontend-2019-homeworks/statuses/44d2a1fb000376f7896ad2a2fbf9da7c52d50feb"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"AMashoshyna"}}