박현우

splash require

Showing 147 changed files with 52 additions and 44 deletions
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
38 "babel-register": "^6.22.0", 38 "babel-register": "^6.22.0",
39 "chalk": "^2.0.1", 39 "chalk": "^2.0.1",
40 "chromedriver": "^2.27.2", 40 "chromedriver": "^2.27.2",
41 - "copy-webpack-plugin": "^4.0.1", 41 + "copy-webpack-plugin": "^4.6.0",
42 "cross-spawn": "^5.0.1", 42 "cross-spawn": "^5.0.1",
43 "css-loader": "^0.28.0", 43 "css-loader": "^0.28.0",
44 "eslint": "^4.15.0", 44 "eslint": "^4.15.0",
......
...@@ -3,44 +3,44 @@ ...@@ -3,44 +3,44 @@
3 <div class="header"> 3 <div class="header">
4 <h1>{{ userId }}</h1> 4 <h1>{{ userId }}</h1>
5 </div> 5 </div>
6 +
6 <div class="body"> 7 <div class="body">
7 <div class="assist"> 8 <div class="assist">
8 - <b-button>Pick Assistant</b-button> 9 + <b-button v-b-toggle.collapse-predict variant="outline-primary">Pick Assistant</b-button>
9 - </div> 10 + <b-collapse id="collapse-predict">
10 - <div class="team"> 11 + <h1>the world of sound</h1>
11 - <div class="team_best"> 12 + <span v-for="champion in championList">
12 - <h1>tb {{ inference_team[0]['id'] }}</h1> 13 + <img v-bind:src="splashLoader(champion)">
13 - </div> 14 + </span>
14 - <div class="team_worst"> 15 + </b-collapse>
15 - <h1>tw {{ inference_team[inference_team.length -1]['id'] }}</h1> 16 + </div>
16 - </div>
17 - </div>
18 -
19 - <b-container fluid class="wrap">
20 - <b-row class="items flex-row flex-nowrap">
21 - <template v-for="team in inference_team">
22 - <b-card class="card">
23 - <b-card-text>{{ team['id'] }}</b-card-text>
24 - <b-card-text>{{ team['coefficient'] }}</b-card-text>
25 - </b-card>
26 - </template>
27 - </b-row>
28 - </b-container>
29 17
30 - <div class="wrap"> 18 + <div class="team">
31 - <div class="items"> 19 + <div class="team_summary">
32 - <h1>1234123412348123840182304981-23841-2034812-384123479012374917340917394073907409172394071092374901723940172394710923749012734091723407102374</h1> 20 + <div class="team_best">
21 + <h1>Best : {{ nameTranslator(inference_team[0]['id']) }}</h1>
22 + <img v-bind:src="splashLoader(inference_team[0]['id'])">
23 + </div>
24 + <div class="team_worst">
25 + <h1>Worst {{ nameTranslator(inference_team[inference_team.length - 1]['id']) }}</h1>
26 + <img v-bind:src="splashLoader(inference_team[inference_team.length - 1]['id'])">
27 + </div>
33 </div> 28 </div>
29 + <b-button v-b-toggle.collapse-1 variant="primary">More</b-button>
30 + <b-collapse id="collapse-1">
31 + <b-container fluid class="wrap">
32 + <b-row class="items flex-row flex-nowrap">
33 + <template v-for="team, index in inference_team">
34 + <b-card class="card">
35 + <img v-bind:src="splashLoader(team['id'])">
36 + <h3>{{ index + 1 }}. {{ nameTranslator(team['id']) }}</h3>
37 + </b-card>
38 + </template>
39 + </b-row>
40 + </b-container>
41 + </b-collapse>
34 </div> 42 </div>
35 43
36 - <div class="enemy">
37 - <div class="enemy_best">
38 - <h1>eb {{ inference_enemy[0]["id"] }}</h1>
39 - </div>
40 - <div class="enemy_worst">
41 - <h1>ew {{ inference_enemy[inference_enemy.length -1]["id"] }}</h1>
42 - </div>
43 - </div>
44 <div class="myPick"> 44 <div class="myPick">
45 </div> 45 </div>
46 </div> 46 </div>
...@@ -48,6 +48,8 @@ ...@@ -48,6 +48,8 @@
48 </template> 48 </template>
49 49
50 <script> 50 <script>
51 +import championTable from '../assets/champion_table.json';
52 +
51 export default { 53 export default {
52 name: 'DetailPage', 54 name: 'DetailPage',
53 data () { 55 data () {
...@@ -58,27 +60,25 @@ export default { ...@@ -58,27 +60,25 @@ export default {
58 inference_enemy: [], 60 inference_enemy: [],
59 inference_secondary: [], 61 inference_secondary: [],
60 myPick: [], 62 myPick: [],
63 + splash: [],
64 + championList: Array.from(Array(145).keys())
61 } 65 }
62 }, 66 },
63 created () { 67 created () {
64 - //this.userId = $route.params.userId
65 - //this.axios.post('http://127.0.0.1:8000/GameData/search/', {'game_id': "laurelwoods"}, {
66 - // headers: { 'Content-Type': 'application/json'}
67 - //})
68 this.axios.get('http://127.0.0.1:8000/GameData/search/', { params: { game_id: 'laurelwoods' }}) 68 this.axios.get('http://127.0.0.1:8000/GameData/search/', { params: { game_id: 'laurelwoods' }})
69 .then((response) => { 69 .then((response) => {
70 this.userPk = response.data.id; 70 this.userPk = response.data.id;
71 this.userId = response.data.game_id; 71 this.userId = response.data.game_id;
72 // inference : team 72 // inference : team
73 - this.axios.get('http://127.0.0.1:8000/GameData/' + this.userPk + '/inference/', { params: { model_type: 'team'}}) 73 + this.axios.get('http://127.0.0.1:8000/GameData/' + this.userPk + '/inference/', { params: { model_type: 'team' } })
74 .then((response) => { this.inference_team = response.data; }) 74 .then((response) => { this.inference_team = response.data; })
75 75
76 // inference : enemy 76 // inference : enemy
77 - this.axios.get('http://127.0.0.1:8000/GameData/' + this.userPk + '/inference/', { params: { model_type: 'enemy'}}) 77 + this.axios.get('http://127.0.0.1:8000/GameData/' + this.userPk + '/inference/', { params: { model_type: 'enemy' } })
78 .then((response) => { this.inference_enemy = response.data; }) 78 .then((response) => { this.inference_enemy = response.data; })
79 79
80 // inference : secondary 80 // inference : secondary
81 - this.axios.get('http://127.0.0.1:8000/GameData/' + this.userPk + '/inference/', { params: { model_type: 'secondary'}}) 81 + this.axios.get('http://127.0.0.1:8000/GameData/' + this.userPk + '/inference/', { params: { model_type: 'secondary' } })
82 .then((response) => { 82 .then((response) => {
83 this.inference_secondary = response.data; }) 83 this.inference_secondary = response.data; })
84 84
...@@ -89,7 +89,15 @@ export default { ...@@ -89,7 +89,15 @@ export default {
89 .catch((error) => { 89 .catch((error) => {
90 console.log(error.response) 90 console.log(error.response)
91 }) 91 })
92 - 92 + },
93 + methods: {
94 + nameTranslator: function (championId) {
95 + return championTable[championId]['name_ko']
96 + },
97 + splashLoader: function (championId) {
98 + const path = require('../assets/splash/' + String(championId) + '.png')
99 + return path
100 + }
93 } 101 }
94 } 102 }
95 </script> 103 </script>
...@@ -106,7 +114,7 @@ export default { ...@@ -106,7 +114,7 @@ export default {
106 overflow: auto; 114 overflow: auto;
107 } 115 }
108 .card { 116 .card {
109 - min-height: 300px; 117 + min-height: 200px;
110 - min-width: 300px; 118 + min-width: 250px;
111 } 119 }
112 -</style>
...\ No newline at end of file ...\ No newline at end of file
120 +</style>
......