Модуль:BotanyStats: различия между версиями

мНет описания правки
мНет описания правки
 
Строка 1: Строка 1:
local p = {}
local p = {}
local firstRun = true  -- Глобальная переменная для отслеживания первого вызова


-- Функция для установки значения по умолчанию
-- Функция для установки значения по умолчанию
Строка 95: Строка 94:
     out = out .. '|- \n'
     out = out .. '|- \n'
      
      
    -- CSS код, который подгружается при первом вызове модуля на странице
    if firstRun then
        firstRun = false
        out = out .. '<div class="customCSS" style="display:none"> .mutation-cell__plants { 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__plants:hover { background: #126d3e; } </div>'
        out = out .. '<div class="customCSS" style="display:none"> .mutation-cell__mutation { width: 100%; margin: 5px 0; box-sizing: border-box; text-align: left; background: #321557; padding: 6px 10px; border-radius: 0.3em; border: 2px solid #1c0f2d; font-weight: 500; transition: background 0.05s; } .mutation-cell__mutation:hover { background: #36155f; } </div>'
    end
     return out
     return out
end
end


return p
return p