feat: Create the generateID() helper
This commit is contained in:
11
index.html
11
index.html
@@ -353,6 +353,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
const poolTypes = ["might", "speed", "intellect"];
|
const poolTypes = ["might", "speed", "intellect"];
|
||||||
|
const characterIDChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||||
|
|
||||||
const containerNoCharacter = document.getElementById("cont-no-loaded");
|
const containerNoCharacter = document.getElementById("cont-no-loaded");
|
||||||
const containerCharacter = document.getElementById("cont-character-sheet");
|
const containerCharacter = document.getElementById("cont-character-sheet");
|
||||||
@@ -435,6 +436,16 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const generateID = () => {
|
||||||
|
var result = "";
|
||||||
|
|
||||||
|
for (var i = 0; i < 16; i++) {
|
||||||
|
result += characterIDChars.charAt(Math.floor(Math.random() * characterIDChars.length));
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
|
||||||
document.addEventListener(
|
document.addEventListener(
|
||||||
"DOMContentLoaded",
|
"DOMContentLoaded",
|
||||||
() => {
|
() => {
|
||||||
|
Reference in New Issue
Block a user