Remove :before where possible

master
trémeur 1 year ago
parent 008c618c16
commit a0e4043dd7

@ -78,15 +78,13 @@ div.fic h1 span.ficno {
font-size: 0.8em; font-size: 0.8em;
} }
div.fic h1 span.ficno::before { div.fic h1 span.ficnoprelim {
font-weight: normal; font-weight: normal;
font-style: italic; font-style: italic;
content: "no. ";
font-size: 0.6em; font-size: 0.6em;
} }
div.fic h1 span.abandoned::before { div.fic h1 span.abandoned {
content: " (abandoned)";
font-weight: normal; font-weight: normal;
background-color: #9c0000; background-color: #9c0000;
color: white; color: white;
@ -96,95 +94,39 @@ div.fic ul.ficlinks li, div.fic ul.ficmeta li {
list-style: none; list-style: none;
} }
div.fic li.ficdate::before { div.fic li.rating span.g {
content:"Date: ";
font-style: italic;
}
div.fic li.wordcount::before {
content:"Wordcount: ";
font-style: italic;
}
div.fic li.rating::before {
content:"Rating: ";
font-style: italic;
}
div.fic li.rating span.g::before {
background-color: #8ab60b; background-color: #8ab60b;
color: white; color: white;
content: "general";
text-transform: uppercase; text-transform: uppercase;
font-family: "Hubballi", sans-serif; font-family: "Hubballi", sans-serif;
} }
div.fic li.rating span.t::before { div.fic li.rating span.t {
background-color: #e8d405; background-color: #e8d405;
color: white; color: white;
content: "teen";
text-transform: uppercase; text-transform: uppercase;
font-family: "Hubballi", sans-serif; font-family: "Hubballi", sans-serif;
} }
div.fic li.rating span.m::before { div.fic li.rating span.m {
background-color: #eb7d10; background-color: #eb7d10;
color: white; color: white;
content: "mature";
text-transform: uppercase; text-transform: uppercase;
font-family: "Hubballi", sans-serif; font-family: "Hubballi", sans-serif;
} }
div.fic li.rating span.e::before { div.fic li.rating span.e {
background-color: #9c0000; background-color: #9c0000;
color: white; color: white;
content: "explicit";
text-transform: uppercase; text-transform: uppercase;
font-family: "Hubballi", sans-serif; font-family: "Hubballi", sans-serif;
} }
div.fic li.fandom::before { div.fic li.warnings i {
content:"Fandom: ";
font-style: italic;
}
div.fic li.characters::before {
content:"Characters: ";
font-style: italic;
}
div.fic li.genre::before {
content:"Genre: ";
font-style: italic;
}
div.fic li.warnings::before {
content:"Warnings: ";
font-style: italic;
color: #9c0000; color: #9c0000;
font-weight: bold; font-weight: bold;
} }
div.fic li.time::before {
content:"Point in canon: ";
font-style: italic;
}
div.fic li.location::before {
content:"Location: ";
font-style: italic;
}
div.fic p.summary::before {
content:"Summary: ";
font-style: italic;
}
div.fic p.note::before {
content:"Notes: ";
font-style: italic;
}
div.fic ul.ficlinks li a.locked::before { div.fic ul.ficlinks li a.locked::before {
content:"🔒"; content:"🔒";
} }
@ -377,22 +319,6 @@ span.pov, span.main, span.secondary, span.mention {
margin: 0 5px; margin: 0 5px;
} }
span.pov:before {
content: "POV: ";
}
span.main:before {
content: "main: ";
}
span.secondary:before {
content: "secondary: ";
}
span.mention:before {
content: "mentioned: ";
}
input#verifyage-checkbox { input#verifyage-checkbox {
display: inline; display: inline;
width: auto; width: auto;

@ -118,13 +118,13 @@ def charlist(local=False):
filewrite.write("<details><summary><span class=\"character " + cssgame + "\">" + character + "</span> ") filewrite.write("<details><summary><span class=\"character " + cssgame + "\">" + character + "</span> ")
# write statistics # write statistics
if len(povcount) > 0: if len(povcount) > 0:
filewrite.write("<span class=\"pov\">" + str(len(povcount)) + "</span>") filewrite.write("<span class=\"pov\">POV: " + str(len(povcount)) + "</span>")
if len(maincount) > 0: if len(maincount) > 0:
filewrite.write("<span class=\"main\">" + str(len(maincount)) + "</span>") filewrite.write("<span class=\"main\">main: " + str(len(maincount)) + "</span>")
if len(secondarycount) > 0: if len(secondarycount) > 0:
filewrite.write("<span class=\"secondary\">" + str(len(secondarycount)) + "</span>") filewrite.write("<span class=\"secondary\">secondary: " + str(len(secondarycount)) + "</span>")
if len(mentioncount) > 0: if len(mentioncount) > 0:
filewrite.write("<span class=\"mention\">" + str(len(mentioncount)) + "</span>") filewrite.write("<span class=\"mention\">mentioned: " + str(len(mentioncount)) + "</span>")
filewrite.write("</summary>\n") filewrite.write("</summary>\n")
filewrite.close() filewrite.close()
# write fic headers in each category # write fic headers in each category

