Skip to content

Commit 020308c

Browse files
committed
0.1.1
- Added moves infos (power, accuracy and pp) in the moves detail popup. - Fixed some bugs
1 parent 280c384 commit 020308c

File tree

11 files changed

+149
-14
lines changed

11 files changed

+149
-14
lines changed

index.html

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,17 @@
364364
<div class="moves-detail-wrapp">
365365
<div class="moves-detail-top">
366366
<p class="moves-detail-move-name"></p>
367+
<div class="move-detail-values-wrapp">
368+
<div class="move-detail-pwr-wrapp"><span class="move-detail-pwr-icon"></span>
369+
<p class="move-detail-pwr-value">40</p>
370+
</div>
371+
<div class="move-detail-acc-wrapp"><span class="move-detail-acc-icon"></span>
372+
<p class="move-detail-acc-value">100</p>
373+
</div>
374+
<div class="move-detail-pp-wrapp"><span class="move-detail-pp-icon">PP</span>
375+
<p class="move-detail-pp-value">35</p>
376+
</div>
377+
</div>
367378
</div>
368379
<div class="moves-detail-content">
369380
<div class="moves-detail-typecat-wrapp">
@@ -1019,7 +1030,8 @@
10191030
<div class="changelog-item-section">
10201031
<p class="changelog-item-section-scope">Removed</p>
10211032
<ul class="changelog-item-section-list">
1022-
<li class="changelog-item-section-dot">Removed the Challenges section (will be inserted again in the next release)</li>
1033+
<li class="changelog-item-section-dot">Removed the Challenges section (will be inserted
1034+
again in the next release)</li>
10231035
</ul>
10241036
</div>
10251037
</div>

js/const.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18341,4 +18341,4 @@ export function getWeaknessToType(type, subType = null, attacker) {
1834118341
return weakness
1834218342
}
1834318343

18344-
export const LOAD_BATCH = 30
18344+
export const LOAD_BATCH = 22

js/controller/Abilities.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class Abilities {
2222
}
2323

2424
// API OK
25-
await this.loadAbilities(1, 30)
25+
await this.loadAbilities(1, LOAD_BATCH)
2626
this.loadListeners()
2727
}
2828

js/controller/Items.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class Items {
1414
}
1515

1616
async init() {
17-
await this.loadItems(1, 30)
17+
await this.loadItems(1, LOAD_BATCH)
1818
this.loadListeners()
1919
}
2020

js/controller/Moves.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export class Moves {
1111
}
1212

1313
async init() {
14-
await this.loadMoves(1, 30)
14+
await this.loadMoves(1, LOAD_BATCH)
1515
this.loadListeners()
1616
}
1717

js/controller/Pokedex.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export class Pokedex {
2626
}
2727

2828
// API OK
29-
await this.loadPokedex(1, 30)
29+
await this.loadPokedex(1, LOAD_BATCH)
3030
this.loadListeners()
3131
}
3232

js/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ const ABILITIES_CONTROLLER = new Abilities(ABILITIES_VIEW)
3232
const NATURES_CONTROLLER = new Natures(NATURES_VIEW)
3333
const ITEMS_CONTROLLER = new Items(ITEMES_VIEW)
3434

35-
3635
// Set views' controller
3736
await POKEDEX_VIEW.setController(POKEDEX_CONTROLLER)
3837
await MOVES_VIEW.setController(MOVES_CONTROLLER)

