Add hover text for header image

This commit is contained in:
mez 2025-08-10 10:16:09 +01:00
parent 2f8f021d06
commit b9093d4938
4 changed files with 3 additions and 89 deletions

View file

@ -22,6 +22,7 @@ Python scripts to generate a mobile-friendly static site for tracking tcg cards
- =subfolder=: subfolder under your (sub)domain in which the TCG pages will be located (leave as an empty string if they are at the top level)
- =url=: URL of your site index page including =https://=
- =name=: the name you use in the game
- =hovertext=: text to display when hovering over the header image
- =sig=: set to =True= when you have a signature card
- =banner=: set to =True= when you have a player banner, and save this in =build/assets/= as =banner.png=
- =lowpriority=: a list of decks you’re collecting that aren’t in mass decks

View file

@ -670,7 +670,7 @@ def headerwrite(thefile,pagename):
header.write("/style.css\">\n <link rel=\"stylesheet\" href=\"")
if len(variables.subfolder) > 0:
header.write("/" + variables.subfolder)
header.write("/user.css\">\n <meta name=\"theme-color\" content=\"" + variables.headerbackground + "\">\n <title>" + variables.name + "’s card collection :: " + pagename + "</title>\n </head>\n <body class=\"" + pagename + "\">\n <aside>\n \n </aside>\n <nav>\n <ul>\n <li>")
header.write("/user.css\">\n <meta name=\"theme-color\" content=\"" + variables.headerbackground + "\">\n <title>" + variables.name + "’s card collection :: " + pagename + "</title>\n </head>\n <body class=\"" + pagename + "\">\n <aside title=\"" + variables.hovertext + "\">\n \n </aside>\n <nav>\n <ul>\n <li>")
if pagename == "index":
header.write("home")
else:

View file

@ -3,6 +3,7 @@ serverpath = ""
subfolder = ""
url = ""
name = "your name"
hovertext = ""
sig = False
banner = False
lowpriority = ["deckname","nameofadeck"]

View file

@ -1,88 +0,0 @@
import log
import datetime
startdate = input("Enter the start date (MMDD): ")
themonth = int(startdate[0:2])
theday = int(startdate[2:4])
urls = []
for event in log.log:
if event["date"].year == datetime.datetime.today().year:
if event["date"].month >= themonth:
if event["date"].day >= theday:
if "trade with " in event["event"]:
try:
if event["received"]:
urls.append(event["url"])
except:
pass
candidates = []
for event in log.log:
if event["url"] in urls:
try:
for card in event["received"]:
if "sig_" not in card:
carddict = {}
carddict["card"] = card
carddict["player"] = event["event"][11:]
carddict["url"] = event["url"]
candidates.append(carddict)
except:
pass
try:
for card in event["lost"]:
if "sig_" not in card:
carddict = {}
carddict["card"] = card
carddict["player"] = event["event"][11:]
carddict["url"] = event["url"]
candidates.append(carddict)
except:
pass
maxcards = {}
for card in candidates:
theplayer = card["player"]
if theplayer in maxcards:
maxcards[theplayer] += 1
else:
maxcards[theplayer] = 1
for player in maxcards:
maxcards[player] = int(maxcards[player] / 2)
word = input("Enter the weekly word: ").replace(" ","").lower()
wordspace = []
places = len(word)
while places > 0:
wordspace.append("")
places -= 1
for card in candidates:
wordindex = 0
go = True
theplayer = card["player"]
if maxcards[theplayer] > 0:
for space in wordspace:
if go:
if space == "":
if word[wordindex] in card["card"]:
newspace = word[wordindex].upper() + " " + card["card"] + " – <a href=\"" + card["url"] + "\">" + card["player"] + "</a>"
wordspace[wordindex] = newspace
go = False
theplayer = card["player"]
maxcards[theplayer] -= 1
wordindex += 1
remaining = []
spaceindex = 0
for space in wordspace:
if space == "":
remaining.append(word[spaceindex].upper())
spaceindex += 1
if len(remaining) > 0:
print("Still need " + ", ".join(remaining))
else:
print("\n" + "\n".join(wordspace) + "\n")