Skip to content

Commit

Permalink
Adding Hero section and adjust the scrolling (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
omarghandour authored Nov 6, 2024
2 parents 88437bf + 17f746e commit 52db26a
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 2 deletions.
Binary file added Public/logo-bw-in-black.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Public/logo-bw.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Public/waves.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Public/wp12821561-black-waves-4k-wallpapers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions app/components/Hero.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React, { forwardRef } from "react";
import Image from "next/image";
import logo from "../../Public/logo-bw.png";
const Hero = forwardRef<HTMLDivElement>((_, ref) => {
return (
<section
ref={ref}
className="min-h-[100dvh] snap-start relative back bg-cover bg-center bg-fixed h-screen flex items-center justify-center "
>
<div className="flex flex-col md:flex-row justify-center items-center ">
<Image
src={logo}
alt="Hero Image"
width={200}
height={500}
className="flex justify-center items-center"
/>
<p className="text-white text-base md:text-lg text-center md:text-left lg:text-xl text-pretty leading-relaxed p-4 md:p-6">
Digital Marketing Agency, SEO Solutions <br /> Innovative Web
Devolpment{" "}
</p>
</div>
</section>
);
});
Hero.displayName = "Hero";

export default Hero;
10 changes: 8 additions & 2 deletions app/components/ScrollBySection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import React, { useEffect, useRef, useState } from "react";
import Welcome from "./Welcome/Welcome";
import MeetUs from "./MeetUs";
import Hero from "./Hero";

const ScrollBySection: React.FC = () => {
const sectionRefs = useRef<HTMLDivElement[]>([]);
Expand Down Expand Up @@ -73,16 +74,21 @@ const ScrollBySection: React.FC = () => {

return (
<div className="h-[100dvh] w-full overflow-hidden">
<Welcome
<Hero
ref={(el) => {
if (el) sectionRefs.current[0] = el;
}}
/>
<MeetUs
<Welcome
ref={(el) => {
if (el) sectionRefs.current[1] = el;
}}
/>
<MeetUs
ref={(el) => {
if (el) sectionRefs.current[2] = el;
}}
/>
{/* Add more sections as needed */}
</div>
);
Expand Down
3 changes: 3 additions & 0 deletions app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,6 @@ body {
justify-content: center;
align-items: center;
}
.back {
background-image: url("../Public/waves.jpg");
}

1 comment on commit 52db26a

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for blackwaves ready!

✅ Preview
https://blackwaves-jcjws7ca8-omarkhaled9913gmailcoms-projects.vercel.app

Built with commit 52db26a.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.