Next pass on Casper refactor

* New Helpers
* Updated Helpers
* New reponsive header styles
* New global blog icon
* Responsive styles adjustments
This commit is contained in:
John O'Nolan 2013-08-26 02:35:53 +02:00 committed by Hannah Wolfe
parent fa61f74ce9
commit 85b74ea393
5 changed files with 94 additions and 36 deletions

View file

@ -266,29 +266,30 @@ table.plain {
1. General 1. General
========================================================================== */ ========================================================================== */
#sitehead { #site-head {
position: relative; position: relative;
width: 100%; width: 100%;
height: 60%; height: 60%;
text-align: center; text-align: center;
color: #fff; color: #fff;
background: #909396 url(http://f.cl.ly/items/1N2205280l2u1l0h190o/bg.jpg) no-repeat center center; background: #303538 url(http://f.cl.ly/items/1N2205280l2u1l0h190o/bg.jpg) no-repeat center center;
background-size: cover; background-size: cover;
} }
.blog-icon { #blog-icon {
position: absolute; position: absolute;
top: 40px; top: 40px;
left: 40px; left: 40px;
z-index: 900;
border: #fff 3px solid; border: #fff 3px solid;
-webkit-border-radius: 100%; -webkit-border-radius: 100%;
-moz-border-radius: 100%; -moz-border-radius: 100%;
border-radius: 100%; border-radius: 100%;
overflow: hidden; overflow: hidden;
box-shadow: rgba(0,0,0,0.1) 0 1px 2px; background: #303538;
} }
.blog-icon img { #blog-icon img {
height: 80px; height: 80px;
width: auto; width: auto;
min-width: 80px; min-width: 80px;
@ -296,29 +297,28 @@ table.plain {
line-height: 0; line-height: 0;
} }
#sitehead .wrap { #site-head .wrap {
display: inline-block; display: inline-block;
position: absolute; position: absolute;
top: 50%; bottom: 40%;
left: 0; left: 0;
right: 0; right: 0;
margin-top: -100px; margin: 0 auto -60px auto;
width: 80%;
max-width: 700px;
} }
#sitehead h1 { .blog-title {
margin:0; margin: 0 0 10px 0;
font-size: 10rem; font-size: 7rem;
font-family: Lato, "Open Sans", sans-serif; letter-spacing: -3px;
font-weight: 100;
} }
#sitehead h2 { .blog-description {
font-size: 1.8rem; font-size: 2rem;
line-height: 1.5em; line-height: 1.5em;
font-weight: 300; font-weight: 300;
opacity: 0.6; opacity: 0.8;
max-width: 700px;
margin: 0 auto;
} }
.post-template .content { .post-template .content {
@ -330,7 +330,8 @@ table.plain {
width:80%; width:80%;
max-width: 700px; max-width: 700px;
border-bottom: #DDE6EB 1px solid; border-bottom: #DDE6EB 1px solid;
margin: 1.6em auto; margin: 3.2em auto;
padding-bottom: 1.6em;
word-break: break-word; word-break: break-word;
hyphens: auto; hyphens: auto;
} }
@ -484,7 +485,7 @@ table.plain {
@media only screen and (max-width: 900px) { @media only screen and (max-width: 900px) {
#sitehead { #site-head {
-webkit-box-sizing: border-box; -webkit-box-sizing: border-box;
-moz-box-sizing: border-box; -moz-box-sizing: border-box;
box-sizing: border-box; box-sizing: border-box;
@ -493,6 +494,30 @@ table.plain {
padding-top: 50%; padding-top: 50%;
} }
#site-head .wrap {
margin: 0 auto -50px auto;
}
#blog-icon {
left: 50%;
margin-left: -41px;
}
.home-template #blog-icon {
top: auto;
bottom: -41px;
}
.blog-title {
font-size: 5rem;
letter-spacing: -3px;
}
.blog-description {
font-size: 1.9rem;
line-height: 1.5em;
}
.post { .post {
font-size: 0.9em; font-size: 0.9em;
line-height: 1.6em; line-height: 1.6em;
@ -500,7 +525,10 @@ table.plain {
h1 { h1 {
font-size: 4.8rem; font-size: 4.8rem;
line-height: 1.2em; }
h2 {
font-size: 3.8rem;
} }
}/* max 900 */ }/* max 900 */
@ -516,8 +544,26 @@ table.plain {
line-height: 1.6em; line-height: 1.6em;
} }
#blog-icon {
h1 { }
#site-head .wrap {
margin: 0 16px -30px 16px;
width: auto;
}
.blog-title {
font-size: 3rem;
letter-spacing: 0;
}
.blog-description {
font-size: 1.5rem;
}
h1, h2 {
font-size: 3rem; font-size: 3rem;
line-height: 1.1em; line-height: 1.1em;
letter-spacing: 0; letter-spacing: 0;

View file

@ -1,5 +1,5 @@
/** /**
* Placeholder JS file for Casper behaviours * Main JS file for Casper behaviours
*/ */
/*globals jQuery, document */ /*globals jQuery, document */
@ -8,6 +8,11 @@
$(document).ready(function(){ $(document).ready(function(){
// On the home page, move the blog icon inside the header
// for better relative/absolute positioning.
$("#blog-icon").prependTo("#site-head");
}); });
}(jQuery)); }(jQuery));

