This commit is contained in:
jueweijue 2024-05-29 21:35:58 +08:00
parent 0d8cda9787
commit 2da7bdb57b
1 changed files with 5 additions and 0 deletions

View File

@ -13,9 +13,12 @@ import qrcode from "@/public/images/qrcode.png";
import Footer from "@/components/Footer";
export default function Home() {
const [currentUserAgent, setCurrentUserAgent] = useState();
const [deviceType, setDeviceType] = useState("");
useEffect(() => {
const userAgent = navigator.userAgent;
setCurrentUserAgent(userAgent);
//
if (/Android/i.test(userAgent)) {
setDeviceType("Android");
@ -57,6 +60,8 @@ export default function Home() {
</div>
<div className="flex flex-col flex-1 py-16 items-center justify-around z-10">
<Image className="w-96" src={slogan} priority alt="" />
<p className="text-white">{deviceType}</p>
<p className="text-white">{currentUserAgent}</p>
{deviceType === "pc" && (
<div className="flex flex-row gap-20">
<a