Make the gallery interactive to load characters
This commit is contained in:
parent
8e3e8a070f
commit
7a776ccf87
2 changed files with 7 additions and 3 deletions
|
@ -29,6 +29,10 @@ def generate_html():
|
|||
background-color: gray;
|
||||
}
|
||||
|
||||
.character-gallery tr {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.character-gallery .image-td {
|
||||
width: 150px;
|
||||
}
|
||||
|
@ -45,7 +49,7 @@ def generate_html():
|
|||
for file in Path("characters").glob("*"):
|
||||
if file.name.endswith(".json"):
|
||||
character = file.name.replace(".json", "")
|
||||
table_html += "<tr>"
|
||||
table_html += f'<tr onclick=\'document.getElementById("character-menu").children[1].children[1].value = "{character}"; document.getElementById("character-menu").children[1].children[1].dispatchEvent(new Event("change"));\'>'
|
||||
image_html = "<div class='placeholder'></div>"
|
||||
|
||||
for i in [
|
||||
|
@ -62,7 +66,7 @@ def generate_html():
|
|||
except:
|
||||
continue
|
||||
|
||||
table_html += f'<td class="image-td"=>{image_html}</td><td class="character-td">{character}</td>'
|
||||
table_html += f'<td class="image-td">{image_html}</td><td class="character-td">{character}</td>'
|
||||
table_html += "</tr>"
|
||||
table_html += "</table></div>"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue