Skip to content
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

Added "Follow On Github" button! #31

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from 8 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
21 changes: 18 additions & 3 deletions src/Components/Landing/Hero.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
import HomeImg from '../../assets/Home.jpeg'
import HomeImg from '../../assets/Home.jpeg';

export default function Hero(props) {
return (
<div className="relative h-screen overflow-hidden">
{/* Background image */}
<img
className="absolute inset-0 w-full h-full object-cover filter blur-sm"
src={HomeImg}
alt="hero-background"
/>
<div className="absolute inset-0 bg-black bg-opacity-60"></div>

{/* Top-right "Star this Repo" button */}
<div className="absolute top-4 right-4 z-20">
<a
href="https://github.com/BamaCharanChhandogi/GitFinder"
target="_blank"
rel="noopener noreferrer"
className="px-4 py-2 text-sm font-medium text-white bg-gradient-to-r from-gray-600 to-gray-800 rounded-full hover:from-gray-500 hover:to-gray-700 transition duration-300 ease-in-out transform hover:-translate-y-1 hover:scale-105 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500"
>
⭐ Star us on Github
</a>
</div>

{/* Main content */}
<div className="relative z-10 h-full flex flex-col justify-center items-center text-center px-4">
<h1 className="text-5xl md:text-7xl font-extrabold text-white mb-6">
Welcome to{" "}
Expand All @@ -28,10 +43,10 @@ export default function Hero(props) {
onClick={props.authenticateUser}
className="px-8 py-3 text-lg font-medium text-white bg-gradient-to-r from-pink-500 to-purple-600 rounded-full hover:from-pink-600 hover:to-purple-700 transition duration-300 ease-in-out transform hover:-translate-y-1 hover:scale-105 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-pink-500"
>
Let's go! 🚂
Let's go! 🚀
</button>
</div>
</div>
</div>
);
}
}
11 changes: 7 additions & 4 deletions src/pages/Explore.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,13 @@ function Explore() {
{!user && !errorMessage && (
<div className="flex justify-center mt-5">
<img
src="https://media.giphy.com/media/4Zd5CCT47enl32Sx3P/giphy.gif"
className="rounded-lg w-4/6"
alt=""
/>

src="https://i.gifer.com/NXvj.gif"
style="width: 700px; height: 394px;"
class="rounded-lg"
alt=""
/>

</div>
)}
{user && (
Expand Down
34 changes: 27 additions & 7 deletions src/pages/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,31 @@ export default function Home() {
const data = await response.json();
return setUserData(data);
};

useEffect(() => {
const unsubscribe = auth.onAuthStateChanged((user) => {
if (user) {
fetchData();
db.collection("posts")
.orderBy("timestamp", "desc")
.onSnapshot((snapshot) => {
setPost(snapshot.docs.map((doc) => ({ id: doc.id, data: doc.data() })));
}, (error) => {
console.error("Error fetching posts:", error);
});
.onSnapshot(
(snapshot) => {
setPost(
snapshot.docs.map((doc) => ({
id: doc.id,
data: doc.data(),
}))
);
},
(error) => {
console.error("Error fetching posts:", error);
}
);
} else {
navigate("/");
}
});

return () => unsubscribe();
}, []);

Expand All @@ -52,9 +61,10 @@ export default function Home() {
setLoading(false);
}, 1000);
}, []);

return (
<>
<div className="flex gap-64 flex-col justify-center md:flex-row bg-[#1B2430] h-auto min-h-screen md:px-40">
<div className="flex gap-64 flex-col justify-center md:flex-row bg-[#1B2430] h-auto min-h-screen md:px-40">
<div>
<Sidebar />
</div>
Expand Down Expand Up @@ -104,6 +114,16 @@ export default function Home() {
}
)
)}

{/* Add Follow on GitHub button below the posts */}
<a
href="https://github.com/BamaCharanChhandogi"
target="_blank"
rel="noopener noreferrer"
className="bg-gradient-to-r from-purple-500 via-pink-500 to-red-500 hover:from-pink-500 hover:to-yellow-500 text-white font-bold py-3 px-6 rounded-lg mt-6 shadow-lg transform hover:scale-105 transition-all duration-300 ease-in-out"
>
Follow on GitHub
</a>
</div>
</div>
</>
Expand Down