From 6f1952a5f091c2a9aa5455c5d43dc10da3fccd72 Mon Sep 17 00:00:00 2001 From: Misode Date: Tue, 2 Apr 2024 05:18:12 +0200 Subject: [PATCH] Revert "Enable demo version" This reverts commit f0d3023cfc643aa273e3d86367fc6c534831b4c1. --- public/images/minecoin.png | Bin 290 -> 0 bytes src/app/App.tsx | 50 ++----------------------------------- 2 files changed, 2 insertions(+), 48 deletions(-) delete mode 100644 public/images/minecoin.png diff --git a/public/images/minecoin.png b/public/images/minecoin.png deleted file mode 100644 index af868fa3fe275704bcee3a3b4a50c8225d671743..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 290 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H3?x5i&EW)6jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCilo1AIbU9kdvnwORlFIcu-Z^8eq>|98axKT19`Q}q8GiH#K!e)^m?DnO+S zQfF^#04d&*Aiv=MNPxlig;E<(g0sLQvY3H^?;r>>?wFYU7ATnQ>Ealo5xjQ7MZN|F z4p&tt#h?G*pIv?9+O)5iZcZsY*KJ&>&g!!9I7i;BjNJ)!*Ij<=^~xx$F)>cjA&@tr68Y| U@tBrvBG6g}Pgg&ebxsLQ00C=q!2kdN diff --git a/src/app/App.tsx b/src/app/App.tsx index 68612315..e66623ee 100644 --- a/src/app/App.tsx +++ b/src/app/App.tsx @@ -1,16 +1,11 @@ import type { RouterOnChangeArgs } from 'preact-router' import { Router } from 'preact-router' -import { useCallback, useEffect, useMemo, useState } from 'preact/hooks' import '../styles/global.css' import '../styles/nodes.css' import { Analytics } from './Analytics.js' -import { Header } from './components/index.js' -import { TextComponent } from './components/TextComponent.jsx' -import { Changelog, Customized, Generator, Generators, Guide, Guides, Home, LegacyPartners, Partners, Sounds, Transformation, Versions, WhatsNew, Worldgen } from './pages/index.js' import { cleanUrl } from './Utils.js' - -const DEMO_KEY = 'misode_demo_2024' -const DEMO_INITIAL_SECONDS = 300 +import { Header } from './components/index.js' +import { Changelog, Customized, Generator, Generators, Guide, Guides, Home, LegacyPartners, Partners, Sounds, Transformation, Versions, WhatsNew, Worldgen } from './pages/index.js' export function App() { const changeRoute = (e: RouterOnChangeArgs) => { @@ -19,33 +14,6 @@ export function App() { setTimeout(() => Analytics.pageview(cleanUrl(e.url))) } - const [demoTimer, setDemoTimer] = useState(DEMO_INITIAL_SECONDS) - - useEffect(() => { - const storedKey = localStorage.getItem(DEMO_KEY) - if (storedKey !== null) { - setDemoTimer(parseInt(storedKey)) - } - const interval = setInterval(() => { - setDemoTimer(timer => { - const newTimer = Math.max(0, timer - 1) - localStorage.setItem(DEMO_KEY, newTimer.toFixed()) - return newTimer - }) - }, 1000) - return () => clearInterval(interval) - }, []) - - const resetDemo = useCallback(() => { - setDemoTimer(DEMO_INITIAL_SECONDS) - }, []) - - const formattedRemainingTime = useMemo(() => { - const minutes = Math.floor(demoTimer / 60).toFixed().padStart(2, '0') - const seconds = (demoTimer % 60).toFixed().padStart(2, '0') - return `${minutes}:${seconds}` - }, [demoTimer]) - return <>
@@ -64,19 +32,5 @@ export function App() { -
0 ? 'bottom-1' : 'top-1/2 -translate-y-1/2'} left-1/2 -translate-x-1/2 max-w-[100vw]`}> -
0 ? 'px-2 py-1' : 'p-6'} flex flex-col items-center item-tooltip ${0 < demoTimer && demoTimer < 60 ? 'motion-safe:animate-bounce' : ''} `}> - {demoTimer > 0 ? <> - - - : <> - -
- Minecoin - -
- } -
-
}