cover
This commit is contained in:
parent
fd1da2923c
commit
97a68b77d2
|
@ -1,11 +1,14 @@
|
||||||
<%
|
<%
|
||||||
const obj = {
|
const poster = post.poster;
|
||||||
image: post['cover'],
|
var obj = {
|
||||||
title: post['cover-title'],
|
image: post.cover
|
||||||
cat: post['cover-cat'],
|
|
||||||
subtitle: post['cover-subtitle'],
|
|
||||||
color: post['cover-text-color']
|
|
||||||
};
|
};
|
||||||
|
if (poster) {
|
||||||
|
obj.headline = poster.headline;
|
||||||
|
obj.topic = poster.topic;
|
||||||
|
obj.caption = poster.caption;
|
||||||
|
obj.color = poster.color;
|
||||||
|
}
|
||||||
function div_default() {
|
function div_default() {
|
||||||
var el = '';
|
var el = '';
|
||||||
el += '<article class="md">';
|
el += '<article class="md">';
|
||||||
|
@ -97,24 +100,24 @@ function div_photo() {
|
||||||
var el = '';
|
var el = '';
|
||||||
el += '<div class="cover">';
|
el += '<div class="cover">';
|
||||||
el += '<img src="' + obj.image + '"/>';
|
el += '<img src="' + obj.image + '"/>';
|
||||||
if (obj.title || obj.cat || obj.subtitle) {
|
if (obj.headline || obj.topic || obj.caption) {
|
||||||
el += '<div class="cover-info"';
|
el += '<div class="cover-info"';
|
||||||
if (obj.color) {
|
if (obj.color) {
|
||||||
el += 'style="color:' + obj.color + '"';
|
el += 'style="color:' + obj.color + '"';
|
||||||
}
|
}
|
||||||
if (obj.cat) {
|
if (obj.topic) {
|
||||||
el += 'position="top">';
|
el += 'position="top">';
|
||||||
} else {
|
} else {
|
||||||
el += 'position="bottom">';
|
el += 'position="bottom">';
|
||||||
}
|
}
|
||||||
if (obj.cat) {
|
if (obj.topic) {
|
||||||
el += '<div class="cap">' + obj.cat + '</div>';
|
el += '<div class="cap">' + obj.topic + '</div>';
|
||||||
}
|
}
|
||||||
if (obj.title) {
|
if (obj.headline) {
|
||||||
el += '<div class="title">' + obj.title + '</div>';
|
el += '<div class="title">' + obj.headline + '</div>';
|
||||||
}
|
}
|
||||||
if (obj.subtitle) {
|
if (obj.caption) {
|
||||||
el += '<div class="cap">' + obj.subtitle + '</div>';
|
el += '<div class="cap">' + obj.caption + '</div>';
|
||||||
}
|
}
|
||||||
el += '</div>';
|
el += '</div>';
|
||||||
|
|
||||||
|
@ -123,7 +126,7 @@ function div_photo() {
|
||||||
return el;
|
return el;
|
||||||
}
|
}
|
||||||
function div() {
|
function div() {
|
||||||
if (obj.image && obj.image.length > 0 && obj.title != undefined) {
|
if (obj.image && obj.image.length > 0 && obj.headline != undefined) {
|
||||||
return div_photo();
|
return div_photo();
|
||||||
}
|
}
|
||||||
return div_default();
|
return div_default();
|
||||||
|
|
|
@ -13,7 +13,7 @@ if (page.title && page.wiki) {
|
||||||
function layout_post_card(layout, post, content) {
|
function layout_post_card(layout, post, content) {
|
||||||
var el = '';
|
var el = '';
|
||||||
var layout = layout;
|
var layout = layout;
|
||||||
if (layout == 'post' && post['cover'] != undefined && post['cover-title'] != undefined) {
|
if (layout == 'post' && post.cover != undefined && post.poster != undefined) {
|
||||||
layout += ' photo';
|
layout += ' photo';
|
||||||
}
|
}
|
||||||
el += '<a class="post-card ' + layout + ' ' + scrollreveal() + '" href="' + url_for(post.link || post.path) + '">';
|
el += '<a class="post-card ' + layout + ' ' + scrollreveal() + '" href="' + url_for(post.link || post.path) + '">';
|
||||||
|
|
|
@ -1,15 +1,13 @@
|
||||||
// list
|
// list
|
||||||
.post-list
|
.post-list
|
||||||
margin: 1rem
|
margin: 1rem
|
||||||
.post-title
|
|
||||||
margin-top: 1.5rem
|
|
||||||
.post-title:first-child
|
.post-title:first-child
|
||||||
margin-top: .5rem
|
margin-top: .5rem
|
||||||
|
|
||||||
.post-list
|
.post-list
|
||||||
.post-title
|
.post-title
|
||||||
font-weight: 500
|
font-weight: 500
|
||||||
margin: .75rem 0
|
margin: 1.25rem 0 .75rem 0
|
||||||
line-height: 1.2
|
line-height: 1.2
|
||||||
font-size: $fs-h3
|
font-size: $fs-h3
|
||||||
border-bottom: none
|
border-bottom: none
|
||||||
|
@ -29,6 +27,7 @@
|
||||||
box-shadow: 0 2px 8px 0px rgba(0, 0, 0, 0.02)
|
box-shadow: 0 2px 8px 0px rgba(0, 0, 0, 0.02)
|
||||||
trans1 box-shadow
|
trans1 box-shadow
|
||||||
overflow: hidden
|
overflow: hidden
|
||||||
|
z-index: 0
|
||||||
background: var(--card)
|
background: var(--card)
|
||||||
position: relative
|
position: relative
|
||||||
.excerpt
|
.excerpt
|
||||||
|
@ -53,8 +52,12 @@
|
||||||
img
|
img
|
||||||
object-fit: contain
|
object-fit: contain
|
||||||
height: 1.5em
|
height: 1.5em
|
||||||
|
|
||||||
.post-list .post-card:hover
|
.post-list .post-card:hover
|
||||||
box-shadow: 0 1px 4px 0px rgba(0, 0, 0, 0.1), 0 4px 16px 0px rgba(0, 0, 0, 0.1)
|
box-shadow: 0 1px 4px 0px rgba(0, 0, 0, 0.1), 0 4px 16px 0px rgba(0, 0, 0, 0.1)
|
||||||
|
img
|
||||||
|
transform: scale(1.02)
|
||||||
|
filter: brightness(80%)
|
||||||
|
|
||||||
|
|
||||||
// common article
|
// common article
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
trans-cover($p, $t = 0.28s)
|
trans-cover($p, $t = 0.28s)
|
||||||
trans2pro: transform 1s $p $t
|
trans2pro: transform 0.5s $p $t
|
||||||
trans-site($p)
|
trans-site($p)
|
||||||
trans2: box-shadow transform $p
|
trans2: box-shadow transform $p
|
||||||
trans-user($p)
|
trans-user($p)
|
||||||
|
|
Loading…
Reference in New Issue