@ -50,7 +50,7 @@ def ficgen(ficno,unique=False,output="output.html",local=False):
# give the div an id if requested # give the div an id if requested
if unique: if unique:
filewrite.write(" id=\"fic" + ficnostring + "\"") filewrite.write(" id=\"fic" + ficnostring + "\"")
filewrite.write(">\n<h1><span class=\"ficno\">" + ficnostring) filewrite.write(">\n<h1><span class=\"ficnoprelim\">no. </span><span class=\"ficno\">" + ficnostring)
# write ficno including translation if there is one # write ficno including translation if there is one
try: try:
filewrite.write("/" + translationstring) filewrite.write("/" + translationstring)
@ -73,8 +73,8 @@ def ficgen(ficno,unique=False,output="output.html",local=False):
except: except:
pass pass
if fileread.status == "abandoned": if fileread.status == "abandoned":
filewrite.write(" <span class=\"abandoned\"></span>") filewrite.write(" <span class=\"abandoned\"> (abandoned)</span>")
filewrite.write("</h1>\n<ul class=\"ficmeta\">\n<li class=\"ficdate\">") filewrite.write("</h1>\n<ul class=\"ficmeta\">\n<li class=\"ficdate\"><i>Date:</i> ")
# write date, date range if ranged or translation # write date, date range if ranged or translation
if fileread.status == "incomplete": if fileread.status == "incomplete":
filewrite.write((fileread.datewords[0])["date"].strftime("%-d %B %Y") + "") filewrite.write((fileread.datewords[0])["date"].strftime("%-d %B %Y") + "")
@ -112,7 +112,7 @@ def ficgen(ficno,unique=False,output="output.html",local=False):
sumwords = 0 sumwords = 0
for instalment in fileread.datewords: for instalment in fileread.datewords:
sumwords = sumwords + instalment["words"] sumwords = sumwords + instalment["words"]
filewrite.write("</li>\n<li class=\"wordcount\">" + str(sumwords)) filewrite.write("</li>\n<li class=\"wordcount\"><i>Wordcount:</i> " + str(sumwords))
transwords = 0 transwords = 0
try: try:
for instalment in transread.datewords: for instalment in transread.datewords:
@ -121,13 +121,22 @@ def ficgen(ficno,unique=False,output="output.html",local=False):
except: except:
pass pass
# write rating # write rating
filewrite.write("</li>\n<li class=\"rating\"><span class=\"" + fileread.rating + "\">") filewrite.write("</li>\n<li class=\"rating\"><i>Rating: </i><span class=\"" + fileread.rating + "\">")
if fileread.rating == "g":
filewrite.write("general")
elif fileread.rating == "t":
filewrite.write("teen")
elif fileread.rating == "m":
filewrite.write("mature")
elif fileread.rating == "e":
filewrite.write("explicit")
filewrite.write("</span>")
# write reason for rating if there is one # write reason for rating if there is one
try: try:
filewrite.write(" (" + fileread.ratingreason + ")") filewrite.write(" (" + fileread.ratingreason + ")")
except: except:
pass pass
filewrite.write("</span></li>\n<li class=\"fandom\">") filewrite.write("</span></li>\n<li class=\"fandom\"><i>Fandom: </i>")
# write fandom # write fandom
try: try:
filewrite.write(fileread.fandomtext) filewrite.write(fileread.fandomtext)
@ -136,10 +145,10 @@ def ficgen(ficno,unique=False,output="output.html",local=False):
filewrite.write("</li>\n") filewrite.write("</li>\n")
# write characters in pov, main, secondary categories, if they exist # write characters in pov, main, secondary categories, if they exist
try: try:
filewrite.write("<li class=\"characters\">" + fileread.charactertext + "</li>\n") filewrite.write("<li class=\"characters\"><i>Characters: </i>" + fileread.charactertext + "</li>\n")
except: except:
try: try:
filewrite.write("<li class=\"characters\">" + ", ".join(fileread.charpov)) filewrite.write("<li class=\"characters\"><i>Characters: </i>" + ", ".join(fileread.charpov))
try: try:
filewrite.write(", " + ", ".join(fileread.charmain)) filewrite.write(", " + ", ".join(fileread.charmain))
except: except:
@ -151,7 +160,7 @@ def ficgen(ficno,unique=False,output="output.html",local=False):
filewrite.write("</li>\n") filewrite.write("</li>\n")
except: except:
try: try:
filewrite.write("<li class=\"characters\">" + ", ".join(fileread.charmain)) filewrite.write("<li class=\"characters\"><i>Characters: </i>" + ", ".join(fileread.charmain))
try: try:
filewrite.write(", " + "<small>" + ", ".join(fileread.charsecondary) + "</small>") filewrite.write(", " + "<small>" + ", ".join(fileread.charsecondary) + "</small>")
except: except:
@ -163,23 +172,23 @@ def ficgen(ficno,unique=False,output="output.html",local=False):
except: except:
pass pass
# write genre # write genre
filewrite.write("<li class=\"genre\">" + ", ".join(fileread.genre) + "</li>\n") filewrite.write("<li class=\"genre\"><i>Genre: </i>" + ", ".join(fileread.genre) + "</li>\n")
# write warnings if they exist # write warnings if they exist
try: try:
filewrite.write("<li class=\"warnings\">" + fileread.warnings + "</li>\n") filewrite.write("<li class=\"warnings\"><i>Warnings: </i>" + fileread.warnings + "</li>\n")
except: except:
pass pass
# write point in canon if there is one # write point in canon if there is one
try: try:
filewrite.write("<li class=\"time\">" + fileread.time + "</li>\n") filewrite.write("<li class=\"time\"><i>Point in canon: </i>" + fileread.time + "</li>\n")
except: except:
pass pass
# write locations if there are any # write locations if there are any
try: try:
filewrite.write("<li class=\"location\">" + fileread.locationtext + "</li>\n") filewrite.write("<li class=\"location\"><i>Location: </i>" + fileread.locationtext + "</li>\n")
except: except:
try: try:
filewrite.write("<li class=\"location\">" + ", ".join(fileread.location) + "</li>\n") filewrite.write("<li class=\"location\"><i>Location: </i>" + ", ".join(fileread.location) + "</li>\n")
except: except:
pass pass
filewrite.write("</ul>\n") filewrite.write("</ul>\n")
@ -187,26 +196,26 @@ def ficgen(ficno,unique=False,output="output.html",local=False):
try: try:
if transread.language == "en": if transread.language == "en":
try: try:
filewrite.write("<p class=\"summary\">" + transread.summary) filewrite.write("<p class=\"summary\"><i>Summary: </i>" + transread.summary)
try: try:
filewrite.write(" " + fileread.summary + "</p>\n") filewrite.write(" " + fileread.summary + "</p>\n")
except: except:
filewrite.write("</p>\n") filewrite.write("</p>\n")
except: except:
try: try:
filewrite.write("<p class=\"summary\">" + fileread.summary + "</p>\n") filewrite.write("<p class=\"summary\"><i>Summary: </i>" + fileread.summary + "</p>\n")
except: except:
pass pass
elif transread.language == "fr": elif transread.language == "fr":
try: try:
filewrite.write("<p class=\"summary\">" + fileread.summary) filewrite.write("<p class=\"summary\"><i>Summary: </i>" + fileread.summary)
try: try:
filewrite.write(" " + transread.summary + "</p>\n") filewrite.write(" " + transread.summary + "</p>\n")
except: except:
filewrite.write("</p>\n") filewrite.write("</p>\n")
except: except:
try: try:
filewrite.write("<p class=\"summary\">" + transread.summary + "</p>\n") filewrite.write("<p class=\"summary\"><i>Summary: </i>" + transread.summary + "</p>\n")
except: except:
pass pass
except: except:
@ -221,14 +230,14 @@ def ficgen(ficno,unique=False,output="output.html",local=False):
juvenilia = False juvenilia = False
try: try:
if fileread.notes: if fileread.notes:
filewrite.write("<p class=\"note\">") filewrite.write("<p class=\"note\"><i>Notes: </i>")
except: except:
try: try:
if fileread.event: if fileread.event:
filewrite.write("<p class=\"note\">") filewrite.write("<p class=\"note\"><i>Notes: </i>")
except: except:
if juvenilia: if juvenilia:
filewrite.write("<p class=\"note\">") filewrite.write("<p class=\"note\"><i>Notes: </i>")
# if juvenilia, add age # if juvenilia, add age
if juvenilia: if juvenilia:
age = relativedelta((fileread.datewords[0])["date"], datetime.datetime(1993,6,28)).years age = relativedelta((fileread.datewords[0])["date"], datetime.datetime(1993,6,28)).years

Loading…
Cancel
Save