web design refresh

This commit is contained in:
Micah Lee 2014-05-22 19:38:14 -04:00
parent 4c56c490dd
commit b64458498d
2 changed files with 75 additions and 2 deletions

72
index.html Normal file
View File

@ -0,0 +1,72 @@
<html>
<head>
<title>OnionShare</title>
<style type="text/css">
body {
background-color: #222222;
color: #ffffff;
text-align: center;
font-family: arial;
padding: 5em 1em;
}
.metadata {
position: absolute;
bottom: 0;
color: #999999;
text-align: left;
}
.button {
-moz-box-shadow:inset 0px 1px 0px 0px #cae3fc;
-webkit-box-shadow:inset 0px 1px 0px 0px #cae3fc;
box-shadow:inset 0px 1px 0px 0px #cae3fc;
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #79bbff), color-stop(1, #4197ee) );
background:-moz-linear-gradient( center top, #79bbff 5%, #4197ee 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#79bbff', endColorstr='#4197ee');
background-color:#79bbff;
-webkit-border-top-left-radius:12px;
-moz-border-radius-topleft:12px;
border-top-left-radius:12px;
-webkit-border-top-right-radius:12px;
-moz-border-radius-topright:12px;
border-top-right-radius:12px;
-webkit-border-bottom-right-radius:12px;
-moz-border-radius-bottomright:12px;
border-bottom-right-radius:12px;
-webkit-border-bottom-left-radius:12px;
-moz-border-radius-bottomleft:12px;
border-bottom-left-radius:12px;
text-indent:0;
border:1px solid #469df5;
display:inline-block;
color:#ffffff;
font-family:Arial;
font-size:29px;
font-weight:bold;
font-style:normal;
height:50px;
line-height:50px;
text-decoration:none;
text-align:center;
text-shadow:1px 1px 0px #287ace;
padding: 0 20px;
}
.button:hover {
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #4197ee), color-stop(1, #79bbff) );
background:-moz-linear-gradient( center top, #4197ee 5%, #79bbff 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4197ee', endColorstr='#79bbff');
background-color:#4197ee;
}.button:active {
position:relative;
top:1px;
}
</style>
</head>
<body>
<p><a class="button" href='/{{ slug }}/download'>{{ filename }} &#x25BC;</a></p>
<div class="metadata">
<p>File size: <strong>{{ filesize }} bytes</strong></p>
<p>SHA1 checksum: <strong>{{ filehash }}</strong></p>
</div>
</body>
</html>

View File

@ -9,7 +9,7 @@ sys.path.append(os.path.dirname(__file__)+'/lib')
from stem.control import Controller
from stem import SocketError
from flask import Flask, Markup, Response, request, make_response, send_from_directory
from flask import Flask, Markup, Response, request, make_response, send_from_directory, render_template_string
app = Flask(__name__)
# generate an unguessable string
@ -21,7 +21,8 @@ filename = filehash = filesize = ''
@app.route("/{0}".format(slug))
def index():
global filename, filesize, filehash, slug
return "<html><head><title>OnionShare</title><style>body {{ background-color: #222222; color: #ffffff; text-align: center; font-family: arial; padding: 5em; }} a {{ color: #ffee00; text-decoration: none; }} a:hover{{ text-decoration: underline; }}</style></head><body><h1><a href='/{0}/download'>{1}</a></h1><p>SHA1 checksum: <strong>{2}</strong><br/>File size: <strong>{3} bytes</strong></p></body></html>".format(slug, os.path.basename(filename), filehash, filesize)
return render_template_string(open('{0}/index.html'.format(os.path.dirname(__file__))).read(),
slug=slug, filename=os.path.basename(filename), filehash=filehash, filesize=filesize)
@app.route("/{0}/download".format(slug))
def download():