diff --git a/backend/src/socket/enum/player.enum.ts b/backend/src/socket/enum/player.enum.ts index 903d484..79361c5 100644 --- a/backend/src/socket/enum/player.enum.ts +++ b/backend/src/socket/enum/player.enum.ts @@ -9,4 +9,5 @@ export enum stateOptions { WALK = 'walk', ROLL = 'roll', JUMP = 'jump', + ATTACK = 'attack', } diff --git a/frontend/src/assets/character/attack/attack.png b/frontend/src/assets/character/attack/attack.png new file mode 100644 index 0000000..6f8249a Binary files /dev/null and b/frontend/src/assets/character/attack/attack.png differ diff --git a/frontend/src/assets/character/sprite.json b/frontend/src/assets/character/sprite.json index d575f5d..785a05a 100644 --- a/frontend/src/assets/character/sprite.json +++ b/frontend/src/assets/character/sprite.json @@ -3,190 +3,211 @@ { "filename": "base1", "frame": { - "x": 33, - "y": 17, - "w": 30, - "h": 30 + "x": 0, + "y": 0, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "base2", "frame": { - "x": 129, - "y": 17, - "w": 30, - "h": 30 + "x": 96, + "y": 0, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "base3", "frame": { - "x": 225, - "y": 17, - "w": 30, - "h": 30 + "x": 192, + "y": 0, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "base4", "frame": { - "x": 321, - "y": 17, - "w": 30, - "h": 30 + "x": 288, + "y": 0, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "base5", "frame": { - "x": 417, - "y": 17, - "w": 30, - "h": 30 + "x": 384, + "y": 0, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "base6", "frame": { - "x": 513, - "y": 17, - "w": 30, - "h": 30 + "x": 480, + "y": 0, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "base7", "frame": { - "x": 609, - "y": 17, - "w": 30, - "h": 30 + "x": 576, + "y": 0, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "base8", "frame": { - "x": 705, - "y": 17, - "w": 30, - "h": 30 + "x": 672, + "y": 0, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "base9", "frame": { - "x": 801, - "y": 17, - "w": 30, - "h": 30 + "x": 768, + "y": 0, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 + } + }, + { + "filename": "base10", + "frame": { + "x": 864, + "y": 0, + "w": 96, + "h": 64 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 96, + "h": 64 + }, + "sourceSize": { + "w": 96, + "h": 64 } }, { @@ -378,1138 +399,1285 @@ "h": 0 } }, + { + "filename": "nohair10", + "frame": { + "x": 0, + "y": 0, + "w": 0, + "h": 0 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 0, + "h": 0 + }, + "sourceSize": { + "w": 0, + "h": 0 + } + }, { "filename": "longhair1", "frame": { - "x": 33, - "y": 81, - "w": 30, - "h": 30 + "x": 0, + "y": 64, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "longhair2", "frame": { - "x": 129, - "y": 81, - "w": 30, - "h": 30 + "x": 96, + "y": 64, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "longhair3", "frame": { - "x": 225, - "y": 81, - "w": 30, - "h": 30 + "x": 192, + "y": 64, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "longhair4", "frame": { - "x": 321, - "y": 81, - "w": 30, - "h": 30 + "x": 288, + "y": 64, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "longhair5", "frame": { - "x": 417, - "y": 81, - "w": 30, - "h": 30 + "x": 384, + "y": 64, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "longhair6", "frame": { - "x": 513, - "y": 81, - "w": 30, - "h": 30 + "x": 480, + "y": 64, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "longhair7", "frame": { - "x": 609, - "y": 81, - "w": 30, - "h": 30 + "x": 576, + "y": 64, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "longhair8", "frame": { - "x": 705, - "y": 81, - "w": 30, - "h": 30 + "x": 672, + "y": 64, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "longhair9", "frame": { - "x": 801, - "y": 81, - "w": 30, - "h": 30 + "x": 768, + "y": 64, + "w": 96, + "h": 64 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 96, + "h": 64 + }, + "sourceSize": { + "w": 96, + "h": 64 + } + }, + { + "filename": "longhair10", + "frame": { + "x": 864, + "y": 64, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "mophair1", "frame": { - "x": 33, - "y": 145, - "w": 30, - "h": 30 + "x": 0, + "y": 128, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "mophair2", "frame": { - "x": 129, - "y": 145, - "w": 30, - "h": 30 + "x": 96, + "y": 128, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "mophair3", "frame": { - "x": 225, - "y": 145, - "w": 30, - "h": 30 + "x": 192, + "y": 128, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "mophair4", "frame": { - "x": 321, - "y": 145, - "w": 30, - "h": 30 + "x": 288, + "y": 128, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "mophair5", "frame": { - "x": 417, - "y": 145, - "w": 30, - "h": 30 + "x": 384, + "y": 128, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "mophair6", "frame": { - "x": 513, - "y": 145, - "w": 30, - "h": 30 + "x": 480, + "y": 128, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "mophair7", "frame": { - "x": 609, - "y": 145, - "w": 30, - "h": 30 + "x": 576, + "y": 128, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "mophair8", "frame": { - "x": 705, - "y": 145, - "w": 30, - "h": 30 + "x": 672, + "y": 128, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "mophair9", "frame": { - "x": 801, - "y": 145, - "w": 30, - "h": 30 + "x": 768, + "y": 128, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 + } + }, + { + "filename": "mophair10", + "frame": { + "x": 864, + "y": 128, + "w": 96, + "h": 64 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 96, + "h": 64 + }, + "sourceSize": { + "w": 96, + "h": 64 } }, { "filename": "shorthair1", "frame": { - "x": 33, - "y": 209, - "w": 30, - "h": 30 + "x": 0, + "y": 192, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "shorthair2", "frame": { - "x": 129, - "y": 209, - "w": 30, - "h": 30 + "x": 96, + "y": 192, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "shorthair3", "frame": { - "x": 225, - "y": 209, - "w": 30, - "h": 30 + "x": 192, + "y": 192, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "shorthair4", "frame": { - "x": 321, - "y": 209, - "w": 30, - "h": 30 + "x": 288, + "y": 192, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "shorthair5", "frame": { - "x": 417, - "y": 209, - "w": 30, - "h": 30 + "x": 384, + "y": 192, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "shorthair6", "frame": { - "x": 513, - "y": 209, - "w": 30, - "h": 30 + "x": 480, + "y": 192, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "shorthair7", "frame": { - "x": 609, - "y": 209, - "w": 30, - "h": 30 + "x": 576, + "y": 192, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "shorthair8", "frame": { - "x": 705, - "y": 209, - "w": 30, - "h": 30 + "x": 672, + "y": 192, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "shorthair9", "frame": { - "x": 801, - "y": 209, - "w": 30, - "h": 30 + "x": 768, + "y": 192, + "w": 96, + "h": 64 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 96, + "h": 64 + }, + "sourceSize": { + "w": 96, + "h": 64 + } + }, + { + "filename": "shorthair10", + "frame": { + "x": 864, + "y": 192, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "spikeyhair1", "frame": { - "x": 33, - "y": 273, - "w": 30, - "h": 30 + "x": 0, + "y": 256, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "spikeyhair2", "frame": { - "x": 129, - "y": 273, - "w": 30, - "h": 30 + "x": 96, + "y": 256, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "spikeyhair3", "frame": { - "x": 225, - "y": 273, - "w": 30, - "h": 30 + "x": 192, + "y": 256, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "spikeyhair4", "frame": { - "x": 321, - "y": 273, - "w": 30, - "h": 30 + "x": 288, + "y": 256, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "spikeyhair5", "frame": { - "x": 417, - "y": 273, - "w": 30, - "h": 30 + "x": 384, + "y": 256, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "spikeyhair6", "frame": { - "x": 513, - "y": 273, - "w": 30, - "h": 30 + "x": 480, + "y": 256, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "spikeyhair7", "frame": { - "x": 609, - "y": 273, - "w": 30, - "h": 30 + "x": 576, + "y": 256, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "spikeyhair8", "frame": { - "x": 705, - "y": 273, - "w": 30, - "h": 30 + "x": 672, + "y": 256, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "spikeyhair9", "frame": { - "x": 801, - "y": 273, - "w": 30, - "h": 30 + "x": 768, + "y": 256, + "w": 96, + "h": 64 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 96, + "h": 64 + }, + "sourceSize": { + "w": 96, + "h": 64 + } + }, + { + "filename": "spikeyhair10", + "frame": { + "x": 864, + "y": 256, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "bowlhair1", "frame": { - "x": 33, - "y": 337, - "w": 30, - "h": 30 + "x": 0, + "y": 320, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "bowlhair2", "frame": { - "x": 129, - "y": 337, - "w": 30, - "h": 30 + "x": 96, + "y": 320, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "bowlhair3", "frame": { - "x": 225, - "y": 337, - "w": 30, - "h": 30 + "x": 192, + "y": 320, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "bowlhair4", "frame": { - "x": 321, - "y": 337, - "w": 30, - "h": 30 + "x": 288, + "y": 320, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "bowlhair5", "frame": { - "x": 417, - "y": 337, - "w": 30, - "h": 30 + "x": 384, + "y": 320, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "bowlhair6", "frame": { - "x": 513, - "y": 337, - "w": 30, - "h": 30 + "x": 480, + "y": 320, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "bowlhair7", "frame": { - "x": 609, - "y": 337, - "w": 30, - "h": 30 + "x": 576, + "y": 320, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "bowlhair8", "frame": { - "x": 705, - "y": 337, - "w": 30, - "h": 30 + "x": 672, + "y": 320, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "bowlhair9", "frame": { - "x": 801, - "y": 337, - "w": 30, - "h": 30 + "x": 768, + "y": 320, + "w": 96, + "h": 64 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 96, + "h": 64 + }, + "sourceSize": { + "w": 96, + "h": 64 + } + }, + { + "filename": "bowlhair10", + "frame": { + "x": 864, + "y": 320, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "curlyhair1", "frame": { - "x": 33, - "y": 401, - "w": 30, - "h": 30 + "x": 0, + "y": 384, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "curlyhair2", "frame": { - "x": 129, - "y": 401, - "w": 30, - "h": 30 + "x": 96, + "y": 384, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "curlyhair3", "frame": { - "x": 225, - "y": 401, - "w": 30, - "h": 30 + "x": 192, + "y": 384, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "curlyhair4", "frame": { - "x": 321, - "y": 401, - "w": 30, - "h": 30 + "x": 288, + "y": 384, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "curlyhair5", "frame": { - "x": 417, - "y": 401, - "w": 30, - "h": 30 + "x": 384, + "y": 384, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "curlyhair6", "frame": { - "x": 513, - "y": 401, - "w": 30, - "h": 30 + "x": 480, + "y": 384, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "curlyhair7", "frame": { - "x": 609, - "y": 401, - "w": 30, - "h": 30 + "x": 576, + "y": 384, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "curlyhair8", "frame": { - "x": 705, - "y": 401, - "w": 30, - "h": 30 + "x": 672, + "y": 384, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } }, { "filename": "curlyhair9", "frame": { - "x": 801, - "y": 401, - "w": 30, - "h": 30 + "x": 768, + "y": 384, + "w": 96, + "h": 64 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 96, + "h": 64 + }, + "sourceSize": { + "w": 96, + "h": 64 + } + }, + { + "filename": "curlyhair10", + "frame": { + "x": 864, + "y": 384, + "w": 96, + "h": 64 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, - "w": 30, - "h": 30 + "w": 96, + "h": 64 }, "sourceSize": { - "w": 30, - "h": 30 + "w": 96, + "h": 64 } } ], diff --git a/frontend/src/assets/character/tool/attack.png b/frontend/src/assets/character/tool/attack.png new file mode 100644 index 0000000..4a4b33b Binary files /dev/null and b/frontend/src/assets/character/tool/attack.png differ diff --git a/frontend/src/assets/icon/checkBox.svg b/frontend/src/assets/icon/checkBox.svg new file mode 100644 index 0000000..f1680bd --- /dev/null +++ b/frontend/src/assets/icon/checkBox.svg @@ -0,0 +1,3 @@ + + + diff --git a/frontend/src/assets/icon/close.svg b/frontend/src/assets/icon/close.svg new file mode 100644 index 0000000..330e579 --- /dev/null +++ b/frontend/src/assets/icon/close.svg @@ -0,0 +1,3 @@ + + + diff --git a/frontend/src/assets/icon/help.svg b/frontend/src/assets/icon/help.svg new file mode 100644 index 0000000..fe02260 --- /dev/null +++ b/frontend/src/assets/icon/help.svg @@ -0,0 +1,3 @@ + + + diff --git a/frontend/src/assets/icon/keyboardA.svg b/frontend/src/assets/icon/keyboardA.svg new file mode 100644 index 0000000..d216176 --- /dev/null +++ b/frontend/src/assets/icon/keyboardA.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/frontend/src/assets/icon/keyboardArrow.svg b/frontend/src/assets/icon/keyboardArrow.svg new file mode 100644 index 0000000..8c3816f --- /dev/null +++ b/frontend/src/assets/icon/keyboardArrow.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/frontend/src/assets/icon/keyboardR.svg b/frontend/src/assets/icon/keyboardR.svg new file mode 100644 index 0000000..c40bbf0 --- /dev/null +++ b/frontend/src/assets/icon/keyboardR.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/frontend/src/assets/icon/keyboardShift.svg b/frontend/src/assets/icon/keyboardShift.svg new file mode 100644 index 0000000..559eea6 --- /dev/null +++ b/frontend/src/assets/icon/keyboardShift.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/frontend/src/assets/icon/keyboardSpace.svg b/frontend/src/assets/icon/keyboardSpace.svg new file mode 100644 index 0000000..4e5e337 --- /dev/null +++ b/frontend/src/assets/icon/keyboardSpace.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/frontend/src/assets/info-boardAndRank.png b/frontend/src/assets/info-boardAndRank.png new file mode 100644 index 0000000..234cfae Binary files /dev/null and b/frontend/src/assets/info-boardAndRank.png differ diff --git a/frontend/src/assets/info-chat.png b/frontend/src/assets/info-chat.png new file mode 100644 index 0000000..6147a1f Binary files /dev/null and b/frontend/src/assets/info-chat.png differ diff --git a/frontend/src/assets/info-friends.png b/frontend/src/assets/info-friends.png new file mode 100644 index 0000000..a322402 Binary files /dev/null and b/frontend/src/assets/info-friends.png differ diff --git a/frontend/src/assets/info-mypage.png b/frontend/src/assets/info-mypage.png new file mode 100644 index 0000000..12d41ef Binary files /dev/null and b/frontend/src/assets/info-mypage.png differ diff --git a/frontend/src/assets/info-setting.png b/frontend/src/assets/info-setting.png new file mode 100644 index 0000000..2987ae2 Binary files /dev/null and b/frontend/src/assets/info-setting.png differ diff --git a/frontend/src/assets/info-walkAndUser.png b/frontend/src/assets/info-walkAndUser.png new file mode 100644 index 0000000..8331bce Binary files /dev/null and b/frontend/src/assets/info-walkAndUser.png differ diff --git a/frontend/src/assets/sidebarImg.png b/frontend/src/assets/sidebarImg.png new file mode 100644 index 0000000..fe2115e Binary files /dev/null and b/frontend/src/assets/sidebarImg.png differ diff --git a/frontend/src/component/Game/Phaser/Player/myPlayer.ts b/frontend/src/component/Game/Phaser/Player/myPlayer.ts index 8e8d2b0..161248e 100644 --- a/frontend/src/component/Game/Phaser/Player/myPlayer.ts +++ b/frontend/src/component/Game/Phaser/Player/myPlayer.ts @@ -29,9 +29,12 @@ export class MyPlayer extends Player { } } - checkAndSetState(state: string, time: number = 0) { + checkAndSetState(state: string, time: number = 0, isAttack: boolean) { if (this.isChangeState) this.state = state; - + if (isAttack) { + this.isAttack = true; + setTimeout(() => (this.isAttack = false), time); + } if (time) { this.isChangeState = false; setTimeout(() => (this.isChangeState = true), time); @@ -45,47 +48,55 @@ export class MyPlayer extends Player { this.state = 'wait'; this.scene.input.keyboard.removeAllKeys(true); } else { - const cursors = this.scene.input.keyboard.createCursorKeys(); - const keyR = this.scene.input.keyboard.addKey( - Phaser.Input.Keyboard.KeyCodes.R - ); - const keyShift = this.scene.input.keyboard.addKey( - Phaser.Input.Keyboard.KeyCodes.SHIFT - ); - const keySpace = this.scene.input.keyboard.addKey( - Phaser.Input.Keyboard.KeyCodes.SPACE - ); + if (!this.isAttack) { + const cursors = this.scene.input.keyboard.createCursorKeys(); + const keyR = this.scene.input.keyboard.addKey( + Phaser.Input.Keyboard.KeyCodes.R + ); + const keyA = this.scene.input.keyboard.addKey( + Phaser.Input.Keyboard.KeyCodes.A + ); + const keyShift = this.scene.input.keyboard.addKey( + Phaser.Input.Keyboard.KeyCodes.SHIFT + ); + const keySpace = this.scene.input.keyboard.addKey( + Phaser.Input.Keyboard.KeyCodes.SPACE + ); - // motion - if (keyR.isDown) { - this.speed = 1.5; - this.checkAndSetState('roll', 100); - } else if (keyShift.isDown) { - this.speed = 1.2; - this.checkAndSetState('run'); - } else if (keySpace.isDown) { - this.speed = 1; - this.checkAndSetState('jump', 500); - } else { - this.speed = 1; - this.checkAndSetState('walk'); - } + // motion + if (keyR.isDown) { + this.speed = 1.5; + this.checkAndSetState('roll', 100, false); + } else if (keyA.isDown) { + this.speed = 1; + this.checkAndSetState('attack', 800, true); + } else if (keyShift.isDown) { + this.speed = 1.2; + this.checkAndSetState('run', 0, false); + } else if (keySpace.isDown) { + this.speed = 1; + this.checkAndSetState('jump', 500, false); + } else { + this.speed = 1; + this.checkAndSetState('walk', 0, false); + } - this.getBody().setVelocity(0, 0); + this.getBody().setVelocity(0, 0); - sortHeldDirection(this, cursors); - if (this.heldDirection.length) { - const move: any = calcMoveToPos(this, this.heldDirection); - this.getBody().setVelocity(move.x * this.speed, move.y * this.speed); + sortHeldDirection(this, cursors); + if (this.heldDirection.length) { + const move: any = calcMoveToPos(this, this.heldDirection); + this.getBody().setVelocity(move.x * this.speed, move.y * this.speed); - if (move.x !== 0) { - const direction = move.x > 0 ? 'right' : 'left'; - changeDirection(this, direction); - } + if (move.x !== 0) { + const direction = move.x > 0 ? 'right' : 'left'; + changeDirection(this, direction); + } - changePosition(this, move.x * this.speed, move.y * this.speed); - } else { - this.checkAndSetState('wait'); + changePosition(this, move.x * this.speed, move.y * this.speed); + } else { + this.checkAndSetState('wait', 0, false); + } } } diff --git a/frontend/src/component/Game/Phaser/Player/player.ts b/frontend/src/component/Game/Phaser/Player/player.ts index daebb60..bbf8163 100644 --- a/frontend/src/component/Game/Phaser/Player/player.ts +++ b/frontend/src/component/Game/Phaser/Player/player.ts @@ -4,10 +4,12 @@ export class Player extends Phaser.Physics.Arcade.Sprite { character: Phaser.GameObjects.Sprite | undefined; hair: Phaser.GameObjects.Sprite | undefined; dust: Phaser.GameObjects.Sprite | undefined; + tool: Phaser.GameObjects.Sprite | undefined; nicknameText: Phaser.GameObjects.Text | undefined; direction: string; isChangeState: boolean; isCanMove: boolean; + isAttack: boolean; state: string; x: number; y: number; @@ -37,6 +39,7 @@ export class Player extends Phaser.Physics.Arcade.Sprite { this.heldDirection = []; this.id = id; this.isCanMove = true; + this.isAttack = false; this.character = this.scene.add.sprite(this.x, this.y, 'character-wait'); this.character.setScale(3); @@ -44,6 +47,9 @@ export class Player extends Phaser.Physics.Arcade.Sprite { this.hair = this.scene.add.sprite(this.x, this.y, `${this.hairName}-wait`); this.hair.setScale(3); + this.tool = this.scene.add.sprite(this.x, this.y, 'attackTool'); + this.tool.setScale(3); + this.dust = this.scene.add.sprite(this.x - 20, this.y + 5, 'dust'); this.dust.setScale(3); @@ -67,6 +73,7 @@ export class Player extends Phaser.Physics.Arcade.Sprite { delete() { this.character?.destroy(); this.hair?.destroy(); + this.tool?.destroy(); this.nicknameText?.destroy(); this.dust?.destroy(); } diff --git a/frontend/src/component/Game/game.ts b/frontend/src/component/Game/game.ts index fb8d230..d674b2c 100644 --- a/frontend/src/component/Game/game.ts +++ b/frontend/src/component/Game/game.ts @@ -14,6 +14,8 @@ import walkImg from '../../assets/character/walk/walk.png'; import runImg from '../../assets/character/run/run.png'; import rollImg from '../../assets/character/roll/roll.png'; import jumpImg from '../../assets/character/jump/jump.png'; +import attackImg from '../../assets/character/attack/attack.png'; +import attackTool from '../../assets/character/tool/attack.png'; import { stringObjectType } from '../../types/types'; const characterImg: stringObjectType = { @@ -22,6 +24,7 @@ const characterImg: stringObjectType = { run: runImg, roll: rollImg, jump: jumpImg, + attack: attackImg, }; export default class Game extends Phaser.Scene { @@ -92,7 +95,7 @@ export default class Game extends Phaser.Scene { this.load.audio('christmas', [christmas]); // 캐릭터 동작 - const actions = ['wait', 'walk', 'run', 'roll', 'jump']; + const actions = ['wait', 'walk', 'run', 'roll', 'jump', 'attack']; actions.forEach((action: string) => { this.load.atlas(action, characterImg[action], spriteJSON); @@ -103,6 +106,11 @@ export default class Game extends Phaser.Scene { frameWidth: 24, frameHeight: 9, }); + + this.load.spritesheet('attackTool', attackTool, { + frameWidth: 96, + frameHeight: 64, + }); } create() { @@ -128,6 +136,7 @@ export default class Game extends Phaser.Scene { { action: 'run', start: 1, end: 8 }, { action: 'roll', start: 2, end: 5 }, { action: 'jump', start: 1, end: 9 }, + { action: 'attack', start: 1, end: 10 }, ]; const hairInfo = [ @@ -180,6 +189,16 @@ export default class Game extends Phaser.Scene { repeat: -1, }); + this.anims.create({ + key: 'attackTool', + frames: this.anims.generateFrameNames('attackTool', { + start: 0, + end: 9, + }), + frameRate: 10, + repeat: -1, + }); + emitter.emit('ready'); } diff --git a/frontend/src/component/Game/util.ts b/frontend/src/component/Game/util.ts index b3651b7..1951040 100644 --- a/frontend/src/component/Game/util.ts +++ b/frontend/src/component/Game/util.ts @@ -13,6 +13,13 @@ export const changeState = (player: any) => { player.dust.visible = false; player.dust.stop(); } + if (player.state === 'attack') { + player.tool.visible = true; + player.tool.play('attackTool'); + } else { + player.tool.visible = false; + player.tool.stop(); + } }; export const changeDirection = (player: any, direction: string) => { @@ -22,6 +29,7 @@ export const changeDirection = (player: any, direction: string) => { player.character.toggleFlipX(); player.hair.toggleFlipX(); player.dust.toggleFlipX(); + player.tool.toggleFlipX(); player.direction = direction; }; @@ -58,6 +66,7 @@ export const changePosition = (player: any, x: number, y: number) => { player.character.setPosition(player.x, player.y); player.hair.setPosition(player.x, player.y); + player.tool.setPosition(player.x, player.y); player.nicknameText.x = player.x - player.nickname.length * 3.5; player.nicknameText.y = player.y + 25; diff --git a/frontend/src/component/Info/Help.tsx b/frontend/src/component/Info/Help.tsx new file mode 100644 index 0000000..bfc5b5f --- /dev/null +++ b/frontend/src/component/Info/Help.tsx @@ -0,0 +1,74 @@ +import { useEffect, useState } from 'react'; +import help from '../../assets/icon/help.svg'; +import BoardAndRankInfo from './HelpDescription/BoardAndRankInfo'; +import KeyBoardInfo from './HelpDescription/KeyBoardInfo'; +import SidebarInfo from './HelpDescription/SidebarInfo'; +import WalkAndUserInfo from './HelpDescription/WalkAndUserInfo'; + +import * as style from './info.styled'; + +const Help = () => { + const [isShowModal, setIsShowModal] = useState(false); + const [animation, setAnimation] = useState('show'); + const [setOpen, isSetOpen] = useState(false); + + const setOpenModal = () => { + isSetOpen(!setOpen); + }; + + const handleModal = () => { + if (isShowModal) { + setAnimation('close'); + setTimeout(() => setIsShowModal(false), 300); + + const setValue = setOpen ? 'open' : 'close'; + localStorage.setItem('openHelp', setValue); + } else { + setAnimation('show'); + setIsShowModal(true); + } + }; + + useEffect(() => { + const openHelp = localStorage.getItem('openHelp'); + if (openHelp === 'open') { + setIsShowModal(true); + isSetOpen(true); + } + }, []); + + return ( + <> + {isShowModal && ( + <> +
+ +

📋 Notice

+
+ + + + +
+
+

우측 하단의 물음표 버튼을 클릭해서 도움말을 볼 수 있습니다.

+
+

접속시 도움말 켜기

+ +
+
+
+ + )} + + + ); +}; + +export default Help; diff --git a/frontend/src/component/Info/HelpDescription/BoardAndRankInfo.tsx b/frontend/src/component/Info/HelpDescription/BoardAndRankInfo.tsx new file mode 100644 index 0000000..1ea4b46 --- /dev/null +++ b/frontend/src/component/Info/HelpDescription/BoardAndRankInfo.tsx @@ -0,0 +1,30 @@ +import * as style from './boardAndRankInfo.styled'; +import * as commonStyle from './common.styled'; +import boardAndRankImg from '../../../assets/info-boardAndRank.png'; + +const BoardAndRankInfo = () => { + return ( +
+

- Board & Rank

+
+ 보드와 순위 이미지 +

+ 오른쪽 하단의 트로피 모양의 버튼을 클릭하면 SleepyBoard가 보여집니다. +

+

+ 상단의 탭을 클릭하여 업적을 보거나,{' '} + 걸음수 랭킹을 볼 수 있습니다. +

+

+ 탭 아래의 필터를 클릭해 모든 유저, 좋아요, 친구, 기간을 설정할 수 + 있습니다. +

+

+ 걸음수 갱신은 매일 자정에 이루어집니다. +

+
+
+ ); +}; + +export default BoardAndRankInfo; diff --git a/frontend/src/component/Info/HelpDescription/KeyBoardInfo.tsx b/frontend/src/component/Info/HelpDescription/KeyBoardInfo.tsx new file mode 100644 index 0000000..63ce3c1 --- /dev/null +++ b/frontend/src/component/Info/HelpDescription/KeyBoardInfo.tsx @@ -0,0 +1,43 @@ +import * as style from './keyBoardInfo.styled'; +import * as commonStyle from './common.styled'; +import keyboardArrow from '../../../assets/icon/keyboardArrow.svg'; +import keyboardSpace from '../../../assets/icon/keyboardSpace.svg'; +import keyboardShift from '../../../assets/icon/keyboardShift.svg'; +import keyboardA from '../../../assets/icon/keyboardA.svg'; +import keyboardR from '../../../assets/icon/keyboardR.svg'; + +const KeyBoardInfo = () => { + return ( +
+

- 기본키 조작법

+
+ + +
+
+ ); +}; + +export default KeyBoardInfo; diff --git a/frontend/src/component/Info/HelpDescription/SidebarInfo.tsx b/frontend/src/component/Info/HelpDescription/SidebarInfo.tsx new file mode 100644 index 0000000..e1b77ad --- /dev/null +++ b/frontend/src/component/Info/HelpDescription/SidebarInfo.tsx @@ -0,0 +1,114 @@ +import * as style from './sidebarInfo.styled'; +import * as commonStyle from './common.styled'; +import sidebarImg from '../../../assets/sidebarImg.png'; +import mypageImg from '../../../assets/info-mypage.png'; +import friendsImg from '../../../assets/info-friends.png'; +import chatImg from '../../../assets/info-chat.png'; +import settingImg from '../../../assets/info-setting.png'; + +const SidebarInfo = () => { + return ( +
+

- 사이드바

+
+ 사이드바 이미지 +

+ 왼쪽 상단의 {'>'} 버튼을 클릭하면 사이드바를 볼 수 + 있습니다. +

+

+ 사이드바 상단의 버튼을 클릭해 다음과 같은 기능을 사용할 수 있습니다. +

+ +
+
+ ); +}; + +export default SidebarInfo; diff --git a/frontend/src/component/Info/HelpDescription/WalkAndUserInfo.tsx b/frontend/src/component/Info/HelpDescription/WalkAndUserInfo.tsx new file mode 100644 index 0000000..d87e42f --- /dev/null +++ b/frontend/src/component/Info/HelpDescription/WalkAndUserInfo.tsx @@ -0,0 +1,25 @@ +import * as style from './boardAndRankInfo.styled'; +import * as commonStyle from './common.styled'; +import walkAndUserImg from '../../../assets/info-walkAndUser.png'; + +const WalkAndUserInfo = () => { + return ( +
+

- 걸음수 & 접속유저

+
+ 걸음수와 접속유저 이미지 +

+ 오른쪽 하단에 자신의 걸음수와{' '} + 접속유저가 표시됩니다. +

+

방향키로 이동했을때 걸음수가 증가하며 랭킹에 반영됩니다.

+
+
+ ); +}; + +export default WalkAndUserInfo; diff --git a/frontend/src/component/Info/HelpDescription/boardAndRankInfo.styled.ts b/frontend/src/component/Info/HelpDescription/boardAndRankInfo.styled.ts new file mode 100644 index 0000000..5af223d --- /dev/null +++ b/frontend/src/component/Info/HelpDescription/boardAndRankInfo.styled.ts @@ -0,0 +1,12 @@ +import { css } from '@emotion/react'; +import theme from '../../../styles/theme'; + +export const description = css` + width: 100%; + + & > p { + padding: 15px; + font-size: 14px; + text-align: center; + } +`; diff --git a/frontend/src/component/Info/HelpDescription/common.styled.ts b/frontend/src/component/Info/HelpDescription/common.styled.ts new file mode 100644 index 0000000..269c8ea --- /dev/null +++ b/frontend/src/component/Info/HelpDescription/common.styled.ts @@ -0,0 +1,28 @@ +import { css } from '@emotion/react'; +import theme from '../../../styles/theme'; + +export const infoContainer = css` + width: 100%; + padding: 20px; + margin-bottom: 10px; + + background-color: ${theme.white05}; + box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.2); + border-radius: 20px; + + strong { + color: ${theme.deepGreen}; + font-weight: 700; + } + + span { + color: ${theme.red}; + font-weight: 700; + } +`; + +export const header = css` + font-size: 18px; + font-weight: 700; + padding-bottom: 15px; +`; diff --git a/frontend/src/component/Info/HelpDescription/keyBoardInfo.styled.ts b/frontend/src/component/Info/HelpDescription/keyBoardInfo.styled.ts new file mode 100644 index 0000000..c8900ba --- /dev/null +++ b/frontend/src/component/Info/HelpDescription/keyBoardInfo.styled.ts @@ -0,0 +1,27 @@ +import { css } from '@emotion/react'; + +export const description = css` + display: flex; + justify-content: space-around; + width: 100%; + height: 250px; + + ul { + display: flex; + height: 100%; + flex-flow: column; + justify-content: space-between; + height: 100%; + padding: 0 20px; + + img { + justify-items: center; + margin-top: 5px; + } + + p { + font-size: 14px; + padding: 10px 0; + } + } +`; diff --git a/frontend/src/component/Info/HelpDescription/sidebarInfo.styled.ts b/frontend/src/component/Info/HelpDescription/sidebarInfo.styled.ts new file mode 100644 index 0000000..cf82cf2 --- /dev/null +++ b/frontend/src/component/Info/HelpDescription/sidebarInfo.styled.ts @@ -0,0 +1,56 @@ +import { css } from '@emotion/react'; +import theme from '../../../styles/theme'; + +export const description = css` + width: 100%; + + & > p { + padding: 15px; + font-size: 14px; + text-align: center; + + span { + width: 14px; + height: 14px; + display: inline-block; + background-color: ${theme.black06}; + color: ${theme.white}; + border-radius: 4px; + } + } +`; + +export const subContentBox = css``; + +export const subContent = css` + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 15px; + box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.2); + + :nth-of-type(1) { + margin-top: 20px; + } + :nth-last-of-type(1) { + margin-bottom: 0; + } +`; + +export const subTitle = css` + padding-bottom: 30px; + font-weight: 700; +`; + +export const subDescription = css` + flex-grow: 1; + height: 200px; + padding: 10px 20px; + background-color: ${theme.white05}; + + & > p { + width: 100%; + padding-bottom: 15px; + font-size: 14px; + } +`; diff --git a/frontend/src/component/Info/HelpDescription/walkAndUserInfo.styled.ts b/frontend/src/component/Info/HelpDescription/walkAndUserInfo.styled.ts new file mode 100644 index 0000000..546e8b3 --- /dev/null +++ b/frontend/src/component/Info/HelpDescription/walkAndUserInfo.styled.ts @@ -0,0 +1,11 @@ +import { css } from '@emotion/react'; + +export const description = css` + width: 100%; + + & > p { + padding: 15px; + font-size: 14px; + text-align: center; + } +`; diff --git a/frontend/src/component/Info/index.tsx b/frontend/src/component/Info/index.tsx index 1067bc1..8edd851 100644 --- a/frontend/src/component/Info/index.tsx +++ b/frontend/src/component/Info/index.tsx @@ -1,10 +1,12 @@ import * as style from './info.styled'; +import Help from './Help'; import Users from './Users'; import Walk from './Walk'; const Info = () => { return ( diff --git a/frontend/src/component/Info/info.styled.ts b/frontend/src/component/Info/info.styled.ts index bff60d6..6846e3b 100644 --- a/frontend/src/component/Info/info.styled.ts +++ b/frontend/src/component/Info/info.styled.ts @@ -1,5 +1,8 @@ import { css } from '@emotion/react'; import theme from '../../styles/theme'; +import close from '../../assets/icon/close.svg'; +import checkBox from '../../assets/icon/checkBox.svg'; +import { flexCenter } from '../../styles/mixin.styled'; export const infoBox = css` display: flex; @@ -10,7 +13,7 @@ export const infoBox = css` export const info = (content: string) => css` display: flex; - justify-content: space-between; + justify-content: space-around; align-items: center; font-size: 14px; color: ${theme.white}; @@ -22,13 +25,121 @@ export const info = (content: string) => css` ::after { content: ''; - display: block; + display: 'block'; width: 20px; height: 15px; - margin-left: 5px; background-image: url(${content}); background-position: center; background-repeat: no-repeat; background-size: contain; } `; + +export const modal = (animation: string) => css` + display: flex; + justify-content: center; + align-items: center; + flex-flow: column; + + width: 60%; + min-width: 600px; + max-width: 800px; + height: 60%; + min-height: 400px; + max-height: 600px; + padding: 20px; + + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -60%); + border-radius: 20px; + background-color: rgba(255, 255, 255, 0.9); + + overflow: auto; + ::-webkit-scrollbar { + display: none; + } + + animation: ${animation} 0.3s ease-in-out; + + @keyframes show { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes close { + from { + opacity: 1; + } + to { + opacity: 0; + } + } +`; + +export const closeBtn = css` + position: absolute; + top: 15px; + right: 15px; + width: 20px; + height: 20px; + opacity: 0.7; + padding: 5px; + + ::after { + content: ''; + display: block; + width: 20px; + height: 20px; + background-image: url(${close}); + background-position: center; + background-repeat: no-repeat; + background-size: contain; + } +`; + +export const header = css` + font-weight: 700; + font-size: 30px; + line-height: 30px; + padding: 20px; + margin-bottom: 10px; + text-align: center; +`; + +export const content = css` + overflow: auto; + padding: 5px; + + ::-webkit-scrollbar { + display: none; + } +`; + +export const helpSettingWrapper = css` + width: 100%; + font-size: 12px; + padding-top: 20px; + text-align: center; +`; + +export const helpSetting = (isCheck: boolean) => css` + ${flexCenter} + padding-top: 10px; + + button { + margin-left: 5px; + width: 14px; + height: 14px; + background-image: url(${checkBox}); + background-position: center; + background-repeat: no-repeat; + background-size: cover; + opacity: ${isCheck ? 1 : 0.3}; + } +`; diff --git a/frontend/src/component/SleepyBoard/index.tsx b/frontend/src/component/SleepyBoard/index.tsx index f1fc1f1..c81f165 100644 --- a/frontend/src/component/SleepyBoard/index.tsx +++ b/frontend/src/component/SleepyBoard/index.tsx @@ -24,6 +24,10 @@ const SleepyBoard = () => { {isShowModal && ( <>
+ {tab === 'board' ? : }
diff --git a/frontend/src/component/SleepyBoard/sleepyboard.styled.ts b/frontend/src/component/SleepyBoard/sleepyboard.styled.ts index 1725a92..91c5b06 100644 --- a/frontend/src/component/SleepyBoard/sleepyboard.styled.ts +++ b/frontend/src/component/SleepyBoard/sleepyboard.styled.ts @@ -3,6 +3,7 @@ import tree from '../../assets/tree.svg'; import trophy from '../../assets/trophy.svg'; import like from '../../assets/icon/like.svg'; import unlike from '../../assets/icon/unlike.svg'; +import close from '../../assets/icon/close.svg'; import { flexCenter } from '../../styles/mixin.styled'; import theme from '../../styles/theme'; @@ -314,3 +315,24 @@ export const infoMsg = css` text-align: center; padding: 20px; `; + +export const closeBtn = css` + position: absolute; + top: 20px; + right: 20px; + width: 20px; + height: 20px; + opacity: 0.7; + padding: 5px; + + ::after { + content: ''; + display: block; + width: 20px; + height: 20px; + background-image: url(${close}); + background-position: center; + background-repeat: no-repeat; + background-size: contain; + } +`;