mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
refactored flow cells, added colors for lab (#78)
* made better flow cells * made cubical desaturation * made colorfull lab nodes * colorful lab nodes for all text ones * all lab nodes are colorful * disabled lazy loading on heroes * fixed color calculation hook * fixed lab color gradients calculation * fixed cell text on flow
This commit is contained in:
parent
7d6f35b0af
commit
94c656fe0f
29 changed files with 345 additions and 63 deletions
|
@ -6,6 +6,9 @@ import { PRESETS, URLS } from '~/constants/urls';
|
|||
import { RouteComponentProps, withRouter } from 'react-router';
|
||||
import { getURL, stringToColour } from '~/utils/dom';
|
||||
import { Avatar } from '~/components/common/Avatar';
|
||||
import { normalizeBrightColor } from '~/utils/color';
|
||||
import { adjustHue } from 'color2k';
|
||||
import { useColorGradientFromString } from '~/utils/hooks/useColorGradientFromString';
|
||||
|
||||
type IProps = RouteComponentProps & {
|
||||
item: Partial<INode>;
|
||||
|
@ -37,10 +40,8 @@ const NodeRelatedItemUnconnected: FC<IProps> = memo(({ item, history }) => {
|
|||
() => (item.thumbnail ? getURL({ url: item.thumbnail }, PRESETS.avatar) : ''),
|
||||
[item]
|
||||
);
|
||||
const backgroundColor = useMemo(
|
||||
() => (!thumb && item.title && stringToColour(item.title)) || '',
|
||||
[]
|
||||
);
|
||||
|
||||
const background = useColorGradientFromString(!thumb ? item.title : '');
|
||||
|
||||
useEffect(() => {
|
||||
if (!ref.current) return;
|
||||
|
@ -76,13 +77,13 @@ const NodeRelatedItemUnconnected: FC<IProps> = memo(({ item, history }) => {
|
|||
/>
|
||||
|
||||
{!item.thumbnail && size === 'small' && (
|
||||
<div className={styles.letters} style={{ backgroundColor }}>
|
||||
<div className={styles.letters} style={{ background }}>
|
||||
{getTitleLetters(item.title)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{!item.thumbnail && size !== 'small' && (
|
||||
<div className={styles.title} style={{ backgroundColor }}>
|
||||
<div className={styles.title} style={{ background }}>
|
||||
{item.title}
|
||||
</div>
|
||||
)}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue