Compare commits

..

5 Commits
2.2.0 ... 2.2.1

14 changed files with 185 additions and 264 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -13,6 +13,8 @@ production stylesheet in assets/built/screen.css
7. Single Post 7. Single Post
7.1. Subscribe Form 7.1. Subscribe Form
7.2. Post Footer 7.2. Post Footer
7.2.1 Single Author Byline
7.2.2 Multiple Author Byline
7.3. Comments 7.3. Comments
7.4. Related Posts 7.4. Related Posts
7.5. Floating Header 7.5. Floating Header
@ -455,38 +457,13 @@ The knock-on effect of this is ugly browser-scroll bars at the bottom, so 80px o
.post-card-meta { .post-card-meta {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: flex-end;
padding: 0 25px 25px; padding: 0 25px 25px;
} }
.profile-image-wrapper,
.avatar-wrapper {
position: absolute;
display: inline-block;
width: 28px;
}
.avatar-wrapper {
display: inline-block;
box-sizing: content-box;
margin-right: 3px;
border: 2px solid #fff;
text-align: center;
background-color: color(var(--lightgrey) l(+10%));
border-radius: 100%;
}
.avatar-wrapper svg {
width: 28px;
height: 28px;
}
.author-profile-image { .author-profile-image {
box-sizing: content-box; display: block;
margin-right: 5px; background: color(var(--lightgrey) l(+10%));
width: 28px;
height: 28px;
border: 2px solid #fff;
border-radius: 100%; border-radius: 100%;
object-fit: cover; object-fit: cover;
@ -499,75 +476,61 @@ The knock-on effect of this is ugly browser-scroll bars at the bottom, so 80px o
.author-list { .author-list {
display: flex; display: flex;
margin-bottom: 0; flex-wrap: wrap-reverse;
margin: 0;
padding: 0; padding: 0;
max-width: calc(100% - 120px); list-style: none;
list-style-type: none;
} }
.author-list-item { .author-list-item {
flex-shrink: 0;
position: relative; position: relative;
margin: 0; margin: 0;
padding: 0; padding: 0;
width: 25px; }
.author-list-item:nth-child(1) { z-index: 10; }
.author-list-item:nth-child(2) { z-index: 9; }
.author-list-item:nth-child(3) { z-index: 8; }
.author-list-item:nth-child(4) { z-index: 7; }
.author-list-item:nth-child(5) { z-index: 6; }
.author-list-item:nth-child(6) { z-index: 5; }
.author-list-item:nth-child(7) { z-index: 4; }
.author-list-item:nth-child(8) { z-index: 3; }
.author-list-item:nth-child(9) { z-index: 2; }
.author-list-item:nth-child(10) { z-index: 1; }
.static-avatar {
display: block;
height: 34px;
width: 34px;
border: #fff 2px solid;
margin: 0 -5px;
border-radius: 100%;
overflow: hidden;
} }
.moving-avatar { .moving-avatar {
transition: all 0.5s cubic-bezier(0.4, 0.01, 0.165, 0.99); display: block;
transform: translate(0px); height: 56px;
width: 56px;
border: #fff 2px solid;
margin: 0 -6px;
border-radius: 100%;
overflow: hidden;
transition: all 0.5s cubic-bezier(0.4, 0.01, 0.165, 0.99) 0.7s;
} }
.moving-avatar.right { @media (min-width: 800px) {
transform: translateX(10px); .author-list:hover .moving-avatar {
} margin: 0;
transition: all 0.3s cubic-bezier(0.4, 0.01, 0.165, 0.99);
.moving-avatar.left { }
transform: translateX(-10px);
}
.author-list-item:nth-child( 1 ) {
z-index: 9;
}
.author-list-item:nth-child( 2 ) {
z-index: 8;
}
.author-list-item:nth-child( 3 ) {
z-index: 7;
}
.author-list-item:nth-child( 4 ) {
z-index: 6;
}
.author-list-item:nth-child( 5 ) {
z-index: 5;
}
.author-list-item:nth-child( 6 ) {
z-index: 4;
}
.author-list-item:nth-child( 7 ) {
z-index: 3;
}
.author-list-item:nth-child( 8 ) {
z-index: 2;
}
.author-list-item:nth-child( 9 ) {
z-index: 1;
}
.z-999 {
z-index: 999;
} }
.author-name-tooltip { .author-name-tooltip {
position: absolute; position: absolute;
bottom: 36px; bottom: 105%;
z-index: 999; z-index: 999;
display: block; display: block;
padding: 2px 8px; padding: 2px 8px;
@ -596,8 +559,11 @@ The knock-on effect of this is ugly browser-scroll bars at the bottom, so 80px o
} }
.reading-time { .reading-time {
flex-shrink: 0;
margin-left: 20px;
color: var(--midgrey); color: var(--midgrey);
font-size: 1.2rem; font-size: 1.2rem;
line-height: 33px;
font-weight: 500; font-weight: 500;
letter-spacing: 0.5px; letter-spacing: 0.5px;
text-transform: uppercase; text-transform: uppercase;
@ -1289,13 +1255,21 @@ Usage (In Ghost editor):
max-width: 840px; max-width: 840px;
} }
/* 7.2.1 Single Author Byline
/* ---------------------------------------------------------- */
.author-card { .author-card {
display: flex; display: flex;
align-items: center; }
.author-card .author-profile-image {
margin-right: 15px;
width: 60px;
height: 60px;
} }
.author-card-name { .author-card-name {
margin: 0 0 2px 0; margin: 8px 0 2px 0;
padding: 0; padding: 0;
font-size: 2rem; font-size: 2rem;
} }
@ -1338,6 +1312,9 @@ Usage (In Ghost editor):
text-decoration: none; text-decoration: none;
} }
/* 7.2.2 Multiple Author Byline
/* ---------------------------------------------------------- */
.post-full-authors { .post-full-authors {
flex-grow: 1; flex-grow: 1;
display: flex; display: flex;
@ -1369,27 +1346,9 @@ Usage (In Ghost editor):
text-transform: uppercase; text-transform: uppercase;
} }
.post-full-footer .author-list-item { .post-full-footer .author-list {
width: 42px; justify-content: center;
} padding: 10px 20px;
@media (max-width: 650px) {
.post-full-footer .author-list-item {
width: 54px;
height: 54px;
}
}
.post-full-footer .author-list-item > a {
position: absolute;
display: inline-block;
width: 48px;
}
.post-full-footer .author-profile-image,
.post-full-footer .avatar-wrapper {
width: 48px;
height: 48px;
} }
.author-card .author-profile-image, .author-card .author-profile-image,
@ -1398,18 +1357,14 @@ Usage (In Ghost editor):
position: relative; position: relative;
} }
.post-full-footer .avatar-wrapper svg {
width: 46px;
height: 46px;
}
.author-list-item .author-card { .author-list-item .author-card {
position: absolute; position: absolute;
bottom: 12px; bottom: 130%;
left: calc(-160px + 28px); left: 50%;
z-index: 999; z-index: 300;
display: block; display: block;
width: 320px; width: 320px;
margin-left: -160px;
font-size: 1.4rem; font-size: 1.4rem;
letter-spacing: 0.2px; letter-spacing: 0.2px;
background: white; background: white;
@ -1417,7 +1372,7 @@ Usage (In Ghost editor):
box-shadow: rgba(39,44,49,0.08) 0 12px 26px, rgba(39, 44, 49, 0.03) 1px 3px 8px; box-shadow: rgba(39,44,49,0.08) 0 12px 26px, rgba(39, 44, 49, 0.03) 1px 3px 8px;
opacity: 0; opacity: 0;
transition: all 0.3s cubic-bezier(0.4, 0.01, 0.165, 0.99); transition: all 0.3s cubic-bezier(0.4, 0.01, 0.165, 0.99);
transform: scale(0.98) translateY(10px); transform: scale(0.98) translateY(15px);
pointer-events: none; pointer-events: none;
} }
@ -1425,10 +1380,11 @@ Usage (In Ghost editor):
content: ""; content: "";
position: absolute; position: absolute;
top: 100%; top: 100%;
left: calc(160px - 20px + 6px); left: 50%;
display: block; display: block;
width: 0; width: 0;
height: 0; height: 0;
margin-left: -12px;
border-top: 12px solid #fff; border-top: 12px solid #fff;
border-right: 12px solid transparent; border-right: 12px solid transparent;
border-left: 12px solid transparent; border-left: 12px solid transparent;

