diff --git a/src/main/webapp/buy_pixel.js b/src/main/webapp/buy_pixel.js deleted file mode 100644 index d0bce12..0000000 --- a/src/main/webapp/buy_pixel.js +++ /dev/null @@ -1,61 +0,0 @@ -var urlPixel = "http://localhost:8080/api/pixel"; - -// var pixelsJSON; - -// const updatePixelsJSON = async () => { -// var reponse = await fetch(urlPixel); -// pixelsJSON = await reponse.json(); -// } - -// Initialize pixel index -function initBuyPixel() { - var pixel_index = 0; - - var pixel = pixelsJSON[pixel_index]; - updatePixelBuyPreview(pixel); -} - -// Compute next pixel index -function nextBuyPixel() { - var pixel_index = document.getElementById("buy-pixel-index").value; - - var table = document.getElementById("pixelTable"); - var number_rows = table.rows.length; - - pixel_index++; - if (pixel_index > number_rows * number_rows - 1) { - pixel_index = 0; - } - - var pixel = pixelsJSON[pixel_index]; - updatePixelBuyPreview(pixel); -} - -// Compute previous pixel index -function previousUserPixel() { - var pixel_index = document.getElementById("buy-pixel-index"); - - var table = document.getElementById("pixelTable"); - var number_rows = table.rows.length; - - pixel_index--; - if (pixel_index < 0) { - pixel_index = number_rows * number_rows - 1; - } - - var pixel = pixelsJSON[pixel_index]; - updatePixelBuyPreview(pixel); -} - -function updatePixelBuyPreview(pixel) { - document.getElementById("buy-pixel-index").value = pixel.id - 1; - document.getElementById("buy-pixel-owner").innerHTML = pixel.owner_username; - document.getElementById("buy-pixel-description").innerHTML = pixel.description; - document.getElementById("buy-pixel-price").innerHTML = pixel.price; -} - -// updatePixelsJSON(); -initBuyPixel(); - -// setInterval(updatePixelsJSON, 10000); - diff --git a/src/main/webapp/index2.html b/src/main/webapp/index2.html index 40997c9..7881c9f 100644 --- a/src/main/webapp/index2.html +++ b/src/main/webapp/index2.html @@ -53,7 +53,6 @@ } -
@@ -182,10 +181,10 @@