Skip to content

Commit 8c6b937

Browse files
committed
feat: enhance responsiveness and styling across components
1 parent 7740636 commit 8c6b937

File tree

7 files changed

+63
-25
lines changed

7 files changed

+63
-25
lines changed

apps/web/src/app/(home)/_components/CommandDisplay.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export function CommandDisplay({ command }: CommandDisplayProps) {
3030
<Copy className="w-4 h-4 text-gray-400" />
3131
)}
3232
</button>
33-
<pre className="pr-12">{command}</pre>
33+
<pre className="pr-12 max-sm:text-xs">{command}</pre>
3434
</div>
3535
</div>
3636
);

apps/web/src/app/(home)/_components/CustomizableStack.tsx

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
useEdgesState,
88
useNodesState,
99
} from "@xyflow/react";
10-
import { useCallback, useState } from "react";
10+
import { useCallback, useEffect, useState } from "react";
1111
import { TechSelector } from "./TechSelector";
1212
import "@xyflow/react/dist/style.css";
1313
import { initialNodes } from "@/lib/constant";
@@ -47,6 +47,23 @@ const CustomizableStack = () => {
4747
orm: "drizzle",
4848
auth: "better-auth",
4949
});
50+
const [windowSize, setWindowSize] = useState("lg");
51+
52+
useEffect(() => {
53+
const handleResize = () => {
54+
if (window.innerWidth < 1024 && window.innerWidth > 768) {
55+
setWindowSize("md");
56+
} else if (window.innerWidth < 768) {
57+
setWindowSize("sm");
58+
} else {
59+
setWindowSize("lg");
60+
}
61+
};
62+
63+
handleResize();
64+
window.addEventListener("resize", handleResize);
65+
return () => window.removeEventListener("resize", handleResize);
66+
}, []);
5067