View File

@ -38,7 +38,7 @@
{{/author}} {{/author}}
{{!-- The main content area --}} {{!-- The main content area --}}
<main id="site-main" class="site-main outer" role="main"> <main id="site-main" class="site-main outer">
<div class="inner"> <div class="inner">
<div class="post-feed"> <div class="post-feed">

View File

@ -28,7 +28,7 @@ It's a good idea to keep this template as minimal as possible in terms of both f
</div> </div>
</header> </header>
<main id="site-main" class="site-main outer" role="main"> <main id="site-main" class="site-main outer">
<div class="inner"> <div class="inner">
<section class="error-message"> <section class="error-message">

View File

@ -29,7 +29,7 @@ You'll notice that we *don't* use any JavsScript, or ghost_head / ghost_foot in
</div> </div>
</header> </header>
<main id="site-main" class="site-main outer" role="main"> <main id="site-main" class="site-main outer">
<div class="inner"> <div class="inner">
<section class="error-message"> <section class="error-message">

View File

@ -20,7 +20,7 @@ into the {body} of the default.hbs template --}}
</header> </header>
{{!-- The main content area --}} {{!-- The main content area --}}
<main id="site-main" class="site-main outer" role="main"> <main id="site-main" class="site-main outer">
<div class="inner"> <div class="inner">
<div class="post-feed"> <div class="post-feed">

