Skip to content

Commit 2594ded

Browse files
Add KBar command bar integration, update styles, and enhance blog layout
1 parent 6a392aa commit 2594ded

File tree

10 files changed

+516
-25
lines changed

10 files changed

+516
-25
lines changed

package-lock.json

Lines changed: 141 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"dompurify": "^3.3.1",
3535
"framer-motion": "^12.6.3",
3636
"github-markdown-css": "^5.8.1",
37+
"kbar": "^0.1.0-beta.48",
3738
"lucide-react": "^0.546.0",
3839
"marked": "^17.0.1",
3940
"mongodb": "^6.16.0",

src/Components/Home/ProjectSection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import projects from "@/data/projects";
77
const ProjectSection = ({ id }: { id: string }) => {
88
return (
99
<ResponsiveBox
10-
classNames="dark:bg-[var(--bgColor)] bg-[var(--bgColor)] dark:bg-grid-white/[0.1] bg-grid-white/[0.1] items-center justify-center lg:px-40"
10+
classNames="dark:bg-[var(--bgColor)] bg-[var(--bgColor)] dark:bg-grid-white/[0.1] bg-grid-white/[0.1] items-center justify-center lg:px-40 scroll-mt-8 lg:scroll-mt-24"
1111
id={id}
1212
>
1313
<ConstrainedBox classNames="px-4 py-12 lg:py-16">

src/Components/Home/SkillSection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import skills from "../../data/skills";
88
const SkillSection = ({ id }: { id: string }) => {
99
return (
1010
<ResponsiveBox
11-
classNames="dark:bg-[var(--dialogColor)] bg-[var(--dialogColor)] items-center justify-center dark:bg-dot-white/[0.15] bg-dot-white/[0.15] lg:px-40"
11+
classNames="dark:bg-[var(--dialogColor)] bg-[var(--dialogColor)] items-center justify-center dark:bg-dot-white/[0.15] bg-dot-white/[0.15] lg:px-40 scroll-mt-8 lg:scroll-mt-24"
1212
id={id}
1313
>
1414
<ConstrainedBox classNames="px-4 py-12">
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
'use client';
2+
3+
import { useKBar } from 'kbar';
4+
import { motion } from 'framer-motion';
5+
import { Command } from 'lucide-react';
6+
import { useEffect, useState } from 'react';
7+
8+
const CommandBarTrigger = () => {
9+
const { query } = useKBar();
10+
const [isMac, setIsMac] = useState(false);
11+
12+
useEffect(() => {
13+
setIsMac(navigator.platform.toUpperCase().indexOf('MAC') >= 0);
14+
}, []);
15+
16+
return (
17+
<motion.div
18+
initial={{ opacity: 0, scale: 0.8, y: -20 }}
19+
animate={{ opacity: 1, scale: 1, y: 0 }}
20+
transition={{ duration: 0.2, ease: "easeOut" }}
21+
style={{ willChange: 'transform, opacity' }}
22+
className="hidden sm:fixed sm:block top-4 right-[160px] md:right-[210px] lg:right-[230px] z-[4999]"
23+
>
24+
<motion.button
25+
onClick={() => query.toggle()}
26+
whileTap={{ scale: 0.95 }}
27+
className="border border-white/[0.25] rounded-full bg-[var(--dialogColor50)] backdrop-blur-sm shadow-[0px_2px_3px_-1px_rgba(0,0,0,0.1),0px_1px_0px_0px_rgba(25,28,33,0.02),0px_0px_0px_1px_rgba(25,28,33,0.08)] px-5 md:px-6 py-3 flex items-center gap-2 sm:gap-3 cursor-pointer transition-all duration-250 group hover:border-[var(--primaryColor)]"
28+
>
29+
<Command className="w-5 h-5 text-zinc-100 transition-colors duration-300 group-hover:text-[var(--primaryColor)]" />
30+
<span className="text-[var(--textColor)] font-semibold text-sm md:text-base transition-colors duration-300 group-hover:text-[var(--primaryColor)]">
31+
Search
32+
</span>
33+
<div className="hidden md:flex items-center gap-1.5 ml-1 opacity-60 group-hover:opacity-100 transition-opacity">
34+
<kbd className="bg-zinc-800/50 px-1.5 py-1 rounded border border-white/10 text-[10px] text-zinc-400 font-bold">
35+
{isMac ? '⌘' : 'Ctrl'}
36+
</kbd>
37+
<kbd className="bg-zinc-800/50 px-1.5 py-1 rounded border border-white/10 text-[10px] text-zinc-400 font-bold">
38+
K
39+
</kbd>
40+
</div>
41+
</motion.button>
42+
</motion.div>
43+
);
44+
};
45+
46+
export default CommandBarTrigger;

0 commit comments

Comments
 (0)