This commit is contained in:
2024-07-17 23:13:56 +05:30
commit a91baa6388
15 changed files with 7524 additions and 0 deletions

BIN
app/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

38
app/globals.css Normal file
View File

@@ -0,0 +1,38 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
:root {
--foreground-rgb: 0, 0, 0;
--background-start-rgb: 214, 219, 220;
--background-end-rgb: 255, 255, 255;
}
@media (prefers-color-scheme: dark) {
:root {
--foreground-rgb: 255, 255, 255;
--background-start-rgb: 255, 255, 255;
--background-end-rgb: 0, 0, 0;
}
}
html, body, #__next {
height: 100%;
margin: 0;
}
body {
color: rgb(var(--foreground-rgb));
background: linear-gradient(
to bottom,
transparent,
rgb(var(--background-end-rgb))
)
rgb(var(--background-start-rgb));
}
@layer utilities {
.text-balance {
text-wrap: balance;
}
}

22
app/layout.tsx Normal file
View File

@@ -0,0 +1,22 @@
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "./globals.css";
const inter = Inter({ subsets: ["latin"] });
export const metadata: Metadata = {
title: "W3b Wallet Login",
description: "Future of gaming",
};
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en">
<body className={inter.className}>{children}</body>
</html>
);
}

57
app/page.tsx Normal file
View File

@@ -0,0 +1,57 @@
"use client";
import { useEffect, useState } from 'react';
import axios from 'axios';
import { PrivyProvider, usePrivy } from '@privy-io/react-auth';
const Home: React.FC = () => {
const { login, ready, user } = usePrivy();
useEffect(() => {
const setResult = async (result: string) => {
const params = new URLSearchParams(window.location.search);
const requestIdFromUrl = params.get('request_id');
try {
await axios({
method: 'get',
url: `https://vps.playpoolstudios.com/metahunt/api/launcher/set_request_response.php`,
withCredentials: false,
params: {
id: requestIdFromUrl,
result: result
},
});
} catch (error) {
console.error('Error making GET request:', error);
}
};
const requestIdFromUrl = new URLSearchParams(window.location.search).get('request_id');
if (requestIdFromUrl) {
setResult('some_result'); // Replace 'some_result' with the actual result you want to send
}
}, []);
return (
<div className='flex flex-col items-center justify-center h-full'>
{user && ready ? (
<h1 className='neon-text mb-4 text-3xl'>Logged in</h1>
) : (
<>
<h1 className='neon-text mb-4 text-3xl'>Complete W3B Wallet Login</h1>
<button className='bg-green-700 rounded-full p-1 px-4 text-lg m-5' onClick={login}>Login</button>
</>
)}
</div>
);
};
const App: React.FC = () => {
return (
<PrivyProvider appId={process.env.NEXT_PUBLIC_PRIVY_APP_ID || 'clww47dl8012n33vqoc9xsy5o'}>
<Home />
</PrivyProvider>
);
};
export default App;