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;
}
div.fic h1 span.ficno::before {
div.fic h1 span.ficnoprelim {
font-weight: normal;
font-style: italic;
content: "no. ";
font-size: 0.6em;
}
div.fic h1 span.abandoned::before {
content: " (abandoned)";
div.fic h1 span.abandoned {
font-weight: normal;
background-color: #9c0000;
color: white;
@ -96,95 +94,39 @@ div.fic ul.ficlinks li, div.fic ul.ficmeta li {
list-style: none;
}
div.fic li.ficdate::before {
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 {
div.fic li.rating span.g {
background-color: #8ab60b;
color: white;
content: "general";
text-transform: uppercase;
font-family: "Hubballi", sans-serif;
}
div.fic li.rating span.t::before {
div.fic li.rating span.t {
background-color: #e8d405;
color: white;
content: "teen";
text-transform: uppercase;
font-family: "Hubballi", sans-serif;
}
div.fic li.rating span.m::before {
div.fic li.rating span.m {
background-color: #eb7d10;
color: white;
content: "mature";
text-transform: uppercase;
font-family: "Hubballi", sans-serif;
}
div.fic li.rating span.e::before {
div.fic li.rating span.e {
background-color: #9c0000;
color: white;
content: "explicit";
text-transform: uppercase;
font-family: "Hubballi", sans-serif;
}
div.fic li.fandom::before {
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;
div.fic li.warnings i {
color: #9c0000;
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 {
content:"🔒";
}
@ -377,22 +319,6 @@ span.pov, span.main, span.secondary, span.mention {
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 {
display: inline;
width: auto;

@ -118,13 +118,13 @@ def charlist(local=False):
filewrite.write("<details><summary><span class=\"character " + cssgame + "\">" + character + "</span> ")
# write statistics
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:
filewrite.write("<span class=\"main\">" + str(len(maincount)) + "</span>")
filewrite.write("<span class=\"main\">main: " + str(len(maincount)) + "</span>")
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:
filewrite.write("<span class=\"mention\">" + str(len(mentioncount)) + "</span>")
filewrite.write("<span class=\"mention\">mentioned: " + str(len(mentioncount)) + "</span>")
filewrite.write("</summary>\n")
filewrite.close()
# 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
if unique:
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
try:
filewrite.write("/" + translationstring)
@ -73,8 +73,8 @@ def ficgen(ficno,unique=False,output="output.html",local=False):
except:
pass
if fileread.status == "abandoned":
filewrite.write(" <span class=\"abandoned\"></span>")
filewrite.write("</h1>\n<ul class=\"ficmeta\">\n<li class=\"ficdate\">")
filewrite.write(" <span class=\"abandoned\"> (abandoned)</span>")
filewrite.write("</h1>\n<ul class=\"ficmeta\">\n<li class=\"ficdate\"><i>Date:</i> ")
# write date, date range if ranged or translation
if fileread.status == "incomplete":
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
for instalment in fileread.datewords:
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
try:
for instalment in transread.datewords:
@ -121,13 +121,22 @@ def ficgen(ficno,unique=False,output="output.html",local=False):
except:
pass
# 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
try:
filewrite.write(" (" + fileread.ratingreason + ")")
except:
pass
filewrite.write("</span></li>\n<li class=\"fandom\">")
filewrite.write("</span></li>\n<li class=\"fandom\"><i>Fandom: </i>")
# write fandom
try:
filewrite.write(fileread.fandomtext)
@ -136,10 +145,10 @@ def ficgen(ficno,unique=False,output="output.html",local=False):
filewrite.write("</li>\n")
# write characters in pov, main, secondary categories, if they exist
try:
filewrite.write("<li class=\"characters\">" + fileread.charactertext + "</li>\n")
filewrite.write("<li class=\"characters\"><i>Characters: </i>" + fileread.charactertext + "</li>\n")
except:
try:
filewrite.write("<li class=\"characters\">" + ", ".join(fileread.charpov))
filewrite.write("<li class=\"characters\"><i>Characters: </i>" + ", ".join(fileread.charpov))
try:
filewrite.write(", " + ", ".join(fileread.charmain))
except:
@ -151,7 +160,7 @@ def ficgen(ficno,unique=False,output="output.html",local=False):
filewrite.write("</li>\n")
except:
try:
filewrite.write("<li class=\"characters\">" + ", ".join(fileread.charmain))
filewrite.write("<li class=\"characters\"><i>Characters: </i>" + ", ".join(fileread.charmain))
try:
filewrite.write(", " + "<small>" + ", ".join(fileread.charsecondary) + "</small>")
except:
@ -163,23 +172,23 @@ def ficgen(ficno,unique=False,output="output.html",local=False):
except:
pass
# 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
try:
filewrite.write("<li class=\"warnings\">" + fileread.warnings + "</li>\n")
filewrite.write("<li class=\"warnings\"><i>Warnings: </i>" + fileread.warnings + "</li>\n")
except:
pass
# write point in canon if there is one
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:
pass
# write locations if there are any
try:
filewrite.write("<li class=\"location\">" + fileread.locationtext + "</li>\n")
filewrite.write("<li class=\"location\"><i>Location: </i>" + fileread.locationtext + "</li>\n")
except:
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:
pass
filewrite.write("</ul>\n")
@ -187,26 +196,26 @@ def ficgen(ficno,unique=False,output="output.html",local=False):
try:
if transread.language == "en":
try:
filewrite.write("<p class=\"summary\">" + transread.summary)
filewrite.write("<p class=\"summary\"><i>Summary: </i>" + transread.summary)
try:
filewrite.write(" " + fileread.summary + "</p>\n")
except:
filewrite.write("</p>\n")
except:
try:
filewrite.write("<p class=\"summary\">" + fileread.summary + "</p>\n")
filewrite.write("<p class=\"summary\"><i>Summary: </i>" + fileread.summary + "</p>\n")
except:
pass
elif transread.language == "fr":
try:
filewrite.write("<p class=\"summary\">" + fileread.summary)
filewrite.write("<p class=\"summary\"><i>Summary: </i>" + fileread.summary)
try:
filewrite.write(" " + transread.summary + "</p>\n")
except:
filewrite.write("</p>\n")
except:
try:
filewrite.write("<p class=\"summary\">" + transread.summary + "</p>\n")
filewrite.write("<p class=\"summary\"><i>Summary: </i>" + transread.summary + "</p>\n")
except:
pass
except:
@ -221,14 +230,14 @@ def ficgen(ficno,unique=False,output="output.html",local=False):
juvenilia = False
try:
if fileread.notes:
filewrite.write("<p class=\"note\">")
filewrite.write("<p class=\"note\"><i>Notes: </i>")
except:
try:
if fileread.event:
filewrite.write("<p class=\"note\">")
filewrite.write("<p class=\"note\"><i>Notes: </i>")
except:
if juvenilia:
filewrite.write("<p class=\"note\">")
filewrite.write("<p class=\"note\"><i>Notes: </i>")
# if juvenilia, add age
if juvenilia:
age = relativedelta((fileread.datewords[0])["date"], datetime.datetime(1993,6,28)).years

Loading…
Cancel
Save