Initial commit
commit
0592ce320b
|
@ -0,0 +1,125 @@
|
|||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
|
||||
<head>
|
||||
<title>Dustin C. Hatch</title>
|
||||
<meta charset="UTF-8" />
|
||||
<link type="text/css" rel="stylesheet"
|
||||
href="//cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/css/foundation.min.css" />
|
||||
<style type="text/css">
|
||||
/* <![CDATA[ */
|
||||
body, html {
|
||||
background-color: #09192f;
|
||||
color: #ffffff;
|
||||
font-family: sans-serif;
|
||||
height: initial;
|
||||
}
|
||||
#main {
|
||||
margin: .5em;
|
||||
}
|
||||
#logo {
|
||||
text-align: center;
|
||||
}
|
||||
#logo img {
|
||||
display: none;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
blockquote#songquote {
|
||||
border: none !important;
|
||||
}
|
||||
blockquote, blockquote p {
|
||||
color: #ffffff;
|
||||
}
|
||||
#songquote {
|
||||
position: relative;
|
||||
}
|
||||
#songquote::before {
|
||||
color: #1b2f48;
|
||||
content: "♫";
|
||||
font-size: 250pt;
|
||||
line-height: 1;
|
||||
position: absolute;
|
||||
top: -75pt;
|
||||
z-index: 5;
|
||||
}
|
||||
#songquote .quote {
|
||||
font-size: 32pt;
|
||||
line-height: 1.2;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
text-shadow: 4px 4px 6px #000000;
|
||||
z-index: 10;
|
||||
}
|
||||
#songquote .citation::before {
|
||||
content: "—";
|
||||
}
|
||||
#songquote .citation {
|
||||
font-size: 18pt;
|
||||
margin-top: 1em;
|
||||
position: relative;
|
||||
text-align: right;
|
||||
z-index: 10;
|
||||
}
|
||||
#songquote .title {
|
||||
font-style: italic;
|
||||
}
|
||||
#songquote .artist {
|
||||
font-variant: small-caps;
|
||||
}
|
||||
@media only screen and (min-width: 640px) {
|
||||
#logo img {
|
||||
display: inline;
|
||||
max-height: 200px;
|
||||
}
|
||||
#songquote::before {
|
||||
font-size: 400pt;
|
||||
top: -100pt;
|
||||
}
|
||||
#songquote .quote {
|
||||
font-size: 48pt;
|
||||
}
|
||||
#songquote .citation {
|
||||
font-size: 20pt;
|
||||
}
|
||||
}
|
||||
@media only screen and (min-width: 1200px) {
|
||||
#logo img {
|
||||
max-height: 400px;
|
||||
}
|
||||
}
|
||||
@media only screen and (min-width: 1440px) {
|
||||
.row {
|
||||
max-width: 1600px;
|
||||
}
|
||||
#main {
|
||||
margin: 10% auto;
|
||||
}
|
||||
#songquote .quote {
|
||||
font-size: 60pt;
|
||||
}
|
||||
#songquote .citation {
|
||||
font-size: 32pt;
|
||||
}
|
||||
}
|
||||
/* ]]> */
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<section id="main" class="row">
|
||||
<div id="logo" class="large-4 columns"><img alt="D"
|
||||
src="//d2g89yxlcdy1r2.cloudfront.net/static/5b377b570198/static/images/D.svg" />
|
||||
</div>
|
||||
<blockquote id="songquote" class="large-8 columns">
|
||||
<p class="quote">{{ quote.quote }}</p>
|
||||
<p class="citation" title="{{ quote.album }} ({{ quote.year }})">
|
||||
<span class="title">{{ quote.title }}</span>
|
||||
by <span class="artist">{{ quote.artist }}</span>
|
||||
</p>
|
||||
</blockquote>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -0,0 +1,56 @@
|
|||
from milla.dispatch import routing
|
||||
from webob import acceptparse
|
||||
import jinja2
|
||||
import milla
|
||||
import os
|
||||
import random
|
||||
import yaml
|
||||
|
||||
|
||||
OFFERS = [
|
||||
'application/xhtml+xml',
|
||||
'text/html',
|
||||
]
|
||||
|
||||
|
||||
try:
|
||||
YamlLoader = yaml.CLoader
|
||||
except AttributeError:
|
||||
YamlLoader = yaml.Loader
|
||||
|
||||
|
||||
env = jinja2.Environment(
|
||||
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)),
|
||||
)
|
||||
|
||||
|
||||
with open(os.path.join(os.path.dirname(__file__), 'songquotes.yml')) as f:
|
||||
songquotes = yaml.load(f, Loader=YamlLoader)
|
||||
|
||||
|
||||
def home(request):
|
||||
response = request.ResponseClass()
|
||||
accept = acceptparse.MIMEAccept(
|
||||
request.accept.header_value.replace('*/*', '')
|
||||
)
|
||||
response.content_type = accept.best_match(OFFERS,
|
||||
response.default_content_type)
|
||||
tmpl = env.get_template('index.html')
|
||||
response.text = tmpl.render(quote=random.choice(songquotes))
|
||||
return response
|
||||
|
||||
|
||||
router = routing.Router()
|
||||
router.add_route('/', home)
|
||||
application = milla.Application(router)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
from wsgiref import simple_server
|
||||
httpd = simple_server.make_server('', 8080, application)
|
||||
try:
|
||||
httpd.serve_forever()
|
||||
except KeyboardInterrupt:
|
||||
print('')
|
||||
httpd.shutdown()
|
||||
httpd.server_close()
|
|
@ -0,0 +1,40 @@
|
|||
- quote: I was given the seal and the key, and I will keep it until I die
|
||||
title: A Prophecy of Worlds to Fall
|
||||
artist: Xandria
|
||||
album: Neverworld's End
|
||||
year: 2012
|
||||
- quote: From ashes we were born, in silence we unite
|
||||
title: Wander
|
||||
artist: Kamelot
|
||||
album: Epica
|
||||
year: 2003
|
||||
- quote: It's hard to light a candle, easy to curse the dark instead
|
||||
title: Last Ride of the Day
|
||||
artist: Nightwish
|
||||
album: Imaginaerum
|
||||
year: 2012
|
||||
- quote: The truth will appear, forever I'm there for you and sing…
|
||||
title: Sacrimony
|
||||
artist: Kamelot
|
||||
album: Silverthorn
|
||||
year: 2012
|
||||
- quote: …The end of all they scare us with will be a million empty brains…
|
||||
title: The Seven Angels
|
||||
artist: Avantasia
|
||||
album: The Metal Opera Part II
|
||||
year: 2002
|
||||
- quote: Wide open minds will divine without reason
|
||||
title: Spectres
|
||||
artist: Avantasia
|
||||
album: The Mystery of Time
|
||||
year: 2013
|
||||
- quote: How come I want you, like the soil yearns for the rain
|
||||
title: EdenEcho
|
||||
artist: Kamelot
|
||||
album: Ghost Opera
|
||||
year: 2007
|
||||
- quote: Grant me just one look into the mystery behind
|
||||
title: The Great Mystery
|
||||
artist: Avantasia
|
||||
album: The Mystery of Time
|
||||
year: 2013
|
Loading…
Reference in New Issue