From 53aaf65055f448dd8320609479213c9b7adcd6c9 Mon Sep 17 00:00:00 2001 From: gtitov Date: Thu, 23 Dec 2021 21:15:20 +0300 Subject: [PATCH] Rename js --- index.js | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 index.js diff --git a/index.js b/index.js deleted file mode 100644 index b657061..0000000 --- a/index.js +++ /dev/null @@ -1,39 +0,0 @@ -const vote = function(markValue) { - const candidateImage = document.querySelector("#candidate") - candidateImage.style.display = "none" - const loadingDiv = document.querySelector("#loading") - loadingDiv.style.display = "block" - - const response = { - photo: candidateImage.src, - mark: markValue - } - // надо отправить в API оценку и отметить, что это фото уже оценено - console.log(response) - // а потом запросить новое фото - candidateImage.src = "photo.jpg" - loadingDiv.style.display = "none" - candidateImage.style.display = "block" -} - -document.querySelector("#dislike").onclick = function() { - vote(1) -} -document.querySelector("#like").onclick = function() { - vote(2) -} -document.querySelector("#next").onclick = function() { - candidateImage.src = "photo.jpg" -} - -// Get a reference to an element. -const candidateImage = document.querySelector("#candidate") - -// Create an instance of Hammer with the reference. -var candidateHammer = new Hammer(candidateImage) -candidateHammer.on('swipeleft', function(ev) { - vote(1) -}) -candidateHammer.on('swiperight', function(ev) { - vote(2) -}) \ No newline at end of file