View file

@ -16,13 +16,24 @@
{{! Styles'n'Scripts }} {{! Styles'n'Scripts }}
<link rel="stylesheet" type="text/css" href="assets/css/screen.css"> <link rel="stylesheet" type="text/css" href="assets/css/screen.css">
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Open+Sans:400italic,700,400"> <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Open+Sans:400italic,700,400">
{{! Ghost outputs important style and meta data with this tag }}
{{ghost_head}}
</head> </head>
<body class="{{bodyclass}}"> <body class="{{body_class}}">
<figure id="blog-icon">
<a href="/" title="Home">
<img src="http://f.cl.ly/items/1O1o3n05373h222G101k/gravatar-j7-100.jpg" alt="John" />
</a>
</figure>
{{! This is where shit gets real }} {{! This is where shit gets real }}
{{{body}}} {{{body}}}
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> {{! Ghost outputs important scripts and data with this tag }}
{{ghost_foot}}
<script type="text/javascript" src="assets/js/index.js"></script> <script type="text/javascript" src="assets/js/index.js"></script>
</body> </body>
</html> </html>

View file

@ -1,21 +1,17 @@
{{!< default}} {{!< default}}
<header id="sitehead"> <header id="site-head">
<figure class="blog-icon">
<img src="http://f.cl.ly/items/1O1o3n05373h222G101k/gravatar-j7-100.jpg" alt="John" />
</figure>
<div class="wrap"> <div class="wrap">
<h1>John O'Nolan</h1> <h1 class="blog-title">{{settings.title}}</h1>
<h2>A designer, developer and entrepreneur. Spends his time travelling the world with a bag of kites. Likes to write.</h2> <h2 class="blog-description">A designer, developer and entrepreneur. Spends his time travelling the world with a bag of kites. Likes journalism and publishing platforms.</h2>
</div> </div>
</header> </header>
<main class="content" role="main"> <main class="content" role="main">
{{#foreach posts}} {{#foreach posts}}
<article class="post"> <article class="{{post_class}}">
<header class="post-header"> <header class="post-header">
<h2 class="post-title"><a href="/{{slug}}">{{title}}</a></h2> <h2 class="post-title"><a href="/{{slug}}">{{title}}</a></h2>
<span class="post-meta"><time datetime="{{date published_at format='YYYY-MM-DD'}}">{{date published_at format='DD MMM YYYY'}}</time> in <a href="#">What I Learned Building...</a></span> <span class="post-meta"><time datetime="{{date published_at format='YYYY-MM-DD'}}">{{date published_at format='DD MMM YYYY'}}</time> in <a href="#">What I Learned Building...</a></span>

View file

@ -4,7 +4,7 @@
{{#post}} {{#post}}
<article class="post"> <article class="{{post_class}}">
<header class="post-header"> <header class="post-header">
<span class="post-meta"><a href="#">John O'Nolan</a> on <a href="#">What I Learned Building...</a></span> <span class="post-meta"><a href="#">John O'Nolan</a> on <a href="#">What I Learned Building...</a></span>