Differenze tra le versioni di "Modulo:Stats"

134 byte aggiunti ,  19:02, 16 lug 2021
Automatic text color using ChooseColor *** sovrascritto il testo esistente ***
(Fixing size issues for statsBox on xs screens *** sovrascritto il testo esistente ***)
(Automatic text color using ChooseColor *** sovrascritto il testo esistente ***)
 
This module displays wikicode for anything
related to a set of values for alall six statistics.
So far, it can display stats for a single
Pokémon, the average for a single type and
local pokes = require('Modulo:Poké/data')
local stats = mw.loadData('Modulo:PokéStats/data')
local cc = require('Modulo:ChooseColor')
 
-- Mapping of stat keys to user-interface names
</div>]],
 
boxStats = [=[{| class="roundy text-center${align}${width} ${textcolor}" style="border-spacing: 0 0.3ex; padding: 0.3ex 0.5ex; font-weight: bolder; ${bg};"
! colspan="2" ${rs}style="padding: 0.3ex 0.8ex;" | Statistiche base${values}
${stats}
 
| class="hidden-xs" | &nbsp;
| class="${rleft}text-small hidden-xs black-text" style="padding: 0.3ex 0.8ex; white-space: nowrap; background: #${bg};" | ${min50}—${max50}
| class="${rright}text-small hidden-xs black-text" style="padding: 0.3ex 0.8ex; white-space: nowrap; background: #${bg};" | ${min100}—${max100}]=],
 
statRow = [=[|-
| ${rright}style="padding: 0.3ex 0.8ex 0.3ex 1.8ex; min-width: 9em; background: #${light};" | ${statBar}${bounds}]=],
 
totalLink = [=[<div class="flex flex-nowrap flex-row flex-main-start flex-items-center">${tot}<span class="text-small text-center" style="margin-left: 2ex;">[[:Categoria:Pokémon con statistiche base totali di ${tot}|<span style="color: initial;">Altri Pokémon con questo totale</span>]]</span></div>]=]
}
 
align = align == 'left' and '' or ' pull-' .. align,
width = ' width-xl-30 width-md-50 width-sm-60 width-xs-100',
textcolor = cc.forModGradBg{args={types['type1'] or 'pcwiki',types['type2'] or t1}},
bg = css.horizGradLua(types),
rs = '',
return s.boxStats{
stats = statsAvg(typedPokes, gen),
types = {typetype1 = type},
align = 'left',
}
270 477

contributi