Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
Revision as of 09:52, 8 September 2025 by MTOnline (talk | contribs) (Created page with "local getArgs = require('Module:Arguments').getArgs local p = {} function p.animate(frame) local args = getArgs(frame) local files = {} local size = args.size or '' local link = args.link or '' for i = 1, 10 do -- arbitrary upper limit for number of frames, change as necessary if args[i] then table.insert(files, args[i]) else break end end if size ~= '' then size = '|' .. size end if link ~= '' then link = '|link=' .. link end local images...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation for this module may be created at Module:Animate/doc

local getArgs = require('Module:Arguments').getArgs

local p = {}

function p.animate(frame)
	local args = getArgs(frame)
	
	local files = {}
	local size = args.size or ''
	local link = args.link or ''
	
	for i = 1, 10 do  -- arbitrary upper limit for number of frames, change as necessary
		if args[i] then
			table.insert(files, args[i])
		else
			break
		end
	end
	
	if size ~= '' then size = '|' .. size end
	if link ~= '' then link = '|link=' .. link end
	
	local images = {}
	for _, file in ipairs(files) do
		if file == '' then
			table.insert(images, '<span><br></span>')
		else
			table.insert(images, '<span>[[File:' .. file .. size .. link .. ']]</span>')
		end
	end
	images[1] = images[1]:gsub('^<span>', '<span class="animated-active">')
	
	return '<span class="animated">' .. table.concat(images) .. '</span>'
end

return p