5168
// biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>
5269
const cleanupConnectionsByCategory = useCallback((category: string) => {
@@ -262,17 +279,17 @@ const CustomizableStack = () => {
262279
return (
263280
<div className="relative w-full max-w-5xl mx-auto z-50 mt-24">
264281
<TechSelector onSelect={handleTechSelect} activeNodes={activeNodes} />
265-
<div className="absolute -top-16 left-1/2 -translate-x-1/2 z-50 w-96">
282+
<div className="absolute -top-16 left-1/2 max-sm:left-[60%] -translate-x-1/2 z-50 w-96">
266283
<CommandDisplay command={generateCommand()} />
267284
</div>
268-
<div className="bg-gray-950/10 lg:p-4 p-1 absolute lg:top-4 top-2 lg:right-4 right-2 z-50 w-80 rounded-xl border border-gray-800 backdrop-blur-3xl">
285+
<div className="max-sm:hidden bg-gray-950/10 lg:p-4 p-1 absolute lg:top-4 top-2 lg:right-4 right-2 z-50 w-80 rounded-xl border border-gray-800 backdrop-blur-3xl">
269286
<div className="lg:text-sm text-xs text-gray-300 text-center">
270287
Select technologies from the left panel to customize your stack. The
271288
graph will automatically update connections.
272289
</div>
273290
</div>
274291
<div className="absolute inset-0 backdrop-blur-3xl bg-gradient-to-r from-blue-500/10 via-purple-500/10 to-pink-500/10 rounded-xl" />
275-
<div className="h-[600px] lg:pl-28 relative backdrop-blur-sm bg-gray-950/50 rounded-xl overflow-hidden border border-gray-800">
292+
<div className="h-[600px] lg:pl-28 max-sm:pt-36 relative backdrop-blur-sm bg-gray-950/50 rounded-xl overflow-hidden border border-gray-800">
276293
<ReactFlow
277294
nodes={nodes}
278295
edges={edges}
@@ -281,8 +298,8 @@ const CustomizableStack = () => {
281298
onConnect={onConnect}
282299
nodeTypes={nodeTypes}
283300
fitView
284-
minZoom={1}
285-
maxZoom={1}
301+
// minZoom={1}
302+
maxZoom={windowSize === "sm" ? 0.6 : windowSize === "md" ? 0.6 : 1}
286303
zoomOnScroll={false}
287304
zoomOnPinch={false}
288305
preventScrolling={false}

apps/web/src/app/(home)/_components/TechConstellation.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ const TechConstellation = () => {
153153
return (
154154
<div
155155
ref={containerRef}
156-
className="relative z-50 w-full h-[90vh] bg-gradient-to-b from-transparent mt-8 via-gray-950 to-transparent overflow-hidden flex items-center justify-center"
156+
className="relative z-50 w-full h-[90vh] bg-gradient-to-b from-transparent mt-8 via-gray-950 to-transparent overflow-auto flex items-center justify-center "
157157
>
158158
<div
159159
ref={centerRef}

apps/web/src/app/(home)/_components/TechSelector.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ interface TechSelectorProps {
2626

2727
export function TechSelector({ onSelect, activeNodes }: TechSelectorProps) {
2828
return (
29-
<div className="absolute top-4 left-4 z-50 space-y-4 bg-gray-950/10 p-4 rounded-xl border border-gray-800 backdrop-blur-3xl">
29+
<div className="absolute max-sm:w-11/12 top-4 left-4 z-50 sm:space-y-4 space-y-2 bg-gray-950/10 sm:p-4 px-4 py-2 rounded-xl border border-gray-800 backdrop-blur-3xl">
3030
<div className="text-sm font-medium text-gray-200">Customize Stack</div>
3131
{Object.entries(techOptions).map(([category, options]) => (
3232
<div key={category} className="space-y-2">

apps/web/src/app/(home)/_components/Terminal.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,27 @@ const TerminalDisplay = () => {
2222
`;
2323

2424
return (
25-
<div className="max-w-6xl mx-auto p-6 mt-12 relative z-50">
25+
<div className="w-[95%] max-w-6xl mx-auto p-2 sm:p-6 mt-6 sm:mt-12 relative z-50">
2626
<div className="bg-gray-900/30 backdrop-blur-3xl rounded-lg shadow-xl overflow-hidden">
27-
<div className="bg-gray-800/30 backdrop-blur-3xl px-4 py-2 flex items-center">
28-
<div className="flex space-x-2">
29-
<div className="w-3 h-3 rounded-full bg-red-500" />
30-
<div className="w-3 h-3 rounded-full bg-yellow-500" />
31-
<div className="w-3 h-3 rounded-full bg-green-500" />
27+
<div className="bg-gray-800/30 backdrop-blur-3xl px-2 sm:px-4 py-1 sm:py-2 flex items-center">
28+
<div className="flex space-x-1 sm:space-x-2">
29+
<div className="w-2 h-2 sm:w-3 sm:h-3 rounded-full bg-red-500" />
30+
<div className="w-2 h-2 sm:w-3 sm:h-3 rounded-full bg-yellow-500" />
31+
<div className="w-2 h-2 sm:w-3 sm:h-3 rounded-full bg-green-500" />
3232
</div>
3333
</div>
3434

35-
<div className="p-4 font-mono text-sm flex flex-col">
36-
<div className="flex items-center text-gray-300 mb-4">
35+
<div className="p-2 sm:p-4 font-mono text-xs sm:text-sm flex flex-col">
36+
<div className="flex items-center text-gray-300 mb-2 sm:mb-4 overflow-x-auto">
3737
<span className="text-green-400"></span>
38-
<span className="text-blue-400 ml-2">~</span>
39-
<span className="ml-2">$</span>
40-
<span className="ml-2 text-white">
38+
<span className="text-blue-400 ml-1 sm:ml-2">~</span>
39+
<span className="ml-1 sm:ml-2">$</span>
40+
<span className="ml-1 sm:ml-2 max-sm:text-xs text-white">
4141
npx create-better-t-stack@latest
4242
</span>
4343
</div>
4444

45-
<pre className="text-blue-400 whitespace-pre overflow-x-auto px-8">
45+
<pre className="text-blue-400 whitespace-pre sm:overflow-x-auto px-8 max-sm:scale-50 max-sm:origin-left">
4646
{TITLE_TEXT}
4747
</pre>
4848
</div>

apps/web/src/app/(home)/page.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const poppins = Poppins({
2020
export default function HomePage() {
2121
return (
2222
<main
23-
className="min-h-screen flex flex-col items-center justify-start p-8 pt-20"
23+
className="min-h-screen flex flex-col items-center justify-start sm:p-8 p-4 pt-20"
2424
style={poppins.style}
2525
>
2626
<BackgroundGradients />
@@ -66,19 +66,19 @@ export default function HomePage() {
6666

6767
<div className="w-full max-w-6xl mx-auto space-y-12 mt-12 relative z-50">
6868
<div className="text-center space-y-6 relative z-10">
69-
<h2 className="text-4xl md:text-5xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-slate-700 via-gray-100 to-stone-600 pb-2">
69+
<h2 className="sm:text-4xl text-3xl md:text-5xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-slate-700 via-gray-100 to-stone-600 pb-2">
7070
A Symphony of Modern Tech
7171
</h2>
7272
<div className="space-y-4 max-w-3xl mx-auto">
73-
<p className="text-xl text-gray-300 leading-relaxed">
73+
<p className="sm:text-xl text-gray-300 leading-relaxed">
7474
Carefully orchestrated stack of{" "}
7575
<span className="text-blue-400 font-semibold">
7676
cutting-edge technologies
7777
</span>
7878
, working in perfect harmony to deliver an exceptional development
7979
experience.
8080
</p>
81-
<div className="flex flex-wrap justify-center gap-4 text-sm text-gray-400">
81+
<div className="flex flex-wrap justify-center sm:gap-4 gap-2 sm:text-sm text-xs text-gray-400">
8282
<span className="px-3 py-1 bg-gray-800/50 rounded-full hover:bg-gray-800 transition-colors">
8383
End-to-end Type Safety
8484
</span>

apps/web/src/app/global.css

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,24 @@
6565
background-position: 200% 50%;
6666
}
6767
}
68+
69+
/* custom scrollbar */
70+
::-webkit-scrollbar {
71+
width: 8px;
72+
}
73+
74+
::-webkit-scrollbar-track {
75+
background: rgba(16, 0, 16, 0.493);
76+
border-radius: 4px;
77+
}
78+
79+
::-webkit-scrollbar-thumb {
80+
background: linear-gradient(45deg, #666, #888);
81+
border-radius: 4px;
82+
border: 2px solid #1a1a1a;
83+
transition: background 0.3s ease;
84+
}
85+
86+
::-webkit-scrollbar-thumb:hover {
87+
background: linear-gradient(45deg, #888, #aaa);
88+
}

0 commit comments

Comments
 (0)