Permalink
Browse files

Portfolio stuff

  • Loading branch information...
1 parent 927d3b5 commit c020156804b65e91a597c6e3ea5ac53afb5a523f @gkoberger committed Apr 24, 2012
View
@@ -92,15 +92,21 @@ def render_notepad(file, args={}, output=None):
return get_template(('notepad_src', file), args=args, output=out_file)
def render_portfolio(file, args={}, output=None):
- if 'template' not in args:
- args['template'] = get_template('notepad_full.html', render=False)
+ #if 'template' not in args:
+ # args['template'] = get_template('notepad_full.html', render=False)
out_file = None
if output:
out_file = re.sub('^/?[-0-9]{11}', '', output)
- out_file = '%s/portfolio/%s' % (FOLDER_TEMP, out_file)
+ out_file = '%s/portfolio/%s.html' % (FOLDER_TEMP, out_file)
+
+ # Move assets
+ template_name = output
+ if os.path.exists('portfolio_src/%s' % template_name):
+ shutil.copytree('portfolio_src/%s' % template_name,
+ '%s/portfolio/%s' % (FOLDER_TEMP, template_name))
- return get_template(('portfolio_src', file), args=args, output=out_file)
+ return get_template(('portfolio_src/%s' % file[0], file[1]), args=args, output=out_file)
def generate_bitly(url):
settings = {}
@@ -139,9 +145,9 @@ def footnoter(value):
value = value + ("<ol class='footnotes'>%s</ol>" % '\n'.join(fns))
return value
-def namespacer(value, namespace, f):
+def namespacer(value, namespace, f, section="magazine"):
value = re.sub('#namespace', '#%s' % namespace, value)
- value = re.sub('assets/', 'magazine/%s/' % f.split('.')[0], value)
+ value = re.sub('assets/', '%s/%s/' % (section, f.split('.')[0]), value)
return value
def escaper(text):
@@ -187,10 +193,10 @@ def get_list_weight(*folders):
for folder in folders:
to_compile = os.listdir(folder)
to_compile = [f for f in to_compile
- if re.match("\d+-(.*).html", f)]
+ if re.match("\d+-(.*)(.html)?", f)]
for f in to_compile:
- d = re.search('(\d+)-(.*).html', f)
+ d = re.search('(\d+)-(.*)(.html)?', f)
slug = d.group(2)
return_list.append({'weight': int(d.group(1)), 'slug':slug, 'filename':f,
'folder': folder})
@@ -366,14 +372,17 @@ def compile_portfolio():
args['page'] = 'portfolio'
args['template'] = template_full
- render_portfolio(portfolio['filename'], args, portfolio['filename'])
+ render_portfolio((portfolio['filename'], "index.html"), args, portfolio['filename'])
#get_template('portfolio.html', args={'notes': notes, 'page': 'notebook'}, output='%s/notepad.html' % FOLDER_TEMP)
-def get_template(template, args={}, output=None, render=True):
+def get_template(template, args={}, output=None, render=True, stop=False):
loader = False
template_file = False
+ if stop:
+ import pdb; pdb.set_trace()
+
if isinstance(template, tuple):
loader = FileSystemLoader('%s/' % template[0])
template_file = template[1]
View
@@ -1378,11 +1378,22 @@ display: block; font-size: 38px; float: left; text-align: left; padding-right: 1
overflow: hidden;
}
+#work #work-head {
+ text-align: center;
+ margin-bottom: 2em;
+}
+
+#work h3.title {
+ display: none;
+}
+
#work #work-info {
box-shadow: 14px 0 17px -21px #888888;
- float: left;
- padding-right: 40px;
- width: 350px;
+ padding: 30px 40px 0 20px;
+ width: 300px;
+
+ display: table-cell;
+ vertical-align: top;
}
#work .work-block {
@@ -1395,16 +1406,54 @@ display: block; font-size: 38px; float: left; text-align: left; padding-right: 1
margin-bottom: 5px;
}
+#work .work-block a {
+ text-decoration: none;
+}
+#work .work-block a:hover {
+ text-decoration: underline;
+}
+
+#work a.go {
+ display: block;
+ background-color: #ddd;
+ font-size: 1.2em;
+ font-weight: bold;
+ text-align: center;
+ padding: 10px;
+ color: #fff !important;
+ text-decoration: none;
+ border-radius: 5px;
+}
+#work a.go:hover {
+ opacity: 0.9;
+ text-decoration: none;
+}
+#work a.go:active {
+ position: relative;
+ top: 2px;
+}
+
#work .work-block p {
color: #777777;
line-height: 1.6em;
margin-bottom: 1em;
}
#work #work-media {
- float: left;
- padding: 30px;
- width: 620px;
+ padding: 30px 20px 30px 40px;
+ width: 690px;
+
+ display: table-cell;
+ vertical-align: top;
+}
+#work #work-media .col {
+ display: table-cell;
+ width: 50%;
+ vertical-align: top;
+ padding-left: 20px;
+}
+#work #work-media .col:first-child {
+ padding-left: 0px;
}
#work #work-media a {
@@ -1416,34 +1465,43 @@ display: block; font-size: 38px; float: left; text-align: left; padding-right: 1
background-color: #FFF;
border-radius: 3px;
box-shadow: 0 0 10px #BBBBBB;
- margin: 5px;
padding: 5px;
}
-#work #work-media a figure div {
- padding: 4px;
+#work #work-media a img {
+ box-shadow: 0 0 10px #BBBBBB;
+ width: 100%;
+ display: block;
+
+ /*
+ -moz-transition: all 0.3s ease-out;
+ -webkit-transition: all 0.3s ease-out;
+ transition: all 0.3s ease-out;
+ */
+
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
+ -ms-box-sizing: border-box;
box-sizing: border-box;
- -moz-transition: all 0.3s ease;
- -webkit-transition: all 0.3s ease;
}
-#work #work-media a:hover figure div {
- padding: 0;
-}
-
-#work #work-media a img {
- border-radius: 3px;
- box-shadow: 0 0 10px #BBBBBB;
- width: 100%;
- display: block;
- -moz-transition: box-shadow 0.3s ease;
- -webkit-transition: box-shadow 0.3s ease;
+#work #work-media a img.noshadow,
+#work #work-media a:hover img.noshadow {
+ -moz-box-shadow: 0 0;
+ -webkit-box-shadow: 0 0;
+ box-shadow: 0 0;
}
#work #work-media a:hover img {
+ -moz-box-shadow: 0 0 15px #AAA;
+ -webkit-box-shadow: 0 0 15px #AAA;
box-shadow: 0 0 15px #AAA;
+
+ /*
+ -moz-transform: scale(1.01);
+ -webkit-transform: scale(1.01);
+ transform: scale(1.01);
+ */
}
#work #work-media figcaption {
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,68 @@
+{% extends template %}
+{% block title %}Stop SOPA{% endblock %}
+{% block date %}November 2011{% endblock %}
+{% block color %}#444{% endblock %}
+{% block url %}http://mozilla.org/sopa{% endblock %}
+
+{% block description %}
+<p>The night before the first Congressional SOPA hearing, Mozilla Webdev decided to do something to show our opposition to the act. We decided to add a snippet
+to Firefox's about:home, which would be seen by 400 million people over the next 24 hours. The only problem was we had nowhere to point people to for more
+information. SOPA was still pretty new, and we didn't know any sites that could handle the millions of hits we were about to pump their way.</p>
+<p>So, I suggested Mozilla make our own SOPA page that explained why we were against it. I wrote and designed the site in Photoshop, while <a
+ href="http://potch.me">Potch</a> sat next to me and wrote the HTML in realtime. Given the time constraints, we could only
+push one file &mdash; so the CSS was inline and the images were all data urls. A few hours later, we had it &mdash; a website explaining Mozilla's position on
+Internet blacklist legislation.</p>
+<p>The site went over so well, Mozilla decided to replace its homepage with it for the Internet-wide SOPA blackout that took place on January 18th, 2012.</p>
+{% endblock %}
+
+{% block media %}
+<a href="#">
+ <figure>
+ <img class="border" src="/assets/website.png">
+ <figcaption>Help Mozilla protect the Internet</figcaption>
+ </figure>
+</a>
+
+<div>
+ <div class="col">
+ <a href="#">
+ <figure>
+ <img src="../assets/nytimes.png" class="border">
+ <figcaption>The NY Times Homepage (Jan 18th, 2012)</figcaption>
+ </figure>
+ </a>
+ </div>
+
+ <div class="col">
+ <a href="#">
+ <figure>
+ <img src="../assets/nbc.png" class="border">
+ <figcaption>Mozilla CEO Gary Kovacs on NBC</figcaption>
+ </figure>
+ </a>
+ </div>
+</div>
+{% endblock %}
+
+{% block more %}
+<div class="work-block work-block-side i-did">
+ <h4 class="title">What I Did</h4>
+ <ul>
+ <li>Design</li>
+ <li>Copywriting</li>
+ </ul>
+</div>
+<div class="work-block work-block-side i-did">
+ <h4 class="title">More Links</h4>
+ <ul>
+ <li><a href="https://github.com/potch/stopsopa">Code on GitHub</a></li>
+ </ul>
+</div>
+<div class="work-block work-block-side">
+ <h4 class="title">Co-Conspirators</h4>
+ <ul>
+ <li><a href="http://potch.me" target="_new">Matthew Claypotch</a></li>
+ <li><a href="http://webdev.mozilla.org" target="_new">Mozilla WebDev</a></li>
+ </ul>
+</div>
+{% endblock %}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -1,40 +0,0 @@
-{% extends template %}
-{% block title %}Offbeat Guides{% endblock %}
-{% block date %}Spring 2010 - August 2011{% endblock %}
-{% block description %}
-<p>Offbeat Guides lets you create personalized, printed travel guides. I became the main developer of the website, which was built on PHP and mySQL. It uses CodeIgniter for a PHP framework, and jQuery for it's JavaScript framework.</p>
-{% endblock %}
-
-{% block media %}
-<a href="#">
-<figure>
- <div style="height:300px;width:620px">
- <img src="http://f.cl.ly/items/1z1D4135111w162j1r0k/Screen%20Shot%202012-01-01%20at%2010.08.13%20PM.png">
- </div>
- <figcaption>This is a test!</figcaption>
-</figure>
-</a>
-<figure>
- <div class="border" style="height:225px;width:400px;">
- <iframe src="http://player.vimeo.com/video/11464259?title=0&amp;byline=0&amp;portrait=0" width="400" height="225" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
- </div>
- <figcaption>Awesome video!</figcaption>
-</figure>
-{% endblock %}
-
-{% block more %}
- <div class="work-block work-block-side">
- <h4 class="title">More Links</h4>
- <ul>
- <li><a href="#">Techcrunch Article</a></li>
- <li><a href="#">GigaOM Article</a></li>
- </ul>
- </div>
- <div class="work-block work-block-side">
- <h4 class="title">Crafted With</h4>
- <ul>
- <li><a href="#">Popcorn.js</a></li>
- <li><a href="#">jQuery</a></li>
- </ul>
- </div>
-{% endblock %}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.

0 comments on commit c020156

Please sign in to comment.