diff options
author | lonkaars <l.leblansch@gmail.com> | 2021-03-30 12:52:46 +0200 |
---|---|---|
committer | lonkaars <l.leblansch@gmail.com> | 2021-03-30 12:52:46 +0200 |
commit | 2a0b62d48e9c63246d1f8935acc9756137dd8fd2 (patch) | |
tree | fecc7d189ee4dc003d86bd27be9a1b1e196a94c7 /components | |
parent | 627166edff0d7c32a99f330c83fb98891a68fc81 (diff) |
light mode css
Diffstat (limited to 'components')
-rw-r--r-- | components/tag.tsx | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/components/tag.tsx b/components/tag.tsx new file mode 100644 index 0000000..6cacb89 --- /dev/null +++ b/components/tag.tsx @@ -0,0 +1,24 @@ +import { CSSProperties } from 'react'; + +export default function Tags(props: { + tags: Array<string>; +}) { + return <div className="tags"> + <span>Tags:</span> + {props.tags.map(tag => <Tag name={tag}/>)} + </div> +} + +export function Tag(props: { + name: string; +}) { + return <a className="tag" href={"/search?tag=" + props.name} style={{ + "--tag-hue": props.name + .split("") + .map(char => char.charCodeAt(0)) + .reduce((a, b) => a + b) + % 360 + } as CSSProperties}> + {props.name} + </a> +} |