7th-saga/web/views/exp.pug

28 lines
803 B
Plaintext

extends master.pug
block tab-content
div.row: div.col-12.col-md-6
table#main-table.table.table-sm.table-borderless.table-hover.sticky-header
thead: tr.header
+sortHeader('Level', 'level')
th Experience
+sortHeader('+ increase', 'increase')
+sortHeader('% increase', 'increase-per')
tbody.data: each value, i in exp
- const prev = exp[i - 1];
- const increaseAmount = i > 0 ? value - prev : 0;
- const increasePercent = i > 0 && prev > 0 ? increaseAmount / prev : 0;
tr(
data-level=(i + 1)
data-increase=increaseAmount
data-increase-per=increasePercent
)
td: strong= i + 1
td: code= value
td
+na(i > 0)
code= increaseAmount
td
+na(i > 0 && prev > 0)
code= (increasePercent * 100).toFixed(2) + '%'