diff --git a/components/pages/home/GlobeView.tsx b/components/pages/home/GlobeView.tsx index e7832a9..c87f391 100644 --- a/components/pages/home/GlobeView.tsx +++ b/components/pages/home/GlobeView.tsx @@ -415,7 +415,7 @@ export function GlobeView() { We are from worldwide

- Our ethnic diersity is our strength. Our students are from all over the world. We are a global team. + Our ethnic dievrsity is our strength. We are from all over the world. We are a global team.

diff --git a/components/pwa-install.jsx b/components/pwa-install.jsx new file mode 100644 index 0000000..ac99a29 --- /dev/null +++ b/components/pwa-install.jsx @@ -0,0 +1,86 @@ +// @ts-nocheck +"use client"; +import { useEffect, useState } from "react"; + +import { Button } from "@/components/ui/button"; +const PwaInstall = () => { + const [deferredPrompt, setDeferredPrompt] = useState(null); + + useEffect(() => { + const handleBeforeInstallPrompt = (event) => { + // Prevent the default installation prompt + event.preventDefault(); + // Store the event for later use + setDeferredPrompt(event); + }; + + // Listen for the beforeinstallprompt event + window.addEventListener("beforeinstallprompt", handleBeforeInstallPrompt); + // warn the user if the app is already installed + + // Cleanup: remove the event listener when the component is unmounted + return () => { + window.removeEventListener( + "beforeinstallprompt", + handleBeforeInstallPrompt, + ); + }; + }, []); + const handleEmailOpen = (event) => { + event.preventDefault(); + window.location.href = "mailto:rinattok21@gmail.com"; + + }; + const handleInstallClick = (event) => { + event.preventDefault(); + + // Display confirmation alert to install from the user + // if ( + // window.confirm( + // "The app is still in development stage. Some devices might face flickering issues. Please use the website for better experience. Click OK to continue." + // ) + // ) { + if (deferredPrompt) { + // Show the installation prompt + deferredPrompt.prompt(); + + // Wait for the user to respond to the prompt + deferredPrompt.userChoice.then((choiceResult) => { + if (choiceResult.outcome === "accepted") { + console.log("User accepted the installation"); + } else { + console.log("User dismissed the installation"); + } + + // Reset the deferredPrompt variable + setDeferredPrompt(null); + }); + } + // } + }; + + return ( +
+ + +
+ ) +}; + +export default PwaInstall; diff --git a/components/ui/google-gemini-effect.tsx b/components/ui/google-gemini-effect.tsx index 29c1a6a..18a4eb4 100644 --- a/components/ui/google-gemini-effect.tsx +++ b/components/ui/google-gemini-effect.tsx @@ -1,7 +1,10 @@ "use client"; -import { cn } from "@/lib/utils"; import { motion, MotionValue } from "framer-motion"; import React from "react"; + +import PwaInstall from '@/components/pwa-install' +import { cn } from "@/lib/utils"; + import { Button } from "./button"; const transition = { @@ -21,19 +24,16 @@ export const GoogleGeminiEffect = ({ className?: string; }) => { return ( -
+

- {title || `Build with Aceternity UI`} + Let's stay connected

{description || - `Scroll this component and see the bottom SVG come to life wow this - works!`} + `Install the app on your device for an optimal experience. You can also contact us via email.`}

-
- +
+
- ); + ) }; diff --git a/public/manifest.json b/public/manifest.json index b59e866..0d8a321 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -5,8 +5,8 @@ "name": "HSTU ECE21", "short_name": "RINATTOK21", "description": "Documentary of HSTU ECE21 Batch. A project by Shahriar Hasan.", - "theme_color": "#FFFFFF", - "background_color": "#000000", + "theme_color": "#000000", + "background_color": "#FFFFFF", "icons": [ { "src": "AppImages/android/android-launchericon-192-192.png",