💂♂️ fixed lint and prittier
This commit is contained in:
@@ -17,8 +17,8 @@ export function TableOfContents({ headings }: TOCProps) {
|
||||
|
||||
useEffect(() => {
|
||||
const observer = new IntersectionObserver(
|
||||
(entries) => {
|
||||
entries.forEach((entry) => {
|
||||
entries => {
|
||||
entries.forEach(entry => {
|
||||
if (entry.isIntersecting) {
|
||||
setActiveId(entry.target.id)
|
||||
}
|
||||
@@ -43,31 +43,45 @@ export function TableOfContents({ headings }: TOCProps) {
|
||||
|
||||
<div className="border-b border-[var(--neon-magenta)] pb-3 mb-4 relative">
|
||||
<div className="flex gap-1.5 mb-2 justify-end">
|
||||
<div className="w-3 h-3 border border-[var(--neon-cyan)]/40 hover:bg-[var(--neon-cyan)]/10 transition-colors cursor-pointer" title="Minimize" />
|
||||
<div className="w-3 h-3 border border-[var(--neon-cyan)]/40 hover:bg-[var(--neon-cyan)]/10 transition-colors cursor-pointer" title="Maximize" />
|
||||
<div className="w-3 h-3 border border-[var(--neon-pink)]/40 hover:bg-[var(--neon-pink)]/10 transition-colors cursor-pointer" title="Close" />
|
||||
<div
|
||||
className="w-3 h-3 border border-[var(--neon-cyan)]/40 hover:bg-[var(--neon-cyan)]/10 transition-colors cursor-pointer"
|
||||
title="Minimize"
|
||||
/>
|
||||
<div
|
||||
className="w-3 h-3 border border-[var(--neon-cyan)]/40 hover:bg-[var(--neon-cyan)]/10 transition-colors cursor-pointer"
|
||||
title="Maximize"
|
||||
/>
|
||||
<div
|
||||
className="w-3 h-3 border border-[var(--neon-pink)]/40 hover:bg-[var(--neon-pink)]/10 transition-colors cursor-pointer"
|
||||
title="Close"
|
||||
/>
|
||||
</div>
|
||||
<h3 className="text-xs font-mono font-bold text-[var(--neon-cyan)] uppercase tracking-wider" style={{ textShadow: '0 0 6px rgba(90,139,149,0.5)' }}>
|
||||
<h3
|
||||
className="text-xs font-mono font-bold text-[var(--neon-cyan)] uppercase tracking-wider"
|
||||
style={{ textShadow: '0 0 6px rgba(90,139,149,0.5)' }}
|
||||
>
|
||||
>> NAVIGATION
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<nav className="space-y-1 relative">
|
||||
{headings.map((heading) => (
|
||||
{headings.map(heading => (
|
||||
<a
|
||||
key={heading.id}
|
||||
href={`#${heading.id}`}
|
||||
className={`
|
||||
block text-sm font-mono py-2 border-l-2 transition-all duration-150
|
||||
${heading.level === 2 ? 'pl-3' : 'pl-6'}
|
||||
${activeId === heading.id
|
||||
? 'text-[var(--neon-cyan)] border-[var(--neon-cyan)] bg-cyan-500/5 shadow-[0_0_8px_rgba(90,139,149,0.3)]'
|
||||
: 'text-zinc-500 border-zinc-900 hover:border-[var(--neon-magenta)] hover:text-[var(--neon-magenta)] hover:bg-magenta-500/3 hover:shadow-[0_0_4px_rgba(155,90,142,0.2)]'
|
||||
${
|
||||
activeId === heading.id
|
||||
? 'text-[var(--neon-cyan)] border-[var(--neon-cyan)] bg-cyan-500/5 shadow-[0_0_8px_rgba(90,139,149,0.3)]'
|
||||
: 'text-zinc-500 border-zinc-900 hover:border-[var(--neon-magenta)] hover:text-[var(--neon-magenta)] hover:bg-magenta-500/3 hover:shadow-[0_0_4px_rgba(155,90,142,0.2)]'
|
||||
}
|
||||
`}
|
||||
style={activeId === heading.id ? { textShadow: '0 0 4px rgba(90,139,149,0.5)' } : {}}
|
||||
>
|
||||
<span className="inline-block">{activeId === heading.id ? '▶ ' : '◆ '}</span>{heading.text}
|
||||
<span className="inline-block">{activeId === heading.id ? '▶ ' : '◆ '}</span>
|
||||
{heading.text}
|
||||
</a>
|
||||
))}
|
||||
</nav>
|
||||
|
||||
Reference in New Issue
Block a user