Skip to content

Commit

Permalink
visitors and github stars button added
Browse files Browse the repository at this point in the history
  • Loading branch information
VinayLodhi1712 committed Oct 26, 2024
1 parent ca85ca7 commit a41e06e
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 7 deletions.
6 changes: 0 additions & 6 deletions client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@

<!-- ############### Footer ############### -->

<div class="visitor-counter">
<div>Visitor</div>
<div class="website-counter"></div>
</div>
<script src="path/to/visitorCounter.js"></script>
<script src="./assets/css/visitors.css"></script>

<script src="visi.js"></script>

Expand Down
46 changes: 45 additions & 1 deletion client/src/component/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ import PropTypes from 'prop-types';
import { Link } from 'react-router-dom';
import { FaXTwitter } from "react-icons/fa6";
import { FaGithub, FaLinkedin, FaYoutube } from 'react-icons/fa';
import React, { useEffect, useState } from 'react';

import React, { useEffect, useState } from "react";
const Footer = (props) => {
const [email, setEmail] = useState("");
const [message, setMessage] = useState("");
const [isError, setIsError] = useState(false); // Flag to handle message color
const [stars, setStars] = useState(0);

const handleSubscribe = async (e) => {
e.preventDefault();
Expand Down Expand Up @@ -78,6 +79,14 @@ const Footer = (props) => {
};
}, []);

useEffect(() => {
const fetchGitHubStars = async () => {
const response = await fetch('https://api.github.com/repos/Bitbox-Connect/Bitbox');
const data = await response.json();
setStars(data.stargazers_count);
};
fetchGitHubStars();
}, []);


return (
Expand Down Expand Up @@ -115,6 +124,41 @@ const Footer = (props) => {
</p>
)}
</div>
<div className="flex flex-col items-center space-y-4 mb-4">
<a
href="https://github.com/Avdhesh-Varshney/chanakya-niti"
target="_blank"
rel="noopener noreferrer"
className="flex items-center bg-gray-800 text-white py-2 px-4 rounded-lg hover:bg-gray-700"
>
<svg
xmlns="http://www.w3.org/2000/svg"
className="h-5 w-5 mr-2"
fill="currentColor"
viewBox="0 0 24 24"
>
<path d="M12 0a12 12 0 00-3.79 23.39c.6.11.82-.26.82-.57v-2.1c-3.34.73-4.04-1.61-4.04-1.61-.55-1.38-1.34-1.75-1.34-1.75-1.09-.75.08-.73.08-.73 1.2.09 1.84 1.23 1.84 1.23 1.07 1.82 2.81 1.3 3.5.99.11-.77.42-1.3.76-1.6-2.67-.3-5.47-1.34-5.47-5.96 0-1.32.47-2.39 1.23-3.23-.12-.3-.53-1.5.12-3.14 0 0 1.01-.32 3.3 1.23a11.51 11.51 0 016 0c2.29-1.55 3.3-1.23 3.3-1.23.65 1.64.24 2.84.12 3.14.76.84 1.23 1.91 1.23 3.23 0 4.63-2.8 5.66-5.47 5.96.43.37.82 1.1.82 2.23v3.31c0 .31.22.69.83.57A12 12 0 0012 0"></path>
</svg>
<span>Star us ⭐ {stars !== null ? stars : '...'}</span>
</a>

<div className="flex flex-col items-center text-gray-800">
<div className="flex items-center space-x-2">
<span className="font-bold text-2xl">Total Visitors : </span>
<a href="https://www.hitwebcounter.com" target="_blank" rel="noopener noreferrer">
<img
src="https://hitwebcounter.com/counter/counter.php?page=17062113&style=0006&nbdigits=5&type=page&initCount=1000"
alt="Visit counter for websites"
className="inline-block"
/>
</a>
</div>
</div>

</div>



<div className="row">
{/* Left section with branding and social icons */}
<div className="col-md-6 col-lg-5 col-12 ft-1">
Expand Down

0 comments on commit a41e06e

Please sign in to comment.