You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
2.3 KiB
Python

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import variables
def headerwrite(thefile,pagename):
header = open(thefile,"a")
header.write("<!DOCTYPE html>\n<html lang=\"en\" style=\"--headbg:" + variables.headerbackground + ";\">\n <head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <link rel=\"stylesheet\" href=\"/style.css\">\n <link rel=\"stylesheet\" href=\"/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>")
if pagename == "index":
header.write("home")
else:
header.write("<a href=\"/\">home</a>")
header.write("</li>\n <li>")
if pagename == "collecting":
header.write("collecting")
else:
header.write("<a href=\"/collecting\">collecting</a>")
header.write("</li>\n <li>")
if pagename == "mastered":
header.write("mastered")
else:
header.write("<a href=\"/mastered\">mastered</a>")
header.write("</li>\n <li>")
if pagename == "owned":
header.write("owned")
else:
header.write("<a href=\"/owned\">owned</a>")
header.write("</li>\n <li>")
if pagename == "trade":
header.write("trading")
else:
header.write("<a href=\"/trade\">trading</a>")
header.write("</li>\n <li>")
if pagename == "wanted":
header.write("wanted")
else:
header.write("<a href=\"/wanted\">wanted</a>")
header.write("</li>\n <li>")
if pagename == "search":
header.write("search")
else:
header.write("<a href=\"/search\">search</a>")
header.write("</li>\n <li>")
if pagename == "log":
header.write("log")
else:
header.write("<a href=\"/log\">log</a>")
header.write("</li>\n <li><a href=\"" + variables.tradepost + "\" target=\"_blank\">trade post @ dw</a></li>\n <li><a href=\"https://colors-tcg.eu/services.php\" target=\"_blank\">service links</a></li>\n </ul>\n </nav>\n <main>\n")
header.close()
def footerwrite(thefile):
footer = open(thefile,"a")
footer.write(" </main>\n </body>\n</html>")
footer.close()