From 0066de5e0875d4741a27edb9a8f800fb2d06a7bb Mon Sep 17 00:00:00 2001 From: ozakione <29860391+OzakIOne@users.noreply.github.com> Date: Wed, 21 Aug 2024 15:00:41 +0200 Subject: [PATCH] grey generated image --- .../Author/GeneratedImage/index.tsx | 24 ++----------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/packages/docusaurus-theme-classic/src/theme/Blog/Components/Author/GeneratedImage/index.tsx b/packages/docusaurus-theme-classic/src/theme/Blog/Components/Author/GeneratedImage/index.tsx index ce6d8a0893..35f56b679c 100644 --- a/packages/docusaurus-theme-classic/src/theme/Blog/Components/Author/GeneratedImage/index.tsx +++ b/packages/docusaurus-theme-classic/src/theme/Blog/Components/Author/GeneratedImage/index.tsx @@ -11,14 +11,6 @@ import Link, {type Props as LinkProps} from '@docusaurus/Link'; import type {Props} from '@theme/Blog/Components/Author/GeneratedImage'; import styles from './styles.module.css'; -const hashString = (str: string) => { - let hash = 0; - for (let i = 0; i < str.length; i += 1) { - hash = (hash + str.charCodeAt(i) * (i + 1)) % 1000; - } - return hash; -}; - function MaybeLink(props: LinkProps): JSX.Element { if (props.href) { return ; @@ -31,25 +23,13 @@ export default function GeneratedImage({ link, className, }: Props): JSX.Element { - const gradientId = `grad-${link}`; - - const hashName = hashString(name); - const primaryColor = `hsl(${hashName % 360}, 95%, 50%)`; - const secondaryColor = `hsl(${(hashName + 120) % 360}, 95%, 50%)`; - return ( - - - - - - - + - {name![0]?.toLocaleUpperCase()} + {name[0]?.toLocaleUpperCase()}