Article card feed mode
This commit is contained in:
parent
6871b1a146
commit
236c469c98
|
@ -1,11 +1,11 @@
|
||||||
h1 {
|
h1 {
|
||||||
@include font-size(4rem);
|
@include font-size(4rem);
|
||||||
|
|
||||||
line-height: 1.1;
|
line-height: 1.1;
|
||||||
margin-top: 0.5em;
|
margin-top: 0.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
|
@include font-size(4rem);
|
||||||
line-height: 1.1;
|
line-height: 1.1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -353,7 +353,6 @@
|
||||||
|
|
||||||
.authorName {
|
.authorName {
|
||||||
@include font-size(1.2rem);
|
@include font-size(1.2rem);
|
||||||
|
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -105,6 +105,7 @@ export const AuthorCard = (props: AuthorCardProps) => {
|
||||||
hasLink={props.hasLink}
|
hasLink={props.hasLink}
|
||||||
isBig={props.isAuthorPage}
|
isBig={props.isAuthorPage}
|
||||||
isAuthorsList={props.isAuthorsList}
|
isAuthorsList={props.isAuthorsList}
|
||||||
|
isFeedMode={props.isFeedMode}
|
||||||
class={styles.circlewrap}
|
class={styles.circlewrap}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
|
@ -73,3 +73,10 @@
|
||||||
line-height: 6.4rem;
|
line-height: 6.4rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.feedMode {
|
||||||
|
.userpic {
|
||||||
|
min-width: 16px;
|
||||||
|
max-width: 16px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@ interface UserpicProps {
|
||||||
isBig?: boolean
|
isBig?: boolean
|
||||||
class?: string
|
class?: string
|
||||||
isAuthorsList?: boolean
|
isAuthorsList?: boolean
|
||||||
|
isFeedMode?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export default (props: UserpicProps) => {
|
export default (props: UserpicProps) => {
|
||||||
|
@ -23,7 +24,8 @@ export default (props: UserpicProps) => {
|
||||||
class={clsx(styles.circlewrap, props.class)}
|
class={clsx(styles.circlewrap, props.class)}
|
||||||
classList={{
|
classList={{
|
||||||
[styles.big]: props.isBig,
|
[styles.big]: props.isBig,
|
||||||
[styles.authorsList]: props.isAuthorsList
|
[styles.authorsList]: props.isAuthorsList,
|
||||||
|
[styles.feedMode]: props.isFeedMode
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Show when={props.hasLink}>
|
<Show when={props.hasLink}>
|
||||||
|
|
|
@ -114,11 +114,20 @@
|
||||||
|
|
||||||
.shoutDetails {
|
.shoutDetails {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shoutDetailsFeedMode {
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.shoutAuthor,
|
||||||
|
.shoutDate {
|
||||||
|
@include font-size(1.2rem);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.shoutCardTitle {
|
.shoutCardTitle {
|
||||||
@include font-size(2.2rem);
|
@include font-size(2.2rem);
|
||||||
|
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
line-height: 1.1;
|
line-height: 1.1;
|
||||||
margin-bottom: 0.8rem;
|
margin-bottom: 0.8rem;
|
||||||
|
@ -136,11 +145,15 @@
|
||||||
/* stylelint-disable-next-line */
|
/* stylelint-disable-next-line */
|
||||||
-webkit-box-decoration-break: clone;
|
-webkit-box-decoration-break: clone;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.shoutCardTitlesContainerFeedMode & {
|
||||||
|
@include font-size(3.2rem);
|
||||||
|
line-height: 1.1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.shoutCardSubtitle {
|
.shoutCardSubtitle {
|
||||||
@include font-size(1.8rem);
|
@include font-size(1.8rem);
|
||||||
|
|
||||||
color: #141414;
|
color: #141414;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
line-height: 1.3;
|
line-height: 1.3;
|
||||||
|
|
|
@ -16,6 +16,7 @@ import { getPagePath, openPage } from '@nanostores/router'
|
||||||
import { router, useRouter } from '../../stores/router'
|
import { router, useRouter } from '../../stores/router'
|
||||||
import { imageProxy } from '../../utils/imageProxy'
|
import { imageProxy } from '../../utils/imageProxy'
|
||||||
import { Popover } from '../_shared/Popover'
|
import { Popover } from '../_shared/Popover'
|
||||||
|
import { AuthorCard } from '../Author/AuthorCard'
|
||||||
|
|
||||||
interface ArticleCardProps {
|
interface ArticleCardProps {
|
||||||
settings?: {
|
settings?: {
|
||||||
|
@ -103,7 +104,7 @@ export const ArticleCard = (props: ArticleCardProps) => {
|
||||||
[styles.shoutCardBeside]: props.settings?.isBeside
|
[styles.shoutCardBeside]: props.settings?.isBeside
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Show when={!props.settings?.noimage && cover}>
|
<Show when={!props.settings?.noimage && cover && !props.settings?.isFeedMode}>
|
||||||
<div class={styles.shoutCardCoverContainer}>
|
<div class={styles.shoutCardCoverContainer}>
|
||||||
<div class={styles.shoutCardCover}>
|
<div class={styles.shoutCardCover}>
|
||||||
<img src={imageProxy(cover)} alt={title || ''} loading="lazy" />
|
<img src={imageProxy(cover)} alt={title || ''} loading="lazy" />
|
||||||
|
@ -112,7 +113,14 @@ export const ArticleCard = (props: ArticleCardProps) => {
|
||||||
</Show>
|
</Show>
|
||||||
|
|
||||||
<div class={styles.shoutCardContent}>
|
<div class={styles.shoutCardContent}>
|
||||||
<Show when={layout && layout !== 'article' && !(props.settings?.noicon || props.settings?.noimage)}>
|
<Show
|
||||||
|
when={
|
||||||
|
layout &&
|
||||||
|
layout !== 'article' &&
|
||||||
|
!(props.settings?.noicon || props.settings?.noimage) &&
|
||||||
|
!props.settings?.isFeedMode
|
||||||
|
}
|
||||||
|
>
|
||||||
<div class={styles.shoutCardType}>
|
<div class={styles.shoutCardType}>
|
||||||
<a href={`/expo/${layout}`}>
|
<a href={`/expo/${layout}`}>
|
||||||
<Icon name={layout} class={styles.icon} />
|
<Icon name={layout} class={styles.icon} />
|
||||||
|
@ -127,11 +135,16 @@ export const ArticleCard = (props: ArticleCardProps) => {
|
||||||
}
|
}
|
||||||
slug={mainTopic.slug}
|
slug={mainTopic.slug}
|
||||||
isFloorImportant={props.settings?.isFloorImportant}
|
isFloorImportant={props.settings?.isFloorImportant}
|
||||||
|
isFeedMode={true}
|
||||||
class={clsx(styles.shoutTopic, { [styles.shoutTopicTop]: props.settings.isShort })}
|
class={clsx(styles.shoutTopic, { [styles.shoutTopicTop]: props.settings.isShort })}
|
||||||
/>
|
/>
|
||||||
</Show>
|
</Show>
|
||||||
|
|
||||||
<div class={styles.shoutCardTitlesContainer}>
|
<div
|
||||||
|
class={clsx(styles.shoutCardTitlesContainer, {
|
||||||
|
[styles.shoutCardTitlesContainerFeedMode]: props.settings?.isFeedMode
|
||||||
|
})}
|
||||||
|
>
|
||||||
<a href={`/${slug || ''}`}>
|
<a href={`/${slug || ''}`}>
|
||||||
<div class={styles.shoutCardTitle}>
|
<div class={styles.shoutCardTitle}>
|
||||||
<span class={styles.shoutCardLinkContainer}>{title}</span>
|
<span class={styles.shoutCardLinkContainer}>{title}</span>
|
||||||
|
@ -146,22 +159,21 @@ export const ArticleCard = (props: ArticleCardProps) => {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Show when={!props.settings?.noauthor || !props.settings?.nodate}>
|
<Show when={!props.settings?.noauthor || !props.settings?.nodate}>
|
||||||
<div class={styles.shoutDetails}>
|
<div
|
||||||
|
class={clsx(styles.shoutDetails, { [styles.shoutDetailsFeedMode]: props.settings?.isFeedMode })}
|
||||||
|
>
|
||||||
<Show when={!props.settings?.noauthor}>
|
<Show when={!props.settings?.noauthor}>
|
||||||
<div class={styles.shoutAuthor}>
|
<div class={styles.shoutAuthor}>
|
||||||
<For each={authors}>
|
<For each={authors}>
|
||||||
{(author, index) => {
|
{(author) => {
|
||||||
let name = author.name
|
|
||||||
|
|
||||||
if (lang() !== 'ru') {
|
|
||||||
name = name === 'Дискурс' ? 'Discours' : translit(name)
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<AuthorCard
|
||||||
<Show when={index() > 0}>, </Show>
|
author={author}
|
||||||
<a href={`/author/${author.slug}`}>{name}</a>
|
hideWriteButton={true}
|
||||||
</>
|
hideFollow={true}
|
||||||
|
isFeedMode={true}
|
||||||
|
hasLink={props.settings?.isFeedMode}
|
||||||
|
/>
|
||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
</For>
|
</For>
|
||||||
|
@ -174,6 +186,25 @@ export const ArticleCard = (props: ArticleCardProps) => {
|
||||||
</Show>
|
</Show>
|
||||||
|
|
||||||
<Show when={props.settings?.isFeedMode}>
|
<Show when={props.settings?.isFeedMode}>
|
||||||
|
<Show when={!props.settings?.noimage && cover}>
|
||||||
|
<div class={styles.shoutCardCoverContainer}>
|
||||||
|
<Show
|
||||||
|
when={
|
||||||
|
layout && layout !== 'article' && !(props.settings?.noicon || props.settings?.noimage)
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<div class={styles.shoutCardType}>
|
||||||
|
<a href={`/expo/${layout}`}>
|
||||||
|
<Icon name={layout} class={styles.icon} />
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</Show>
|
||||||
|
<div class={styles.shoutCardCover}>
|
||||||
|
<img src={imageProxy(cover)} alt={title || ''} loading="lazy" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Show>
|
||||||
|
|
||||||
<section
|
<section
|
||||||
class={styles.shoutCardDetails}
|
class={styles.shoutCardDetails}
|
||||||
classList={{ [styles.shoutCardDetailsActive]: isActionPopupActive() }}
|
classList={{ [styles.shoutCardDetailsActive]: isActionPopupActive() }}
|
||||||
|
|
|
@ -32,3 +32,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.shoutTopicFeedMode {
|
||||||
|
font-size: 1.2rem;
|
||||||
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ type CardTopicProps = {
|
||||||
title: string
|
title: string
|
||||||
slug: string
|
slug: string
|
||||||
isFloorImportant?: boolean
|
isFloorImportant?: boolean
|
||||||
|
isFeedMode?: boolean
|
||||||
class?: string
|
class?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,7 +15,8 @@ export const CardTopic = (props: CardTopicProps) => {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
class={clsx(styles.shoutTopic, props.class, {
|
class={clsx(styles.shoutTopic, props.class, {
|
||||||
[styles.shoutTopicFloorImportant]: props.isFloorImportant
|
[styles.shoutTopicFloorImportant]: props.isFloorImportant,
|
||||||
|
[styles.shoutTopicFeedMode]: props.isFeedMode
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
<a href={getPagePath(router, 'topic', { slug: props.slug })}>{props.title}</a>
|
<a href={getPagePath(router, 'topic', { slug: props.slug })}>{props.title}</a>
|
||||||
|
|
|
@ -370,6 +370,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.userpic {
|
.userpic {
|
||||||
|
align-items: center;
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
|
|
||||||
img {
|
img {
|
||||||
|
|
|
@ -123,13 +123,11 @@ h2 {
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
@include font-size(4.8rem);
|
@include font-size(4.8rem);
|
||||||
|
|
||||||
line-height: 1.1;
|
line-height: 1.1;
|
||||||
}
|
}
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
@include font-size(4rem);
|
@include font-size(4rem);
|
||||||
|
|
||||||
line-height: 1.1;
|
line-height: 1.1;
|
||||||
margin-bottom: 0.5em;
|
margin-bottom: 0.5em;
|
||||||
margin-top: 1.5em;
|
margin-top: 1.5em;
|
||||||
|
@ -137,7 +135,6 @@ h2 {
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
@include font-size(3.2rem);
|
@include font-size(3.2rem);
|
||||||
|
|
||||||
line-height: 1.1;
|
line-height: 1.1;
|
||||||
margin-bottom: 0.5em;
|
margin-bottom: 0.5em;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user