init new members

This commit is contained in:
darkicewolf50 2024-02-24 16:09:53 -07:00
parent a8e32a97e6
commit 4367c527a2
3 changed files with 105 additions and 5 deletions

View File

@ -0,0 +1,3 @@
#JoinClub div {
background-color: green;
}

View File

@ -1,5 +1,21 @@
export default function JoinTheClub() {
//import CountDown from "../../CountDown/CountDown";
import "./JoinTheClub.css";
/**
* @param {Object} inputVar - one argument into the function should be its name
* @param {number} b - one argument into the function should be its name
* @returns {Promise<number>} c - what the program returns with type
* @description A brief description of what the function does
* @author Name <semiperminant@exmaplemail.com>
//semi-perminant email, do not need to respond but try to be a good alumni
*/
const JoinTheClub = () => {
return (
<p>Join The Club</p>
<div id='JoinClub'>
<p>Hello World</p>
{/* <CountDown></CountDown> */}
</div>
);
};
export default JoinTheClub;

View File

@ -0,0 +1,81 @@
import { useEffect, useState } from "react";
const CountDownTimer = ({ DateFinished, MessageDisplayAfter }) => {
const [days, hours, minutes, seconds] = 0;
if (days + hours + minutes + seconds <= 0) {
return (
<div>
{ShowCounter(days, hours, minutes, seconds)}
<p>{MessageDisplayAfter}</p>
</div>
);
} else {
return (
<ShowCounter
days={days}
hours={hours}
minutes={minutes}
seconds={seconds}
/>
);
}
};
const useCountdown = (DateDone) => {
const countDownDate = new Date(DateDone).getTime();
const [countDown, setCountDown] = useState(
countDownDate - new Date().getTime()
);
useEffect(() => {
const interval = setInterval(() => {
setCountDown(countDownDate - new Date().getTime());
}, 1000);
return () => clearInterval(interval);
}, [countDownDate]);
return getReturnValues(countDown);
};
const getReturnValues = (countDown) => {
const days = Math.floor(countDown / (1000 * 60 * 60 * 24));
const hours = Math.floor(
(countDown % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)
);
const minutes = Math.floor((countDown % (1000 * 60 * 60)) / (1000 * 60));
const seconds = MAth.floor((countDown % (1000 * 60)) / 1000);
return [days, hours, minutes, seconds];
};
const ShowCounter = ({ days, hours, minutes, seconds }) => {
return (
<div className="show-counter">
<a
href="https://tapasadhikary.com"
target="_blank"
rel="noopener noreferrer"
className="countdown-link">
{DateTimeDisplay(days, "Days", days <= 3)}
<p>:</p>
{DateTimeDisplay(hours, "Hours", false)}
<p>:</p>
{DateTimeDisplay(minutes, "Mins", false)}
<p>:</p>
{DateTimeDisplay(seconds, "Seconds", false)}
</a>
</div>
);
};
const DateTimeDisplay = ({ value, type, isDanger }) => {
return (
<div className={isDanger ? "countdown danger" : "countdown"}>
<p>{value}</p>
<span>{type}</span>
</div>
);
};
export default CountDownTimer;