diff --git a/.idea/sonarlint/issuestore/index.pb b/.idea/sonarlint/issuestore/index.pb index 1acfd19..5e0fe71 100644 --- a/.idea/sonarlint/issuestore/index.pb +++ b/.idea/sonarlint/issuestore/index.pb @@ -25,4 +25,26 @@ Dockerfile,6/6/6651ddff6eb82c840ced7c1dddee15c6e1913dd4 C gxcko.me/index.html,b/7/b79f0003805511ae806f7e33f5782062e101d0ca S -#gxcko.me/redirect/genshin-util.html,9/7/97e5aa2277ea4409e286b869db31c0f5222ecc38 \ No newline at end of file +#gxcko.me/redirect/genshin-util.html,9/7/97e5aa2277ea4409e286b869db31c0f5222ecc38 +O +gxcko.me/styles/backgrounds.css,3/3/330d4a9c49c4726b9f01b6c860ed4321cc8dc3f1 +< + package.json,7/0/7030d0b2f71b999ff89a343de08c414af32fc93a +H +gxcko.me/styles/text.css,a/b/abf1eee665d5a5830a98aac81af4492667c61303 +A +tsconfig.app.json,4/3/43dc209d69db416f8cba4f9850ff857de70532a2 += + .eslintrc.cjs,e/3/e360fad5b6efa2ddba75769ed72a37505224b2ea +B +tsconfig.node.json,c/d/cd346bdc6f8eee39e4d280aa9a6f7949c2133a71 +> +vite.config.ts,7/5/75ea7f3ea6d80d54bb5b2357996972d1632a5038 +9 + README.md,8/e/8ec9a00bfd09b3190ac6b22251dbb1aa95a0579d +T +$gxcko.me/src/components/PageTime.tsx,b/6/b6a98121df0c48870d5b7c885e9c7a25a427d037 +D +gxcko.me/src/App.tsx,0/5/0590d048294f17dacfdaacf6ecc6b9f93cb01f0c +S +#.idea/sonarlint/issuestore/index.pb,9/f/9fe84ebb15faf917b7def6236dba604453cc61e0 \ No newline at end of file diff --git a/.idea/sonarlint/securityhotspotstore/index.pb b/.idea/sonarlint/securityhotspotstore/index.pb index 3f4f1a4..d975e8c 100644 --- a/.idea/sonarlint/securityhotspotstore/index.pb +++ b/.idea/sonarlint/securityhotspotstore/index.pb @@ -103,4 +103,8 @@ J V &gxcko.me/src/components/Background.tsx,9/e/9e03bbc2a26711f36db8fc9c4dbab2accc542f54 \ -,.idea/inspectionProfiles/Project_Default.xml,4/9/496a238a6afa168dbaf6efd37bb459331589579c \ No newline at end of file +,.idea/inspectionProfiles/Project_Default.xml,4/9/496a238a6afa168dbaf6efd37bb459331589579c +T +$gxcko.me/src/components/PageTime.tsx,b/6/b6a98121df0c48870d5b7c885e9c7a25a427d037 +S +#.idea/sonarlint/issuestore/index.pb,9/f/9fe84ebb15faf917b7def6236dba604453cc61e0 \ No newline at end of file diff --git a/gxcko.me/src/App.tsx b/gxcko.me/src/App.tsx index 05ea989..5d20c32 100644 --- a/gxcko.me/src/App.tsx +++ b/gxcko.me/src/App.tsx @@ -4,6 +4,7 @@ import {ThemeProvider} from "./contexts/ThemeContext.tsx"; import BottomBanner from "./components/BottomBanner.tsx"; import {BlurProvider} from "./contexts/BlurContext.tsx"; import ContentContainer from "./components/ContentContainer.tsx"; +import PageTime from "./components/PageTime.tsx"; export default function App() { return ( @@ -14,6 +15,7 @@ export default function App() { + diff --git a/gxcko.me/src/components/PageTime.tsx b/gxcko.me/src/components/PageTime.tsx new file mode 100644 index 0000000..3cee90b --- /dev/null +++ b/gxcko.me/src/components/PageTime.tsx @@ -0,0 +1,28 @@ +import {useState} from "react"; +import {useBlur} from "../contexts/BlurContext.tsx"; + +export default function PageTime() { + + const [seconds, setSeconds] = useState(0); + + setTimeout(() => { + setSeconds(seconds + 1); + }, 1000); + + const {blur} = useBlur(); + + const secondsToString = (seconds: number) => { + const hours = Math.floor(seconds / 3600); + const minutes = Math.floor(seconds % 3600 / 60); + const secondsString = Math.floor(seconds % 3600 % 60); + console.log(hours + "h" + minutes + "m" + secondsString + "s"); + return `${hours === 0 ? "" : hours < 10 ? "0" + hours + "h" + ":" : hours + "h" + ":"}${minutes === 0 && hours === 0 ? "" : minutes < 10 ? "0" + minutes + "m" + ":" : minutes + "m" + ":"}${secondsString === 0 && minutes === 0 && hours === 0 ? "" : secondsString < 10 ? "0" + secondsString + "s" : secondsString + "s"}`; + } + + return ( +
+

Time wasted on this page: {secondsToString(seconds)}

+ {seconds > 3600 ?

Why are you still here?

: ""} +
+ ) +} \ No newline at end of file diff --git a/gxcko.me/styles/text.css b/gxcko.me/styles/text.css index 39319d0..20d0398 100644 --- a/gxcko.me/styles/text.css +++ b/gxcko.me/styles/text.css @@ -34,4 +34,18 @@ .half-br { margin-top: 0.5em; +} + +#pageTime { + text-align: right; + font-size: x-large; + position: fixed; + bottom: 0; + right: 1%; + transition: all 1s ease-in-out, + color 0s; +} + +#pageTime.blur { + filter: blur(5px); } \ No newline at end of file