Link banner to trade post, count redeemed levels

This commit is contained in:
mez 2025-05-29 22:37:50 +01:00
parent a348577149
commit 692c5e1447

130
colors.py
View file

@ -55,6 +55,7 @@ coupons = []
datelist = [] datelist = []
logitems = [] logitems = []
pends = [] pends = []
levelcrayons = 0
for event in log.log: for event in log.log:
logentry = {} logentry = {}
@ -259,6 +260,9 @@ for event in log.log:
pends.remove(card) pends.remove(card)
except: except:
pass pass
if event["event"] == "level up":
for crayontype in event["crayons"]:
levelcrayons += event["crayons"][crayontype]
if logit == True: if logit == True:
logitems.append(logentry) logitems.append(logentry)
@ -1156,12 +1160,130 @@ def indexgen():
if len(variables.subfolder) > 0: if len(variables.subfolder) > 0:
content.write("/" + variables.subfolder) content.write("/" + variables.subfolder)
content.write("/decks/sigs/" + variables.name.lower() + ".gif\" loading=\"lazy\">") content.write("/decks/sigs/" + variables.name.lower() + ".gif\" loading=\"lazy\">")
if variables.sig: if variables.banner:
content.write("<img src=\"") content.write("<a target=\"_blank\" href=\"" + variables.tradepost + "\"><img src=\"")
if len(variables.subfolder) > 0: if len(variables.subfolder) > 0:
content.write("/" + variables.subfolder) content.write("/" + variables.subfolder)
content.write("/assets/banner.png\" loading=\"lazy\">") content.write("/assets/banner.png\" loading=\"lazy\"></a>")
content.write("\n<ul>\n<li>player name: <span class=\"name\">" + variables.name + "</span></li>\n<li>" + str(len(cardlist) + tradepend) + " cards <span class=\"rank " + rank + "\">(" + rank + ")</span></li>\n") content.write("\n<ul>\n<li>player name: <span class=\"name\">" + variables.name + "</span></li>\n<li>" + str(len(cardlist) + tradepend) + " cards <span class=\"rank " + rank + "\" title=\"redeemed: ")
if levelcrayons == 0:
content.write("red")
elif levelcrayons == 1:
content.write("orange")
elif levelcrayons == 2:
content.write("yellow")
elif levelcrayons == 3:
content.write("green")
elif levelcrayons == 4:
content.write("blue")
elif levelcrayons == 5:
content.write("purple")
elif levelcrayons == 6:
content.write("brown")
elif levelcrayons == 7:
if variables.british:
content.write("grey")
else:
content.write("gray")
elif levelcrayons == 8:
content.write("strawberry")
elif levelcrayons == 9:
content.write("tangerine")
elif levelcrayons == 10:
content.write("lemon")
elif levelcrayons == 11:
content.write("lime")
elif levelcrayons == 12:
content.write("blueberry")
elif levelcrayons == 13:
content.write("grape")
elif levelcrayons == 14:
content.write("apricot")
elif levelcrayons == 15:
content.write("dragon fruit")
elif levelcrayons == 16:
content.write("ruby")
elif levelcrayons == 17:
content.write("amber")
elif levelcrayons == 18:
content.write("gold")
elif levelcrayons == 19:
content.write("emerald")
elif levelcrayons == 20:
content.write("sapphire")
elif levelcrayons == 21:
content.write("amethyst")
elif levelcrayons == 22:
content.write("bronze")
elif levelcrayons == 23:
content.write("silver")
elif levelcrayons == 24:
content.write("sakura")
elif levelcrayons == 25:
content.write("tiger lily")
elif levelcrayons == 26:
content.write("daffodil")
elif levelcrayons == 27:
content.write("clover")
elif levelcrayons == 28:
content.write("hydrangea")
elif levelcrayons == 29:
content.write("lilac")
elif levelcrayons == 30:
content.write("chocolate cosmos")
elif levelcrayons == 31:
content.write("magnolia")
elif levelcrayons == 32:
content.write("mars")
elif levelcrayons == 33:
content.write("saturn")
elif levelcrayons == 34:
content.write("venus")
elif levelcrayons == 35:
content.write("earth")
elif levelcrayons == 36:
content.write("neptune")
elif levelcrayons == 37:
content.write("uranus")
elif levelcrayons == 38:
content.write("jupiter")
elif levelcrayons == 39:
content.write("mercury")
elif levelcrayons == 40:
content.write("fire")
elif levelcrayons == 41:
content.write("wind")
elif levelcrayons == 42:
content.write("light")
elif levelcrayons == 43:
content.write("nature")
elif levelcrayons == 44:
content.write("water")
elif levelcrayons == 45:
content.write("darkness")
elif levelcrayons == 46:
content.write("ground")
elif levelcrayons == 47:
content.write("metal")
elif levelcrayons == 48:
content.write("lion")
elif levelcrayons == 49:
content.write("tiger")
elif levelcrayons == 50:
content.write("cheetah")
elif levelcrayons == 51:
content.write("panther")
elif levelcrayons == 52:
content.write("russian blue")
elif levelcrayons == 53:
content.write("chartreux")
elif levelcrayons == 54:
content.write("puma")
elif levelcrayons == 55:
content.write("himalayan")
else:
content.write("rainbow" + " + " + str(levelcrayons - 56))
content.write("\">(" + rank + ")</span></li>\n")
if tradepend > 0: if tradepend > 0:
content.write("<li>" + str(tradepend) + " card") content.write("<li>" + str(tradepend) + " card")
if tradepend > 1: if tradepend > 1: