Skip to content

added #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions components/Home.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import Head from 'next/head';
import Image from 'next/image';
import Layout, { siteTitle } from '../components/layout';
import utilStyles from '../styles/utils.module.css';
import styles from '../styles/layout.module.css';
import Link from 'next/link';

export default function Home() {
return (
<Layout home>
<Head>
<title>{siteTitle}</title>
</Head>

<section className={utilStyles.headingMd}>
<p>
Welcome to <strong>TechNexus</strong>, where technology meets innovation.
Explore, learn, and connect with the future of tech.
</p>
</section>

{/* Adding a futuristic hero section */}
<section className={styles.heroSection}>
<Image
priority
src="https://images.unsplash.com/photo-1506748686214-e9df14d4d9d0"
className={styles.heroImage}
layout="fill"
objectFit="cover"
alt="Futuristic background"
/>
<div className={styles.heroOverlay}>
<h1 className={styles.heroTitle}>Welcome to the Future</h1>
<p className={styles.heroSubtitle}>
Explore cutting-edge technology trends and build the future with us.
</p>
</div>
</section>

<section className={styles.profileSection}>
<h2 className={utilStyles.headingLg}>Meet the Creator</h2>
<div className={styles.profileContainer}>
<Image
priority
src="https://i.imgur.com/yXOvdOSs.jpg"
className={`${utilStyles.borderCircle} ${styles.glowEffect}`}
height={144}
width={144}
alt="Profile Picture"
/>
<p>
Hi, I’m <strong>Your Name</strong>. I’m passionate about coding, robotics, and the future of AI.
Let’s build something amazing together!
</p>
</div>
</section>

{/* Futuristic Button Links */}
<section className={styles.linkSection}>
<Link href="/projects">
<a className={styles.futuristicButton}>Explore Projects</a>
</Link>
<Link href="/about">
<a className={styles.futuristicButton}>Learn More About Us</a>
</Link>
</section>
</Layout>
);
}
61 changes: 29 additions & 32 deletions components/layout.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
// import styles from '../styles/layout.module.css';

// export default function Layout({ children }) {
// return <div className={styles.container}>{children}</div>;
// }

import Head from 'next/head';
import Image from 'next/image';
import styles from '../styles/layout.module.css';
import utilStyles from '../styles/utils.module.css';
import Link from 'next/link';

const name = 'Your Name';
export const siteTitle = 'Next.js Sample Website';
export const siteTitle = 'Next.js Futuristic Website';

export default function Layout({ children, home }) {
return (
Expand All @@ -20,7 +14,7 @@ export default function Layout({ children, home }) {
<link rel="icon" href="/favicon.ico" />
<meta
name="description"
content="Learn how to build a personal website using Next.js"
content="Learn how to build a futuristic website using Next.js"
/>
<meta
property="og:image"
Expand All @@ -31,49 +25,52 @@ export default function Layout({ children, home }) {
<meta name="og:title" content={siteTitle} />
<meta name="twitter:card" content="summary_large_image" />
</Head>

<header className={styles.header}>
{home ? (
<>
<Image
priority
src="/images/istockphoto-491520707-612x612.jpg"
className={utilStyles.borderCircle}
height={144}
width={144}
alt=""
/>
<h1 className={utilStyles.heading2Xl}>{name}</h1>
<div className={styles.profileContainer}>
<Image
priority
src="/images/istockphoto-491520707-612x612.jpg"
className={`${utilStyles.borderCircle} ${styles.glowEffect}`}
height={144}
width={144}
alt="Profile Picture"
/>
<h1 className={`${utilStyles.heading2Xl} ${styles.titleEffect}`}>{name}</h1>
</div>
</>
) : (
<>
<Link href="/">
<a>
<Image
priority
src="/images/profile.jpg"
className={utilStyles.borderCircle}
height={108}
width={108}
alt=""
/>
</a>
<Image
priority
src="/images/profile.jpg"
className={`${utilStyles.borderCircle} ${styles.smallProfileGlow}`}
height={108}
width={108}
alt="Profile Picture"
/>
</Link>
<h2 className={utilStyles.headingLg}>
<Link href="/">
<a className={utilStyles.colorInherit}>{name}</a>
<Link href="/" className={utilStyles.colorInherit}>
<span className={styles.titleEffect}>{name}</span>
</Link>
</h2>
</>
)}
</header>
<main>{children}</main>

<main className={styles.mainContent}>{children}</main>

{!home && (
<div className={styles.backToHome}>
<Link href="/">
<a>← Back to home</a>
<span className={styles.backButton}>← Back to home</span>
</Link>
</div>
)}
</div>
);
}
}
13 changes: 12 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"dependencies": {
"gray-matter": "^4.0.3",
"next": "latest",
"nprogress": "^0.2.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
}
Expand Down
33 changes: 30 additions & 3 deletions pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,33 @@
import '../styles/globals.css';

import { useEffect } from 'react';
import { useRouter } from 'next/router';
import NProgress from 'nprogress'; // For page load progress bar
import 'nprogress/nprogress.css'; // Import NProgress styles
import Layout from '../components/layout'; // Global Layout component

export default function App({ Component, pageProps }) {
return <Component {...pageProps} />;
}
const router = useRouter();

// NProgress (page transition loading effect)
useEffect(() => {
const handleRouteStart = () => NProgress.start();
const handleRouteDone = () => NProgress.done();

router.events.on('routeChangeStart', handleRouteStart);
router.events.on('routeChangeComplete', handleRouteDone);
router.events.on('routeChangeError', handleRouteDone);

return () => {
router.events.off('routeChangeStart', handleRouteStart);
router.events.off('routeChangeComplete', handleRouteDone);
router.events.off('routeChangeError', handleRouteDone);
};
}, [router]);

return (
<Layout>
{/* Wrapping the component with global layout */}
<Component {...pageProps} />
</Layout>
);
}
Loading