Fixed the things I broke
missing styling moved from example files back to source code
This commit is contained in:
parent
c24d2e31c2
commit
fcba310d74
3 changed files with 12 additions and 13 deletions
10
decode.py
10
decode.py
|
@ -69,9 +69,9 @@ def main(fname, oname = None, verbose = True, encoding = 'std',
|
|||
namestr = ''
|
||||
if for_html:
|
||||
if code:
|
||||
namestr = ('<div class="hover_img"><a href="http://magiccards.info/scans/en/' + code + '">' + truename
|
||||
+ '</a><span><img style="background: url(http://magiccards.info/scans/en/' + code
|
||||
+ ');" alt="image"/></span>' + ': ' + str(dist) + '</div>')
|
||||
namestr = ('<div class="hover_img"><a href="#">' + truename
|
||||
+ '<span><img style="background: url(http://magiccards.info/scans/en/' + code
|
||||
+ ');" alt=""/></span></a>' + ': ' + str(dist) + '\n</div>\n')
|
||||
else:
|
||||
namestr = '<div>' + truename + ': ' + str(dist) + '</div>'
|
||||
elif for_forum:
|
||||
|
@ -116,6 +116,8 @@ def main(fname, oname = None, verbose = True, encoding = 'std',
|
|||
nearest = card.nearest_cards
|
||||
for dist, cardname in nearest:
|
||||
cstring += hoverimg(cardname, dist, namediff)
|
||||
if for_html:
|
||||
cstring += "<br>\n"
|
||||
cstring += '~~ closest names ~~\n'
|
||||
if for_html:
|
||||
cstring += "<br>\n"
|
||||
|
@ -123,7 +125,7 @@ def main(fname, oname = None, verbose = True, encoding = 'std',
|
|||
for dist, cardname in nearest:
|
||||
cstring += hoverimg(cardname, dist, namediff)
|
||||
if for_html:
|
||||
cstring = '<hr><div>' + cstring.replace('\n', '<br>\n') + '</div>\n</div>'
|
||||
cstring = '<hr><div>' + cstring + '</div>\n</div>'
|
||||
elif for_mse:
|
||||
cstring = ('\n\n' + cstring[:-1]).replace('\n', '\n\t\t')
|
||||
|
||||
|
|
|
@ -745,9 +745,9 @@ class Card:
|
|||
|
||||
if for_html and for_forum:
|
||||
#force for_html to false to create tootip with forum spoiler
|
||||
outstr += ('<div class="hover_img"><a href="#">[F] <span><p>'
|
||||
outstr += ('<div class="hover_img"><a href="#">[F]</a> <span><p>'
|
||||
+ self.format(gatherer=gatherer, for_forum=for_forum, for_html=False, vdump=vdump).replace('\n', '<br>')
|
||||
+ '</p></span></a></div>')
|
||||
+ '</p></span></div>')
|
||||
|
||||
outstr += linebreak
|
||||
|
||||
|
|
|
@ -11,8 +11,7 @@ html_prepend = """<!DOCTYPE html>
|
|||
}
|
||||
div.hover_img {
|
||||
position: relative;
|
||||
left: 45%;
|
||||
display:inline;
|
||||
display:inline-block;
|
||||
}
|
||||
.hover_img a {
|
||||
position: relative;
|
||||
|
@ -23,18 +22,16 @@ html_prepend = """<!DOCTYPE html>
|
|||
display: none;
|
||||
z-index: 99;
|
||||
}
|
||||
.hover_img span:hover {
|
||||
display:block;
|
||||
.hover_img:hover span {
|
||||
display:inline-block;
|
||||
}
|
||||
|
||||
.hover_img span p {
|
||||
padding: 10px;
|
||||
width:250px;
|
||||
background:#FFFF99;
|
||||
}
|
||||
|
||||
.hover_img a:hover span {
|
||||
display: block;
|
||||
}
|
||||
.hover_img img {
|
||||
height: 445px;
|
||||
width: 312px;
|
||||
|
|
Loading…
Reference in a new issue