mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
fixed shadows, added author panel
This commit is contained in:
parent
c1279c538a
commit
f2fbca80e1
21 changed files with 209 additions and 55 deletions
28
src/components/comment/CommentAvatar/index.tsx
Normal file
28
src/components/comment/CommentAvatar/index.tsx
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
import React, { FC, useCallback } from 'react';
|
||||||
|
import { getURLFromString } from '~/utils/dom';
|
||||||
|
import { PRESETS } from '~/constants/urls';
|
||||||
|
import styles from './styles.module.scss';
|
||||||
|
import classNames from 'classnames';
|
||||||
|
import { openUserProfile } from '~/utils/user';
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
url?: string;
|
||||||
|
username?: string;
|
||||||
|
size?: number;
|
||||||
|
className?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const CommentAvatar: FC<Props> = ({ url, username, size, className }) => {
|
||||||
|
const backgroundImage = !!url ? `url('${getURLFromString(url, PRESETS.avatar)}')` : undefined;
|
||||||
|
const onOpenProfile = useCallback(() => openUserProfile(username), [username]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className={classNames(styles.avatar, className)}
|
||||||
|
style={{ backgroundImage }}
|
||||||
|
onClick={onOpenProfile}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export { CommentAvatar };
|
19
src/components/comment/CommentAvatar/styles.module.scss
Normal file
19
src/components/comment/CommentAvatar/styles.module.scss
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
@import "~/styles/variables";
|
||||||
|
|
||||||
|
.avatar {
|
||||||
|
@include outer_shadow;
|
||||||
|
|
||||||
|
width: $comment_height;
|
||||||
|
height: $comment_height;
|
||||||
|
background-color: transparentize(black, 0.9);
|
||||||
|
flex-shrink: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
border-radius: $radius;
|
||||||
|
background-position: center;
|
||||||
|
background-size: cover;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
img {
|
||||||
|
object-fit: cover;
|
||||||
|
}
|
||||||
|
}
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
.wrap {
|
.wrap {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
@include row_shadow;
|
||||||
}
|
}
|
||||||
|
|
||||||
.lock,
|
.lock,
|
||||||
|
@ -51,13 +52,10 @@
|
||||||
|
|
||||||
.edit {
|
.edit {
|
||||||
top: 28px;
|
top: 28px;
|
||||||
background: blue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.block {
|
.block {
|
||||||
@include outer_shadow();
|
|
||||||
min-height: $comment_height;
|
min-height: $comment_height;
|
||||||
// box-shadow: inset rgba(255, 255, 255, 0.05) 1px 1px, inset rgba(0, 0, 0, 0.1) -1px -1px;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
|
@ -108,7 +106,7 @@
|
||||||
|
|
||||||
.date {
|
.date {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 0;
|
bottom: 1px;
|
||||||
right: 0;
|
right: 0;
|
||||||
font: $font_12_regular;
|
font: $font_12_regular;
|
||||||
color: transparentize($color: white, $amount: 0.8);
|
color: transparentize($color: white, $amount: 0.8);
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
left: 0;
|
left: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background: transparentize($comment_bg, 0.15) 50% 50%;
|
background: transparentize($content_bg, 0.15) 50% 50%;
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
z-index: 15;
|
z-index: 15;
|
||||||
border-radius: $radius;
|
border-radius: $radius;
|
||||||
|
|
|
@ -10,10 +10,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.input {
|
.input {
|
||||||
@include outer_shadow();
|
|
||||||
position: relative;
|
position: relative;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
padding: ($gap / 2) ($gap / 2 + 1px);
|
padding: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.buttons {
|
.buttons {
|
||||||
|
|
|
@ -2,14 +2,12 @@ import React, { FC, HTMLAttributes } from 'react';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
import { Card } from '../Card';
|
|
||||||
import { IUser } from '~/redux/auth/types';
|
import { IUser } from '~/redux/auth/types';
|
||||||
import { getURL } from '~/utils/dom';
|
|
||||||
import { path } from 'ramda';
|
import { path } from 'ramda';
|
||||||
import { PRESETS } from '~/constants/urls';
|
import { CommentAvatar } from '~/components/comment/CommentAvatar';
|
||||||
|
import { Card } from '~/components/containers/Card';
|
||||||
|
|
||||||
type IProps = HTMLAttributes<HTMLDivElement> & {
|
type IProps = HTMLAttributes<HTMLDivElement> & {
|
||||||
// photo?: string;
|
|
||||||
user: IUser;
|
user: IUser;
|
||||||
is_empty?: boolean;
|
is_empty?: boolean;
|
||||||
is_loading?: boolean;
|
is_loading?: boolean;
|
||||||
|
@ -26,22 +24,19 @@ const CommentWrapper: FC<IProps> = ({
|
||||||
user,
|
user,
|
||||||
...props
|
...props
|
||||||
}) => (
|
}) => (
|
||||||
<Card
|
<div className={classNames(styles.wrap, className, { is_empty, is_loading, is_same })} {...props}>
|
||||||
className={classNames(styles.wrap, className, { is_empty, is_loading, is_same })}
|
|
||||||
seamless
|
|
||||||
{...props}
|
|
||||||
>
|
|
||||||
<div className={styles.thumb}>
|
<div className={styles.thumb}>
|
||||||
<div
|
<CommentAvatar
|
||||||
|
url={path(['photo', 'url'], user)}
|
||||||
|
username={user.username}
|
||||||
className={styles.thumb_image}
|
className={styles.thumb_image}
|
||||||
style={{ backgroundImage: `url("${getURL(path(['photo'], user), PRESETS.avatar)}")` }}
|
|
||||||
onClick={() => window.postMessage({ type: 'username', username: user.username }, '*')}
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div className={styles.thumb_user}>~{path(['username'], user)}</div>
|
<div className={styles.thumb_user}>~{path(['username'], user)}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className={styles.text}>{children}</div>
|
<div className={styles.text}>{children}</div>
|
||||||
</Card>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
export { CommentWrapper };
|
export { CommentWrapper };
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
@import "src/styles/variables";
|
@import "src/styles/variables";
|
||||||
|
|
||||||
.wrap {
|
.wrap {
|
||||||
|
@include outer_shadow;
|
||||||
|
|
||||||
background: $comment_bg;
|
background: $comment_bg;
|
||||||
min-height: $comment_height;
|
min-height: $comment_height;
|
||||||
display: flex;
|
display: flex;
|
||||||
position: relative;
|
position: relative;
|
||||||
box-shadow: none;
|
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
|
border-radius: $radius;
|
||||||
|
|
||||||
&:global(.is_empty) {
|
&:global(.is_empty) {
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
|
@ -54,7 +56,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.thumb_image {
|
div.thumb_image {
|
||||||
height: $comment_height;
|
height: $comment_height;
|
||||||
background: transparentize(white, 0.97) no-repeat 50% 50%;
|
background: transparentize(white, 0.97) no-repeat 50% 50%;
|
||||||
border-radius: $panel_radius 0 0 $panel_radius;
|
border-radius: $panel_radius 0 0 $panel_radius;
|
||||||
|
@ -65,6 +67,7 @@
|
||||||
|
|
||||||
@include tablet {
|
@include tablet {
|
||||||
height: 32px;
|
height: 32px;
|
||||||
|
width: 32px;
|
||||||
flex: 0 0 32px;
|
flex: 0 0 32px;
|
||||||
border-radius: $panel_radius;
|
border-radius: $panel_radius;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,6 @@
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
|
||||||
&> * {
|
&> * {
|
||||||
margin: 0 $gap $gap 0;
|
margin: $gap / 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
32
src/components/node/NodeAuthorBlock/index.tsx
Normal file
32
src/components/node/NodeAuthorBlock/index.tsx
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
import React, { FC, useCallback } from 'react';
|
||||||
|
import { INode } from '~/redux/types';
|
||||||
|
import styles from './styles.module.scss';
|
||||||
|
import { CommentAvatar } from '~/components/comment/CommentAvatar';
|
||||||
|
import { openUserProfile } from '~/utils/user';
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
node?: INode;
|
||||||
|
}
|
||||||
|
|
||||||
|
const NodeAuthorBlock: FC<Props> = ({ node }) => {
|
||||||
|
if (!node?.user) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const { fullname, username, description, photo } = node.user;
|
||||||
|
|
||||||
|
const onOpenProfile = useCallback(() => openUserProfile(username), [username]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={styles.block} onClick={onOpenProfile}>
|
||||||
|
<CommentAvatar username={username} url={photo?.url} className={styles.avatar} />
|
||||||
|
|
||||||
|
<div className={styles.info}>
|
||||||
|
<div className={styles.username}>{fullname || username}</div>
|
||||||
|
{description && <div className={styles.description}>{description}</div>}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export { NodeAuthorBlock };
|
39
src/components/node/NodeAuthorBlock/styles.module.scss
Normal file
39
src/components/node/NodeAuthorBlock/styles.module.scss
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
@import "~/styles/variables.scss";
|
||||||
|
|
||||||
|
div.block {
|
||||||
|
@include inner_shadow_active;
|
||||||
|
|
||||||
|
cursor: pointer;
|
||||||
|
background: $inset_bg;
|
||||||
|
padding: $gap;
|
||||||
|
border-radius: $radius;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: stretch;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info {
|
||||||
|
}
|
||||||
|
|
||||||
|
.username {
|
||||||
|
font: $font_16_semibold;
|
||||||
|
line-height: 21px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.description {
|
||||||
|
@include clamp(3, 12 * 1.25);
|
||||||
|
|
||||||
|
margin-top: 3px;
|
||||||
|
font: $font_12_regular;
|
||||||
|
line-height: 1.25em;
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.avatar {
|
||||||
|
width: 48px;
|
||||||
|
height: 48px;
|
||||||
|
margin-right: 10px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
align-self: flex-start;
|
||||||
|
}
|
|
@ -12,6 +12,7 @@ import { NodeTagsBlock } from '~/components/node/NodeTagsBlock';
|
||||||
import { INodeRelated } from '~/redux/node/types';
|
import { INodeRelated } from '~/redux/node/types';
|
||||||
import StickyBox from 'react-sticky-box/dist/esnext';
|
import StickyBox from 'react-sticky-box/dist/esnext';
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
import { NodeAuthorBlock } from '~/components/node/NodeAuthorBlock';
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
node: INode;
|
node: INode;
|
||||||
|
@ -60,10 +61,17 @@ const NodeBottomBlock: FC<IProps> = ({
|
||||||
|
|
||||||
<div className={styles.panel}>
|
<div className={styles.panel}>
|
||||||
<StickyBox className={styles.sticky} offsetTop={72}>
|
<StickyBox className={styles.sticky} offsetTop={72}>
|
||||||
<Group className={styles.left}>
|
<div className={styles.left}>
|
||||||
<NodeTagsBlock node={node} isLoading={isLoading} />
|
<div className={styles.left_item}>
|
||||||
<NodeRelatedBlock isLoading={isLoading} node={node} related={related} />
|
<NodeAuthorBlock node={node} />
|
||||||
</Group>
|
</div>
|
||||||
|
<div className={styles.left_item}>
|
||||||
|
<NodeTagsBlock node={node} isLoading={isLoading} />
|
||||||
|
</div>
|
||||||
|
<div className={styles.left_item}>
|
||||||
|
<NodeRelatedBlock isLoading={isLoading} node={node} related={related} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</StickyBox>
|
</StickyBox>
|
||||||
</div>
|
</div>
|
||||||
</Group>
|
</Group>
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
padding-left: $gap / 2;
|
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
|
@ -51,3 +50,7 @@
|
||||||
flex: 1;
|
flex: 1;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.left_item {
|
||||||
|
padding-bottom: $gap * 2;
|
||||||
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
left: 50%;
|
left: 50%;
|
||||||
bottom: $gap * 2;
|
bottom: $gap * 2;
|
||||||
transform: translate(-50%, 0);
|
transform: translate(-50%, 0);
|
||||||
background: darken($comment_bg, 4%);
|
background: darken($content_bg, 4%);
|
||||||
width: auto;
|
width: auto;
|
||||||
padding: 5px 10px;
|
padding: 5px 10px;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
@import "src/styles/variables";
|
@import "src/styles/variables";
|
||||||
|
|
||||||
.place {
|
.place {
|
||||||
// height: 72px;
|
@include row_shadow;
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
margin-top: -$radius;
|
margin-top: -$radius;
|
||||||
|
|
|
@ -38,7 +38,6 @@
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
background-color: $content_bg;
|
|
||||||
|
|
||||||
&:global(.stack) {
|
&:global(.stack) {
|
||||||
padding: 0 $gap;
|
padding: 0 $gap;
|
||||||
|
@ -59,12 +58,10 @@
|
||||||
justify-content: stretch;
|
justify-content: stretch;
|
||||||
border-radius: $radius $radius 0 0;
|
border-radius: $radius $radius 0 0;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: $gap $gap;
|
padding: $gap;
|
||||||
height: 64px;
|
height: 64px;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
|
|
||||||
@include outer_shadow();
|
|
||||||
|
|
||||||
@include tablet {
|
@include tablet {
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
height: auto;
|
height: auto;
|
||||||
|
|
|
@ -5,6 +5,7 @@ import { INode } from '~/redux/types';
|
||||||
import { PRESETS, URLS } from '~/constants/urls';
|
import { PRESETS, URLS } from '~/constants/urls';
|
||||||
import { RouteComponentProps, withRouter } from 'react-router';
|
import { RouteComponentProps, withRouter } from 'react-router';
|
||||||
import { getURL, stringToColour } from '~/utils/dom';
|
import { getURL, stringToColour } from '~/utils/dom';
|
||||||
|
import { CommentAvatar } from '~/components/comment/CommentAvatar';
|
||||||
|
|
||||||
type IProps = RouteComponentProps & {
|
type IProps = RouteComponentProps & {
|
||||||
item: Partial<INode>;
|
item: Partial<INode>;
|
||||||
|
@ -59,6 +60,8 @@ const NodeRelatedItemUnconnected: FC<IProps> = memo(({ item, history }) => {
|
||||||
return 'small';
|
return 'small';
|
||||||
}, [width]);
|
}, [width]);
|
||||||
|
|
||||||
|
const image = useMemo(() => getURL({ url: item.thumbnail }, PRESETS.avatar), [item.thumbnail]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={classNames(styles.item, styles[size], { [styles.is_loaded]: is_loaded })}
|
className={classNames(styles.item, styles[size], { [styles.is_loaded]: is_loaded })}
|
||||||
|
@ -66,11 +69,10 @@ const NodeRelatedItemUnconnected: FC<IProps> = memo(({ item, history }) => {
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
ref={ref}
|
ref={ref}
|
||||||
>
|
>
|
||||||
<div
|
<CommentAvatar
|
||||||
className={styles.thumb}
|
username={item.title}
|
||||||
style={{
|
url={item.thumbnail}
|
||||||
backgroundImage: `url("${thumb}")`,
|
className={classNames(styles.thumb, { [styles.is_loaded]: is_loaded })}
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{!item.thumbnail && size === 'small' && (
|
{!item.thumbnail && size === 'small' && (
|
||||||
|
@ -85,11 +87,7 @@ const NodeRelatedItemUnconnected: FC<IProps> = memo(({ item, history }) => {
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<img
|
<img src={image} alt="loader" onLoad={() => setIsLoaded(true)} />
|
||||||
src={getURL({ url: item.thumbnail }, PRESETS.avatar)}
|
|
||||||
alt="loader"
|
|
||||||
onLoad={() => setIsLoaded(true)}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
|
@ -16,13 +16,10 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.thumb {
|
div.thumb {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
border-radius: $cell_radius;
|
|
||||||
background: lighten($content_bg, 2%) 50% 50% no-repeat;
|
|
||||||
background-size: cover;
|
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transition: opacity 0.5s;
|
transition: opacity 0.5s;
|
||||||
will-change: opacity;
|
will-change: opacity;
|
||||||
|
@ -33,6 +30,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.letters, .title {
|
.letters, .title {
|
||||||
|
@include outer_shadow;
|
||||||
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
color: darken(white, 50%);
|
color: darken(white, 50%);
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
padding: 0 $gap / 2;
|
padding: 0 $gap / 2;
|
||||||
padding-bottom: $gap / 2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.tags.tags {
|
.tags.tags {
|
||||||
|
@ -20,7 +19,7 @@
|
||||||
@include lab_shadow;
|
@include lab_shadow;
|
||||||
|
|
||||||
border-radius: $radius;
|
border-radius: $radius;
|
||||||
background-color: $comment_bg;
|
background: $comment_bg;
|
||||||
padding: $gap;
|
padding: $gap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,9 @@ $text_sign: 22px;
|
||||||
$input_bg_color: darken($content_bg, 2%);
|
$input_bg_color: darken($content_bg, 2%);
|
||||||
$button_bg_color: $red_gradient;
|
$button_bg_color: $red_gradient;
|
||||||
|
|
||||||
$comment_bg: lighten($content_bg, 2%);
|
$inset_bg: linear-gradient(135deg, darken($content_bg, 2%), $content_bg);
|
||||||
|
$comment_bg: linear-gradient(135deg, $content_bg, lighten($content_bg, 2%));
|
||||||
|
|
||||||
$panel_bg: transparent;
|
$panel_bg: transparent;
|
||||||
$node_bg: darken($content_bg, 2%);
|
$node_bg: darken($content_bg, 2%);
|
||||||
$node_image_bg: darken($main_bg_color, 4%);
|
$node_image_bg: darken($main_bg_color, 4%);
|
||||||
|
|
|
@ -88,11 +88,38 @@ $login_dialog_padding: $gap $gap 30px $gap;
|
||||||
$sidebar_border: transparentize(white, 0.95);
|
$sidebar_border: transparentize(white, 0.95);
|
||||||
|
|
||||||
@mixin outer_shadow() {
|
@mixin outer_shadow() {
|
||||||
box-shadow: inset transparentize(white, 0.95) 0 1px, transparentize(black, 0.8) -1px -1px;
|
box-shadow:
|
||||||
|
inset transparentize(white, 0.95) 1px 1px,
|
||||||
|
transparentize(black, 0.8) 1px 1px,
|
||||||
|
transparentize(black, 0.6) 0 1px 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@mixin row_shadow() {
|
||||||
|
&:not(last-child) {
|
||||||
|
box-shadow:
|
||||||
|
transparentize(white, 0.95) 0 1px,
|
||||||
|
inset transparentize(black, 0.8) 0 -1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:only-child {
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin inner_shadow() {
|
@mixin inner_shadow() {
|
||||||
box-shadow: inset transparentize(white, 0.95) 0 -1px, inset transparentize(black, 0.5) 0 1px;
|
box-shadow:
|
||||||
|
inset transparentize(white, 0.92) -1px -1px,
|
||||||
|
inset transparentize(black, 0.5) 1px 1px,
|
||||||
|
inset transparentize(black, 0.7) 0 0 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@mixin inner_shadow_active() {
|
||||||
|
@include inner_shadow;
|
||||||
|
transition: background-color 250ms;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: transparentize(white, 0.95);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin input_shadow() {
|
@mixin input_shadow() {
|
||||||
|
@ -232,7 +259,8 @@ $sidebar_border: transparentize(white, 0.95);
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin lab_shadow {
|
@mixin lab_shadow {
|
||||||
box-shadow: transparentize(black, 0.5) 0 0 0 1px,
|
box-shadow:
|
||||||
|
transparentize(black, 0.5) 0 0 0 1px,
|
||||||
inset transparentize(white, 0.9) 0 1px,
|
inset transparentize(white, 0.9) 0 1px,
|
||||||
lighten(black, 10%) 0 4px;
|
lighten(black, 0.1) 0 4px;
|
||||||
}
|
}
|
||||||
|
|
7
src/utils/user.ts
Normal file
7
src/utils/user.ts
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
export const openUserProfile = (username?: string) => {
|
||||||
|
if (!username) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
window.postMessage({ type: 'username', username }, '*');
|
||||||
|
};
|
Loading…
Add table
Add a link
Reference in a new issue