Модуль:BotanyStats: различия между версиями
Pok (обсуждение | вклад) Нет описания правки |
Pok (обсуждение | вклад) Нет описания правки |
||
| Строка 42: | Строка 42: | ||
end | end | ||
return words | return words | ||
end | |||
-- Меняем цвета в зависимости от наличия параметра `mutation` | |||
local mutationClass = "" | |||
if mutation == nil then | |||
mutationClass = 'mutation-cell__plants' | |||
else | |||
mutationClass = 'mutation-cell__mutation' | |||
end | end | ||
| Строка 50: | Строка 58: | ||
elseif mutationId == "" then | elseif mutationId == "" then | ||
-- Если параметр пуст | -- Если параметр пуст | ||
mutationCells = '<div class= | mutationCells = '<div class=' .. mutationClass .. '>Не имеет мутаций</div> \n' | ||
else | else | ||
-- Если параметр задан и не пуст | -- Если параметр задан и не пуст | ||
local words = splitWords(mutationId) | local words = splitWords(mutationId) | ||
for _, word in ipairs(words) do | for _, word in ipairs(words) do | ||
mutationCells = mutationCells .. '<div class= | mutationCells = mutationCells .. '<div class=' .. mutationClass .. '>{{#invoke:Entity Lookup|createimagetooltip|Файл:' .. word .. '.png|' .. word .. '|Мета=32x32px,link=}} [[#{{#invoke:Entity Lookup|getname|' .. word .. '}}|{{#invoke:Entity Lookup|getname|' .. word .. '}}]]</div>' | ||
end | end | ||
end | end | ||
| Строка 78: | Строка 86: | ||
out = out .. frame:preprocess('* {{tooltip|Освещения|Оптимальный уровень освещения|color=#e1f6ff}}: ' .. '<b>' .. idealLight .. '</b>' .. '\n') | out = out .. frame:preprocess('* {{tooltip|Освещения|Оптимальный уровень освещения|color=#e1f6ff}}: ' .. '<b>' .. idealLight .. '</b>' .. '\n') | ||
out = out .. '| ' .. description .. '\n' | out = out .. '| ' .. description .. '\n' | ||
out = out .. frame:preprocess('|' .. mutationCells .. '\n') | |||
-- | -- Меняем цвета в зависимости от наличия параметра `mutation` | ||
if mutation == nil then | |||
if | |||
out = out .. frame:preprocess('|{{SlideMenu|overlay|color=#e1f6ff|background-color=#301453|border-color=#211235|border-size=3px|title=Список|content=<p></p> \n' .. location .. '}} \n') | out = out .. frame:preprocess('|{{SlideMenu|overlay|color=#e1f6ff|background-color=#301453|border-color=#211235|border-size=3px|title=Список|content=<p></p> \n' .. location .. '}} \n') | ||
else | else | ||
| Строка 96: | Строка 100: | ||
if firstRun then | if firstRun then | ||
firstRun = false | firstRun = false | ||
out = out .. '<div class="customCSS" style="display:none"> . | out = out .. '<div class="customCSS" style="display:none"> .mutation-cell__mutation { width: 100%; margin: 5px 0; box-sizing: border-box; text-align: left; background: #10673a; padding: 6px 10px; border-radius: 0.3em; border: 2px solid #094124; font-weight: 500; transition: background 0.05s; } .mutation-cell__mutation:hover { background: #126d3e; } </div>' | ||
end | end | ||
return out | return out | ||