refactor: update header and hero components for improved styling and layout

This commit is contained in:
2025-02-03 20:01:18 +01:00
parent 2d21a82205
commit bf79f2ea06
7 changed files with 352 additions and 289 deletions

View File

@@ -15,33 +15,34 @@ export default function Header() {
return (
<div className={inter.className}>
<header
className={`p-5 bg-white/30 text-gray-700 fixed w-full z-10 backdrop-blur-md shadow-xl rounded-b-2xl transition-transform ${isSidebarOpen ? 'transform -translate-y-full' : ''}`}>
<nav className="flex justify-between items-center mx-auto">
<h1 className="text-2xl md:text-4xl">Dennis</h1>
<button
className="md:hidden text-gray-700 hover:text-gray-900"
onClick={toggleSidebar}
>
<svg
className="w-6 h-6"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
<div className="p-4">
<header
className={`p-4 bg-white/45 text-gray-700 w-full backdrop-blur-md shadow-xl rounded-2xl transition-transform ${isSidebarOpen ? 'transform -translate-y-full' : ''}`}>
<nav className="flex justify-between items-center mx-auto">
<h1 className="text-xl md:text-2xl">Dennis Konkol</h1>
<button
className="md:hidden text-gray-700 hover:text-gray-900"
onClick={toggleSidebar}
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="M4 6h16M4 12h16M4 18h16"
/>
</svg>
</button>
<div className="hidden md:flex space-x-4 md:space-x-6">
<Link href="#projects">
<button
className="relative px-4 py-2 text-gray-700 hover:text-gray-900 text-xl md:text-2xl group">
<svg
className="w-6 h-6"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="M4 6h16M4 12h16M4 18h16"
/>
</svg>
</button>
<div className="hidden md:flex space-x-4 md:space-x-6">
<Link href="#projects">
<button
className="relative px-4 py-2 text-gray-700 hover:text-gray-900 text-xl md:text-2xl group">
<span
className="inline-flex items-center group-hover:transform group-hover:-translate-x-2 transition-transform">
Projects
@@ -60,11 +61,11 @@ export default function Header() {
/>
</svg>
</span>
</button>
</Link>
<Link href="#contact">
<button
className="relative px-4 py-2 text-gray-700 hover:text-gray-900 text-xl md:text-2xl group">
</button>
</Link>
<Link href="#contact">
<button
className="relative px-4 py-2 text-gray-700 hover:text-gray-900 text-xl md:text-2xl group">
<span
className="inline-flex items-center group-hover:transform group-hover:-translate-x-2 transition-transform">
Contact
@@ -96,11 +97,11 @@ export default function Header() {
/>
</svg>
</span>
</button>
</Link>
<Link href="#about">
<button
className="relative px-4 py-2 text-gray-700 hover:text-gray-900 text-xl md:text-2xl group">
</button>
</Link>
<Link href="#about">
<button
className="relative px-4 py-2 text-gray-700 hover:text-gray-900 text-xl md:text-2xl group">
<span
className="inline-flex items-center group-hover:transform group-hover:-translate-x-2 transition-transform">
About
@@ -128,60 +129,61 @@ export default function Header() {
/>
</svg>
</span>
</button>
</Link>
</div>
</nav>
</header>
<div
className={`fixed inset-0 bg-black bg-opacity-50 transition-opacity ${isSidebarOpen ? 'opacity-100' : 'opacity-0 pointer-events-none'}`}
onClick={toggleSidebar}
></div>
<div
className={`fixed top-0 right-0 h-full bg-white w-1/3 transform transition-transform flex flex-col ${isSidebarOpen ? 'translate-x-0' : 'translate-x-full'}`}
>
<button
className="absolute top-4 right-4 text-gray-700 hover:text-gray-900"
onClick={toggleSidebar}
>
<svg
className="w-6 h-6"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="M6 18L18 6M6 6l12 12"
/>
</svg>
</button>
<div className="pt-8 space-y-4 flex-grow">
<Link href="#projects">
<button
className="w-full px-4 py-2 pt-8 text-gray-700 hover:text-gray-900 text-xl md:text-2xl group">
Projects
</button>
</Link>
<Link href="#contact">
<button
className="w-full px-4 py-2 text-gray-700 hover:text-gray-900 text-xl md:text-2xl group">
Contact
</button>
</Link>
<Link href="#about">
<button
className="w-full px-4 py-2 text-gray-700 hover:text-gray-900 text-xl md:text-2xl group">
About
</button>
</Link>
</div>
</nav>
</header>
<div
className={`fixed inset-0 bg-black bg-opacity-50 transition-opacity ${isSidebarOpen ? 'opacity-100' : 'opacity-0 pointer-events-none'}`}
onClick={toggleSidebar}
></div>
<div
className={`fixed top-0 right-0 h-full bg-white w-1/3 transform transition-transform flex flex-col ${isSidebarOpen ? 'translate-x-0' : 'translate-x-full'}`}
>
<button
className="absolute top-4 right-4 text-gray-700 hover:text-gray-900"
onClick={toggleSidebar}
>
<svg
className="w-6 h-6"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="M6 18L18 6M6 6l12 12"
/>
</svg>
</button>
<div className="pt-8 space-y-4 flex-grow">
<Link href="#projects">
<button
className="w-full px-4 py-2 pt-8 text-gray-700 hover:text-gray-900 text-xl md:text-2xl group">
Projects
</button>
</Link>
<Link href="#contact">
<button
className="w-full px-4 py-2 text-gray-700 hover:text-gray-900 text-xl md:text-2xl group">
Contact
</button>
</Link>
<Link href="#about">
<button
className="w-full px-4 py-2 text-gray-700 hover:text-gray-900 text-xl md:text-2xl group">
About
</button>
</Link>
<h6 className="text-center text-xs text-gray-500 p-4">© 2025 Dennis</h6>
</div>
<h6 className="text-center text-xs text-gray-500 p-4">© 2025 Dennis</h6>
</div>
</div>
);

View File

@@ -1,21 +1,49 @@
import Link from "next/link";
import Image from "next/image";
import {Roboto} from "next/font/google";
const roboto = Roboto({weight: "400", subsets: ["latin"]});
export default function Hero() {
return (
<div id="hero">
<section
id="hero"
className="text-center p-20 text-black"
>
<h1 className="text-5xl font-bold">Hi, I am Dennis</h1>
<p className="mt-4 text-xl">A passionate developer and student.</p>
<Link href="#projects">
<button
className="mt-6 inline-block px-6 py-2 bg-black text-black rounded hover:bg-gray-800 dark:bg-white dark:text-black dark:hover:bg-gray-300 transition">
See My Work
</button>
</Link>
</section>
<div className={roboto.className}>
<div id="hero"
className="flex flex-col md:flex-row items-center justify-center pt-16 pb-16 px-6 text-gray-700">
{/* Left Section: Text */}
<div className="flex flex-col items-center p-8 bg-gradient-to-br from-white/60 to-white/30
backdrop-blur-lg rounded-2xl shadow-xl max-w-lg text-center">
<h1 className="text-4xl md:text-5xl font-extrabold text-gray-900">
Hi, Im Dennis
</h1>
<h2 className="mt-2 text-xl md:text-2xl font-semibold text-gray-700">
Student & Software Engineer
</h2>
<h3 className="mt-1 text-lg md:text-xl text-gray-600">
Based in Osnabrück, Germany
</h3>
<p className="mt-6 text-gray-800 text-lg leading-relaxed">
Passionate about technology, coding, and solving real-world problems.
I enjoy building innovative solutions and continuously expanding my knowledge.
</p>
<p className="mt-4 text-gray-700 text-base">
Currently working on exciting projects that merge creativity with functionality.
Always eager to learn and collaborate!
</p>
</div>
{/* Right Section: Image */}
<div className="flex mt-8 md:mt-0 md:ml-12">
<Image
src="/images/me.jpg"
alt="Image of Dennis"
width={400}
height={400}
className="rounded-2xl shadow-lg shadow-gray-700 object-cover"
/>
</div>
</div>
</div>
);
}

View File

@@ -2,50 +2,50 @@
"use client";
import Link from "next/link";
import { useEffect, useState } from "react";
import {useEffect, useState} from "react";
interface Project {
id: string;
title: string;
description: string;
link: string;
id: string;
title: string;
description: string;
link: string;
}
export default function Projects() {
const [projects, setProjects] = useState<Project[]>([]);
const [projects, setProjects] = useState<Project[]>([]);
useEffect(() => {
fetch("/data/projects.json")
.then((res) => res.json())
.then((data) => setProjects(data));
}, []);
useEffect(() => {
fetch("/data/projects.json")
.then((res) => res.json())
.then((data) => setProjects(data));
}, []);
return (
<section id="projects" className="p-10">
<h2 className="text-3xl font-bold text-center text-gray-800 dark:text-white">
Projects
</h2>
<div className="mt-6 grid grid-cols-1 md:grid-cols-2 gap-6">
{projects.map((project) => (
<div
key={project.id}
className="p-4 border rounded shadow-lg "
>
<h3 className="text-2xl font-bold text-gray-800 dark:text-white">
{project.title}
</h3>
<p className="mt-2 text-gray-600 dark:text-gray-300">
{project.description}
</p>
<Link
href={`/Projects/${project.title.toLowerCase().replace(" ", "-")}`}
className="mt-4 inline-block text-blue-500 hover:underline"
>
View Project
</Link>
</div>
))}
</div>
</section>
);
return (
<section id="projects" className="p-10">
<h2 className="text-3xl font-bold text-center text-gray-800 dark:text-white">
Projects
</h2>
<div className="mt-6 grid grid-cols-1 md:grid-cols-2 gap-6">
{projects.map((project) => (
<div
key={project.id}
className="p-4 border shadow-lg bg-white/45 rounded-2xl"
>
<h3 className="text-2xl font-bold text-gray-800">
{project.title}
</h3>
<p className="mt-2 text-gray-500">
{project.description}
</p>
<Link
href={`/Projects/${project.title.toLowerCase().replace(" ", "-")}`}
className="mt-4 inline-block text-blue-800 hover:underline"
>
View Project
</Link>
</div>
))}
</div>
</section>
);
}

View File

@@ -5,7 +5,10 @@
/* Custom Global Styles */
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
background-color: #e7e7e7;
/*from to background color*/
/*background: -webkit-repeating-radial-gradient(circle, #f0f0f0, #8a8a8a);*/
background: linear-gradient(120deg, #f5f7fa 0%, #303030 100%);
}
.neumorphism {