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
129 changes: 0 additions & 129 deletions src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
@tailwind utilities;

:root {
--void-glow: 0 0 20px rgba(132, 61, 255, 0.5);
--dominion-glow: 0 0 20px rgba(74, 144, 217, 0.5);
--synthesis-glow: 0 0 20px rgba(155, 89, 182, 0.5);
--swarm-glow: 0 0 20px rgba(139, 69, 19, 0.5);
}

* {
Expand Down Expand Up @@ -74,17 +70,6 @@ main {
active:scale-[0.98];
}

.resource-display {
@apply flex items-center gap-2 px-3 py-1.5 bg-black/50 border border-void-700/50 rounded-md;
}

.control-group-indicator {
@apply w-7 h-7 flex items-center justify-center
bg-gradient-to-b from-void-800 to-void-900
border border-void-600/50 rounded
text-xs font-mono text-void-200 shadow-inner;
}

/* Minimap with modern border treatment */
.minimap-container {
@apply relative w-48 h-48 bg-black/90 rounded-lg overflow-hidden
Expand All @@ -96,38 +81,6 @@ main {
shadow-[0_0_8px_rgba(59,130,246,0.3)];
}

.unit-health-bar {
@apply absolute -top-2 left-1/2 -translate-x-1/2 w-10 h-1.5
bg-black/80 rounded-full overflow-hidden border border-black/50;
}

.unit-health-fill {
@apply h-full bg-gradient-to-r from-green-600 to-green-400 transition-all duration-200;
}

/* Command card with improved grid styling */
.command-card {
@apply grid grid-cols-4 gap-1.5 p-3
bg-black/70 border border-void-700 rounded-lg backdrop-blur-sm;
}

.command-button {
@apply w-12 h-12 relative
bg-gradient-to-b from-void-800 to-void-900
hover:from-void-700 hover:to-void-800
border border-void-600/50 rounded-md
flex flex-col items-center justify-center gap-0.5
transition-all duration-150
hover:border-blue-500/50 hover:shadow-[0_0_8px_rgba(59,130,246,0.2)]
active:scale-95;
}

.command-button-disabled {
@apply opacity-40 cursor-not-allowed
hover:from-void-800 hover:to-void-900
hover:border-void-600/50 hover:shadow-none;
}

/* Tooltip styling */
.tooltip {
@apply absolute z-50 px-3 py-2 text-sm
Expand All @@ -138,26 +91,6 @@ main {
}

/* Animations */
@keyframes pulse-glow {
0%, 100% {
box-shadow: 0 0 10px rgba(132, 61, 255, 0.3);
}
50% {
box-shadow: 0 0 20px rgba(132, 61, 255, 0.6);
}
}

@keyframes selection-pulse {
0%, 100% {
transform: scale(1);
opacity: 1;
}
50% {
transform: scale(1.1);
opacity: 0.7;
}
}

@keyframes shimmer {
0% {
background-position: 200% 0;
Expand All @@ -178,44 +111,6 @@ main {
}
}

@keyframes float {
0%, 100% {
transform: translateY(0px);
}
50% {
transform: translateY(-10px);
}
}

@keyframes glow-pulse {
0%, 100% {
filter: drop-shadow(0 0 10px rgba(132, 61, 255, 0.3));
}
50% {
filter: drop-shadow(0 0 25px rgba(132, 61, 255, 0.6));
}
}

@keyframes fade-in-up {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}

@keyframes rotate-slow {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}

@keyframes scanline {
0% {
top: -5%;
Expand All @@ -233,14 +128,6 @@ main {
}
}

.animate-pulse-glow {
animation: pulse-glow 2s ease-in-out infinite;
}

.animate-selection {
animation: selection-pulse 1s ease-in-out infinite;
}

.animate-shimmer {
animation: shimmer 8s linear infinite;
}
Expand All @@ -249,22 +136,6 @@ main {
animation: pulse-slow 4s ease-in-out infinite;
}

.animate-float {
animation: float 3s ease-in-out infinite;
}

.animate-glow-pulse {
animation: glow-pulse 2s ease-in-out infinite;
}

.animate-fade-in-up {
animation: fade-in-up 0.6s ease-out forwards;
}

.animate-rotate-slow {
animation: rotate-slow 20s linear infinite;
}

/* Prevent text selection during gameplay */
.game-container {
user-select: none;
Expand Down
7 changes: 0 additions & 7 deletions src/data/audio.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,3 @@ export const VOICE_COOLDOWN_CONFIG = {
attack: VOICE_COOLDOWN_ATTACK,
ready: VOICE_COOLDOWN_READY,
} as const;

/**
* All command audio parameters grouped together.
*/
export const COMMAND_AUDIO_CONFIG = {
debounceWindow: COMMAND_DEBOUNCE_WINDOW,
} as const;
31 changes: 0 additions & 31 deletions src/engine/definitions/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,37 +51,6 @@ export async function waitForDefinitions(): Promise<void> {
await DefinitionRegistry.waitForInitialization();
}

// Store the initialization promise so it can be awaited by callers
let initializationPromise: Promise<void> | null = null;

/**
* @deprecated Use initializeDefinitions() instead. This is kept for backwards compatibility.
* Will internally call initializeDefinitions() to load from JSON.
*
* @returns Promise that resolves when definitions are loaded.
* Callers should await this before accessing definitions.
*/
export function bootstrapDefinitions(): Promise<void> {
if (DefinitionRegistry.isInitialized()) {
return Promise.resolve();
}

// Return existing promise if initialization is already in progress
if (initializationPromise) {
return initializationPromise;
}

debugInitialization.log('[Bootstrap] bootstrapDefinitions() called - starting async JSON load');
initializationPromise = initializeDefinitions()
.catch((err) => {
console.error('[Bootstrap] Failed to load definitions from JSON:', err);
initializationPromise = null;
throw err;
});

return initializationPromise;
}

// ==================== BACKWARDS COMPATIBILITY EXPORTS ====================
// These getters provide backwards-compatible access to definitions.
// They pull from the DefinitionRegistry which loads from JSON.
Expand Down
7 changes: 3 additions & 4 deletions src/engine/definitions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
*
* Usage:
*
* 1. JSON Loading (recommended for new games):
* 1. Initialize from JSON (call once at app startup):
* await initializeDefinitions('/data/game.json');
*
* 2. TypeScript Bootstrapping (backwards compatibility):
* bootstrapDefinitions();
* 2. Wait if initialization is in progress:
* await waitForDefinitions();
*
* 3. Accessing Definitions:
* const unit = DefinitionRegistry.getUnit('trooper');
Expand All @@ -22,7 +22,6 @@ export { DefinitionRegistry, DefinitionRegistryClass } from './DefinitionRegistr

// Bootstrap functions
export {
bootstrapDefinitions,
initializeDefinitions,
definitionsReady,
waitForDefinitions,
Expand Down
11 changes: 0 additions & 11 deletions tests/data/audioConfig.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
VOICE_COOLDOWN_READY,
COMMAND_DEBOUNCE_WINDOW,
VOICE_COOLDOWN_CONFIG,
COMMAND_AUDIO_CONFIG,
} from '@/data/audio.config';

describe('Audio Configuration', () => {
Expand Down Expand Up @@ -84,16 +83,6 @@ describe('Audio Configuration', () => {
});
});

describe('COMMAND_AUDIO_CONFIG', () => {
it('contains debounce window', () => {
expect(COMMAND_AUDIO_CONFIG).toHaveProperty('debounceWindow', COMMAND_DEBOUNCE_WINDOW);
});

it('value matches individual constant', () => {
expect(COMMAND_AUDIO_CONFIG.debounceWindow).toBe(COMMAND_DEBOUNCE_WINDOW);
});
});

describe('RTS-style rate limiting', () => {
it('selection cooldown prevents spam', () => {
// 2 seconds is reasonable for selection spam prevention
Expand Down
Loading