2022-09-23 14:58:23 +01:00
|
|
|
import pandas as pd
|
|
|
|
|
|
|
|
titleDF = pd.read_csv("title.csv")
|
|
|
|
linksDF = pd.read_csv("links.csv")
|
|
|
|
|
|
|
|
html = open("index.html", "w")
|
2022-09-23 16:50:13 +01:00
|
|
|
html.write(f"<!DOCTYPE html>\n<html lang='en'>\n<head>\n\t<title>{titleDF['title'][0]}</title>\n\t<meta charset='UTF-8'>\n\t<meta name='viewport' content='width=device-width, initial-scale=1'/>\n\t<link rel='stylesheet' href='styles.css'>\n</head>\n<body>\n")
|
2022-09-23 14:58:23 +01:00
|
|
|
html.write(f"<img src='{titleDF['logo'][0]}' class='top-logo'>\n\t<h2>{titleDF['description'][0]}</h2>\n<br>\n")
|
|
|
|
for i,x in linksDF.iterrows():
|
|
|
|
html.write(f"<div>\n<button class='menu' onclick='{x['name'].replace(' ','').lower()}.show()'><img src='{x['logo']}' class='small-logo'>  {x['name']}</button>\n\t</div>\n\t<br>\n")
|
|
|
|
html.write("\t<script src='script.js'></script>\n</body>\n</html>")
|
|
|
|
html.close()
|
|
|
|
|
|
|
|
script = open("script.js", "w")
|
2022-09-23 15:03:30 +01:00
|
|
|
script.write("class link{\n\tconstructor(url){\n\t\tthis.url= url;\n\t}\n\tshow(){\n\t\tvar win=window.open(this.url, '_blank');\n\t\twin.focus();\n\t}\n}\n")
|
2022-09-23 14:58:23 +01:00
|
|
|
for i,x in linksDF.iterrows():
|
|
|
|
script.write(f"var {x['name'].replace(' ','').lower()} = new link('{x['link']}')\n")
|
|
|
|
script.close()
|