38
loading...
This website collects cookies to deliver better user experience
One Dark Pro
theme.export function CommentCode({ children }: CodeProps) {
return <span className="text-gray-600">{children}</span>;
}
export function KeyCode({ children }: CodeProps) {
return <span className="text-purple-600">{children}</span>;
}
export function StringCode({ children }: CodeProps) {
return <span className="text-green-600">{children}</span>;
}
export function NumCode({ children }: CodeProps) {
return <span className="text-yellow-500">{children}</span>;
}
export function PropertyCode({ children }: CodeProps) {
return <span className="text-red-500">{children}</span>;
}
Code
component that represents each line of the code editor.export function Code({ line, error, warning, children }: Props) {
return (
<div className="flex py-0.5 space-x-4 text-gray-300">
<div className="flex items-center justify-end flex-shrink-0 w-12 text-gray-600 select-none">
{(error || warning) && (
<div
className={classNames(
"flex-shrink-0 w-2 h-2 mr-2 bg-opacity-60 rounded-full",
error ? "bg-red-500" : "bg-yellow-400"
)}
/>
)}
<div
className={classNames(
"flex-shrink-0",
error
? "text-red-500 text-opacity-60"
: warning && "text-yellow-400 text-opacity-60"
)}
>
{line}
</div>
</div>
<span>{children}</span>
{(error || warning) && (
<div
className={classNames(
"text-opacity-60",
error ? "text-red-500" : "text-yellow-400"
)}
>
{"◼ " + (error ? error : warning) + "..."}
</div>
)}
</div>
);
}
<Code line={lineCount++}>
<KeyCode>let</KeyCode>
<BaseCode> name = </BaseCode>
<StringCode>"Akmal Hossain"</StringCode>
<BaseCode>;</BaseCode>
</Code>
<Code line={lineCount++}>
<KeyCode>let</KeyCode>
<BaseCode> age = </BaseCode>
<NumCode>21</NumCode>
<BaseCode>;</BaseCode>
</Code>
<meta name="description" content="description" />
<meta property="og:type" content="website" />
<meta property="og:url" content="your url" />
<meta property="og:title" content="title" />
<meta property="og:description" content="description" />
<meta property="twitter:card" content="summary_large_image" />
<meta property="twitter:url" content="your url" />
<meta property="twitter:title" content="title" />
<meta property="twitter:description" content="description" />
Originally. I got the idea from Robin Malfait, who is a developer from tailwindlabs. He built his protfolio inspired by Neovim which is his code editor of choice. So I decided to build my own with the similar idea. My portfolio even has some similar jokes and easter eggs as his (I will change when I can come up with some of my own 😜).