mirror of
https://git.aramjonghu.dev/AramJonghu/aramjonghu-site.git
synced 2026-09-14 10:03:30 +02:00
chore(icons): nerd-fonts icons included
This commit is contained in:
@@ -37,6 +37,12 @@
|
|||||||
font-display: swap;
|
font-display: swap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: "NerdFontSymbols";
|
||||||
|
src: url("./assets/fonts/nerd-fonts-symbols.woff2") format("woff2");
|
||||||
|
font-display: block;
|
||||||
|
}
|
||||||
|
|
||||||
.ui-btn {
|
.ui-btn {
|
||||||
@apply text-ctp-text border border-ctp-text rounded px-3 py-1 cursor-pointer transition-colors;
|
@apply text-ctp-text border border-ctp-text rounded px-3 py-1 cursor-pointer transition-colors;
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
@@ -52,8 +52,8 @@ export default function Header({ theme }: HeaderProps) {
|
|||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<button className="ui-btn ui-btn:hover" onClick={toggleTheme}>
|
<button className="ui-btn ui-btn:hover text-lg font-[NerdFontSymbols]" onClick={toggleTheme}>
|
||||||
{currentTheme === "macchiato" ? "🌙 Dark" : "☀️ Light"}
|
{currentTheme === "macchiato" ? "" : ""}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import {
|
import {
|
||||||
useEffect,
|
useEffect,
|
||||||
|
useRef,
|
||||||
useState,
|
useState,
|
||||||
useMemo,
|
useMemo,
|
||||||
type ComponentPropsWithoutRef,
|
type ComponentPropsWithoutRef,
|
||||||
@@ -196,6 +197,8 @@ export default function MdProcessor({
|
|||||||
})
|
})
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
|
const copyRef = useRef<HTMLButtonElement>(null);
|
||||||
|
|
||||||
if (highlighted) {
|
if (highlighted) {
|
||||||
return (
|
return (
|
||||||
<div className="relative border-2 border-ctp-text/50 rounded-md overflow-hidden my-6 bg-ctp-base">
|
<div className="relative border-2 border-ctp-text/50 rounded-md overflow-hidden my-6 bg-ctp-base">
|
||||||
@@ -204,6 +207,32 @@ export default function MdProcessor({
|
|||||||
{lang}
|
{lang}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
|
<button
|
||||||
|
ref={copyRef}
|
||||||
|
onClick={() => {
|
||||||
|
navigator.clipboard
|
||||||
|
.writeText(code)
|
||||||
|
.then(() => {
|
||||||
|
if (copyRef.current) {
|
||||||
|
copyRef.current.textContent =
|
||||||
|
"Copied!";
|
||||||
|
setTimeout(
|
||||||
|
() => {
|
||||||
|
if (
|
||||||
|
copyRef.current
|
||||||
|
)
|
||||||
|
copyRef.current.textContent =
|
||||||
|
"\uf0c5";
|
||||||
|
},
|
||||||
|
1500,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
className="absolute top-1 right-1 px-2 py-1 text-base font-mono text-ctp-subtext0 hover:text-ctp-green transition-colors cursor-pointer select-none z-10 font-[NerdFontSymbols]"
|
||||||
|
>
|
||||||
|
|
||||||
|
</button>
|
||||||
<div
|
<div
|
||||||
className={`overflow-x-auto text-sm p-4 ${lang ? "pt-7" : ""}`}
|
className={`overflow-x-auto text-sm p-4 ${lang ? "pt-7" : ""}`}
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
|
|||||||
Reference in New Issue
Block a user