werefox-cafe/src/info/pages/hrt/index.js

51 lines
1.5 KiB
JavaScript
Raw Normal View History

import BasicPage from "../../components/basic-page-template";
import WCard from "../../components/werefox-card";
function getTimes(interval) {
let expected = Date.now() - new Date("December 11, 2020 00:00:00") + interval;
let days = Math.round(expected / 1000 / 60 / 60 / 24);
let hours = (new Date(expected).getHours() + 6) % 24;
let minutes = new Date(expected).getMinutes();
let seconds = new Date(expected).getSeconds();
return {
expected: expected,
days: days,
hours: hours,
minutes: minutes,
seconds: seconds,
};
}
export default function HRT() {
const initialTimes = getTimes(0);
const initialTimesArray = [
`${initialTimes["days"]} days, `,
`${initialTimes["hours"]} hours, `,
`${initialTimes["minutes"]} minutes, `,
`and ${initialTimes["seconds"]} seconds`,
];
console.log(initialTimesArray);
return (
<BasicPage
page_title="Alexis Werefox HRT Tracker"
card_title="Track my HRT progress!"
>
<WCard>
<p className="p-6 text-lg md:text-2xl text-center text-werefox-blue-dark dark:text-werefox-blue">
I'm so glad you're interested!!
<br />
I have been on HRT for:
<br />
<p className="grid grid-cols-1 grid-rows-4">
{initialTimesArray.map((t, n) => (
<p id={`time_${n}`}>{t}</p>
))}
</p>
</p>
</WCard>
<script src="/js/hrttimer.js"></script>
</BasicPage>
);
}