From b6ebc5f88ffe9fb442238f160879ad47dd713d11 Mon Sep 17 00:00:00 2001
From: name <email@example.com>
Date: Fri, 11 Aug 2023 05:09:24 +0000
Subject: 2023-08-10

---
 docusaurus/src/theme/Footer/InputPreloader.tsx | 43 ++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 docusaurus/src/theme/Footer/InputPreloader.tsx

(limited to 'docusaurus/src/theme/Footer/InputPreloader.tsx')

diff --git a/docusaurus/src/theme/Footer/InputPreloader.tsx b/docusaurus/src/theme/Footer/InputPreloader.tsx
new file mode 100644
index 0000000..325f8a7
--- /dev/null
+++ b/docusaurus/src/theme/Footer/InputPreloader.tsx
@@ -0,0 +1,43 @@
+/**
+ * @license
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ * This file is part of Wolfree.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ */
+
+import React, { useEffect, useState } from "react";
+
+const InputPreloader = () => {
+  const [showIframe, setShowIframe] = useState(false);
+
+  useEffect(() => {
+    const handleIframeLoad = () => {
+      // Show the iframe after a 3000ms delay
+      const timerId = setTimeout(() => setShowIframe(true), 3000);
+      // Cleanup the timer when the component unmounts
+      return () => clearTimeout(timerId);
+    };
+
+    window.scroll(0, 0);
+
+    window.addEventListener("load", handleIframeLoad);
+
+    // Cleanup the event listener when the component unmounts
+    return () => window.removeEventListener("load", handleIframeLoad);
+  }, []); // Empty dependency array means the effect runs only once after initial render
+
+  return (
+    <>
+      {/* Use a descriptive title for accessibility */}
+      {showIframe && (
+        <iframe
+          title="Input Page Preloader"
+          src="/input/"
+          style={{ display: "none" }}
+        />
+      )}
+    </>
+  );
+};
+
+export default InputPreloader;
-- 
cgit v1.2.3

