homepage
homepage
useEffect(() => {
const handleScroll = () => {
const scrollPosition = window.scrollY + window.innerHeight;
setVisibleSections({
home: scrollPosition > document.getElementById("home").offsetTop + 200,
about: scrollPosition > document.getElementById("aboutus").offsetTop + 200,
contact: scrollPosition > document.getElementById("contactus").offsetTop +
200
});
};
window.addEventListener("scroll", handleScroll);
return () => window.removeEventListener("scroll", handleScroll);
}, []);
return (
<div>
<nav className="navbar">
<a href="#home">Home</a>
<a href="#aboutus">About</a>
<a href="#contactus">Contact</a>
</nav>
<style>
{`
html, body {
overflow-x: hidden;
overflow-y: auto;
scroll-behavior: smooth;
}
::-webkit-scrollbar {
display: none;
}
.navbar {
position: fixed;
top: 0;
width: 100%;
background: rgba(240, 240, 240, 0.2);
backdrop-filter: blur(100px);
-webkit-backdrop-filter: blur(10px);
border-radius: 5px;
padding: 15px 0;
text-align: center;
z-index: 1000;
transition: background 0.3s ease-in-out;
}
.navbar.scrolled {
background: rgba(0, 0, 0, 0.6);
}
.navbar a {
color: white;
text-decoration: none;
margin: 0 20px;
font-size: 18px;
transition: color 0.3s ease;
display: inline-block;
}
.navbar a:hover {
color: rgb(0, 0, 0);
transform: translateY(-3px);
}
.homepage-container {
background-image: url('./background.jpg');
background-size: cover;
background-position: center;
background-repeat: no-repeat;
background-blend-mode: overlay;
width: 100vw;
height: 100vh;
max-width: 100%;
max-height: 100%;
}
.text-section h1 {
font-size: 40px;
margin-bottom: 10px;
}
.text-section p {
font-size: 18px;
margin-bottom: 20px;
}
.cta-button {
padding: 12px 24px;
font-size: 18px;
border: none;
background: white;
color: black;
cursor: pointer;
transition: transform 0.3s ease, background 0.3s ease;
}
.cta-button:hover {
background: rgb(55, 140, 55);
transform: scale(1.05);
}
.about-section {
background-image: url('./background.jpg');
display: flex;
flex-direction: column;
text-align: center;
padding: 50px;
}
.about-content h2 {
font-size: 36px;
margin-bottom: 15px;
}
.about-images img {
width: 200px;
margin: 10px;
transition: transform 0.3s ease-in-out;
}
.about-images img:hover {
transform: scale(1.1);
}
.contact-form {
display: flex;
flex-direction: column;
width: 50%;
font-family: sohne, "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.contact-form button {
padding: 12px;
background: white;
cursor: pointer;
transition: background 0.3s ease, transform 0.3s ease;
color: black;
}
.contact-form button:hover {
background: rgb(59, 101, 59);
transform: scale(1.05);
}
.fade-in {
opacity: 1;
transform: translateY(0);
transition: opacity 1s ease-out, transform 1s ease-out;
}
.zoom-in {
transition: transform 0.3s ease-in-out;
}
.zoom-in:hover {
transform: scale(1.1);
}
.status-message {
margin-top: 10px;
color: yellow;
}
`}
</style>
</div>
);
};