Skip to content

Commit 780dcbc

Browse files
authored
Merge pull request #12 from CSO2/feature/ui
Logo adds/ minor ui fixes
2 parents 2032086 + 174ac64 commit 780dcbc

File tree

5 files changed

+144
-48
lines changed

5 files changed

+144
-48
lines changed

app/components/home/CategoriesSection.tsx

Lines changed: 129 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,59 +2,156 @@
22

33
import { motion } from 'framer-motion';
44
import Link from 'next/link';
5-
import { Cpu, HardDrive, Cpu as Gpu, MemoryStick, Box, Zap, Fan, Monitor } from 'lucide-react';
5+
import {
6+
Cpu,
7+
HardDrive,
8+
Cpu as Gpu,
9+
MemoryStick,
10+
Box,
11+
Zap,
12+
Fan,
13+
Monitor,
14+
ChevronLeft,
15+
ChevronRight
16+
} from 'lucide-react';
17+
import { useRef } from 'react';
618

719
export default function CategoriesSection() {
20+
const scrollContainerRef = useRef<HTMLDivElement>(null);
21+
822
const categories = [
9-
{ name: 'CPUs', icon: Cpu, href: '/components/cpu' },
10-
{ name: 'GPUs', icon: Gpu, href: '/components/gpu' },
11-
{ name: 'Motherboards', icon: Monitor, href: '/components/motherboard' },
12-
{ name: 'RAM', icon: MemoryStick, href: '/components/ram' },
13-
{ name: 'Storage', icon: HardDrive, href: '/components/storage' },
14-
{ name: 'Power Supply', icon: Zap, href: '/components/psu' },
15-
{ name: 'Cooling', icon: Fan, href: '/components/cooler' },
16-
{ name: 'Cases', icon: Box, href: '/components/case' },
23+
{
24+
name: 'CPUs',
25+
description: 'The brain of your computer. Handle complex tasks with ease.',
26+
icon: Cpu,
27+
href: '/components/cpu'
28+
},
29+
{
30+
name: 'GPUs',
31+
description: 'Immersive graphics for gaming and professional rendering.',
32+
icon: Gpu,
33+
href: '/components/gpu'
34+
},
35+
{
36+
name: 'Motherboards',
37+
description: 'The foundation connecting all your components together.',
38+
icon: Monitor,
39+
href: '/components/motherboard'
40+
},
41+
{
42+
name: 'RAM',
43+
description: 'High-speed memory for seamless multitasking.',
44+
icon: MemoryStick,
45+
href: '/components/ram'
46+
},
47+
{
48+
name: 'Storage',
49+
description: 'Secure and fast storage for all your data needs.',
50+
icon: HardDrive,
51+
href: '/components/storage'
52+
},
53+
{
54+
name: 'Power Supply',
55+
description: 'Reliable power delivery for stable system performance.',
56+
icon: Zap,
57+
href: '/components/psu'
58+
},
59+
{
60+
name: 'Cooling',
61+
description: 'Keep your temperatures low and performance high.',
62+
icon: Fan,
63+
href: '/components/cooler'
64+
},
65+
{
66+
name: 'Cases',
67+
description: 'Stylish protection for your high-performance build.',
68+
icon: Box,
69+
href: '/components/case'
70+
},
1771
];
1872

73+
const scroll = (direction: 'left' | 'right') => {
74+
if (scrollContainerRef.current) {
75+
const scrollAmount = 400;
76+
scrollContainerRef.current.scrollBy({
77+
left: direction === 'right' ? scrollAmount : -scrollAmount,
78+
behavior: 'smooth'
79+
});
80+
}
81+
};
82+
1983
return (
20-
<section className="py-12 sm:py-16 md:py-20 bg-background">
84+
<section className="py-12 sm:py-16 md:py-20 bg-background relative overflow-hidden">
2185
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
22-
<motion.div
23-
initial={{ opacity: 0, y: 20 }}
24-
whileInView={{ opacity: 1, y: 0 }}
25-
viewport={{ once: true }}
26-
transition={{ duration: 0.6 }}
27-
className="text-center mb-8 sm:mb-10 md:mb-12"
28-
>
29-
<h2 className="text-2xl sm:text-3xl md:text-4xl font-heading font-bold text-foreground mb-3 sm:mb-4">
30-
Shop by Category
31-
</h2>
32-
<p className="text-base sm:text-lg text-muted-foreground">
33-
Find the perfect components for your build
34-
</p>
35-
</motion.div>
86+
<div className="flex justify-between items-end mb-8 sm:mb-10 md:mb-12">
87+
<motion.div
88+
initial={{ opacity: 0, x: -20 }}
89+
whileInView={{ opacity: 1, x: 0 }}
90+
viewport={{ once: true }}
91+
transition={{ duration: 0.6 }}
92+
className="max-w-2xl"
93+
>
94+
<h2 className="text-2xl sm:text-3xl md:text-4xl font-heading font-bold text-foreground mb-3 sm:mb-4">
95+
Shop by Category
96+
</h2>
97+
<p className="text-base sm:text-lg text-muted-foreground">
98+
Find the perfect components for your build
99+
</p>
100+
</motion.div>
36101

37-
<div className="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4 sm:gap-6">
102+
<div className="hidden sm:flex items-center gap-2">
103+
<button
104+
onClick={() => scroll('left')}
105+
className="p-2 rounded-full border border-border bg-background hover:bg-muted transition-colors"
106+
aria-label="Scroll left"
107+
>
108+
<ChevronLeft className="h-6 w-6" />
109+
</button>
110+
<button
111+
onClick={() => scroll('right')}
112+
className="p-2 rounded-full border border-border bg-background hover:bg-muted transition-colors"
113+
aria-label="Scroll right"
114+
>
115+
<ChevronRight className="h-6 w-6" />
116+
</button>
117+
</div>
118+
</div>
119+
120+
<div
121+
ref={scrollContainerRef}
122+
className="flex overflow-x-auto gap-4 sm:gap-6 pb-4 -mx-4 px-4 sm:mx-0 sm:px-0 scrollbar-hide snap-x"
123+
style={{ scrollbarWidth: 'none', msOverflowStyle: 'none' }}
124+
>
38125
{categories.map((category, index) => (
39126
<motion.div
40127
key={category.name}
41128
initial={{ opacity: 0, y: 20 }}
42129
whileInView={{ opacity: 1, y: 0 }}
43130
viewport={{ once: true }}
44131
transition={{ delay: index * 0.05, duration: 0.4 }}
132+
className="min-w-[280px] sm:min-w-[350px] md:min-w-[400px] snap-start"
45133
>
46-
<Link href={category.href}>
134+
<Link href={category.href} className="block h-full">
47135
<motion.div
48136
whileHover={{ y: -5 }}
49137
whileTap={{ scale: 0.98 }}
50-
className="group relative flex flex-col items-center justify-center p-6 rounded-2xl bg-gradient-to-br from-card to-secondary/5 border border-primary/10 shadow-sm hover:shadow-lg hover:border-primary/50 transition-all duration-300 h-full min-h-[160px]"
138+
className="group relative h-full flex items-center justify-between p-6 sm:p-8 rounded-2xl bg-gradient-to-br from-secondary/30 to-background border border-border hover:border-primary/50 hover:from-secondary/50 hover:to-background transition-all duration-300 overflow-hidden"
51139
>
52-
<div className="mb-4 text-primary group-hover:scale-110 transition-transform duration-300 bg-primary/10 p-4 rounded-xl">
53-
<category.icon className="h-8 w-8" strokeWidth={1.5} />
140+
<div className="absolute -right-4 -bottom-4 text-primary/5 rotate-12 transform group-hover:scale-110 group-hover:text-primary/10 transition-all duration-500">
141+
<category.icon className="w-32 h-32" strokeWidth={1} />
142+
</div>
143+
144+
<div className="relative z-10 flex-1 pr-4">
145+
<h3 className="text-lg sm:text-xl font-bold text-foreground mb-2 group-hover:text-primary transition-colors">
146+
{category.name}
147+
</h3>
148+
<p className="text-sm sm:text-base text-muted-foreground line-clamp-2">
149+
{category.description}
150+
</p>
151+
</div>
152+
<div className="relative z-10 flex-shrink-0 w-16 h-16 sm:w-20 sm:h-20 flex items-center justify-center rounded-xl bg-background/80 backdrop-blur-sm shadow-sm group-hover:scale-105 transition-transform duration-300 border border-primary/10">
153+
<category.icon className="h-8 w-8 sm:h-10 sm:w-10 text-primary" strokeWidth={1.5} />
54154
</div>
55-
<h3 className="text-base sm:text-lg font-semibold text-foreground group-hover:text-primary transition-colors">
56-
{category.name}
57-
</h3>
58155
</motion.div>
59156
</Link>
60157
</motion.div>

app/components/home/HeroSection.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,28 +90,26 @@ export default function HeroSection() {
9090
</div>
9191
</motion.div>
9292

93-
{/* Bottom Right: Components */}
9493
<motion.div
9594
variants={itemVariants}
9695
className="relative group rounded-3xl overflow-hidden min-h-[250px] lg:min-h-0 bg-[#F0F4F8] dark:bg-muted"
9796
>
98-
<div className="absolute top-0 right-0 max-w-[60%] p-6 z-10 text-right">
97+
<div className="absolute top-6 right-6 z-10 text-right max-w-[180px]">
9998
<h3 className="text-xl font-bold text-foreground mb-1">Components</h3>
100-
<p className="text-muted-foreground text-sm">Power your dream</p>
99+
<p className="text-muted-foreground text-sm font-medium">Power your dream</p>
101100
<Link
102101
href="/components"
103-
className="mt-4 inline-flex items-center text-sm font-bold text-primary hover:underline"
102+
className="mt-4 inline-flex items-center text-sm font-bold text-primary hover:text-primary/80 transition-colors"
104103
>
105104
Upgrade Now
106105
</Link>
107106
</div>
108-
<div className="absolute bottom-0 left-0 p-4">
107+
<div className="absolute bottom-0 left-0 w-[65%] h-[90%] pointer-events-none">
109108
<Image
110109
src="/images/hero/hero-gpu.png"
111110
alt="High End GPU"
112-
width={280}
113-
height={200}
114-
className="object-contain drop-shadow-2xl transition-transform duration-500 group-hover:scale-105 group-hover:-translate-y-2"
111+
fill
112+
className="object-contain object-left-bottom drop-shadow-2xl transition-transform duration-500 group-hover:scale-105"
115113
/>
116114
</div>
117115
</motion.div>

app/components/ui/Navigation.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import {
1111
Sun,
1212
Menu,
1313
X,
14-
Cpu,
1514
} from 'lucide-react';
15+
import Image from 'next/image';
1616
import { useThemeStore } from '@/lib/store/themeStore';
1717
import { useCartStore } from '@/lib/store/cartStore';
1818
import { useWishlistStore } from '@/lib/store/wishlistStore';
@@ -69,13 +69,14 @@ export default function Navigation() {
6969
<div className="flex items-center justify-between h-14 sm:h-16">
7070
{/* Logo */}
7171
<Link href="/" className="flex items-center space-x-2 group">
72-
<motion.div
73-
whileHover={{ rotate: 180 }}
74-
transition={{ duration: 0.5 }}
75-
className="text-primary"
76-
>
77-
<Cpu size={28} strokeWidth={2.5} />
78-
</motion.div>
72+
<Image
73+
src="/logo.png"
74+
alt="CS02 Logo"
75+
width={32}
76+
height={32}
77+
className="w-8 h-8 object-contain"
78+
priority
79+
/>
7980
<div className="flex flex-col">
8081
<span className="text-xl font-heading font-bold tracking-tight leading-none group-hover:text-primary transition-colors">
8182
CS02

app/favicon.ico

-10.3 KB
Binary file not shown.

public/logo.png

17.2 KB
Loading

0 commit comments

Comments
 (0)