Skip to content

Commit

Permalink
Fix avatars
Browse files Browse the repository at this point in the history
  • Loading branch information
AunePVP committed Dec 4, 2023
1 parent ddc1ff5 commit 0dff50a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
13 changes: 7 additions & 6 deletions users/control/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,14 @@ function selectstyle() {
sprite = "adventurer";
} else if (type === "adventurer-neutral") {
sprite = "adventurer-neutral";
} else if (type === "notionists") {
sprite = "notionists";
} else if (type === "human") {
document.getElementById("selectsph").style.display = "block";
sprite = document.getElementById("selectsph").value;
sprite = "avataaars";
} else if (type === "bottts") {
sprite = "bottts";
} else if (type === "gridy") {
sprite = "gridy";
} else if (type === "croodles") {
sprite = "croodles";
} else if (type === "identicon") {
sprite = "identicon";
} else if (type === "pixel-art") {
Expand All @@ -172,6 +173,6 @@ function selectstyle() {
}
if (type !== "human") {document.getElementById("selectsph").style.display = "none";}
let seed = document.getElementById("seed").value;
let link = "https://avatars.dicebear.com/api/";
document.getElementById("ppictureimg").src = link + sprite + "/" + seed + ".svg";
let link = "https://api.dicebear.com/7.x/";
document.getElementById("ppictureimg").src = link + sprite + "/svg?seed=" + seed;
}
7 changes: 4 additions & 3 deletions users/control/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ function test_input($data)
</div>
</div>
<div id="zusammenfassung">
<div id="ppicture"><?php echo "<img id='ppictureimg' src='https://avatars.dicebear.com/api/$sprite/$seed.svg'>"?></div>
<div id="ppicture"><?php echo "<img id='ppictureimg' src='https://api.dicebear.com/7.x/$sprite/svg?seed=$seed'>"?></div>
<div id="customizecontent">
<details id="customizedetails">
<summary id="customizesummary">Customize</summary>
Expand All @@ -349,9 +349,10 @@ function test_input($data)
<option disabled selected <?php if(!isset($sprite)){echo "selected ";}?> style="display:none">select a sprite</option>
<option <?php if($sprite=="adventurer"){echo "selected ";}?>value="adventurer">Adventurer</option>
<option <?php if($sprite=="adventurer-neutral"){echo "selected ";}?>value="adventurer-neutral">Adventurer-Neutral</option>
<option <?php if($sprite=="male" || $sprite=="female"){echo "selected ";}?>value="human">Human</option>
<option <?php if($sprite=="notionists"){echo "selected ";}?>value="notionists">Notonionist</option>
<option <?php if($sprite=="avataaars"){echo "selected ";}?>value="avataaars">Human</option>
<option <?php if($sprite=="bottts"){echo "selected ";}?>value="bottts">Bottts</option>
<option <?php if($sprite=="gridy"){echo "selected ";}?>value="gridy">Gridy</option>
<option <?php if($sprite=="croodles"){echo "selected ";}?>value="croodles">Croodles</option>
<option <?php if($sprite=="identicon"){echo "selected ";}?>value="identicon">Identicon</option>
<option <?php if($sprite=="pixel-art"){echo "selected ";}?>value="pixel-art">Pixel Art</option>
<option <?php if($sprite=="pixel-art-neutral"){echo "selected ";}?>value="pixel-art-neutral">Pixel Art Neutral</option>
Expand Down

0 comments on commit 0dff50a

Please sign in to comment.