From b99347325cf8c6af8211698310fd753fa1970297 Mon Sep 17 00:00:00 2001 From: Muhammad Sabeeh Date: Thu, 19 Jun 2025 22:15:37 -0400 Subject: [PATCH] feature: added socket connection, updated styles --- webclientvue/src/pages/GamePage.vue | 249 +++++++++++++++++++++------- 1 file changed, 191 insertions(+), 58 deletions(-) diff --git a/webclientvue/src/pages/GamePage.vue b/webclientvue/src/pages/GamePage.vue index cb16e377d..9c890c999 100644 --- a/webclientvue/src/pages/GamePage.vue +++ b/webclientvue/src/pages/GamePage.vue @@ -1,27 +1,37 @@ @@ -72,7 +93,7 @@ @@ -335,43 +384,111 @@ const cardStyle = (card: Card, index: number): CSSProperties => ({ display: flex; flex-direction: column; height: 100vh; + background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%); } /* Control buttons container */ .controls { - padding: 10px; - background: #eee; + padding: 0px; + background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%); gap: 10px; + border-top: 1px solid rgba(255, 255, 255, 0.1); + box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3); +} + +.controls button { + background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); + color: white; + border: none; + border-radius: 8px; + padding: 12px 24px; + font-weight: bold; + cursor: pointer; + transition: all 0.3s ease; + box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); +} + +.controls button:hover { + transform: translateY(-2px); + box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); + background: linear-gradient(135deg, #764ba2 0%, #667eea 100%); +} + +.controls button:active { + transform: translateY(0); + box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); } /* Play area where cards are rendered */ .play-area { - height: 50%; - width: 50%; - background: #4a5568; - position: absolute; - bottom: 0; - overflow: hidden; /* prevent overflow outside play area */ + height: 100%; + width: 100%; + position: relative; } -/* Upper play view area (red background) */ +/* Upper play view area (opponent areas) */ .play-view-area { - background: red; - position: absolute; - width: 50%; - height: 50%; - overflow: hidden; + background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 50%, #c0392b 100%); + border: 2px solid rgba(255, 255, 255, 0.2); + border-radius: 12px; + color: white; + position: relative; + text-align: center; + display: flex; + justify-content: center; + align-items: center; + width: 100%; + height: 100%; top: 0; + box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3); + font-weight: bold; + text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); } /* Container for play area and other UI elements */ .play-area-container { position: relative; display: grid; - grid-template-columns: 1fr 1fr; + grid-template-columns: 4fr 1fr; width: 100%; height: 100%; - overflow: hidden; + gap: 8px; +} + +.playAreaStyles { + height: 100%; + display: flex; + flex-grow: 1; + flex-direction: column; + position: relative; + border: 2px solid rgba(255, 255, 255, 0.2); + background: linear-gradient(135deg, #2ecc71 0%, #27ae60 50%, #229954 100%); + border-radius: 12px; + box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3); + overflow-y: hidden; +} + +.draw-area { + margin-top: auto; + background: linear-gradient(135deg, #3498db 0%, #2980b9 50%, #1f4e79 100%); + border-radius: 12px 12px 0 0; + border: 2px solid rgba(255, 255, 255, 0.2); + box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3); + height: 20%; + width: 100%; + overflow-x: auto; /* Allow horizontal scrolling */ + overflow-y: hidden; + white-space: nowrap; /* Prevent line breaks so cards line up horizontally */ + position: relative; + padding: 10px; + box-sizing: border-box; +} + +.peek-area { + background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 50%, #663399 100%); + border: 2px solid rgba(255, 255, 255, 0.2); + border-radius: 12px; + box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3); } /* Each card stack container is absolutely positioned */ @@ -383,14 +500,30 @@ const cardStyle = (card: Card, index: number): CSSProperties => ({ .card { width: 60px; /* matches CARD_WIDTH */ height: 90px; /* matches CARD_HEIGHT */ - background: #edf2f7; - border: 1px solid #2d3748; - border-radius: 4px; + background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 50%, #dee2e6 100%); + border: 2px solid #495057; + border-radius: 8px; text-align: center; line-height: 90px; /* vertically center card name */ user-select: none; /* disable text selection */ cursor: grab; font-size: 10px; - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); + font-weight: bold; + color: #212529; + box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); + transition: all 0.2s ease; +} + +.card:hover { + transform: translateY(-2px); + box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4); + border-color: #6c757d; +} + +.peeked-card { + background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 50%, #fdcb6e 100%); + border: 3px solid #e17055; + box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4); + transform: scale(1.05); }