11"use client" ;
22import { useState } from "react" ;
3- import { IoMdCloseCircle , IoMdRemoveCircle , IoMdAddCircle } from "react-icons/io" ;
3+ import { IoMdCloseCircle , IoMdRemoveCircle , IoMdAddCircle , IoMdMoon } from "react-icons/io" ;
4+ import { MdSunny } from "react-icons/md" ;
5+ import { FaLightbulb , FaRegLightbulb } from "react-icons/fa" ;
46
57export default function Hero ( ) {
68 // Add near the top of Hero component
@@ -59,11 +61,11 @@ export default function Hero() {
5961 < div className = "w-full h-full bg-white rounded-lg shadow-inner flex flex-col overflow-hidden text-xs flex-grow mt-2 mb-2" >
6062 { /* Sticky Header */ }
6163 < div className = "flex justify-between items-center px-4 py-2 bg-neutral-50 border-b border-neutral-200 sticky top-0" >
62- < div className = "font-semibold text-neutral-700" > StreamUI </ div >
63- < div className = "flex gap-3 " >
64- < div className = "w-10 h-3 bg-neutral-200 rounded" > </ div >
65- < div className = "w-10 h-3 bg-neutral-200 rounded" > </ div >
66- < div className = "w-10 h-3 bg-neutral-200 rounded" > </ div >
64+ < div className = "font-medium text-neutral-700" > Stream < span className = "px-1 py-1 ml-1 text-white bg-black rounded-md" > UI </ span > </ div >
65+ < div className = "flex gap-2 " >
66+ < div className = "text-xs" > Home </ div >
67+ < div className = "text-xs" > Features </ div >
68+ < div className = "text-xs" > Reviews </ div >
6769 </ div >
6870 </ div >
6971 { /* Hero Section */ }
@@ -86,7 +88,7 @@ export default function Hero() {
8688 </ div >
8789
8890 { /* Side Preview Cards */ }
89- < div className = "bg-neutral-200 rounded-xl shadow-md flex flex-col justify-center items-center gap-2 p-3" >
91+ < div className = "bg-neutral-100 rounded-xl shadow-md flex flex-col justify-center items-center gap-2 p-3" >
9092 < button className = "bg-black text-white text-xs px-3 py-1 rounded-lg shadow hover:bg-neutral-800 transition" >
9193 Dark Button
9294 </ button >
@@ -95,10 +97,10 @@ export default function Hero() {
9597 </ button >
9698 </ div >
9799 { /* Toggle Showcase Card */ }
98- < div className = { `${ isDark ? "bg-neutral-900 text-white" : "bg-neutral-200 " } rounded-xl shadow-md flex flex-col items-center justify-center gap-3 p-4 transition-colors duration-300` } >
100+ < div className = { `${ isDark ? "bg-neutral-900 text-white" : "bg-neutral-100 " } rounded-xl shadow-md flex flex-col items-center justify-center gap-3 p-4 transition-colors duration-300` } >
99101 < span className = "text-xs font-medium" > { isDark ? "Dark Mode" : "Light Mode" } </ span >
100102
101- { /* Toggle Variety 1: Pill Switch */ }
103+ { /* Toggle Variety 1: Pill Switch with icons */ }
102104 < label className = "relative inline-block w-12 h-7 cursor-pointer" >
103105 < input
104106 type = "checkbox"
@@ -107,20 +109,27 @@ export default function Hero() {
107109 className = "opacity-0 w-0 h-0 peer"
108110 />
109111 < div className = { `absolute inset-0 rounded-full transition ${ isDark ? "bg-white/30" : "bg-neutral-300" } ` } > </ div >
112+ { /* Icons inside toggle */ }
113+ < IoMdMoon className = "absolute left-2 top-2 text-[10px] text-white pointer-events-none" />
114+ < MdSunny className = "absolute right-2 top-2 text-[10px] text-black pointer-events-none" />
110115 < div className = { `absolute left-0.5 top-0.5 w-6 h-6 rounded-full shadow transform transition ${ isDark ? "translate-x-5 bg-white" : "bg-white" } ` } > </ div >
111116 </ label >
112117
113- { /* Toggle Variety 2: Circle Toggle */ }
114- < label className = "relative inline-block w-8 h-8 cursor-pointer" >
115- < input
116- type = "checkbox"
117- checked = { isDark }
118- onChange = { ( ) => setIsDark ( ! isDark ) }
119- className = "opacity-0 w-0 h-0 peer"
120- />
121- < div className = { `absolute inset-0 rounded-full transition ${ isDark ? "bg-white/30" : "bg-neutral-300" } ` } > </ div >
122- < div className = { `absolute top-1 left-1 w-6 h-6 rounded-full shadow transform transition ${ isDark ? "bg-white" : "bg-white" } ` } > </ div >
123- </ label >
118+ { /* Toggle Variety 2: Circle Toggle with icon */ }
119+ < button
120+ type = "button"
121+ onClick = { ( ) => setIsDark ( ! isDark ) }
122+ className = { `relative w-10 h-10 rounded-full flex items-center justify-center transition-all duration-200 ${
123+ isDark ? 'bg-white/30 text-white' : 'bg-neutral-200 text-yellow-500'
124+ } ${ isDark ? 'shadow-inner' : 'shadow-md' } active:scale-95`}
125+ aria-label = { isDark ? 'Switch to light mode' : 'Switch to dark mode' }
126+ >
127+ { isDark ? (
128+ < FaRegLightbulb className = "text-[18px]" />
129+ ) : (
130+ < FaLightbulb className = "text-[18px]" />
131+ ) }
132+ </ button >
124133
125134 { /* Toggle Variety 3: Rounded Slider */ }
126135 < label className = "relative inline-block w-16 h-8 cursor-pointer" >
0 commit comments