aboutsummaryrefslogtreecommitdiffstats
path: root/src/components
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2023-10-31 22:31:14 +0100
committerLibravatar Kristóf Marussy <kristof@marussy.com>2024-03-15 19:19:30 +0100
commit6bd77e41a145e239ee63a2152c79851458eff40f (patch)
tree226ab23bba764ad6a7aba76cc7a60191c3d7af09 /src/components
downloadblog-6bd77e41a145e239ee63a2152c79851458eff40f.tar.gz
blog-6bd77e41a145e239ee63a2152c79851458eff40f.tar.zst
blog-6bd77e41a145e239ee63a2152c79851458eff40f.zip
Initial commit
Diffstat (limited to 'src/components')
-rw-r--r--src/components/icons.tsx58
-rw-r--r--src/components/icons/fediverse.ts17
2 files changed, 75 insertions, 0 deletions
diff --git a/src/components/icons.tsx b/src/components/icons.tsx
new file mode 100644
index 0000000..5f3b40f
--- /dev/null
+++ b/src/components/icons.tsx
@@ -0,0 +1,58 @@
1/*
2 * SPDX-FileCopyrightText: 2023 Kristóf Marussy
3 *
4 * SPDX-License-Identifier: MIT
5 */
6
7import { useId } from 'react';
8import {
9 siGithub,
10 siGooglescholar,
11 siLinkedin,
12 siOrcid,
13} from 'simple-icons';
14
15import fediverse from './icons/fediverse';
16
17export function Icon({ path, alt }: {
18 path: string;
19 alt: string;
20}) {
21 const titleId = useId();
22
23 return (
24 <>
25 <svg
26 version="1.1"
27 xmlns="http://www.w3.org/2000/svg"
28 role="img"
29 aria-labelledby={titleId}
30 viewBox="0 0 24 24"
31 width="24"
32 height="24"
33 >
34 <path fill="currentColor" d={path} />
35 </svg>
36 <span className="sr-only" id={titleId}>{alt}</span>
37 </>
38 );
39}
40
41export function SimpleIcon({ icon: { path, title } }: {
42 icon: {
43 path: string;
44 title: string;
45 };
46}) {
47 return <Icon path={path} alt={title} />;
48}
49
50export const FediverseIcon = () => <SimpleIcon icon={fediverse} />;
51
52export const GithubIcon = () => <SimpleIcon icon={siGithub} />;
53
54export const GoogleScholarIcon = () => <SimpleIcon icon={siGooglescholar} />;
55
56export const LinkedInIcon = () => <SimpleIcon icon={siLinkedin} />;
57
58export const OrcidIcon = () => <SimpleIcon icon={siOrcid} />;
diff --git a/src/components/icons/fediverse.ts b/src/components/icons/fediverse.ts
new file mode 100644
index 0000000..b1dec2c
--- /dev/null
+++ b/src/components/icons/fediverse.ts
@@ -0,0 +1,17 @@
1/*
2 * SPDX-FileCopyrightText: 2018 Eukombos <https://commons.wikimedia.org/wiki/User:Eukombos>
3 * SPDX-FileCopyrightText: 2023 Kristóf Marussy <kristof@marussy.com>
4 *
5 * SPDX-License-Identifier: CC0-1.0
6 *
7 * This icon is based on the Fediverse logo proposal (mono version) SVG by Eukombos at
8 * https://commons.wikimedia.org/w/index.php?title=File:Fediverse_logo_proposal_(mono_version).svg&oldid=794518552
9 *
10 * The paths in the original SVG were merged into a single path and
11 * the drawing was resized to match the "0 0 24 24" viewbox of Simple Icons.
12 */
13
14export default {
15 path: 'M 13.257051,0.00339397 A 2.2950868,2.2950868 0 0 0 10.840525,2.1702751 2.2950868,2.2950868 0 0 0 13.007402,4.5868015 2.2950868,2.2950868 0 0 0 15.423929,2.4199203 2.2950868,2.2950868 0 0 0 13.257051,0.00339397 Z M 10.64391,2.7023491 4.0999012,6.0186935 A 2.5245956,2.5245956 0 0 1 4.7885787,7.3777239 L 11.332517,4.0612358 A 2.5245955,2.5245955 0 0 1 10.64391,2.7023491 Z m 4.724906,0.7585318 A 2.5245955,2.5245955 0 0 1 14.28885,4.5357666 l 5.176748,5.1967186 A 2.5245956,2.5245956 0 0 1 20.545491,8.6575958 Z M 11.35807,4.0877908 7.5293316,11.562395 8.6597573,12.69719 12.713593,4.7833406 A 2.5245955,2.5245955 0 0 1 11.35807,4.0877908 Z m 2.918826,0.453989 a 2.5245955,2.5245955 0 0 1 -1.281947,0.2742046 2.5245955,2.5245955 0 0 1 -0.220951,-0.023055 l 0.579673,3.7118604 1.581694,0.2537951 z M 2.4249452,5.4931316 A 2.2950868,2.2950868 0 0 0 0.00841882,7.660009 2.2950868,2.2950868 0 0 0 2.1752978,10.076535 2.2950868,2.2950868 0 0 0 4.5918241,7.909658 2.2950868,2.2950868 0 0 0 2.4249452,5.4931316 Z m 2.3682857,1.912436 a 2.5245955,2.5245955 0 0 1 0.02778,0.5165439 2.5245955,2.5245955 0 0 1 -0.262386,0.9887843 l 3.7147213,0.5966321 0.7301174,-1.425807 z m 6.3666521,1.0224221 -0.730189,1.4259543 8.777093,1.409634 a 2.5245956,2.5245956 0 0 1 -0.02532,-0.502729 2.5245956,2.5245956 0 0 1 0.269329,-1.0013099 z m 10.667128,0.1785069 a 2.2950868,2.2950868 0 0 0 -2.416526,2.1668814 2.2950868,2.2950868 0 0 0 2.166877,2.416526 2.2950868,2.2950868 0 0 0 2.416527,-2.166881 2.2950868,2.2950868 0 0 0 -2.166878,-2.4165264 z M 4.5367126,8.9506224 A 2.5245955,2.5245955 0 0 1 3.4569593,10.025364 l 5.9276921,5.950814 1.4291036,-0.724252 z M 3.4240355,10.041972 a 2.5245955,2.5245955 0 0 1 -1.2611917,0.263659 2.5245955,2.5245955 0 0 1 -0.2437075,-0.02532 l 1.1324315,7.243427 a 2.5245956,2.5245956 0 0 1 1.2611913,-0.26366 2.5245956,2.5245956 0 0 1 0.2435639,0.02532 z m 10.2665345,0.620609 1.370554,8.775948 a 2.5245956,2.5245956 0 0 1 1.242795,-0.254438 2.5245956,2.5245956 0 0 1 0.264113,0.0291 l -1.295696,-8.29689 z m 5.523232,0.642655 -3.355852,1.700722 0.247408,1.582699 3.797032,-1.924387 a 2.5245956,2.5245956 0 0 1 -0.688607,-1.359034 z m 0.714085,1.385514 -3.342756,6.525902 a 2.5245955,2.5245955 0 0 1 1.35567,0.695622 l 3.342684,-6.525831 A 2.5245956,2.5245956 0 0 1 19.927887,12.69075 Z M 6.5335325,13.50647 4.594186,17.29248 a 2.5245956,2.5245956 0 0 1 1.3553834,0.695475 l 1.7143208,-3.346762 z m 7.3762655,0.486772 -7.934679,4.021268 a 2.5245955,2.5245955 0 0 1 0.6887504,1.359174 l 7.4933556,-3.797679 z m -1.554284,2.806385 -1.429103,0.724247 3.00357,3.015309 A 2.5245956,2.5245956 0 0 1 15.00995,19.464298 Z M 4.3003063,17.489091 A 2.2950868,2.2950868 0 0 0 1.88378,19.655897 2.2950868,2.2950868 0 0 0 4.0506589,22.072423 2.2950868,2.2950868 0 0 0 6.4671149,19.905546 2.2950868,2.2950868 0 0 0 4.3003063,17.489091 Z m 2.3695726,1.920453 a 2.5245955,2.5245955 0 0 1 0.026457,0.508527 2.5245955,2.5245955 0 0 1 -0.2663432,0.996011 l 7.2422093,1.162136 a 2.5245956,2.5245956 0 0 1 -0.02646,-0.508599 2.5245956,2.5245956 0 0 1 0.266381,-0.995943 z m 9.6215151,0.0037 a 2.2950868,2.2950868 0 0 0 -2.416523,2.166805 2.2950868,2.2950868 0 0 0 2.166878,2.416527 2.2950868,2.2950868 0 0 0 2.416526,-2.166878 2.2950868,2.2950868 0 0 0 -2.166881,-2.416454 z',
16 title: 'Fediverse',
17};