diff --git a/build/assets/fonts/04b24.ttf b/build/assets/fonts/04b24.ttf new file mode 100644 index 0000000..bc02f7e Binary files /dev/null and b/build/assets/fonts/04b24.ttf differ diff --git a/build/assets/portfolio/blue.png b/build/assets/portfolio/blue.png new file mode 100644 index 0000000..30639e8 Binary files /dev/null and b/build/assets/portfolio/blue.png differ diff --git a/build/assets/portfolio/brown.png b/build/assets/portfolio/brown.png new file mode 100644 index 0000000..df9b474 Binary files /dev/null and b/build/assets/portfolio/brown.png differ diff --git a/build/assets/portfolio/gray.png b/build/assets/portfolio/gray.png new file mode 100644 index 0000000..815f69a Binary files /dev/null and b/build/assets/portfolio/gray.png differ diff --git a/build/assets/portfolio/green.png b/build/assets/portfolio/green.png new file mode 100644 index 0000000..310fbe5 Binary files /dev/null and b/build/assets/portfolio/green.png differ diff --git a/build/assets/portfolio/orange.png b/build/assets/portfolio/orange.png new file mode 100644 index 0000000..742c72f Binary files /dev/null and b/build/assets/portfolio/orange.png differ diff --git a/build/assets/portfolio/palette.png b/build/assets/portfolio/palette.png new file mode 100644 index 0000000..56ae59f Binary files /dev/null and b/build/assets/portfolio/palette.png differ diff --git a/build/assets/portfolio/purple.png b/build/assets/portfolio/purple.png new file mode 100644 index 0000000..d025fac Binary files /dev/null and b/build/assets/portfolio/purple.png differ diff --git a/build/assets/portfolio/red.png b/build/assets/portfolio/red.png new file mode 100644 index 0000000..1d2a356 Binary files /dev/null and b/build/assets/portfolio/red.png differ diff --git a/build/assets/portfolio/yellow.png b/build/assets/portfolio/yellow.png new file mode 100644 index 0000000..b4204b7 Binary files /dev/null and b/build/assets/portfolio/yellow.png differ diff --git a/build/style.css b/build/style.css index a70a4ff..99cc27b 100644 --- a/build/style.css +++ b/build/style.css @@ -1,3 +1,11 @@ +@font-face { + src: url("/assets/fonts/04b24.ttf"); + font-display: swap; + font-family: "04b24"; + font-style: normal; + font-weight: 400; +} + /* basic colours */ :root { @@ -134,3 +142,381 @@ h2.collectingheader { top: 0; background-color: Canvas; } + +/* portfolios */ +a:has(div.foliocase) { + text-decoration: none; +} + +div.foliocase { + display: flex; + flex-direction: row; + gap: 3px; + flex-wrap: wrap; + margin-bottom: 5px; +} + +table.portfolio { + letter-spacing: 0px; + font-family: "04b24", sans-serif; + background-color: black; + width: 111px; + height: 75px; + -webkit-font-smoothing: none; + font-smooth: never; + text-transform: lowercase; + white-space: nowrap; + font-size: 8px; + color: white; + /* filter: contrast(1); */ +} + +table.portfolio tr:last-of-type { + text-align: right; +} + +table.portfolio.palette { + background: url("/assets/portfolio/palette.png"); + background-repeat: no-repeat; + background-size: cover; +} + +table.portfolio.red { + background: url("/assets/portfolio/red.png"); + background-repeat: no-repeat; + background-size: cover; +} + +table.portfolio.orange { + background: url("/assets/portfolio/orange.png"); + background-repeat: no-repeat; + background-size: cover; +} + +table.portfolio.yellow { + background: url("/assets/portfolio/yellow.png"); + background-repeat: no-repeat; + background-size: cover; +} + +table.portfolio.green { + background: url("/assets/portfolio/green.png"); + background-repeat: no-repeat; + background-size: cover; +} + +table.portfolio.blue { + background: url("/assets/portfolio/blue.png"); + background-repeat: no-repeat; + background-size: cover; +} + +table.portfolio.purple { + background: url("/assets/portfolio/purple.png"); + background-repeat: no-repeat; + background-size: cover; +} + +table.portfolio.brown { + background: url("/assets/portfolio/brown.png"); + background-repeat: no-repeat; + background-size: cover; +} + +table.portfolio.gray { + background: url("/assets/portfolio/gray.png"); + background-repeat: no-repeat; + background-size: cover; +} + +table.portfolio td { + overflow-x: hidden; +} + +table.portfolio.palette td.deck1 { + color: #ff2424; +} + +table.portfolio.palette td.deck2 { + color: #ff890d; +} + +table.portfolio.palette td.deck3 { + color: #f6d600; +} + +table.portfolio.palette td.deck4 { + color: #3bc803; +} + +table.portfolio.palette td.deck5 { + color: #1798ea; +} + +table.portfolio.palette td.deck6 { + color: #e300f7; +} + +table.portfolio.palette td.deck7 { + color: #b57a5e; +} + +table.portfolio.palette td.deck8 { + color: #8c8989; +} + +table.portfolio.red td.deck1 { + color: rgb(164,1,1); +} + +table.portfolio.red td.deck2 { + color: rgb(196,2,2); +} + +table.portfolio.red td.deck3 { + color: rgb(210,30,21); +} + +table.portfolio.red td.deck4 { + color: rgb(246,25,25); +} + +table.portfolio.red td.deck5 { + color: rgb(244,57,48); +} + +table.portfolio.red td.deck6 { + color: rgb(222,86,79); +} + +table.portfolio.red td.deck7 { + color: rgb(241,149,145); +} + +table.portfolio.red td.deck8 { + color: rgb(255,196,196); +} + +table.portfolio.orange td.deck1 { + color: rgb(253,107,0); +} + +table.portfolio.orange td.deck2 { + color: rgb(255,137,51); +} + +table.portfolio.orange td.deck3 { + color: rgb(244,156,78); +} + +table.portfolio.orange td.deck4 { + color: rgb(246,165,47); +} + +table.portfolio.orange td.deck5 { + color: rgb(235,167,70); +} + +table.portfolio.orange td.deck6 { + color: rgb(244,188,109); +} + +table.portfolio.orange td.deck7 { + color: rgb(246,194,144); +} + +table.portfolio.orange td.deck8 { + color: rgb(250,225,193); +} + +table.portfolio.yellow td.deck1 { + color: rgb(187,176,0); +} + +table.portfolio.yellow td.deck2 { + color: rgb(226,215,32); +} + +table.portfolio.yellow td.deck3 { + color: rgb(246,255,0); +} + +table.portfolio.yellow td.deck4 { + color: rgb(255,216,0); +} + +table.portfolio.yellow td.deck5 { + color: rgb(249,216,33); +} + +table.portfolio.yellow td.deck6 { + color: rgb(252,225,74); +} + +table.portfolio.yellow td.deck7 { + color: rgb(250,229,115); +} + +table.portfolio.yellow td.deck8 { + color: rgb(255,241,166); +} + +table.portfolio.green td.deck1 { + color: rgb(9,140,2); +} + +table.portfolio.green td.deck2 { + color: rgb(23,167,47); +} + +table.portfolio.green td.deck3 { + color: rgb(15,204,6); +} + +table.portfolio.green td.deck4 { + color: rgb(38,220,29); +} + +table.portfolio.green td.deck5 { + color: rgb(58,249,89); +} + +table.portfolio.green td.deck6 { + color: rgb(111,243,81); +} + +table.portfolio.green td.deck7 { + color: rgb(147,247,124); +} + +table.portfolio.green td.deck8 { + color: rgb(197,255,183); +} + +table.portfolio.blue td.deck1 { + color: rgb(0,30,214); +} + +table.portfolio.blue td.deck2 { + color: rgb(14,31,255); +} + +table.portfolio.blue td.deck3 { + color: rgb(47,61,240); +} + +table.portfolio.blue td.deck4 { + color: rgb(51,102,250); +} + +table.portfolio.blue td.deck5 { + color: rgb(93,160,244); +} + +table.portfolio.blue td.deck6 { + color: rgb(58,221,250); +} + +table.portfolio.blue td.deck7 { + color: rgb(92,253,225); +} + +table.portfolio.blue td.deck8 { + color: rgb(161,255,238); +} + +table.portfolio.purple td.deck1 { + color: rgb(97,0,171); +} + +table.portfolio.purple td.deck2 { + color: rgb(135,2,238); +} + +table.portfolio.purple td.deck3 { + color: rgb(159,42,249); +} + +table.portfolio.purple td.deck4 { + color: rgb(154,50,234); +} + +table.portfolio.purple td.deck5 { + color: rgb(159,57,238); +} + +table.portfolio.purple td.deck6 { + color: rgb(154,80,238); +} + +table.portfolio.purple td.deck7 { + color: rgb(159,113,244); +} + +table.portfolio.purple td.deck8 { + color: rgb(194,161,255); +} + +table.portfolio.brown td.deck1 { + color: rgb(147,66,0); +} + +table.portfolio.brown td.deck2 { + color: rgb(123,65,17); +} + +table.portfolio.brown td.deck3 { + color: rgb(107,73,20); +} + +table.portfolio.brown td.deck4 { + color: rgb(113,86,43); +} + +table.portfolio.brown td.deck5 { + color: rgb(144,109,76); +} + +table.portfolio.brown td.deck6 { + color: rgb(178,139,101); +} + +table.portfolio.brown td.deck7 { + color: rgb(189,151,126); +} + +table.portfolio.brown td.deck8 { + color: rgb(208,184,168); +} + +table.portfolio.gray td.deck1 { + color: rgb(76,74,76); +} + +table.portfolio.gray td.deck2 { + color: rgb(108,98,100); +} + +table.portfolio.gray td.deck3 { + color: rgb(124,118,116); +} + +table.portfolio.gray td.deck4 { + color: rgb(140,126,124); +} + +table.portfolio.gray td.deck5 { + color: rgb(156,146,148); +} + +table.portfolio.gray td.deck6 { + color: rgb(180,170,172); +} + +table.portfolio.gray td.deck7 { + color: rgb(196,182,180); +} + +table.portfolio.gray td.deck8 { + color: rgb(228,222,220); +} diff --git a/generate.py b/generate.py index 95ecb75..d92b106 100644 --- a/generate.py +++ b/generate.py @@ -1,4 +1,4 @@ -import download,indexgen,collectinggen,ownedgen,wantedgen,loggen,levelsgen,tradegen,masteredgen +import download,indexgen,collectinggen,ownedgen,wantedgen,loggen,levelsgen,tradegen,masteredgen,portfoliosgen download.getimg() indexgen.indexgen() @@ -9,3 +9,4 @@ loggen.loggen() levelsgen.levelsgen() tradegen.tradeall() masteredgen.masteredall() +portfoliosgen.portfoliosgen() diff --git a/indexgen.py b/indexgen.py index abcd4b3..7917402 100644 --- a/indexgen.py +++ b/indexgen.py @@ -226,6 +226,13 @@ def indexgen(): if sketch > 19: content.write("" + str(int(sketch / 20)) + " completed\n") content.write("\n\n") + if len(variables.portfolios) > 0: + content.write("\n
\n") + if len(tcgcore.getpalettes()) > 0: + content.write(tcgcore.portfoliogen(tcgcore.getpalettes()[-1],"palette",len(tcgcore.getpalettes()))) + if len(tcgcore.getmonochrome()) > 0: + content.write(tcgcore.portfoliogen(tcgcore.getmonochrome()[-1],"monochrome",len(tcgcore.getmonochrome()))) + content.write("
\n
\n") decksofinterest = [] for card in tcgcore.ownedcards(): if card[0:4] != "sig_": @@ -238,7 +245,7 @@ def indexgen(): mastereddecks = sorted(mastereddecks,key=lambda d: d["date"],reverse=True) if len(mastereddecks) > 0: content.write("

mastered decks

\n

") - masteredcount = 1 + masteredcount = 0 for deck in mastereddecks: if masteredcount < variables.maxmastered: content.write("") diff --git a/portfoliosgen.py b/portfoliosgen.py new file mode 100644 index 0000000..67e6435 --- /dev/null +++ b/portfoliosgen.py @@ -0,0 +1,37 @@ +import datetime,os +import log,skel,tcgcore,variables + +def portfoliosgen(colour=False): + if not os.path.isdir("build/portfolios"): + os.mkdir("build/portfolios") + if colour: + if not os.path.isdir("build/portfolios/" + colour): + os.mkdir("build/portfolios/" + colour) + thefile = "build/portfolios/" + colour + "/index.html" + else: + thefile = "build/portfolios/index.html" + if os.path.exists(thefile): + os.remove(thefile) + skel.headerwrite(thefile,"portfolios") + content = open(thefile,"a") + content.write("

portfolios

\n") + if len(variables.portfolios) > 0: + if len(tcgcore.getpalettes()) > 0: + content.write("
\n") + portnumber = 1 + for portfolio in tcgcore.getpalettes(): + content.write(tcgcore.portfoliogen(portfolio,"palette",portnumber)) + portnumber += 1 + content.write("
\n") + if len(tcgcore.getmonochrome()) > 0: + content.write("
\n") + portnumber = 1 + for portfolio in tcgcore.getmonochrome(): + content.write(tcgcore.portfoliogen(portfolio,"monochrome",portnumber)) + portnumber += 1 + content.write("
\n") + content.close() + skel.footerwrite(thefile) + +if __name__ == "__main__": + portfoliosgen() diff --git a/tcgcore.py b/tcgcore.py index 9df36a0..99198e2 100644 --- a/tcgcore.py +++ b/tcgcore.py @@ -174,3 +174,190 @@ def filterwrite(page,colour=False,sigs=False): filterstring += " " filterstring += "

\n" return filterstring + +def getpalettes(): + palette = [] + if len(variables.portfolios) > 0: + for portfolio in variables.portfolios: + if portfolio["type"] == "palette": + thepalette = {} + for deck in portfolio["decks"]: + thepalette[cardtype(deck + "01")] = deck + palette.append(thepalette) + return palette + +def getmonochrome(): + monochrome = [] + if len(variables.portfolios) > 0: + for portfolio in variables.portfolios: + if portfolio["type"] == "monochrome": + themonochrome = {} + colourdecks = [] + for deck in portfolio["decks"]: + colourdecks.append(deck) + colourdecks = sorted(colourdecks) + themonochrome["colour"] = cardtype(colourdecks[0] + "01") + themonochrome["decks"] = colourdecks + monochrome.append(themonochrome) + return monochrome + +def portfoliogen(portfolio,thetype,portnumber): + if thetype == "palette": + portstring = "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
" + variables.name.lower() + "
" + try: + if deckmastered(portfolio["red"]): + portstring += "■" + else: + portstring += "□" + portstring += " " + portfolio["red"] + except: + if deckmastered(portfolio["special"]): + portstring += "■" + else: + portstring += "□" + portstring += " " + portfolio["special"] + portstring += "" + try: + if deckmastered(portfolio["blue"]): + portstring += "■" + else: + portstring += "□" + portstring += " " + portfolio["blue"] + except: + if deckmastered(portfolio["special"]): + portstring += "■" + else: + portstring += "□" + portstring += " " + portfolio["special"] + portstring += "
" + try: + if deckmastered(portfolio["orange"]): + portstring += "■" + else: + portstring += "□" + portstring += " " + portfolio["orange"] + except: + if deckmastered(portfolio["special"]): + portstring += "■" + else: + portstring += "□" + portstring += " " + portfolio["special"] + portstring += "" + try: + if deckmastered(portfolio["purple"]): + portstring += "■" + else: + portstring += "□" + portstring += " " + portfolio["purple"] + except: + if deckmastered(portfolio["special"]): + portstring += "■" + else: + portstring += "□" + portstring += " " + portfolio["special"] + portstring += "
" + try: + if deckmastered(portfolio["yellow"]): + portstring += "■" + else: + portstring += "□" + portstring += " " + portfolio["yellow"] + except: + if deckmastered(portfolio["special"]): + portstring += "■" + else: + portstring += "□" + portstring += " " + portfolio["special"] + portstring += "" + try: + if deckmastered(portfolio["brown"]): + portstring += "■" + else: + portstring += "□" + portstring += " " + portfolio["brown"] + except: + if deckmastered(portfolio["special"]): + portstring += "■" + else: + portstring += "□" + portstring += " " + portfolio["special"] + portstring += "
" + try: + if deckmastered(portfolio["green"]): + portstring += "■" + else: + portstring += "□" + portstring += " " + portfolio["green"] + except: + if deckmastered(portfolio["special"]): + portstring += "■" + else: + portstring += "□" + portstring += " " + portfolio["special"] + portstring += "" + try: + if deckmastered(portfolio["gray"]): + portstring += "■" + else: + portstring += "□" + portstring += " " + portfolio["gray"] + except: + if deckmastered(portfolio["special"]): + portstring += "■" + else: + portstring += "□" + portstring += " " + portfolio["special"] + portstring += "
palette portfolio " + if portnumber < 10: + portstring += "0" + str(portnumber) + else: + portstring += str(portnumber) + portstring += "
\n" + elif thetype == "monochrome": + portstring = "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
" + variables.name.lower() + "
" + if deckmastered(portfolio["decks"][0]): + portstring += "■" + else: + portstring += "□" + portstring += " " + portfolio["decks"][0] + "" + if deckmastered(portfolio["decks"][4]): + portstring += "■" + else: + portstring += "□" + portstring += " " + portfolio["decks"][4] + "
" + if deckmastered(portfolio["decks"][1]): + portstring += "■" + else: + portstring += "□" + portstring += " " + portfolio["decks"][1] + "" + if deckmastered(portfolio["decks"][5]): + portstring += "■" + else: + portstring += "□" + portstring += " " + portfolio["decks"][5] + "
" + if deckmastered(portfolio["decks"][2]): + portstring += "■" + else: + portstring += "□" + portstring += " " + portfolio["decks"][2] + "" + if deckmastered(portfolio["decks"][6]): + portstring += "■" + else: + portstring += "□" + portstring += " " + portfolio["decks"][6] + "
" + if deckmastered(portfolio["decks"][3]): + portstring += "■" + else: + portstring += "□" + portstring += " " + portfolio["decks"][3] + "" + if deckmastered(portfolio["decks"][7]): + portstring += "■" + else: + portstring += "□" + portstring += " " + portfolio["decks"][7] + "
monochrome portfolio " + if portnumber < 10: + portstring += "0" + str(portnumber) + else: + portstring += str(portnumber) + portstring += "
\n" + return portstring diff --git a/variables-template.py b/variables-template.py index d442cee..1a71490 100644 --- a/variables-template.py +++ b/variables-template.py @@ -11,3 +11,4 @@ collectthreshold = 2 keepsig = False tradestatement = "" maxmastered = 20 +portfolios = [{"type":"palette","decks":["one","two","three","four","five","six","seven","eight"]}]