Skip to content

Commit

Permalink
Added Snake Extreme page and redirect to games overview
Browse files Browse the repository at this point in the history
  • Loading branch information
tech-n1c committed May 31, 2024
1 parent 0454ab0 commit 914e19d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions frontend2shine/app/(games)/games/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ export default function Games() {

</div>

{/* Upcoming game */}
{/* Snake Extreme */}
<div className="rounded-xl flex flex-col h-full p-6 bg-gray-800 items-center" data-aos="fade-up"
data-aos-delay="400">
<Image className="rounded-2xl mb-5" src={SnakeGame} width={300} alt="Snake Game" />
<blockquote className="text-lg text-gray-400 grow text-center">Stay tuned for this upcoming game!</blockquote>
<blockquote className="text-lg text-gray-400 grow text-center">In Snake Extreme, crank up the speed and outsmart your own lengthening serpent, gobbling pixelated goodies for a high-score frenzy!</blockquote>
<div className="text-gray-700 font-medium mt-6 pt-5 border-t border-gray-700 mb-2">
<div data-aos="fade-up" data-aos-delay="400">
<SessionProvider>
Expand Down
2 changes: 1 addition & 1 deletion frontend2shine/components/blackjack-redirect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const BlackJackRedirect = () => {
const user = session?.user;

if (user) {
const url = `https://engine.maiwald.cc?username=${encodeURIComponent(user?.name || '')}&email=${encodeURIComponent(user?.email || '')}`;
const url = `https://engine.maiwald.cc/blackjack.html?username=${encodeURIComponent(user?.name || '')}&email=${encodeURIComponent(user?.email || '')}`;
setPlayNowUrl(url);
} else {
setButtonText('Log in to play BlackJack.');
Expand Down
10 changes: 8 additions & 2 deletions frontend2shine/components/snake-redirect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,20 @@ import React, {ChangeEvent, useEffect, useState} from "react";

export const SnakeRedirect = () => {
const [playNowUrl, setPlayNowUrl] = useState<string | null>(null); // Declare type as string | null
const [buttonText, setButtonText] = useState('Not playable yet.'); // Change the button text to "Play Snake Extreme."
const [buttonText, setButtonText] = useState('Play Snake Extreme.'); // Change the button text to "Play Snake Extreme."
const {data: session, status: loadingStatus} = useSession();

useEffect(() => {
const fetchData = async () => {
const session = await getSession();
const user = session?.user;
setButtonText('Not playable yet.');

if (user) {
const url = `https://engine.maiwald.cc/snake.html?username=${encodeURIComponent(user?.name || '')}&email=${encodeURIComponent(user?.email || '')}`;
setPlayNowUrl(url);
} else {
setButtonText('Log in to play Snake Extreme.');
}
};

fetchData();
Expand Down

0 comments on commit 914e19d

Please sign in to comment.