View File

@ -2,7 +2,7 @@
"name": "casper", "name": "casper",
"description": "The default personal blogging theme for Ghost. Beautiful, minimal and responsive.", "description": "The default personal blogging theme for Ghost. Beautiful, minimal and responsive.",
"demo": "https://demo.ghost.io", "demo": "https://demo.ghost.io",
"version": "2.2.0", "version": "2.2.1",
"engines": { "engines": {
"ghost": ">=1.2.0" "ghost": ">=1.2.0"
}, },

View File

@ -12,7 +12,7 @@ into the {body} of the default.hbs template --}}
{{!-- Everything inside the #post tags pulls data from the post --}} {{!-- Everything inside the #post tags pulls data from the post --}}
{{#post}} {{#post}}
<main id="site-main" class="site-main outer" role="main"> <main id="site-main" class="site-main outer">
<div class="inner"> <div class="inner">
<article class="post-full {{post_class}} {{#unless feature_image}}no-image{{/unless}}"> <article class="post-full {{post_class}} {{#unless feature_image}}no-image{{/unless}}">

View File

@ -0,0 +1,72 @@
<section class="post-full-authors">
<div class="post-full-authors-content">
<p>This post was a collaboration between</p>
<p>{{authors}}</p>
</div>
<ul class="author-list">
{{#foreach authors}}
<li class="author-list-item">
<div class="author-card">
<div class="basic-info">
{{#if profile_image}}
<img class="author-profile-image" src="{{profile_image}}" alt="{{name}}" />
{{else}}
<div class="author-profile-image">{{> "icons/avatar"}}</div>
{{/if}}
<h2>{{name}}</h2>
</div>
<div class="bio">
{{#if bio}}
<p>{{bio}}</p>
<p><a href="{{url}}">More posts</a> by {{name}}.</p>
{{else}}
<p>Read <a href="{{url}}">more posts</a> by this author.</p>
{{/if}}
</div>
</div>
{{#if profile_image}}
<a href="{{url}}" class="moving-avatar"><img class="author-profile-image" src="{{profile_image}}" alt="{{name}}" /></a>
{{else}}
<a href="{{url}}" class="moving-avatar author-profile-image">{{> "icons/avatar"}}</a>
{{/if}}
</li>
{{/foreach}}
</ul>
</section>
{{#contentFor "scripts"}}
<script>
// Adds delay to author card dropups to disappear. This gives enough
// time for the user to interact with the author card while they move
// the mouse from the avatar to the card. Also makes space for the
// interacted avatar.
$(document).ready(function () {
var hoverTimeout;
$('.author-list-item').hover(function(){
var $this = $(this);
clearTimeout(hoverTimeout);
$('.author-card').removeClass('hovered');
$(this).children('.author-card').addClass('hovered');
}, function() {
var $this = $(this);
hoverTimeout = setTimeout(function() {
$this.children('.author-card').removeClass('hovered');
}, 800);
});
});
</script>
{{/contentFor}}

View File

@ -0,0 +1,23 @@
{{!-- Everything inside the #author tags pulls data from the author --}}
{{#author}}
<section class="author-card">
{{#if profile_image}}
<img class="author-profile-image" src="{{profile_image}}" alt="{{name}}" />
{{else}}
<span class="avatar-wrapper">{{> "icons/avatar"}}</span>
{{/if}}
<section class="author-card-content">
<h4 class="author-card-name"><a href="{{url}}">{{name}}</a></h4>
{{#if bio}}
<p>{{bio}}</p>
{{else}}
<p>Read <a href="{{url}}">more posts</a> by this author.</p>
{{/if}}
</section>
</section>
<div class="post-full-footer-right">
<a class="author-card-button" href="{{url}}">Read More</a>
</div>
{{/author}}

View File

@ -27,9 +27,9 @@
</div> </div>
{{#if profile_image}} {{#if profile_image}}
<span class="profile-image-wrapper"><img class="author-profile-image" src="{{profile_image}}" alt="{{name}}" /></span> <a href="{{url}}" class="static-avatar"><img class="author-profile-image" src="{{profile_image}}" alt="{{name}}" /></a>
{{else}} {{else}}
<span class="avatar-wrapper">{{> "icons/avatar"}}</span> <a href="{{url}}" class="static-avatar author-profile-image">{{> "icons/avatar"}}</a>
{{/if}} {{/if}}
</li> </li>
{{/foreach}} {{/foreach}}

148
post.hbs
View File

@ -12,7 +12,7 @@ into the {body} of the default.hbs template --}}
{{!-- Everything inside the #post tags pulls data from the post --}} {{!-- Everything inside the #post tags pulls data from the post --}}
{{#post}} {{#post}}
<main id="site-main" class="site-main outer" role="main"> <main id="site-main" class="site-main outer">
<div class="inner"> <div class="inner">
<article class="post-full {{post_class}} {{#unless feature_image}}no-image{{/unless}}"> <article class="post-full {{post_class}} {{#unless feature_image}}no-image{{/unless}}">
@ -47,102 +47,22 @@ into the {body} of the default.hbs template --}}
<footer class="post-full-footer"> <footer class="post-full-footer">
{{!-- If there are multiple authors for the post, display all of their avatars in a stack --}} {{!-- There are two options for how we display the byline/author-info.
If the post has more than one author, we load a specific template
from includes/byline-multiple.hbs, otherwise, we just use the
default byline. --}}
{{#has author="count:>1"}} {{#has author="count:>1"}}
{{> "byline-multiple"}}
<section class="post-full-authors">
<div class="post-full-authors-content">
<p>This post was a collaboration between</p>
<p>{{authors}}</p>
</div>
<ul class="author-list">
{{#foreach authors}}
<li class="author-list-item">
<div class="author-card">
<div class="basic-info">
{{#if profile_image}}
<img class="author-profile-image" src="{{profile_image}}" alt="{{name}}" />
{{else}}
<span class="avatar-wrapper">{{> "icons/avatar"}}</span>
{{/if}}
<h2>{{name}}</h2>
</div>
<div class="bio">
{{#if bio}}
<p>{{bio}}</p>
<p><a href="{{url}}">More posts</a> by {{name}}.</p>
{{else}}
<p>Read <a href="{{url}}">more posts</a> by this author.</p>
{{/if}}
</div>
</div>
{{#if profile_image}}
<a href="{{url}}" class="moving-avatar"><img class="author-profile-image" src="{{profile_image}}" alt="{{name}}" /></a>
{{else}}
<a href="{{url}}" class="moving-avatar"><span class="avatar-wrapper">{{> "icons/avatar"}}</span></a>
{{/if}}
</li>
{{/foreach}}
</ul>
</section>
{{!-- If there is a single author for the post, display her/his information --}}
{{else}} {{else}}
{{> "byline-single"}}
{{!-- Everything inside the #author tags pulls data from the author --}}
{{#author}}
<section class="author-card">
{{#if profile_image}}
<img class="author-profile-image" src="{{profile_image}}" alt="{{name}}" />
{{else}}
<span class="avatar-wrapper">{{> "icons/avatar"}}</span>
{{/if}}
<section class="author-card-content">
<h4 class="author-card-name"><a href="{{url}}">{{name}}</a></h4>
{{#if bio}}
<p>{{bio}}</p>
{{else}}
<p>Read <a href="{{url}}">more posts</a> by this author.</p>
{{/if}}
</section>
</section>
<div class="post-full-footer-right">
<a class="author-card-button" href="{{url}}">Read More</a>
</div>
{{/author}}
{{/has}} {{/has}}
</footer> </footer>
{{!-- {{!--
If you use Disqus comments, just uncomment this block.
The only thing you need to change is "test-apkdzgmqhj" - which
should be replaced with your own Disqus site-id.
<section class="post-full-comments"> <section class="post-full-comments">
<div id="disqus_thread"></div> If you want to embed comments, this is a good place to do it!
<script>
var disqus_config = function () {
this.page.url = '{{url absolute="true"}}';
this.page.identifier = 'ghost-{{comment_id}}';
};
(function() {
var d = document, s = d.createElement('script');
s.src = 'https://test-apkdzgmqhj.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script>
</section> </section>
--}} --}}
@ -271,56 +191,6 @@ $(document).ready(function () {
update(); update();
});
// Adds delay to author card dropups to disappear. This gives enough
// time for the user to interact with the author card while they move
// the mouse from the avatar to the card. Also makes space for the
// interacted avatar.
$(document).ready(function () {
var hoverTimeout;
var direction = 'left';
$('.author-list-item:first-child').addClass('first-child');
function makeSpaceForAvatar(avatar) {
if (avatar.hasClass('first-child')) {
return;
}
$('.author-list-item').each(function(i, obj) {
if ($(this)[0] != avatar[0]) {
if (Number($(this).css('z-index')) > Number(avatar.css('z-index'))) {
$(this).children('.moving-avatar').addClass('left');
} else {
$(this).children('.moving-avatar').addClass('right');
}
}
});
}
$('.author-list-item').hover(function(){
var $this = $(this);
clearTimeout(hoverTimeout);
$('.author-card').removeClass('hovered');
$(this).children('.author-card').addClass('hovered');
makeSpaceForAvatar($this);
}, function() {
var $this = $(this);
$('.author-list-item').children('.moving-avatar').removeClass('left right');
hoverTimeout = setTimeout(function() {
$this.children('.author-card').removeClass('hovered');
}, 800);
});
}); });
</script> </script>
{{/contentFor}} {{/contentFor}}

View File

@ -21,7 +21,7 @@
{{/tag}} {{/tag}}
{{!-- The main content area --}} {{!-- The main content area --}}
<main id="site-main" class="site-main outer" role="main"> <main id="site-main" class="site-main outer">
<div class="inner"> <div class="inner">
<div class="post-feed"> <div class="post-feed">
{{#foreach posts}} {{#foreach posts}}