Module:Mouse-ripple

From Test Wiki
Revision as of 08:13, 10 March 2021 by QFQ (talk | contribs) (moegirls)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Documentation for this module may be created at Module:Mouse-ripple/doc

local module = {}

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

function randomRgb()
	function color()
		local val = math.random(0, 255)
		local zero = ''
		if val < 16 then zero = '0' end
		return zero..string.format('%X', val)	
	end
	return '#'..color()..color()..color()
end

-- class: a:画布行 b:块容器(为了尽量少输出字符串)
function canvasLine()
	local line = {}
	for i=1, 50 do
		line[i] = '<b class="b"><b style="color:'..randomRgb()..'"></b></b>'
  end
  return '<b class="a">'..table.concat(line)..'</b>'
end

function _main(args)
	local canvas = {}
	for i=1, 50 do
		canvas[i] = canvasLine()	
	end
	return '<b class="mouse-ripple nomobile">'..table.concat(canvas)..'</b>'
end

function module.main()
	return _main(args)
end

return module