fix: un id en moins
Co-authored-by: Laureηt <Laurent2916@users.noreply.github.com>
This commit is contained in:
parent
f3cb2e5da9
commit
a957027656
|
@ -90,7 +90,7 @@
|
||||||
Wallet
|
Wallet
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
<div class="solde" id="solde"></div>
|
<div class="solde"></div>
|
||||||
<form action="pay" method="post">
|
<form action="pay" method="post">
|
||||||
<div class="data">
|
<div class="data">
|
||||||
<label>Amount</label>
|
<label>Amount</label>
|
||||||
|
@ -115,6 +115,7 @@
|
||||||
My pixels
|
My pixels
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
|
<div class="solde"></div>
|
||||||
<div id="color"></div>
|
<div id="color"></div>
|
||||||
<div id="pixel-index"></div>
|
<div id="pixel-index"></div>
|
||||||
(<div id="user-pixel-index"></div>)
|
(<div id="user-pixel-index"></div>)
|
||||||
|
@ -139,7 +140,7 @@
|
||||||
<label>Description</label>
|
<label>Description</label>
|
||||||
<input type="text" name="desc" id="description" required>
|
<input type="text" name="desc" id="description" required>
|
||||||
</div>
|
</div>
|
||||||
<div class=" btn">
|
<div class="btn">
|
||||||
<button type="submit">Modify</button>
|
<button type="submit">Modify</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
@ -159,6 +160,7 @@
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
<form action="modify" method="post">
|
<form action="modify" method="post">
|
||||||
|
<div class="solde"></div>
|
||||||
<div class="data">
|
<div class="data">
|
||||||
<label>Index</label>
|
<label>Index</label>
|
||||||
<input type="number" name="index" id="buy-pixel-index" required>
|
<input type="number" name="index" id="buy-pixel-index" required>
|
||||||
|
|
|
@ -18,10 +18,11 @@ const updateUserJSON = async () => {
|
||||||
userJSON = await reponse.json();
|
userJSON = await reponse.json();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function updateSolde() {
|
function updateSolde() {
|
||||||
var div = document.getElementById("solde");
|
var elems = document.getElementsByClassName("solde");
|
||||||
div.innerHTML = userJSON.solde + '$';
|
elems.forEach(el => {
|
||||||
|
el.innerHTML = userJSON.solde + '₿';
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
updateSolde();
|
updateSolde();
|
||||||
|
@ -70,13 +71,13 @@ function setPixels() {
|
||||||
//////////////////////
|
//////////////////////
|
||||||
|
|
||||||
function hexToRgb(hex) {
|
function hexToRgb(hex) {
|
||||||
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
||||||
console.log(result);
|
console.log(result);
|
||||||
return result ? {
|
return result ? {
|
||||||
r: parseInt(result[1], 16),
|
r: parseInt(result[1], 16),
|
||||||
g: parseInt(result[2], 16),
|
g: parseInt(result[2], 16),
|
||||||
b: parseInt(result[3], 16)
|
b: parseInt(result[3], 16)
|
||||||
} : null;
|
} : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize pixel index
|
// Initialize pixel index
|
||||||
|
@ -125,8 +126,6 @@ function previousUserPixel() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function updatePixelPreview() {
|
function updatePixelPreview() {
|
||||||
var colorDiv = document.getElementById("color");
|
|
||||||
|
|
||||||
var index = parseInt(document.getElementById("pixel-index").innerHTML);
|
var index = parseInt(document.getElementById("pixel-index").innerHTML);
|
||||||
var pixel = pixelsJSON[index];
|
var pixel = pixelsJSON[index];
|
||||||
|
|
||||||
|
@ -150,7 +149,6 @@ function updatePixelPreview() {
|
||||||
// Update description
|
// Update description
|
||||||
var description = document.getElementById("description");
|
var description = document.getElementById("description");
|
||||||
description.value = pixel.description;
|
description.value = pixel.description;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update preview's color
|
// Update preview's color
|
||||||
|
|
Loading…
Reference in a new issue