Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions frontend/src/Components/ClueInput.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
}
} catch (e) {
// ignore
console.error(e);
}

const onClueReceived = (clueData) => {
Expand Down Expand Up @@ -82,7 +83,7 @@
socket.off('requestClue', onRequestClue);
socket.off('turnSwitched', onTurnSwitched);
};
}, [joinedTitle, joinedTeam]);

Check warning on line 86 in frontend/src/Components/ClueInput.jsx

View workflow job for this annotation

GitHub Actions / build-frontend

React Hook useEffect has missing dependencies: 'clueWord', 'ui?.clueDisplayActive', and 'ui.lastClue'. Either include them or remove the dependency array

useEffect(() => {
const onCardRevealed = ({ cardsRevealedThisTurn }) => {
Expand Down Expand Up @@ -129,7 +130,7 @@

useEffect(()=>{
console.log("ClueWord:",clueWord);
},[])

Check warning on line 133 in frontend/src/Components/ClueInput.jsx

View workflow job for this annotation

GitHub Actions / build-frontend

React Hook useEffect has a missing dependency: 'clueWord'. Either include it or remove the dependency array

return (
<div>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/Components/PlayerList.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JoinContext } from "./Teams";
import { JoinContext } from "../context/JoinContext";
import { useContext } from "react";

const PlayerList = ({ team, title, players, colorClasses }) => {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/Components/Teams.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createContext, useState, useEffect } from "react";

Check failure on line 1 in frontend/src/Components/Teams.jsx

View workflow job for this annotation

GitHub Actions / build-frontend

'createContext' is defined but never used. Allowed unused vars must match /^[A-Z_]/u
import { useParams } from "react-router-dom";
import { useSelector } from "react-redux";
import TeamPanel from "./TeamPanel";
Expand All @@ -7,7 +7,7 @@
import API_URL from '../apiConfig';


export const JoinContext = createContext();
import { JoinContext } from "../context/JoinContext";

const Teams = ({ onDataReceived }) => {
const { gameId } = useParams(); // <-- GET GAME ID FROM URL
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/Components/ThemeToggle.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ export default function ThemeToggle() {
document.documentElement.classList.remove('dark')
localStorage.setItem('theme', 'light')
}
} catch {}
} catch (e){
console.error(e);
}
}, [dark])

return (
Expand Down
12 changes: 12 additions & 0 deletions frontend/src/constants/floating_words.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export const FLOATING_WORDS = [
'AGENT', 'CLUE', 'CONTACT', 'DECRYPT', 'ENCODE', 'MISSION',
'REVEALER', 'CONCEALER', 'INTEL', 'ASSASSIN', 'RED', 'BLUE',
'FIELD', 'CODE', 'TARGET', 'WILD', 'DANGER', 'SECRET', 'PUZZLE',
'SPY', 'CARD', 'GUESS', 'TURN', 'SCORE', 'TEAM', 'COVER', 'TRAITOR', // New words
'HIDDEN', 'KEY', 'WORD', 'CYPHER', 'LOCATE', 'VECTOR', 'CONFIRM', 'PASS', // More new words

// Doubling the list for higher density
'CLUE', 'AGENT', 'ENCODE', 'MISSION', 'REVEALER', 'INTEL',
'RED', 'BLUE', 'FIELD', 'CODE', 'TARGET', 'DANGER', 'SECRET', 'PUZZLE',
'SPY', 'CARD', 'GUESS', 'SCORE', 'TEAM', 'HIDDEN', 'KEY', 'WORD' // Doubled new words
];
3 changes: 3 additions & 0 deletions frontend/src/context/JoinContext.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { createContext } from "react";

export const JoinContext = createContext();
2 changes: 1 addition & 1 deletion frontend/src/pages/Error.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useNavigate, Link } from "react-router-dom";
import ThemeToggle from "../Components/ThemeToggle";

// Floating words used on the Home page — keep consistent here
import {FLOATING_WORDS} from "./Home";
import { FLOATING_WORDS } from "../constants/floating_words";
// const FLOATING_WORDS = [
// 'AGENT', 'CLUE', 'MISSION', 'INTEL', 'SECRET', 'SPY', 'CARD', 'GUESS', 'TEAM', 'CODE',
// 'RED', 'BLUE', 'HIDDEN', 'KEY', 'WORD'
Expand Down
14 changes: 1 addition & 13 deletions frontend/src/pages/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,7 @@ import axios from "axios";
import ThemeToggle from '../Components/ThemeToggle';
import API_URL from '../apiConfig';

// List of words for the animated background (Increased density)
export const FLOATING_WORDS = [
'AGENT', 'CLUE', 'CONTACT', 'DECRYPT', 'ENCODE', 'MISSION',
'REVEALER', 'CONCEALER', 'INTEL', 'ASSASSIN', 'RED', 'BLUE',
'FIELD', 'CODE', 'TARGET', 'WILD', 'DANGER', 'SECRET', 'PUZZLE',
'SPY', 'CARD', 'GUESS', 'TURN', 'SCORE', 'TEAM', 'COVER', 'TRAITOR', // New words
'HIDDEN', 'KEY', 'WORD', 'CYPHER', 'LOCATE', 'VECTOR', 'CONFIRM', 'PASS', // More new words

// Doubling the list for higher density
'CLUE', 'AGENT', 'ENCODE', 'MISSION', 'REVEALER', 'INTEL',
'RED', 'BLUE', 'FIELD', 'CODE', 'TARGET', 'DANGER', 'SECRET', 'PUZZLE',
'SPY', 'CARD', 'GUESS', 'SCORE', 'TEAM', 'HIDDEN', 'KEY', 'WORD' // Doubled new words
];
import { FLOATING_WORDS } from '../constants/floating_words';

// Reusable component for a single floating word (for clarity)
const FloatingWord = ({ word, x, y, size, delay, duration }) => (
Expand Down
Loading