Skip to content

Commit

Permalink
revert to 2 wide column
Browse files Browse the repository at this point in the history
  • Loading branch information
kbinreallife committed May 26, 2024
1 parent c7629a1 commit 4aec133
Showing 1 changed file with 7 additions and 19 deletions.
26 changes: 7 additions & 19 deletions src/app/page.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use client'

import dynamic from 'next/dynamic';
import React, { useState, useEffect, useRef, useCallback } from 'react';
import React, { useState, useEffect, useRef } from 'react';
import Head from 'next/head';

const DynamicHome = dynamic(() => import('./globals.css'), { ssr: false });
Expand All @@ -13,7 +14,7 @@ export default function Home() {
const toggleSection = (section) => {
setShowSection(showSection === section ? null : section);
};

const hideAllSections = () => {
setShowSection(null);
};
Expand All @@ -30,25 +31,12 @@ export default function Home() {
};
}, []);

const handleClickLink = useCallback((section) => {
const handleClickLink = (section) => {
return (event) => {
event.stopPropagation();
toggleSection(section);
};
}, []);

// Preload images
const preloadImages = useCallback(() => {
badges.forEach((badge) => {
const img = new Image();
img.src = badge.imageUrl;
});
}, []);

// Call preloadImages function when the component mounts
useEffect(() => {
preloadImages();
}, [preloadImages]);
};

const badges = [
{
Expand Down Expand Up @@ -193,22 +181,22 @@ export default function Home() {
{showSection === 'badges' && (
<div className="p-4 rounded-md h-auto section-content">
<h2 className="text-lg font-bold mb-2">Badges</h2>
<div className="grid gap-4 grid-container md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5">
<div className="grid grid-cols-2 gap-4 grid-container">
{badges.map((badge, index) => (
<a href={badge.linkUrl} target="_blank" rel="noopener noreferrer" key={index} onClick={(e) => e.stopPropagation()} className="grid-item">
<img
src={badge.imageUrl}
alt={`Badge ${index + 1}`}
width="200"
height="200"
className='max-w-none'
/>
</a>
))}
</div>
</div>
)}


{/* Contact Section */}
{showSection === 'contact' && (
<div className="p-4 rounded-md h-48 section-content">
Expand Down

0 comments on commit 4aec133

Please sign in to comment.