diff --git a/.yarn/install-state.gz b/.yarn/install-state.gz index dc5589e..64fa86d 100644 Binary files a/.yarn/install-state.gz and b/.yarn/install-state.gz differ diff --git a/package.json b/package.json index 12e913e..89274b9 100644 --- a/package.json +++ b/package.json @@ -59,6 +59,7 @@ "react-syntax-highlighter": "^15.5.0", "react-tippy": "^1.4.0", "react-toastify": "^10.0.4", + "react-wordcloud": "^1.2.7", "rehype-raw": "^7.0.0", "remark-gfm": "^4.0.0", "styled-components": "^6.1.8", diff --git a/src/components/organisms/home/Intro.tsx b/src/components/organisms/home/Intro.tsx index e1da741..0f013d1 100644 --- a/src/components/organisms/home/Intro.tsx +++ b/src/components/organisms/home/Intro.tsx @@ -1,32 +1,35 @@ -import clsx from 'clsx'; -import { Inder } from 'next/font/google'; import React from 'react'; -import { FaLaptopCode, FaLightbulb } from 'react-icons/fa'; -import { MdHomeWork } from 'react-icons/md'; -const inder = Inder({ weight: '400', subsets: ['latin'] }); +import styles from './home.module.css'; -const Intro = () => { +import clsxm from '@/lib/clsxm'; +import { shuffleArray } from '@/lib/helper'; + +import TagCloud from '@/components/organisms/home/TagCloud'; + +import Terminal from './Terminal'; + +import { CodeSnippet } from '@/types/CodeSnippet'; + +export interface IntroProps { + codeSnippets: CodeSnippet[]; + greeting: string; +} + +const Intro = ({ greeting, codeSnippets }: IntroProps) => { return ( -
-
-
- - Full-Stack Engineer -
-
- - Lifelong Learner -
-
- - WFH enthusiast -
+
+

+ + {greeting} + {' '} + 👋 +

+ +
+ + +
); diff --git a/src/components/organisms/home/Intro2.tsx b/src/components/organisms/home/Intro2.tsx deleted file mode 100644 index 0e45487..0000000 --- a/src/components/organisms/home/Intro2.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import React from 'react'; - -import styles from './home.module.css'; - -import clsxm from '@/lib/clsxm'; -import { shuffleArray } from '@/lib/helper'; - -import Intro from '@/components/organisms/home/Intro'; - -import Terminal from './Terminal'; - -import { CodeSnippet } from '@/types/CodeSnippet'; - -export interface IntroProps { - codeSnippets: CodeSnippet[]; - greeting: string; -} - -const Intro2 = ({ greeting, codeSnippets }: IntroProps) => { - return ( -
-

- - {greeting} - {' '} - 👋 -

- -
- - - -
-
- ); -}; - -export default Intro2; diff --git a/src/components/organisms/home/TagCloud.tsx b/src/components/organisms/home/TagCloud.tsx new file mode 100644 index 0000000..695c5a0 --- /dev/null +++ b/src/components/organisms/home/TagCloud.tsx @@ -0,0 +1,50 @@ +'use client'; + +// import {Inder} from 'next/font/google'; +import React from 'react'; +import ReactWordcloud from 'react-wordcloud'; + +import 'tippy.js/dist/tippy.css'; +import 'tippy.js/animations/scale.css'; + +import tags from '@/data/tags.json'; + +// const inder = Inder({weight: '400', subsets: ['latin']}); + +interface Options { + colors?: string[]; + rotations?: number; + rotationAngles?: [number, number]; + deterministic?: boolean; + fontFamily?: string; + fontSizes?: [number, number]; + padding?: number; + randomSeed?: string; + enableTooltip?: boolean; +} + +const TagCloud = () => { + const callbacks = { + // getWordColor: (tag: Tag) => tag.value > 10 ? "blue" : "lightblue", + // onWordClick: console.log, + // onWordMouseOver: console.log, + // getWordTooltip: (tag: Tag) => `${tag.text} (${tag.value}) [${tag.value > 50 ? "good" : "bad"}]`, + }; + const options: Options = { + colors: ['#0d40a4', '#1A86D2', '#61c1f8', '#FFCE47'], + rotations: 1, + rotationAngles: [0, 0], + fontFamily: 'verdana', + fontSizes: [10, 42], + deterministic: true, + enableTooltip: false, + }; + + return ( +
+ +
+ ); +}; + +export default TagCloud; diff --git a/src/components/pages/home-page.tsx b/src/components/pages/home-page.tsx index 603f5ad..9ae5df0 100644 --- a/src/components/pages/home-page.tsx +++ b/src/components/pages/home-page.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import Intro2 from '@/components/organisms/home/Intro2'; +import Intro from '@/components/organisms/home/Intro'; import Summary from '@/components/organisms/home/Summary'; import { CodeSnippet } from '@/types/CodeSnippet'; @@ -14,7 +14,7 @@ export default function HomePage({ homePage, codeSnippets }: HomePageProps) { return (
- +
diff --git a/src/data/tags.json b/src/data/tags.json new file mode 100644 index 0000000..2ada35d --- /dev/null +++ b/src/data/tags.json @@ -0,0 +1,222 @@ +[ + { + "value": 20, + "text": "software engineer" + }, + { + "value": 20, + "text": "full-stack developer" + }, + { + "value": 17, + "text": "frontend" + }, + { + "value": 19, + "text": "backend" + }, + { + "value": 18, + "text": "Java" + }, + { + "value": 18, + "text": "Kotlin" + }, + { + "value": 16, + "text": "Typescript" + }, + { + "value": 17, + "text": "Javascript" + }, + { + "value": 16, + "text": "next.js" + }, + { + "value": 15, + "text": "Spring Boot" + }, + { + "value": 14, + "text": "CSS" + }, + { + "value": 15, + "text": "HTML" + }, + { + "value": 18, + "text": "lifelong learner" + }, + { + "value": 17, + "text": "WFH enthusiast" + }, + { + "value": 13, + "text": "remote work" + }, + { + "value": 16, + "text": "Appetize" + }, + { + "value": 14, + "text": "Resourcify" + }, + { + "value": 16, + "text": "Booking.com" + }, + { + "value": 13, + "text": "BJSS" + }, + { + "value": 13, + "text": "UniBZ" + }, + { + "value": 15, + "text": "University of Manchester" + }, + { + "value": 15, + "text": "College of Charleston" + }, + { + "value": 12, + "text": "Tongji University" + }, + { + "value": 5, + "text": "multilingual" + }, + { + "value": 11, + "text": "python" + }, + { + "value": 11, + "text": "C#" + }, + { + "value": 12, + "text": "computer science" + }, + { + "value": 10, + "text": "writing" + }, + { + "value": 10, + "text": "reading" + }, + { + "value": 10, + "text": "bookworm" + }, + { + "value": 9, + "text": "\uD83D\uDCDA" + }, + { + "value": 9, + "text": "oboe" + }, + { + "value": 9, + "text": "\uD83C\uDFB6" + }, + { + "value": 10, + "text": "travel" + }, + { + "value": 8, + "text": "photos" + }, + { + "value": 8, + "text": "food" + }, + { + "value": 8, + "text": "recipes" + }, + { + "value": 7, + "text": "podcasts" + }, + { + "value": 8, + "text": "video games" + }, + { + "value": 6, + "text": "\uD83D\uDC08" + }, + { + "value": 6, + "text": "\uD83D\uDC22" + }, + { + "value": 6, + "text": "\uD83E\uDD94" + }, + { + "value": 8, + "text": "classical music" + }, + { + "value": 16, + "text": "React" + }, + { + "value": 15, + "text": "Angular" + }, + { + "value": 10, + "text": "Vue" + }, + { + "value": 16, + "text": "APIs" + }, + { + "value": 12, + "text": "UI" + }, + { + "value": 13, + "text": "tailwind" + }, + { + "value": 13, + "text": "android" + }, + { + "value": 11, + "text": "iOS" + }, + { + "value": 7, + "text": "PHP" + }, + { + "value": 8, + "text": "Docker" + }, + { + "value": 8, + "text": "SQL" + }, + { + "value": 7, + "text": "GraphQL" + } +] diff --git a/yarn.lock b/yarn.lock index 3216c7e..f53a582 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2996,7 +2996,7 @@ __metadata: languageName: node linkType: hard -"@popperjs/core@npm:^2.11.8": +"@popperjs/core@npm:^2.11.8, @popperjs/core@npm:^2.9.0": version: 2.11.8 resolution: "@popperjs/core@npm:2.11.8" checksum: 10c0/4681e682abc006d25eb380d0cf3efc7557043f53b6aea7a5057d0d1e7df849a00e281cd8ea79c902a35a414d7919621fc2ba293ecec05f413598e0b23d5a1e63 @@ -8366,6 +8366,146 @@ __metadata: languageName: node linkType: hard +"d3-array@npm:2, d3-array@npm:^2.3.0, d3-array@npm:^2.5.0": + version: 2.12.1 + resolution: "d3-array@npm:2.12.1" + dependencies: + internmap: "npm:^1.0.0" + checksum: 10c0/7eca10427a9f113a4ca6a0f7301127cab26043fd5e362631ef5a0edd1c4b2dd70c56ed317566700c31e4a6d88b55f3951aaba192291817f243b730cb2352882e + languageName: node + linkType: hard + +"d3-cloud@npm:^1.2.5": + version: 1.2.7 + resolution: "d3-cloud@npm:1.2.7" + dependencies: + d3-dispatch: "npm:^1.0.3" + checksum: 10c0/9a1eb9b1854d5f54b9aba9afe1edfeca14f2849e6176aa6fcee51def62fd825c802e9b2cf37d8b3d51868c894558596fbe5a0bd956d9bf065b55decb95892e10 + languageName: node + linkType: hard + +"d3-color@npm:1": + version: 1.4.1 + resolution: "d3-color@npm:1.4.1" + checksum: 10c0/668721dedc1d7e84aa9b3c51ccbaa1facd92ae9303d86ea0d5d0cf589dab892bc4cc7e155696537ed43e8f053d3ad0dde86363e1a789bad800a786f2ede527d7 + languageName: node + linkType: hard + +"d3-color@npm:1 - 2": + version: 2.0.0 + resolution: "d3-color@npm:2.0.0" + checksum: 10c0/5aa58dfb78e3db764373a904eabb643dc024ff6071128a41e86faafa100e0e17a796e06ac3f2662e9937242bb75b8286788629773d76936f11c17bd5fe5e15cd + languageName: node + linkType: hard + +"d3-dispatch@npm:1, d3-dispatch@npm:^1.0.3, d3-dispatch@npm:^1.0.6": + version: 1.0.6 + resolution: "d3-dispatch@npm:1.0.6" + checksum: 10c0/6302554a019e2d75d4e3dc7e8757a00b4b12ac2a2952bccc66e4478ccd170f425e2b6a9443118d5feadcd2439f33582b63c7925e832104ff1978cadea2a30dc2 + languageName: node + linkType: hard + +"d3-ease@npm:1": + version: 1.0.7 + resolution: "d3-ease@npm:1.0.7" + checksum: 10c0/784de7696cc683f251b2186ae4e248761758bdbfab1f78f1a7bddb08a4832923033be765dba907485f8911270f9343c3068e543d33d77cca1182582b34cb4970 + languageName: node + linkType: hard + +"d3-format@npm:1 - 2": + version: 2.0.0 + resolution: "d3-format@npm:2.0.0" + checksum: 10c0/c869af459e20767dc3d9cbb2946ba79cc266ae4fb35d11c50c63fc89ea4ed168c702c7e3db94d503b3618de9609bf3bf2d855ef53e21109ddd7eb9c8f3fcf8a1 + languageName: node + linkType: hard + +"d3-interpolate@npm:1": + version: 1.4.0 + resolution: "d3-interpolate@npm:1.4.0" + dependencies: + d3-color: "npm:1" + checksum: 10c0/33274a06d5969f7cf8477f490dd9bea6cf2f5e89da800e0db17e1b6663dfcc288ebc34ae85f891e83f59f87086e9468db0614281b9fe8ba50162d8a45149ed0f + languageName: node + linkType: hard + +"d3-interpolate@npm:1.2.0 - 2": + version: 2.0.1 + resolution: "d3-interpolate@npm:2.0.1" + dependencies: + d3-color: "npm:1 - 2" + checksum: 10c0/2a5725b0c9c7fef3e8878cf75ad67be851b1472de3dda1f694c441786a1a32e198ddfaa6880d6b280401c1af5b844b61ccdd63d85d1607c1e6bb3a3f0bf532ea + languageName: node + linkType: hard + +"d3-scale-chromatic@npm:^1.5.0": + version: 1.5.0 + resolution: "d3-scale-chromatic@npm:1.5.0" + dependencies: + d3-color: "npm:1" + d3-interpolate: "npm:1" + checksum: 10c0/162e63d95ff67f5c50ca55d47c172dfbc2eb0dcb437121fd8256961d747c7a10206b45b1789e7abe51f30a40295c216b78a9ccc06f74d89ef52197417a40811c + languageName: node + linkType: hard + +"d3-scale@npm:^3.2.1": + version: 3.3.0 + resolution: "d3-scale@npm:3.3.0" + dependencies: + d3-array: "npm:^2.3.0" + d3-format: "npm:1 - 2" + d3-interpolate: "npm:1.2.0 - 2" + d3-time: "npm:^2.1.1" + d3-time-format: "npm:2 - 3" + checksum: 10c0/cb63c271ec9c5b632c245c63e0d0716b32adcc468247972c552f5be62fb34a17f71e4ac29fd8976704369f4b958bc6789c61a49427efe2160ae979d7843569dc + languageName: node + linkType: hard + +"d3-selection@npm:1.4.2, d3-selection@npm:^1.1.0": + version: 1.4.2 + resolution: "d3-selection@npm:1.4.2" + checksum: 10c0/e755b6b62d794d0b968cc6264f37109e425de0d9fd306ce94414b07e46a2c6830d21c1fe0821a660d07e82069b6fe3b67da1b3b909e8f6af8f16f020cd25cae0 + languageName: node + linkType: hard + +"d3-time-format@npm:2 - 3": + version: 3.0.0 + resolution: "d3-time-format@npm:3.0.0" + dependencies: + d3-time: "npm:1 - 2" + checksum: 10c0/0abe3379f07d1c12ce8930cdddad1223c99cd3e4eac05cf409b5a7953e9ebed56a95a64b0977f63958cfb6101fa4a2a85533a5eae40df84f22c0117dbf5e8982 + languageName: node + linkType: hard + +"d3-time@npm:1 - 2, d3-time@npm:^2.1.1": + version: 2.1.1 + resolution: "d3-time@npm:2.1.1" + dependencies: + d3-array: "npm:2" + checksum: 10c0/4a01770a857bc37d2bafb8f00250e0e6a1fcc8051aea93e5eed168d8ee93e92da508a75ab5e42fc5472aa37e2a83aac68afaf3f12d9167c184ce781faadf5682 + languageName: node + linkType: hard + +"d3-timer@npm:1": + version: 1.0.10 + resolution: "d3-timer@npm:1.0.10" + checksum: 10c0/7e77030a206861e4e626754c689795d43f036fb07a7f8ca6360eb8b7cbe6f52bf43c9c4297ae9a9a906e4de594212702f83c0cde23d4e20d8689a4211e438155 + languageName: node + linkType: hard + +"d3-transition@npm:^1.3.2": + version: 1.3.2 + resolution: "d3-transition@npm:1.3.2" + dependencies: + d3-color: "npm:1" + d3-dispatch: "npm:1" + d3-ease: "npm:1" + d3-interpolate: "npm:1" + d3-selection: "npm:^1.1.0" + d3-timer: "npm:1" + checksum: 10c0/b78a34108b2514c2e5ce65837742027497ea36408ad19d725ec7d0cc9fcead3c40353d6d8640813210c9367d3e7ae7f4b608beed8cafb4e0cabaa56fd610e3f0 + languageName: node + linkType: hard + "damerau-levenshtein@npm:^1.0.8": version: 1.0.8 resolution: "damerau-levenshtein@npm:1.0.8" @@ -11615,6 +11755,13 @@ __metadata: languageName: node linkType: hard +"internmap@npm:^1.0.0": + version: 1.0.1 + resolution: "internmap@npm:1.0.1" + checksum: 10c0/60942be815ca19da643b6d4f23bd0bf4e8c97abbd080fb963fe67583b60bdfb3530448ad4486bae40810e92317bded9995cc31411218acc750d72cd4e8646eee + languageName: node + linkType: hard + "interpret@npm:^3.1.1": version: 3.1.1 resolution: "interpret@npm:3.1.1" @@ -13302,6 +13449,13 @@ __metadata: languageName: node linkType: hard +"lodash.clonedeep@npm:^4.5.0": + version: 4.5.0 + resolution: "lodash.clonedeep@npm:4.5.0" + checksum: 10c0/2caf0e4808f319d761d2939ee0642fa6867a4bbf2cfce43276698828380756b99d4c4fa226d881655e6ac298dd453fe12a5ec8ba49861777759494c534936985 + languageName: node + linkType: hard + "lodash.debounce@npm:^4.0.8": version: 4.0.8 resolution: "lodash.debounce@npm:4.0.8" @@ -13666,6 +13820,7 @@ __metadata: react-syntax-highlighter: "npm:^15.5.0" react-tippy: "npm:^1.4.0" react-toastify: "npm:^10.0.4" + react-wordcloud: "npm:^1.2.7" rehype-raw: "npm:^7.0.0" remark-gfm: "npm:^4.0.0" storybook: "npm:^7.6.17" @@ -17203,6 +17358,28 @@ __metadata: languageName: node linkType: hard +"react-wordcloud@npm:^1.2.7": + version: 1.2.7 + resolution: "react-wordcloud@npm:1.2.7" + dependencies: + d3-array: "npm:^2.5.0" + d3-cloud: "npm:^1.2.5" + d3-dispatch: "npm:^1.0.6" + d3-scale: "npm:^3.2.1" + d3-scale-chromatic: "npm:^1.5.0" + d3-selection: "npm:1.4.2" + d3-transition: "npm:^1.3.2" + lodash.clonedeep: "npm:^4.5.0" + lodash.debounce: "npm:^4.0.8" + resize-observer-polyfill: "npm:^1.5.1" + seedrandom: "npm:^3.0.5" + tippy.js: "npm:^6.2.6" + peerDependencies: + react: ^16.13.0 + checksum: 10c0/571e83882c68f7b78fea3825a0f5d2653976ed04d1b001a424023805ac1ec3fb26a7da0b8dcf913ffbc348defa5c3284a7050879eabf10526e42a35a078703b2 + languageName: node + linkType: hard + "react@npm:^18.2.0": version: 18.2.0 resolution: "react@npm:18.2.0" @@ -17571,6 +17748,13 @@ __metadata: languageName: node linkType: hard +"resize-observer-polyfill@npm:^1.5.1": + version: 1.5.1 + resolution: "resize-observer-polyfill@npm:1.5.1" + checksum: 10c0/5e882475067f0b97dc07e0f37c3e335ac5bc3520d463f777cec7e894bb273eddbfecb857ae668e6fb6881fd6f6bb7148246967172139302da50fa12ea3a15d95 + languageName: node + linkType: hard + "resolve-cwd@npm:^3.0.0": version: 3.0.0 resolution: "resolve-cwd@npm:3.0.0" @@ -17937,6 +18121,13 @@ __metadata: languageName: node linkType: hard +"seedrandom@npm:^3.0.5": + version: 3.0.5 + resolution: "seedrandom@npm:3.0.5" + checksum: 10c0/929752ac098ff4990b3f8e0ac39136534916e72879d6eb625230141d20db26e2f44c4d03d153d457682e8cbaab0fb7d58a1e7267a157cf23fd8cf34e25044e88 + languageName: node + linkType: hard + "semver@npm:2 || 3 || 4 || 5, semver@npm:^5.6.0": version: 5.7.2 resolution: "semver@npm:5.7.2" @@ -19176,6 +19367,15 @@ __metadata: languageName: node linkType: hard +"tippy.js@npm:^6.2.6": + version: 6.3.7 + resolution: "tippy.js@npm:6.3.7" + dependencies: + "@popperjs/core": "npm:^2.9.0" + checksum: 10c0/ec3677beb8caec791ee1f715663f28f42d60e0f7250074a047d13d5e6db95fdb6d26d8a3ac16cecb4ebcaf33ae919dbc889cf97948d115e8d3c81518c911b379 + languageName: node + linkType: hard + "title-case@npm:^3.0.3": version: 3.0.3 resolution: "title-case@npm:3.0.3"