@@ -8,6 +8,7 @@ import useDebounce from "@azure-fundamentals/hooks/useDebounce";
88
99const Home : NextPage = ( ) => {
1010 const [ searchTerm , setSearchTerm ] = useState ( "" ) ;
11+ const [ hoveredCard , setHoveredCard ] = useState < string | null > ( null ) ;
1112 const debouncedSearchTerm = useDebounce ( searchTerm , 500 ) ;
1213
1314 const handleSearchChange = ( event : React . ChangeEvent < HTMLInputElement > ) => {
@@ -19,40 +20,47 @@ const Home: NextPage = () => {
1920 ) ;
2021
2122 return (
22- < div className = "mx-auto mb-6 w-full lg:w-[70vw] 2xl:w-[45%] text-center" >
23- < h2 className = "text-gray-900 dark:text-gray-100 text-5xl font-bold uppercase" >
23+ < div className = "mx-auto mb-6 w-full lg:w-[70vw] 2xl:w-[45%] text-center px-6 pr-8 sm:px-8 sm:pr-12 lg:px-12 lg:pr-16 " >
24+ < h2 className = "text-gray-900 dark:text-gray-100 text-5xl font-bold uppercase mt-16 " >
2425 Welcome!
2526 </ h2 >
26- < p className = "text-gray-900 dark:text-gray-100 text-lg mt-4 mb-6 px-5 leading-6" >
27+ < p className = "text-gray-900 dark:text-gray-100 text-lg mt-4 mb-6 leading-6" >
2728 Select an exam from the list below.
2829 </ p >
2930 < input
3031 type = "text"
3132 value = { searchTerm }
3233 onChange = { handleSearchChange }
3334 placeholder = "Search exams"
34- className = "mb-6 px-4 py-2 border border-gray-200 dark:border-gray-800 bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-gray-100 rounded-md w-3/4 lg:w-1/2"
35+ className = "mb-6 px-4 py-2 border border-gray-200 dark:border-gray-800 bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-gray-100 rounded-md w-3/4 lg:w-1/2 focus:border-primary-500 focus:outline-none focus:ring-2 focus:ring-primary-500/20 "
3536 />
3637 < div
37- className = { `grid ${
38+ className = { `cards-container grid ${
3839 filteredExams . length > 0
3940 ? "grid-cols-1 sm:grid-cols-2 gap-x-10 gap-y-5"
4041 : "flex justify-center items-center"
4142 } mx-5 lg:mx-0`}
4243 >
4344 { filteredExams . length > 0 ? (
4445 filteredExams . map ( ( exam ) => (
45- < NameLink
46+ < div
4647 key = { exam . name }
47- href = { {
48- pathname : "/modes" ,
49- query : { url : exam . url , name : exam . name } ,
50- } }
51- heading = { exam . name }
52- paragraph = { exam . subtitle }
53- wrapperClassNames = ""
54- headingClassNames = ""
55- />
48+ onMouseEnter = { ( ) => setHoveredCard ( exam . name ) }
49+ onMouseLeave = { ( ) => setHoveredCard ( null ) }
50+ >
51+ < NameLink
52+ href = { {
53+ pathname : "/modes" ,
54+ query : { url : exam . url , name : exam . name } ,
55+ } }
56+ heading = { exam . name }
57+ paragraph = { exam . subtitle }
58+ wrapperClassNames = {
59+ hoveredCard && hoveredCard !== exam . name ? "dimmed" : ""
60+ }
61+ headingClassNames = ""
62+ />
63+ </ div >
5664 ) )
5765 ) : (
5866 < p className = "text-gray-900 dark:text-gray-100 text-lg mt-4" >
0 commit comments