Add social share and QR code

Add social share buttons and a QR code to interactive pages, excluding green screen pages.
This commit is contained in:
gpt-engineer-app[bot] 2025-07-19 14:07:18 +00:00
parent 04ecfc8d28
commit b60c8481f7
5 changed files with 607 additions and 8 deletions

View file

@ -2,10 +2,15 @@ import React, { useState, useEffect, useCallback } from 'react';
import { Button } from '@/components/ui/button';
import { Card, CardContent } from '@/components/ui/card';
import { Badge } from '@/components/ui/badge';
import SocialShare from '@/components/SocialShare';
const POWERS_OF_TWO = [128, 64, 32, 16, 8, 4, 2, 1];
const BinaryNumberGame = () => {
interface BinaryNumberGameProps {
showSocialShare?: boolean;
}
const BinaryNumberGame: React.FC<BinaryNumberGameProps> = ({ showSocialShare = true }) => {
const [targetNumber, setTargetNumber] = useState<number>(0);
const [flippedCards, setFlippedCards] = useState<boolean[]>(new Array(8).fill(false));
const [currentSum, setCurrentSum] = useState<number>(0);
@ -165,6 +170,14 @@ const BinaryNumberGame = () => {
{!hasGameStarted ? 'Start Game' : isGameWon ? 'Play Again' : 'New Game'}
</Button>
</div>
{showSocialShare && (
<SocialShare
title="Binary Number Representation Game"
description="Learn how numbers are represented in binary (base-2) format through an interactive guessing game."
url={`${window.location.origin}/binary-number-game`}
/>
)}
</div>
);
};