local getArgs = require('Module:Arguments').getArgs
local p = {}
function p.main(frame)
local args = getArgs(frame)
local width = args.width or ''
local height = args.height or ''
local t = args.time or ''
local color = args.color or ''
local hoverColor = args.hoverColor or ''
local circleWidth = args.circleWidth or ''
local slideStyle = args.slideStyle or ''
local html = {}
table.insert(html, '<div class="ActivityBannerContainer" style="width:' .. width .. ';height:' .. height .. ';" data-scroll-time="' .. t .. '">')
table.insert(html, '<div class="ActivityBannerImages" style="height:' .. height .. ';">')
local i = 1
while args['图片' .. i] do
local img = args['图片' .. i]
table.insert(html, '<div>' .. img .. '</div>')
i = i + 1
end
table.insert(html, '</div>')
table.insert(html, '<ul class="ActivityBannerSwitcher" data-circle-color="' .. color .. '" data-circle-hover="' .. hoverColor .. '">')
for j = 1, i - 1 do
table.insert(html, '<li class="ActivityBannerSwitcherItem" style="width:' .. circleWidth .. ';height:' .. circleWidth .. ';"></li>')
end
table.insert(html, '</ul>')
table.insert(html, '<div class="ActivityBannerArrow left" style="' .. slideStyle .. '">❮</div>')
table.insert(html, '<div class="ActivityBannerArrow right" style="' .. slideStyle .. '">❯</div>')
table.insert(html, '</div>')
return table.concat(html)
end
return p