-
Notifications
You must be signed in to change notification settings - Fork 0
feat: player summary #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the player summary component by replacing PlayerSummary with a new PlayerCard component, introducing a more modern card-based design with overlapping layout and hover animations.
- Replaces
PlayerSummarycomponent withPlayerCardcomponent featuring card-based UI - Adds new
Avatarcomponent with player-specific assets for visual representation - Implements overlapping card layout with hover animations and scaling effects
Reviewed Changes
Copilot reviewed 13 out of 17 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/components/round-summary/round-summary.tsx | Updates import and usage from PlayerSummary to PlayerCard |
| src/components/round-summary/round-summary.module.css | Adds card overlap styling and hover animations for stacked card layout |
| src/components/round-summary/player-summary.tsx | Removes old PlayerSummary component |
| src/components/round-summary/player-summary.module.css | Removes old PlayerSummary styles |
| src/components/round-summary/player-card.tsx | Adds new PlayerCard component with improved accessibility and card design |
| src/components/round-summary/player-card.test.tsx | Adds unit tests for PlayerCard component |
| src/components/round-summary/player-card.module.css | Adds styling for new card design with player-specific theming |
| src/components/round-summary/avatar/avatar.tsx | Adds Avatar component for player visual representation |
| src/components/round-summary/avatar/avatar.test.tsx | Adds unit tests for Avatar component |
| src/components/round-summary/avatar/avatar.module.css | Adds Avatar component styling |
| src/components/round-summary/avatar/assets/index.ts | Exports avatar asset imports |
| } | ||
|
|
||
| .playerCard.active { | ||
| z-index: 5 !important; /* FIXME */ |
Copilot
AI
Jul 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The !important declaration should be avoided. Consider restructuring the CSS to achieve the desired z-index without using !important.
| z-index: 5 !important; /* FIXME */ | |
| z-index: 5; /* Adjusted to avoid !important */ |
| & article { | ||
| /* XXX card overlap: is it possible to use some flex magic instead? */ | ||
| margin-top: -4vh; | ||
|
|
||
| transition: transform 0.3s ease-in-out; | ||
| } | ||
|
|
||
| & article:first-child { | ||
| margin-top: 0; | ||
| } | ||
|
|
||
| & article:nth-child(1) { | ||
| z-index: 4; | ||
| } | ||
|
|
||
| & article:nth-child(2) { | ||
| z-index: 3; | ||
| } | ||
|
|
||
| & article:nth-child(3) { | ||
| z-index: 2; |
Copilot
AI
Jul 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The negative margin approach for card overlap creates a maintenance concern as noted in the comment. Consider using CSS Grid or flexbox with absolute positioning for more maintainable card stacking.
| & article { | |
| /* XXX card overlap: is it possible to use some flex magic instead? */ | |
| margin-top: -4vh; | |
| transition: transform 0.3s ease-in-out; | |
| } | |
| & article:first-child { | |
| margin-top: 0; | |
| } | |
| & article:nth-child(1) { | |
| z-index: 4; | |
| } | |
| & article:nth-child(2) { | |
| z-index: 3; | |
| } | |
| & article:nth-child(3) { | |
| z-index: 2; | |
| display: grid; | |
| grid-template-rows: repeat(3, auto); | |
| position: relative; | |
| & article { | |
| grid-row: 1; | |
| position: absolute; | |
| width: 100%; | |
| transition: transform 0.3s ease-in-out; | |
| } | |
| & article:nth-child(1) { | |
| z-index: 4; | |
| top: 0; | |
| } | |
| & article:nth-child(2) { | |
| z-index: 3; | |
| top: 6vh; | |
| } | |
| & article:nth-child(3) { | |
| z-index: 2; | |
| top: 12vh; |
| pointer-events: none; | ||
| } | ||
|
|
||
| /* |
Copilot
AI
Jul 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commented-out CSS code for player-specific colors should be removed if it's not needed, or uncommented and implemented if it's intended functionality.
| /* |
# [0.7.0](v0.6.0...v0.7.0) (2025-07-22) ### Features * player summary ([#10](#10)) ([ace466f](ace466f)), closes [/#diff-656b9b5c7ee888cb67d666b8ea000b16ceff3933c61848d895c5626d6f86db1dR1-R34](https://github.com///issues/diff-656b9b5c7ee888cb67d666b8ea000b16ceff3933c61848d895c5626d6f86db1dR1-R34) [/#diff-154b7417a785791b29bec3858af773dbf39f61e89dc3d4e1df76abaa782f4c37L2-R2](https://github.com///issues/diff-154b7417a785791b29bec3858af773dbf39f61e89dc3d4e1df76abaa782f4c37L2-R2) [/#diff-154b7417a785791b29bec3858af773dbf39f61e89dc3d4e1df76abaa782f4c37L30-R30](https://github.com///issues/diff-154b7417a785791b29bec3858af773dbf39f61e89dc3d4e1df76abaa782f4c37L30-R30) [/#diff-102b4b1e1b681392824b8628d9527dedd1bd7111115ee63c8458d9dda0848952L1-L33](https://github.com///issues/diff-102b4b1e1b681392824b8628d9527dedd1bd7111115ee63c8458d9dda0848952L1-L33) [/#diff-6acfe855afc93cd952569aa69e347ef8f24f4e0912d0638f9a5e565e83cb2da7L1-L16](https://github.com///issues/diff-6acfe855afc93cd952569aa69e347ef8f24f4e0912d0638f9a5e565e83cb2da7L1-L16) [/#diff-2a7e1cc6dda58e9e09c9c92339e7eda5ee6c63e0e834924f9f7d0a6e2f98e260R1-R22](https://github.com///issues/diff-2a7e1cc6dda58e9e09c9c92339e7eda5ee6c63e0e834924f9f7d0a6e2f98e260R1-R22) [/#diff-45719cceadcbffdc5084fdcd0b770b14133b1cabe58c3ab93c362a938b969f29R1-R11](https://github.com///issues/diff-45719cceadcbffdc5084fdcd0b770b14133b1cabe58c3ab93c362a938b969f29R1-R11) [/#diff-310f0b5fd71b9ffb281a9fa4877a05b8ba57bbb49a22582681765c322b318b4cR1-R31](https://github.com///issues/diff-310f0b5fd71b9ffb281a9fa4877a05b8ba57bbb49a22582681765c322b318b4cR1-R31) [/#diff-f5611d82ab82f01d245452acc76998aaac1bb1640faa38adc584f3d9aeee8873R1-R16](https://github.com///issues/diff-f5611d82ab82f01d245452acc76998aaac1bb1640faa38adc584f3d9aeee8873R1-R16) [/#diff-30ecc934eebdf4b1a2e1c55f6688089b582a0b223fa344160db207938e1cd6e1R1-R10](https://github.com///issues/diff-30ecc934eebdf4b1a2e1c55f6688089b582a0b223fa344160db207938e1cd6e1R1-R10) [/#diff-fd4df391dc4c98c116d5ad533c359047c01a98230904b79b81961edd68b06ee2R1-R67](https://github.com///issues/diff-fd4df391dc4c98c116d5ad533c359047c01a98230904b79b81961edd68b06ee2R1-R67) [/#diff-00e9e73b85bd3402dfe3b4ff7c4ee9a140f33b0e7f01ad8e55ab0864e07575dbR8-R64](https://github.com///issues/diff-00e9e73b85bd3402dfe3b4ff7c4ee9a140f33b0e7f01ad8e55ab0864e07575dbR8-R64) [/#diff-5632ab761432b7f7fc3792349232070c32c3426571b2783e4239b60874662fbcR1-R16](https://github.com///issues/diff-5632ab761432b7f7fc3792349232070c32c3426571b2783e4239b60874662fbcR1-R16) [/#diff-02c98d3e4dff46744bc17c8c6c34f80f52a02ff2cc4e7f437b7c131bd4571777R1-R30](https://github.com///issues/diff-02c98d3e4dff46744bc17c8c6c34f80f52a02ff2cc4e7f437b7c131bd4571777R1-R30) * **RoundSummary:** first version of RoundSummary ([691009f](691009f))
This pull request introduces a significant refactor and enhancement of the
round-summarycomponent by replacing thePlayerSummarycomponent with a newPlayerCardcomponent. The changes improve the structure, styling, and functionality of player-related UI elements. Additionally, a reusableAvatarcomponent has been introduced to handle player and enemy avatars more effectively.Component Refactor and Replacement:
PlayerSummarycomponent with the newPlayerCardcomponent, which provides a more structured and visually enhanced representation of player information. (src/components/round-summary/player-card.tsx, [1];src/components/round-summary/round-summary.tsx, [2] [3]PlayerSummarycomponent and its associated styles. (src/components/round-summary/player-summary.tsx, [1];src/components/round-summary/player-summary.module.css, [2]Avatar Component Introduction:
Avatarcomponent to render player and enemy avatars dynamically, along with associated assets and styles. (src/components/round-summary/avatar/avatar.tsx, [1];src/components/round-summary/avatar/assets/index.ts, [2];src/components/round-summary/avatar/avatar.module.css, [3]Avatarcomponent to ensure proper rendering and functionality. (src/components/round-summary/avatar/avatar.test.tsx, [1];src/components/round-summary/avatar/__snapshots__/avatar.test.tsx.snap, [2]Styling Enhancements:
PlayerCardcomponent to improve layout, interactivity, and visual hierarchy. (src/components/round-summary/player-card.module.css, src/components/round-summary/player-card.module.cssR1-R67)round-summarylayout by introducing hover effects and layered card stacking for better user interaction. (src/components/round-summary/round-summary.module.css, src/components/round-summary/round-summary.module.cssR8-R64)Testing and Snapshots:
PlayerCardcomponent to verify its rendering and behavior. (src/components/round-summary/player-card.test.tsx, [1];src/components/round-summary/__snapshots__/player-card.test.tsx.snap, [2]These changes collectively improve the maintainability, reusability, and user experience of the
round-summarycomponent.