mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
whatsnew
This commit is contained in:
parent
81c9a5d7b3
commit
41a35f1490
9 changed files with 87 additions and 151 deletions
|
@ -1,89 +0,0 @@
|
||||||
$cols: $content_width / $cell;
|
|
||||||
$stamp_color: $content_bg;
|
|
||||||
|
|
||||||
.grid {
|
|
||||||
display: grid;
|
|
||||||
|
|
||||||
grid-template-columns: repeat(5, 1fr);
|
|
||||||
grid-template-rows: 50vh $cell;
|
|
||||||
grid-auto-rows: $cell;
|
|
||||||
|
|
||||||
grid-auto-flow: row dense;
|
|
||||||
grid-column-gap: $gap;
|
|
||||||
grid-row-gap: $gap;
|
|
||||||
|
|
||||||
@include tablet {
|
|
||||||
padding: 0 $gap;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: $cell * 6) {
|
|
||||||
grid-template-columns: repeat(5, 1fr);
|
|
||||||
grid-template-rows: 50vh 20vw;
|
|
||||||
grid-auto-rows: 20vw;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: $cell * 5) {
|
|
||||||
grid-template-columns: repeat(4, 1fr);
|
|
||||||
grid-template-rows: 40vh 25vw;
|
|
||||||
grid-auto-rows: 25vw;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: $cell * 4) {
|
|
||||||
grid-template-columns: repeat(3, 1fr);
|
|
||||||
grid-template-rows: 40vh 33vw;
|
|
||||||
grid-auto-rows: 33vw;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: $cell * 3) {
|
|
||||||
grid-template-columns: repeat(2, 1fr);
|
|
||||||
grid-template-rows: 40vh 50vw;
|
|
||||||
grid-auto-rows: 50vw;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: $cell * 2) {
|
|
||||||
grid-template-columns: repeat(2, 1fr);
|
|
||||||
grid-template-rows: 40vh 50vw;
|
|
||||||
grid-auto-rows: 50vw;
|
|
||||||
grid-column-gap: $gap;
|
|
||||||
grid-row-gap: $gap;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.pad_last {
|
|
||||||
grid-column-end: $cols + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.hero {
|
|
||||||
grid-row-start: 1;
|
|
||||||
grid-row-end: span 1;
|
|
||||||
grid-column-start: 1;
|
|
||||||
grid-column-end: -1;
|
|
||||||
background: darken($content_bg, 2%);
|
|
||||||
border-radius: $radius;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
font: $font_24_semibold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.stamp {
|
|
||||||
grid-row-end: span 2;
|
|
||||||
grid-column: -2 / -1;
|
|
||||||
display: flex;
|
|
||||||
align-items: stretch;
|
|
||||||
justify-content: stretch;
|
|
||||||
overflow: hidden;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
&::after {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
height: 60px;
|
|
||||||
width: 100%;
|
|
||||||
background: linear-gradient(transparentize($stamp_color, 1), $stamp_color 90%);
|
|
||||||
pointer-events: none;
|
|
||||||
touch-action: none;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,4 +1,4 @@
|
||||||
import React, { FC } from 'react';
|
import React, { FC, useState, useCallback, FormEvent } from 'react';
|
||||||
import * as styles from './styles.scss';
|
import * as styles from './styles.scss';
|
||||||
import { IFlowState } from '~/redux/flow/reducer';
|
import { IFlowState } from '~/redux/flow/reducer';
|
||||||
import { getURL, getPrettyDate } from '~/utils/dom';
|
import { getURL, getPrettyDate } from '~/utils/dom';
|
||||||
|
@ -13,13 +13,24 @@ interface IProps {
|
||||||
updated: IFlowState['updated'];
|
updated: IFlowState['updated'];
|
||||||
}
|
}
|
||||||
|
|
||||||
const FlowRecent: FC<IProps> = ({ recent, updated }) => (
|
const FlowRecent: FC<IProps> = ({ recent, updated }) => {
|
||||||
|
const [search, setSearch] = useState('');
|
||||||
|
|
||||||
|
const onSearchSubmit = useCallback((event: FormEvent) => {
|
||||||
|
event.preventDefault();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return (
|
||||||
<div>
|
<div>
|
||||||
<div className={styles.search}>
|
<form className={styles.search} onSubmit={onSearchSubmit}>
|
||||||
<InputText title="Поиск" />
|
<InputText title="Поиск" value={search} handler={setSearch} />
|
||||||
</div>
|
</form>
|
||||||
|
|
||||||
<div className={styles.grid}>
|
<div className={styles.grid}>
|
||||||
|
<div className={styles.grid_label}>
|
||||||
|
<span>Что нового?</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
{updated &&
|
{updated &&
|
||||||
updated.slice(0, 20).map(node => (
|
updated.slice(0, 20).map(node => (
|
||||||
<Link key={node.id} className={styles.item} to={URLS.NODE_URL(node.id)}>
|
<Link key={node.id} className={styles.item} to={URLS.NODE_URL(node.id)}>
|
||||||
|
@ -52,6 +63,7 @@ const FlowRecent: FC<IProps> = ({ recent, updated }) => (
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
};
|
||||||
|
|
||||||
export { FlowRecent };
|
export { FlowRecent };
|
||||||
|
|
|
@ -5,12 +5,19 @@
|
||||||
flex: 1;
|
flex: 1;
|
||||||
background: $content_bg;
|
background: $content_bg;
|
||||||
padding: $gap;
|
padding: $gap;
|
||||||
|
border-radius: 0 0 $radius $radius;
|
||||||
|
|
||||||
@include outer_shadow();
|
@include outer_shadow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.grid_label {
|
||||||
|
margin-bottom: $gap;
|
||||||
|
@include title_with_line();
|
||||||
|
color: transparentize(white, $amount: 0.8);
|
||||||
|
}
|
||||||
|
|
||||||
.search {
|
.search {
|
||||||
background: lighten($content_bg, 3%);
|
background: lighten($content_bg, 4%);
|
||||||
border-radius: $radius $radius 0 0;
|
border-radius: $radius $radius 0 0;
|
||||||
padding: $gap;
|
padding: $gap;
|
||||||
|
|
||||||
|
|
|
@ -71,11 +71,13 @@ const InputText: FC<IInputTextProps> = ({
|
||||||
<LoaderCircle size={20} />
|
<LoaderCircle size={20} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{title && (
|
{title && (
|
||||||
<div className={styles.title}>
|
<div className={styles.title}>
|
||||||
<span>{title}</span>
|
<span>{title}</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{error && (
|
{error && (
|
||||||
<div className={styles.error}>
|
<div className={styles.error}>
|
||||||
<span>{error}</span>
|
<span>{error}</span>
|
||||||
|
|
|
@ -13,10 +13,9 @@ const NodeRelated: FC<IProps> = ({ title, items }) => {
|
||||||
return (
|
return (
|
||||||
<Group className={styles.wrap}>
|
<Group className={styles.wrap}>
|
||||||
<div className={styles.title}>
|
<div className={styles.title}>
|
||||||
<div className={styles.line} />
|
|
||||||
<div className={styles.text}>{title}</div>
|
<div className={styles.text}>{title}</div>
|
||||||
<div className={styles.line} />
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className={styles.grid}>
|
<div className={styles.grid}>
|
||||||
{items.map(item => (
|
{items.map(item => (
|
||||||
<NodeRelatedItem item={item} key={item.id} />
|
<NodeRelatedItem item={item} key={item.id} />
|
||||||
|
|
|
@ -17,20 +17,9 @@
|
||||||
grid-template-columns: repeat(6, 1fr);
|
grid-template-columns: repeat(6, 1fr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.title {
|
|
||||||
font: $font_14_semibold;
|
|
||||||
text-transform: uppercase;
|
|
||||||
color: transparentize(white, 0.3);
|
|
||||||
flex-direction: row;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.line {
|
.title {
|
||||||
display: none;
|
@include title_with_line();
|
||||||
flex: 1;
|
|
||||||
height: 2px;
|
|
||||||
background: transparentize(white, 0.95);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.text {
|
.text {
|
||||||
|
|
|
@ -73,13 +73,9 @@ $cols: $content_width / $cell;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stamp {
|
.stamp {
|
||||||
@include outer_shadow();
|
|
||||||
|
|
||||||
grid-row-end: span 2;
|
grid-row-end: span 2;
|
||||||
grid-column: -2 / -1;
|
grid-column: -2 / -1;
|
||||||
display: flex;
|
display: flex;
|
||||||
font: $font_24_semibold;
|
|
||||||
display: flex;
|
|
||||||
align-items: stretch;
|
align-items: stretch;
|
||||||
justify-content: stretch;
|
justify-content: stretch;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
|
@ -215,7 +215,7 @@
|
||||||
.textarea {
|
.textarea {
|
||||||
outline: none;
|
outline: none;
|
||||||
border: none;
|
border: none;
|
||||||
font: inherit;
|
font: $font_16_medium;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
color: white;
|
color: white;
|
||||||
|
@ -270,7 +270,7 @@
|
||||||
transition: top 0.25s, bottom 0.25s, font 0.25s, color 0.25s;
|
transition: top 0.25s, bottom 0.25s, font 0.25s, color 0.25s;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
touch-action: none;
|
touch-action: none;
|
||||||
color: transparentize(white, 0.3);
|
color: transparentize(white, 0.5);
|
||||||
text-transform: capitalize;
|
text-transform: capitalize;
|
||||||
background: $input_bg_color;
|
background: $input_bg_color;
|
||||||
|
|
||||||
|
|
|
@ -152,3 +152,23 @@ $input_shadow_filled: $input_shadow;
|
||||||
@content;
|
@content;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@mixin title_with_line {
|
||||||
|
font: $font_14_semibold;
|
||||||
|
text-transform: uppercase;
|
||||||
|
color: transparentize(white, 0.3);
|
||||||
|
flex-direction: row;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
& > * {
|
||||||
|
padding-right: $gap;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:after {
|
||||||
|
content: ' ';
|
||||||
|
flex: 1;
|
||||||
|
height: 2px;
|
||||||
|
background: transparentize(white, 0.95);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue