Fixed the things I broke

missing styling moved from example files back to source code
This commit is contained in:
reimannsum 2016-06-13 19:47:13 -04:00
parent c24d2e31c2
commit fcba310d74
3 changed files with 12 additions and 13 deletions

View File

@ -69,9 +69,9 @@ def main(fname, oname = None, verbose = True, encoding = 'std',
namestr = '' namestr = ''
if for_html: if for_html:
if code: if code:
namestr = ('<div class="hover_img"><a href="http://magiccards.info/scans/en/' + code + '">' + truename namestr = ('<div class="hover_img"><a href="#">' + truename
+ '</a><span><img style="background: url(http://magiccards.info/scans/en/' + code + '<span><img style="background: url(http://magiccards.info/scans/en/' + code
+ ');" alt="image"/></span>' + ': ' + str(dist) + '</div>') + ');" alt=""/></span></a>' + ': ' + str(dist) + '\n</div>\n')
else: else:
namestr = '<div>' + truename + ': ' + str(dist) + '</div>' namestr = '<div>' + truename + ': ' + str(dist) + '</div>'
elif for_forum: elif for_forum:
@ -116,6 +116,8 @@ def main(fname, oname = None, verbose = True, encoding = 'std',
nearest = card.nearest_cards nearest = card.nearest_cards
for dist, cardname in nearest: for dist, cardname in nearest:
cstring += hoverimg(cardname, dist, namediff) cstring += hoverimg(cardname, dist, namediff)
if for_html:
cstring += "<br>\n"
cstring += '~~ closest names ~~\n' cstring += '~~ closest names ~~\n'
if for_html: if for_html:
cstring += "<br>\n" cstring += "<br>\n"
@ -123,7 +125,7 @@ def main(fname, oname = None, verbose = True, encoding = 'std',
for dist, cardname in nearest: for dist, cardname in nearest:
cstring += hoverimg(cardname, dist, namediff) cstring += hoverimg(cardname, dist, namediff)
if for_html: if for_html:
cstring = '<hr><div>' + cstring.replace('\n', '<br>\n') + '</div>\n</div>' cstring = '<hr><div>' + cstring + '</div>\n</div>'
elif for_mse: elif for_mse:
cstring = ('\n\n' + cstring[:-1]).replace('\n', '\n\t\t') cstring = ('\n\n' + cstring[:-1]).replace('\n', '\n\t\t')

View File

@ -745,9 +745,9 @@ class Card:
if for_html and for_forum: if for_html and for_forum:
#force for_html to false to create tootip with forum spoiler #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>') + 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 outstr += linebreak

View File

@ -11,8 +11,7 @@ html_prepend = """<!DOCTYPE html>
} }
div.hover_img { div.hover_img {
position: relative; position: relative;
left: 45%; display:inline-block;
display:inline;
} }
.hover_img a { .hover_img a {
position: relative; position: relative;
@ -23,18 +22,16 @@ html_prepend = """<!DOCTYPE html>
display: none; display: none;
z-index: 99; z-index: 99;
} }
.hover_img span:hover { .hover_img:hover span {
display:block; display:inline-block;
} }
.hover_img span p { .hover_img span p {
padding: 10px;
width:250px; width:250px;
background:#FFFF99; background:#FFFF99;
} }
.hover_img a:hover span {
display: block;
}
.hover_img img { .hover_img img {
height: 445px; height: 445px;
width: 312px; width: 312px;