Merge branch 'feature/2-character_page' into develop
Showing
21 changed files
with
438 additions
and
32 deletions
... | @@ -6,6 +6,6 @@ let routes = require('./routes'); | ... | @@ -6,6 +6,6 @@ let routes = require('./routes'); |
6 | app.use(bodyParser.urlencoded({ extended: false })); | 6 | app.use(bodyParser.urlencoded({ extended: false })); |
7 | app.use(bodyParser.json()); | 7 | app.use(bodyParser.json()); |
8 | 8 | ||
9 | -app.get('/api/home', routes.home); | 9 | +app.get('/api/character', routes.character.getCharacter); |
10 | 10 | ||
11 | let server = app.listen(80); | 11 | let server = app.listen(80); |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
app/node/model/job.js
0 → 100644
This diff is collapsed. Click to expand it.
app/node/model/stat.js
0 → 100644
app/node/model/weapon.js
0 → 100644
1 | +module.exports = { | ||
2 | + '한손검': 1.2, | ||
3 | + '한손도끼': 1.2, | ||
4 | + '한손둔기': 1.2, | ||
5 | + '스태프': 1, | ||
6 | + '완드': 1, | ||
7 | + '샤이닝 로드': 1.2, | ||
8 | + '단검': 1.3, | ||
9 | + '케인': 1.3, | ||
10 | + '데스페라도': 1.3, | ||
11 | + '에너지소드': 1.5, | ||
12 | + '소울 슈터': 1.7, | ||
13 | + 'ESP 리미터': 1.2, | ||
14 | + '체인': 1.3, | ||
15 | + '매직 건틀렛': 1.2, | ||
16 | + '부채': 1.3, | ||
17 | + '튜너': 1.3, | ||
18 | + '두손검': 1.34, | ||
19 | + '두손도끼': 1.34, | ||
20 | + '두손둔기': 1.34, | ||
21 | + '창': 1.34, | ||
22 | + '폴암': 1.49, | ||
23 | + '태도': 1.34, | ||
24 | + '건틀렛 리볼버': 1.7, | ||
25 | + '활': 1.3, | ||
26 | + '석궁': 1.35, | ||
27 | + '듀얼 보우건': 1.3, | ||
28 | + '에인션트 보우': 1.3, | ||
29 | + '아대': 1.75, | ||
30 | + '건': 1.5, | ||
31 | + '너클': 1.7, | ||
32 | + '핸드캐논': 1.5 | ||
33 | +} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
This diff is collapsed. Click to expand it.
... | @@ -9,8 +9,11 @@ | ... | @@ -9,8 +9,11 @@ |
9 | "author": "", | 9 | "author": "", |
10 | "license": "ISC", | 10 | "license": "ISC", |
11 | "dependencies": { | 11 | "dependencies": { |
12 | + "axios": "^0.19.2", | ||
12 | "express": "^4.17.1", | 13 | "express": "^4.17.1", |
13 | "http": "0.0.1-security", | 14 | "http": "0.0.1-security", |
15 | + "jquery": "^3.5.1", | ||
16 | + "jsdom": "^16.2.2", | ||
14 | "nodemon": "^2.0.4" | 17 | "nodemon": "^2.0.4" |
15 | } | 18 | } |
16 | } | 19 | } | ... | ... |
app/node/routes/character.js
0 → 100644
This diff is collapsed. Click to expand it.
app/node/routes/home.js
deleted
100644 → 0
... | @@ -30,6 +30,14 @@ | ... | @@ -30,6 +30,14 @@ |
30 | "js-tokens": "^4.0.0" | 30 | "js-tokens": "^4.0.0" |
31 | } | 31 | } |
32 | }, | 32 | }, |
33 | + "@lottiefiles/svelte-lottie-player": { | ||
34 | + "version": "0.1.4", | ||
35 | + "resolved": "https://registry.npmjs.org/@lottiefiles/svelte-lottie-player/-/svelte-lottie-player-0.1.4.tgz", | ||
36 | + "integrity": "sha512-NVNDdB1kQLIOytWsTxEYRRHhl2T9oZFfKSkUEr8m73JM7jaLP8J8GGH9B6A0vXU4wKsjR69ET6JEvib6z1QH+g==", | ||
37 | + "requires": { | ||
38 | + "lottie-web": "^5.6.8" | ||
39 | + } | ||
40 | + }, | ||
33 | "@nodelib/fs.scandir": { | 41 | "@nodelib/fs.scandir": { |
34 | "version": "2.1.3", | 42 | "version": "2.1.3", |
35 | "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", | 43 | "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", |
... | @@ -85,9 +93,9 @@ | ... | @@ -85,9 +93,9 @@ |
85 | } | 93 | } |
86 | }, | 94 | }, |
87 | "@rollup/pluginutils": { | 95 | "@rollup/pluginutils": { |
88 | - "version": "3.0.10", | 96 | + "version": "3.1.0", |
89 | - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.0.10.tgz", | 97 | + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", |
90 | - "integrity": "sha512-d44M7t+PjmMrASHbhgpSbVgtL6EFyX7J4mYxwQ/c5eoaE6N2VgCgEcWVzNnwycIloti+/MpwFr8qfw+nRw00sw==", | 98 | + "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", |
91 | "dev": true, | 99 | "dev": true, |
92 | "requires": { | 100 | "requires": { |
93 | "@types/estree": "0.0.39", | 101 | "@types/estree": "0.0.39", |
... | @@ -101,11 +109,6 @@ | ... | @@ -101,11 +109,6 @@ |
101 | "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", | 109 | "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", |
102 | "dev": true | 110 | "dev": true |
103 | }, | 111 | }, |
104 | - "@types/events": { | ||
105 | - "version": "3.0.0", | ||
106 | - "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", | ||
107 | - "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==" | ||
108 | - }, | ||
109 | "@types/fs-extra": { | 112 | "@types/fs-extra": { |
110 | "version": "8.1.1", | 113 | "version": "8.1.1", |
111 | "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-8.1.1.tgz", | 114 | "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-8.1.1.tgz", |
... | @@ -115,11 +118,10 @@ | ... | @@ -115,11 +118,10 @@ |
115 | } | 118 | } |
116 | }, | 119 | }, |
117 | "@types/glob": { | 120 | "@types/glob": { |
118 | - "version": "7.1.1", | 121 | + "version": "7.1.2", |
119 | - "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.1.tgz", | 122 | + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.2.tgz", |
120 | - "integrity": "sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w==", | 123 | + "integrity": "sha512-VgNIkxK+j7Nz5P7jvUZlRvhuPSmsEfS03b0alKcq5V/STUKAa3Plemsn5mrQUO7am6OErJ4rhGEGJbACclrtRA==", |
121 | "requires": { | 124 | "requires": { |
122 | - "@types/events": "*", | ||
123 | "@types/minimatch": "*", | 125 | "@types/minimatch": "*", |
124 | "@types/node": "*" | 126 | "@types/node": "*" |
125 | } | 127 | } |
... | @@ -130,9 +132,9 @@ | ... | @@ -130,9 +132,9 @@ |
130 | "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==" | 132 | "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==" |
131 | }, | 133 | }, |
132 | "@types/node": { | 134 | "@types/node": { |
133 | - "version": "14.0.9", | 135 | + "version": "14.0.13", |
134 | - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.9.tgz", | 136 | + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.13.tgz", |
135 | - "integrity": "sha512-0sCTiXKXELOBxvZLN4krQ0FPOAA7ij+6WwvD0k/PHd9/KAkr4dXel5J9fh6F4x1FwAQILqAWkmpeuS6mjf1iKA==" | 137 | + "integrity": "sha512-rouEWBImiRaSJsVA+ITTFM6ZxibuAlTuNOCyxVbwreu6k6+ujs7DfnU9o+PShFhET78pMBl3eH+AGSI5eOTkPA==" |
136 | }, | 138 | }, |
137 | "@types/resolve": { | 139 | "@types/resolve": { |
138 | "version": "0.0.8", | 140 | "version": "0.0.8", |
... | @@ -144,9 +146,9 @@ | ... | @@ -144,9 +146,9 @@ |
144 | } | 146 | } |
145 | }, | 147 | }, |
146 | "acorn": { | 148 | "acorn": { |
147 | - "version": "7.2.0", | 149 | + "version": "7.3.1", |
148 | - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.2.0.tgz", | 150 | + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.3.1.tgz", |
149 | - "integrity": "sha512-apwXVmYVpQ34m/i71vrApRrRKCWQnZZF1+npOD0WV5xZFfwWOmKGQ2RWlfdy9vWITsenisM8M0Qeq8agcFHNiQ==", | 151 | + "integrity": "sha512-tLc0wSnatxAQHVHUapaHdz72pi9KUyHjq5KyHjGg9Y8Ifdc79pTh2XvI6I1/chZbnM7QtNKzh66ooDogPZSleA==", |
150 | "dev": true | 152 | "dev": true |
151 | }, | 153 | }, |
152 | "ansi-styles": { | 154 | "ansi-styles": { |
... | @@ -163,6 +165,14 @@ | ... | @@ -163,6 +165,14 @@ |
163 | "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", | 165 | "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", |
164 | "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==" | 166 | "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==" |
165 | }, | 167 | }, |
168 | + "axios": { | ||
169 | + "version": "0.19.2", | ||
170 | + "resolved": "https://registry.npmjs.org/axios/-/axios-0.19.2.tgz", | ||
171 | + "integrity": "sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==", | ||
172 | + "requires": { | ||
173 | + "follow-redirects": "1.5.10" | ||
174 | + } | ||
175 | + }, | ||
166 | "balanced-match": { | 176 | "balanced-match": { |
167 | "version": "1.0.0", | 177 | "version": "1.0.0", |
168 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", | 178 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", |
... | @@ -244,6 +254,14 @@ | ... | @@ -244,6 +254,14 @@ |
244 | "resolved": "https://registry.npmjs.org/console-clear/-/console-clear-1.1.1.tgz", | 254 | "resolved": "https://registry.npmjs.org/console-clear/-/console-clear-1.1.1.tgz", |
245 | "integrity": "sha512-pMD+MVR538ipqkG5JXeOEbKWS5um1H4LUUccUQG68qpeqBYbzYy79Gh55jkd2TtPdRfUaLWdv6LPP//5Zt0aPQ==" | 255 | "integrity": "sha512-pMD+MVR538ipqkG5JXeOEbKWS5um1H4LUUccUQG68qpeqBYbzYy79Gh55jkd2TtPdRfUaLWdv6LPP//5Zt0aPQ==" |
246 | }, | 256 | }, |
257 | + "debug": { | ||
258 | + "version": "3.1.0", | ||
259 | + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", | ||
260 | + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", | ||
261 | + "requires": { | ||
262 | + "ms": "2.0.0" | ||
263 | + } | ||
264 | + }, | ||
247 | "dir-glob": { | 265 | "dir-glob": { |
248 | "version": "3.0.1", | 266 | "version": "3.0.1", |
249 | "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", | 267 | "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", |
... | @@ -293,6 +311,14 @@ | ... | @@ -293,6 +311,14 @@ |
293 | "to-regex-range": "^5.0.1" | 311 | "to-regex-range": "^5.0.1" |
294 | } | 312 | } |
295 | }, | 313 | }, |
314 | + "follow-redirects": { | ||
315 | + "version": "1.5.10", | ||
316 | + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz", | ||
317 | + "integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==", | ||
318 | + "requires": { | ||
319 | + "debug": "=3.1.0" | ||
320 | + } | ||
321 | + }, | ||
296 | "fs-extra": { | 322 | "fs-extra": { |
297 | "version": "8.1.0", | 323 | "version": "8.1.0", |
298 | "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", | 324 | "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", |
... | @@ -478,6 +504,11 @@ | ... | @@ -478,6 +504,11 @@ |
478 | "resolved": "https://registry.npmjs.org/local-access/-/local-access-1.0.1.tgz", | 504 | "resolved": "https://registry.npmjs.org/local-access/-/local-access-1.0.1.tgz", |
479 | "integrity": "sha512-ykt2pgN0aqIy6KQC1CqdWTWkmUwNgaOS6dcpHVjyBJONA+Xi7AtSB1vuxC/U/0tjIP3wcRudwQk1YYzUvzk2bA==" | 505 | "integrity": "sha512-ykt2pgN0aqIy6KQC1CqdWTWkmUwNgaOS6dcpHVjyBJONA+Xi7AtSB1vuxC/U/0tjIP3wcRudwQk1YYzUvzk2bA==" |
480 | }, | 506 | }, |
507 | + "lottie-web": { | ||
508 | + "version": "5.6.10", | ||
509 | + "resolved": "https://registry.npmjs.org/lottie-web/-/lottie-web-5.6.10.tgz", | ||
510 | + "integrity": "sha512-ucTzaiBJOMm56/K7Wqjajyh7qXlonHKB3+b5fHvhSiz+jOrXt6QDNKAinI3qdw/zvvYHKzXvFMy5SgOXbOJ5ng==" | ||
511 | + }, | ||
481 | "magic-string": { | 512 | "magic-string": { |
482 | "version": "0.25.7", | 513 | "version": "0.25.7", |
483 | "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", | 514 | "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", |
... | @@ -525,6 +556,11 @@ | ... | @@ -525,6 +556,11 @@ |
525 | "resolved": "https://registry.npmjs.org/mri/-/mri-1.1.5.tgz", | 556 | "resolved": "https://registry.npmjs.org/mri/-/mri-1.1.5.tgz", |
526 | "integrity": "sha512-d2RKzMD4JNyHMbnbWnznPaa8vbdlq/4pNZ3IgdaGrVbBhebBsGUUE/6qorTMYNS6TwuH3ilfOlD2bf4Igh8CKg==" | 557 | "integrity": "sha512-d2RKzMD4JNyHMbnbWnznPaa8vbdlq/4pNZ3IgdaGrVbBhebBsGUUE/6qorTMYNS6TwuH3ilfOlD2bf4Igh8CKg==" |
527 | }, | 558 | }, |
559 | + "ms": { | ||
560 | + "version": "2.0.0", | ||
561 | + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", | ||
562 | + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" | ||
563 | + }, | ||
528 | "once": { | 564 | "once": { |
529 | "version": "1.4.0", | 565 | "version": "1.4.0", |
530 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", | 566 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", |
... | @@ -722,9 +758,9 @@ | ... | @@ -722,9 +758,9 @@ |
722 | } | 758 | } |
723 | }, | 759 | }, |
724 | "svelte": { | 760 | "svelte": { |
725 | - "version": "3.23.0", | 761 | + "version": "3.23.2", |
726 | - "resolved": "https://registry.npmjs.org/svelte/-/svelte-3.23.0.tgz", | 762 | + "resolved": "https://registry.npmjs.org/svelte/-/svelte-3.23.2.tgz", |
727 | - "integrity": "sha512-cnyd96bK/Nw5DnYuB1hzm5cl6+I1fpmdKOteA7KLzU9KGLsLmvWsSkSKbcntzODCLmSySN3HjcgTHRo6/rJNTw==", | 763 | + "integrity": "sha512-hE8GeTM83YVR4GY6/6PeDEcGct4JS5aCi+IYbCAa76oaPSfuF7L85DQYULQxlTK/KPWzw3L1GRGmC3oPG/PQoA==", |
728 | "dev": true | 764 | "dev": true |
729 | }, | 765 | }, |
730 | "svelte-spa-router": { | 766 | "svelte-spa-router": { | ... | ... |
... | @@ -15,6 +15,8 @@ | ... | @@ -15,6 +15,8 @@ |
15 | "svelte": "^3.0.0" | 15 | "svelte": "^3.0.0" |
16 | }, | 16 | }, |
17 | "dependencies": { | 17 | "dependencies": { |
18 | + "@lottiefiles/svelte-lottie-player": "^0.1.4", | ||
19 | + "axios": "^0.19.2", | ||
18 | "rollup-plugin-copy": "^3.3.0", | 20 | "rollup-plugin-copy": "^3.3.0", |
19 | "sirv-cli": "^0.4.4", | 21 | "sirv-cli": "^0.4.4", |
20 | "svelte-spa-router": "^2.1.0" | 22 | "svelte-spa-router": "^2.1.0" | ... | ... |
app/web/public/favicon.png
deleted
100644 → 0

3.05 KB
1 | <!DOCTYPE html> | 1 | <!DOCTYPE html> |
2 | <html lang="en"> | 2 | <html lang="en"> |
3 | 3 | ||
4 | -<head> | 4 | +<head lang="ko"> |
5 | <meta charset='utf-8'> | 5 | <meta charset='utf-8'> |
6 | <meta name='viewport' content='width=device-width,initial-scale=1'> | 6 | <meta name='viewport' content='width=device-width,initial-scale=1'> |
7 | 7 | ||
8 | <title>::메이플스토리 스펙 계산기::</title> | 8 | <title>::메이플스토리 스펙 계산기::</title> |
9 | 9 | ||
10 | - <link rel='icon' type='image/png' href='/favicon.png'> | 10 | + <link rel='icon' type='shortcut icon' href='./build/static/images/favicon.ico'> |
11 | - <link rel='stylesheet' href='/global.css'> | 11 | + <link rel='stylesheet' href='./static/css/global.css'> |
12 | <link rel='stylesheet' href='/build/bundle.css'> | 12 | <link rel='stylesheet' href='/build/bundle.css'> |
13 | + <meta property="og:image" content="./build/static/images/ogimage.png"> | ||
14 | + <meta property="og:title" content="::메이플스토리 스펙 계산기::"> | ||
15 | + <meta property="og:description" content="당신의 메이플스토리 스펙 효율을 빠르게 계산해보세요!"> | ||
13 | 16 | ||
14 | <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css"> | 17 | <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css"> |
15 | <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script> | 18 | <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script> | ... | ... |
app/web/src/components/Loading.svelte
0 → 100644
1 | +<script> | ||
2 | + import {LottiePlayer} from '@lottiefiles/svelte-lottie-player'; | ||
3 | + | ||
4 | + export let count = 0; | ||
5 | +</script> | ||
6 | + | ||
7 | +<div id="loading" class:show={count > 0}> | ||
8 | + <LottiePlayer | ||
9 | + src="https://assets5.lottiefiles.com/packages/lf20_kblbXu.json" background="transparent" speed="1" width={300} height={300} controls={false} controlsLayout={null} loop autoplay> | ||
10 | + </LottiePlayer> | ||
11 | +</div> | ||
12 | + | ||
13 | +<style> | ||
14 | +#loading { position:fixed; width:100%; height:100%; z-index:9999; background-color:rgba(0,0,0,0.3); align-items:center; justify-content:center; display:none; } | ||
15 | +#loading.show { display:flex; } | ||
16 | +</style> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
app/web/src/images/favicon.ico
0 → 100644
No preview for this file type
app/web/src/images/ogimage.png
0 → 100644

7.47 KB
1 | import Search from './routes/Search.svelte'; | 1 | import Search from './routes/Search.svelte'; |
2 | +import Character from './routes/Character.svelte'; | ||
2 | 3 | ||
3 | const routes = { | 4 | const routes = { |
4 | '/': Search, | 5 | '/': Search, |
6 | + '/character': Character, | ||
7 | + '/character/:character': Character, | ||
5 | }; | 8 | }; |
6 | 9 | ||
7 | export default routes; | 10 | export default routes; |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
app/web/src/routes/Character.svelte
0 → 100644
1 | +<script> | ||
2 | + export let params = {}; | ||
3 | + | ||
4 | + import {push} from 'svelte-spa-router'; | ||
5 | + import axios from 'axios'; | ||
6 | + import Loading from '../components/Loading.svelte'; | ||
7 | + | ||
8 | + let callCount = 0; | ||
9 | + let isBuff = false; | ||
10 | + let isCharacterLoading = false; | ||
11 | + let stats; | ||
12 | + | ||
13 | + let character = { | ||
14 | + info:{ | ||
15 | + avatar:'', | ||
16 | + nickname:'', | ||
17 | + characterCode:'', | ||
18 | + job:'', | ||
19 | + majorName:'', | ||
20 | + attackPowerName:'', | ||
21 | + server:{ | ||
22 | + name:'', | ||
23 | + icon:'' | ||
24 | + }, | ||
25 | + level:237 | ||
26 | + }, | ||
27 | + analysis:{ | ||
28 | + default:{ | ||
29 | + stats:{ | ||
30 | + major:{ | ||
31 | + pure:0, | ||
32 | + percent:0, | ||
33 | + added:0, | ||
34 | + }, | ||
35 | + minor:0, | ||
36 | + damage:{ | ||
37 | + all:0, | ||
38 | + boss:0 | ||
39 | + }, | ||
40 | + finalDamage:0, | ||
41 | + criticalDamage:0, | ||
42 | + attackPower:{ | ||
43 | + pure:0, | ||
44 | + percent:0, | ||
45 | + }, | ||
46 | + ignoreGuard:0 | ||
47 | + }, | ||
48 | + efficiency:{ | ||
49 | + major:{ | ||
50 | + pure:1, | ||
51 | + percent:1 | ||
52 | + }, | ||
53 | + attackPower:{ | ||
54 | + pure:1, | ||
55 | + percent:1 | ||
56 | + }, | ||
57 | + damage:1, | ||
58 | + criticalDamage:1, | ||
59 | + ignoreGuard:1 | ||
60 | + } | ||
61 | + } | ||
62 | + }, | ||
63 | + buff:{ | ||
64 | + stats:{ | ||
65 | + major:{ | ||
66 | + pure:0, | ||
67 | + percent:0, | ||
68 | + added:0, | ||
69 | + }, | ||
70 | + minor:0, | ||
71 | + damage:{ | ||
72 | + all:0, | ||
73 | + boss:0 | ||
74 | + }, | ||
75 | + finalDamage:0, | ||
76 | + criticalDamage:0, | ||
77 | + attackPower:{ | ||
78 | + pure:0, | ||
79 | + percent:0, | ||
80 | + }, | ||
81 | + ignoreGuard:0 | ||
82 | + }, | ||
83 | + efficiency:{ | ||
84 | + major:{ | ||
85 | + pure:1, | ||
86 | + percent:1 | ||
87 | + }, | ||
88 | + attackPower:{ | ||
89 | + pure:1, | ||
90 | + percent:1 | ||
91 | + }, | ||
92 | + damage:1, | ||
93 | + criticalDamage:1, | ||
94 | + ignoreGuard:1 | ||
95 | + } | ||
96 | + } | ||
97 | + } | ||
98 | + | ||
99 | + function init() { | ||
100 | + let nickname; | ||
101 | + | ||
102 | + if(!params.character) { | ||
103 | + M.toast({html:"캐릭터명을 입력해주세요."}); | ||
104 | + push("/"); | ||
105 | + } | ||
106 | + | ||
107 | + nickname = decodeURI(params.character); | ||
108 | + | ||
109 | + callCount++; | ||
110 | + axios.get('/api/character', { | ||
111 | + params:{ | ||
112 | + nickname:nickname | ||
113 | + } | ||
114 | + }).then(function(response) { | ||
115 | + character = response.data; | ||
116 | + isCharacterLoading = true; | ||
117 | + }).catch(function(error) { | ||
118 | + switch(error.response.status) { | ||
119 | + case 404: | ||
120 | + M.toast({html:"존재하지 않는 캐릭터입니다."}); | ||
121 | + break; | ||
122 | + case 403: | ||
123 | + M.toast({html:"캐릭터 정보 공개설정이 필요합니다."}); | ||
124 | + setTimeout(function() { | ||
125 | + window.open("https://maplestory.nexon.com/MyMaple/Account/Character/Visibility"); | ||
126 | + }, 2000); | ||
127 | + break; | ||
128 | + case 503: | ||
129 | + M.toast({html:"메이플스토리가 점검중입니다."}); | ||
130 | + break; | ||
131 | + default: | ||
132 | + M.toast({html:"서버와의 통신이 원활하지 않습니다.<br><br>잠시 후에 시도해주세요."}); | ||
133 | + break; | ||
134 | + } | ||
135 | + push('/'); | ||
136 | + }).finally(function() { | ||
137 | + callCount--; | ||
138 | + }); | ||
139 | + } | ||
140 | + | ||
141 | + function showValue(value) { | ||
142 | + return parseFloat(value).toFixed(2); | ||
143 | + } | ||
144 | + | ||
145 | + function goBack() { | ||
146 | + push('/'); | ||
147 | + } | ||
148 | + | ||
149 | + $: | ||
150 | + if(isCharacterLoading && isBuff) { | ||
151 | + stats = character.analysis.buff; | ||
152 | + } else { | ||
153 | + stats = character.analysis.default; | ||
154 | + } | ||
155 | + | ||
156 | + init(); | ||
157 | +</script> | ||
158 | + | ||
159 | +<svelte:head> | ||
160 | + | ||
161 | +</svelte:head> | ||
162 | + | ||
163 | +<Loading count={callCount} /> | ||
164 | +<section> | ||
165 | + {#if isCharacterLoading} | ||
166 | + <article class="info-box"> | ||
167 | + <div class="row"> | ||
168 | + <div class="col s12 m10 l8 offset-m1 offset-l2"> | ||
169 | + <div class="row"> | ||
170 | + <div class="col s12 m4 l3"> | ||
171 | + <div class="card character-card"> | ||
172 | + <div class="card-stacked"> | ||
173 | + <div class="card-content"> | ||
174 | + <div class="character-img"> | ||
175 | + <img src={character.info.avatar} class="responsive-img" alt="캐릭터"> | ||
176 | + </div> | ||
177 | + <h6 class="pink-text text-accent-3"> | ||
178 | + <img src={character.info.server.icon} alt={character.info.server.name}> | ||
179 | + {character.info.nickname} | ||
180 | + </h6> | ||
181 | + <div class="job grey-text text-darken-2"> | ||
182 | + {character.info.job} | ||
183 | + </div> | ||
184 | + <div class="level grey-text text-darken-2"> | ||
185 | + Lv.{character.info.level} | ||
186 | + </div> | ||
187 | + </div> | ||
188 | + </div> | ||
189 | + </div> | ||
190 | + <div class="back-button-box"> | ||
191 | + <button class="btn waves-light btn red accent-2" on:click={goBack}> | ||
192 | + <i class="material-icons">arrow_back</i> | ||
193 | + <span>뒤로가기</span> | ||
194 | + </button> | ||
195 | + </div> | ||
196 | + </div> | ||
197 | + <div class="col s12 m8 l9"> | ||
198 | + <div class="card character-card"> | ||
199 | + <div class="card-stacked"> | ||
200 | + <div class="card-content"> | ||
201 | + <div class="buff-switch"> | ||
202 | + <div class="switch"> | ||
203 | + <label> | ||
204 | + 노버프 | ||
205 | + <input type="checkbox" bind:checked={isBuff}> | ||
206 | + <span class="lever"></span> | ||
207 | + 버프(자벞,링크,노블,영메) | ||
208 | + </label> | ||
209 | + </div> | ||
210 | + </div> | ||
211 | + <table class="table-efficiency"> | ||
212 | + <thead> | ||
213 | + <tr> | ||
214 | + <th>스탯</th> | ||
215 | + <th>효율</th> | ||
216 | + </tr> | ||
217 | + </thead> | ||
218 | + <tbody> | ||
219 | + <tr> | ||
220 | + <th rowspan="2">{character.info.majorName} 1%</th> | ||
221 | + <td>{character.info.majorName} {showValue(stats.efficiency.major.percent)}</td> | ||
222 | + </tr> | ||
223 | + <tr> | ||
224 | + <td>{character.info.attackPowerName} {showValue(stats.efficiency.major.percent / stats.efficiency.attackPower.pure)}</td> | ||
225 | + </tr> | ||
226 | + <tr> | ||
227 | + <th>{character.info.attackPowerName} 1</th> | ||
228 | + <td>{character.info.majorName} {showValue(stats.efficiency.attackPower.pure)}</td> | ||
229 | + </tr> | ||
230 | + <tr> | ||
231 | + <th rowspan="5">{character.info.attackPowerName} 1%</th> | ||
232 | + <td>{character.info.majorName} {showValue(stats.efficiency.attackPower.percent)}</td> | ||
233 | + </tr> | ||
234 | + <tr> | ||
235 | + <td>{character.info.majorName} {showValue(stats.efficiency.attackPower.percent / stats.efficiency.major.percent)}%</td> | ||
236 | + </tr> | ||
237 | + <tr> | ||
238 | + <td>{character.info.attackPowerName} {showValue(stats.efficiency.attackPower.percent / stats.efficiency.attackPower.pure)}</td> | ||
239 | + </tr> | ||
240 | + <tr> | ||
241 | + <td>데미지(보공) {showValue(stats.efficiency.attackPower.percent / stats.efficiency.damage)}%</td> | ||
242 | + </tr> | ||
243 | + <tr> | ||
244 | + <td>방무 {showValue(stats.efficiency.attackPower.percent / stats.efficiency.ignoreGuard)}%</td> | ||
245 | + </tr> | ||
246 | + <tr> | ||
247 | + <th rowspan="2">데미지(보공) 1%</th> | ||
248 | + <td>{character.info.majorName} {showValue(stats.efficiency.damage)}</td> | ||
249 | + </tr> | ||
250 | + <tr> | ||
251 | + <td>방무 {showValue(stats.efficiency.damage / stats.efficiency.ignoreGuard)}%</td> | ||
252 | + </tr> | ||
253 | + <tr> | ||
254 | + <th rowspan="2">크뎀 1%</th> | ||
255 | + <td>{character.info.majorName} {showValue(stats.efficiency.criticalDamage)}</td> | ||
256 | + </tr> | ||
257 | + <tr> | ||
258 | + <td>{character.info.majorName} {showValue(stats.efficiency.criticalDamage / stats.efficiency.major.percent)}%</td> | ||
259 | + </tr> | ||
260 | + <tr> | ||
261 | + <th>방무 1%</th> | ||
262 | + <td>{character.info.majorName} {showValue(stats.efficiency.ignoreGuard)}</td> | ||
263 | + </tr> | ||
264 | + </tbody> | ||
265 | + </table> | ||
266 | + </div> | ||
267 | + </div> | ||
268 | + </div> | ||
269 | + </div> | ||
270 | + </div> | ||
271 | + </div> | ||
272 | + </div> | ||
273 | + </article> | ||
274 | + {/if} | ||
275 | +</section> | ||
276 | + | ||
277 | +<style> | ||
278 | +section { width:100%; height:100%; display:flex; flex-direction:column; padding:20px 0; } | ||
279 | +.info-box { margin:auto 0; } | ||
280 | +.info-box > .row > .col > .row > .col { margin-bottom:.5rem; } | ||
281 | +.character-card .card-content { text-align:center; } | ||
282 | +.character-card .card-content .job { font-size:0.8em } | ||
283 | +.character-card .card-content .level { font-size:0.8em } | ||
284 | +.character-card .card-content h6 img { width:14px; height:14px; } | ||
285 | +.character-card .card-content h6 { font-weight:bold; } | ||
286 | +.table-efficiency td, .table-efficiency th { text-align:left; } | ||
287 | +.back-button-box button { width:100%; display:block; height:48px; line-height:48px; } | ||
288 | +.back-button-box button i.material-icons { vertical-align:middle; } | ||
289 | +.back-button-box button span { vertical-align:middle; } | ||
290 | +.buff-switch .switch label input[type=checkbox]:checked+.lever:after { background-color:#e57373; } | ||
291 | +.buff-switch .switch label input[type=checkbox]:not(:checked)+.lever { background-color:#ffcdd2; } | ||
292 | +.buff-switch .switch label input[type=checkbox]:checked+.lever { background-color:#ef9a9a ; } | ||
293 | +</style> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
... | @@ -38,6 +38,10 @@ | ... | @@ -38,6 +38,10 @@ |
38 | </p> | 38 | </p> |
39 | <p> | 39 | <p> |
40 | <a href="https://maplestory.nexon.com/MyMaple/Account/Character/Visibility" target="_BLANK">공개설정하러 가기</a> | 40 | <a href="https://maplestory.nexon.com/MyMaple/Account/Character/Visibility" target="_BLANK">공개설정하러 가기</a> |
41 | + </p> | ||
42 | + <p class="red-text text-accent-1"> | ||
43 | + <i class="material-icons">info_outline</i> | ||
44 | + <span>제논, 데몬어벤져는 지원하지 않습니다.</span> | ||
41 | </p> | 45 | </p> |
42 | </div> | 46 | </div> |
43 | </div> | 47 | </div> |
... | @@ -47,9 +51,11 @@ | ... | @@ -47,9 +51,11 @@ |
47 | </section> | 51 | </section> |
48 | 52 | ||
49 | <style> | 53 | <style> |
50 | -section { width:100%; height:100%; display:flex; flex-direction:column; justify-content:center; } | 54 | +section { width:100%; height:100%; display:flex; flex-direction:column; } |
51 | -.search-box { width:100%; } | 55 | +.search-box { width:100%; margin:auto 0; } |
52 | h4 { font-size:20px; text-align:center; } | 56 | h4 { font-size:20px; text-align:center; } |
53 | .input-field { padding-right:70px; } | 57 | .input-field { padding-right:70px; } |
54 | .input-field button { position:absolute; right:0; top:7px; } | 58 | .input-field button { position:absolute; right:0; top:7px; } |
59 | +.card-action i.material-icons { font-size:1.1em; vertical-align:middle; } | ||
60 | +.card-action i.material-icons ~ span { vertical-align:middle; } | ||
55 | </style> | 61 | </style> |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or login to post a comment