js/view/MovesView.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ export class MovesView {
5252
typeDiv.style.background = `url("${IMGS_PATH}${m.type}type.png") center/80% no-repeat`
5353
moveItem.style.backgroundColor = `var(--${m.type}-clr-bg-type)`
5454

55-
if (m.type == "dark" || m.type == "ground" || m.type == "water" || m.type == "steel" || m.type == "rock" || m.type == "poison" || m.type == "ghost" || m.type == "grass") {
55+
if (m.type == "dark" || m.type == "ground" || m.type == "water" || m.type == "steel" || m.type == "rock"
56+
|| m.type == "poison" || m.type == "ghost" || m.type == "grass") {
57+
5658
pwrWrapp.style.boxShadow = "0 0 .3rem var(--clr-primary-white)"
5759
accWrapp.style.boxShadow = "0 0 .3rem var(--clr-primary-white)"
5860
ppWrapp.style.boxShadow = "0 0 .3rem var(--clr-primary-white)"
@@ -71,15 +73,13 @@ export class MovesView {
7173
else
7274
pwrValue.textContent = "--"
7375

74-
7576
if (m.accuracy)
7677
accValue.textContent = m.accuracy
7778
else
7879
accValue.textContent = "--"
7980

8081
ppValue.textContent = m.pp
8182

82-
8383
typeWrapper.appendChild(typeDiv)
8484
nameWrapp.appendChild(nameP)
8585
moveTop.append(typeWrapper, nameWrapp)
@@ -159,6 +159,10 @@ export class MovesView {
159159
document.querySelector(".moves-detail-move-desc").textContent = m.description
160160
document.querySelector(".moves-detail-move-effect").textContent = m.effect
161161

162+
document.querySelector(".move-detail-pwr-value").textContent = m.power ?? "--"
163+
document.querySelector(".move-detail-acc-value").textContent = m.accuracy ?? "--"
164+
document.querySelector(".move-detail-pp-value").textContent = m.pp ?? "--"
165+
162166
document.querySelector(".moves-detail-type-wrapp").style.backgroundColor = `var(--${m.type}-clr-bg-type)`
163167
document.querySelector(".moves-detail-type-icon").style.background = `url("${IMGS_PATH}${m.type}type.png") center/contain no-repeat`
164168
document.querySelector(".moves-detail-cat-icon").style.background = `url("${IMGS_PATH}${m.category}.png") center/contain no-repeat`

styles/abilities.css

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,22 @@
177177
overflow: auto;
178178
}
179179

180-
.abilities-detail-move-desc::-webkit-scrollbar,
181180
.abilities-detail-move-effect::-webkit-scrollbar {
181+
width: 2.5rem;
182+
}
183+
184+
.abilities-detail-move-effect::-webkit-scrollbar-track {
185+
background: var(--clr-text-grey);
186+
}
187+
188+
.abilities-detail-move-effect::-webkit-scrollbar-thumb {
189+
background-color: var(--clr-primary-white);
190+
border-radius: 2rem;
191+
border: 1rem solid var(--clr-text-grey);
192+
}
193+
194+
195+
.abilities-detail-move-desc::-webkit-scrollbar {
182196
display: none;
183197
}
184198

@@ -194,7 +208,17 @@
194208
}
195209

196210
.abilities-detail-learners-wrapp::-webkit-scrollbar {
197-
display: none
211+
width: 2.5rem;
212+
}
213+
214+
.abilities-detail-learners-wrapp::-webkit-scrollbar-track {
215+
background: var(--clr-text-grey);
216+
}
217+
218+
.abilities-detail-learners-wrapp::-webkit-scrollbar-thumb {
219+
background-color: var(--clr-primary-white);
220+
border-radius: 2rem;
221+
border: 1rem solid var(--clr-text-grey);
198222
}
199223

200224
.abilities-detail-learner-item {

styles/items.css

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,4 +232,24 @@
232232
color: var(--clr-primary-white);
233233
font-weight: 200;
234234
line-height: 2.5rem;
235+
}
236+
237+
.items-detail-item-effect {
238+
max-height: 200px;
239+
text-align: justify;
240+
overflow: auto;
241+
}
242+
243+
.items-detail-item-effect::-webkit-scrollbar {
244+
width: 2.5rem;
245+
}
246+
247+
.items-detail-item-effect::-webkit-scrollbar-track {
248+
background: var(--clr-text-grey);
249+
}
250+
251+
.items-detail-item-effect::-webkit-scrollbar-thumb {
252+
background-color: var(--clr-primary-white);
253+
border-radius: 2rem;
254+
border: 1rem solid var(--clr-text-grey);
235255
}

0 commit comments

Comments
 (0)