Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:AnimateText: Difference between revisions

From Mine in Abyss
minecraft>Nixinova
mNo edit summary
 
m 1 revision imported
 
(No difference)

Latest revision as of 13:26, 11 October 2024

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

local p = {}
function p.animate( f )
	local args = f
	if f == mw.getCurrentFrame() then
		args = f:getParent().args
	end
	
	local text = {}
	for row in mw.text.gsplit( args[1], '%s*,,%s*' ) do
		if row == '' then
			table.insert( text, '<span><br></span>' )
		else
			table.insert( text, '<span>' .. row .. '</span>' )
		end
	end
	text[1] = text[1]:gsub( '^<span>', '<span class="animated-active">' )
	
	return '<span class="animated">' .. table.concat( text ) .. '</span>'
end
return p