This commit is contained in:
2026-03-27 10:43:10 -04:00
Unverified
parent 2495f41df9
commit c8781fddaa
15 changed files with 1650 additions and 1630 deletions

View File

@@ -0,0 +1,4 @@
node_modules
.next
out
connect4-moderator-server

4
connect4-ui/.prettierrc Normal file
View File

@@ -0,0 +1,4 @@
{
"useTabs": false,
"tabWidth": 2
}

View File

@@ -8,5 +8,8 @@
body { body {
background-color: var(--background); background-color: var(--background);
color: var(--foreground); color: var(--foreground);
font-family: system-ui, -apple-system, sans-serif; font-family:
system-ui,
-apple-system,
sans-serif;
} }

View File

@@ -54,7 +54,9 @@ export default function Board({
<div className="w-3.5 h-3.5 rounded-full bg-yellow-400 shrink-0" /> <div className="w-3.5 h-3.5 rounded-full bg-yellow-400 shrink-0" />
<span className="font-medium">{player2}</span> <span className="font-medium">{player2}</span>
{currentTurnColor === 2 && ( {currentTurnColor === 2 && (
<span className="text-xs text-yellow-400 animate-pulse"> Turn</span> <span className="text-xs text-yellow-400 animate-pulse">
Turn
</span>
)} )}
</div> </div>
</div> </div>
@@ -80,7 +82,9 @@ export default function Board({
{/* Drop arrow indicator */} {/* Drop arrow indicator */}
<div <div
className={`h-2 flex items-center justify-center transition-opacity ${ className={`h-2 flex items-center justify-center transition-opacity ${
hoveredCol === col && canInteract ? "opacity-100" : "opacity-0" hoveredCol === col && canInteract
? "opacity-100"
: "opacity-0"
}`} }`}
> >
<div className="w-0 h-0 border-l-4 border-r-4 border-t-4 border-l-transparent border-r-transparent border-t-white/70" /> <div className="w-0 h-0 border-l-4 border-r-4 border-t-4 border-l-transparent border-r-transparent border-t-white/70" />
@@ -98,9 +102,7 @@ export default function Board({
className={`w-12 h-12 rounded-full border-2 transition-all duration-150 ${ className={`w-12 h-12 rounded-full border-2 transition-all duration-150 ${
cell === 1 cell === 1
? `bg-red-500 shadow-lg shadow-red-950/60 ${ ? `bg-red-500 shadow-lg shadow-red-950/60 ${
isLast isLast ? "border-white scale-110" : "border-red-700"
? "border-white scale-110"
: "border-red-700"
}` }`
: cell === 2 : cell === 2
? `bg-yellow-400 shadow-lg shadow-yellow-950/60 ${ ? `bg-yellow-400 shadow-lg shadow-yellow-950/60 ${

View File

@@ -20,6 +20,7 @@
"eslint": "^9", "eslint": "^9",
"eslint-config-next": "15.2.4", "eslint-config-next": "15.2.4",
"postcss": "^8", "postcss": "^8",
"prettier": "^3.8.1",
"tailwindcss": "^4", "tailwindcss": "^4",
"typescript": "^5" "typescript": "^5"
} }
@@ -4962,6 +4963,22 @@
"node": ">= 0.8.0" "node": ">= 0.8.0"
} }
}, },
"node_modules/prettier": {
"version": "3.8.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.1.tgz",
"integrity": "sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg==",
"dev": true,
"license": "MIT",
"bin": {
"prettier": "bin/prettier.cjs"
},
"engines": {
"node": ">=14"
},
"funding": {
"url": "https://github.com/prettier/prettier?sponsor=1"
}
},
"node_modules/prop-types": { "node_modules/prop-types": {
"version": "15.8.1", "version": "15.8.1",
"resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz",

View File

@@ -6,7 +6,9 @@
"dev": "next dev", "dev": "next dev",
"build": "next build", "build": "next build",
"start": "next start", "start": "next start",
"lint": "next lint" "lint": "next lint",
"format": "prettier --write .",
"format:check": "prettier --check ."
}, },
"dependencies": { "dependencies": {
"next": "15.2.4", "next": "15.2.4",
@@ -14,14 +16,15 @@
"react-dom": "^19.0.0" "react-dom": "^19.0.0"
}, },
"devDependencies": { "devDependencies": {
"@tailwindcss/postcss": "^4",
"@types/node": "^20", "@types/node": "^20",
"@types/react": "^19", "@types/react": "^19",
"@types/react-dom": "^19", "@types/react-dom": "^19",
"eslint": "^9", "eslint": "^9",
"eslint-config-next": "15.2.4", "eslint-config-next": "15.2.4",
"typescript": "^5", "postcss": "^8",
"prettier": "^3.8.1",
"tailwindcss": "^4", "tailwindcss": "^4",
"@tailwindcss/postcss": "^4", "typescript": "^5"
"postcss": "^8"
} }
} }

View File

@@ -1,10 +1,6 @@
{ {
"compilerOptions": { "compilerOptions": {
"lib": [ "lib": ["dom", "dom.iterable", "esnext"],
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true, "allowJs": true,
"skipLibCheck": true, "skipLibCheck": true,
"strict": true, "strict": true,
@@ -22,19 +18,10 @@
} }
], ],
"paths": { "paths": {
"@/*": [ "@/*": ["./*"]
"./*"
]
}, },
"target": "ES2017" "target": "ES2017"
}, },
"include": [ "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"next-env.d.ts", "exclude": ["node_modules"]
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts"
],
"exclude": [
"node_modules"
]
} }