Module:Sandbox

-- Load modules local fun = require("Module:Functional") local iter = fun.iter

local sandbox = {}

-- The documentation page will show the result of the test function. local function test local data = require("Module:Data") local colors = require("Module:In-Game Colors") local Label = require("Module:GameUIBuilder").GameUILabel local grid_pos = mw.loadData("Module:ParentItem/slotpos") local ROW_POSITIONS = grid_pos["rows"] local COL_POSITIONS = grid_pos["cols"] local faction, rarity, title = "Rebel", "Common", "Voyager Corvette" local background = "VoyagerCorvette-Background.png" local frame = Label({"game-ui-parentitemdisplay-label"}, {		["position"] = "relative",		["background-color"] = "black",	}, nil)

local background_image = Label(nil, {		["position"] = "absolute",		["width"] = "358px",		["height"] = "444px",		["top"] = "66px",		["left"] = "38px",	}, string.format("", background)) frame:node(background_image) local faction_icon = Label(nil, {		["position"] = "absolute",		["width"] = "40px",		["height"] = "40px",		["left"] = "5px",		["top"] = "2px",	}, string.format("", data.FACTION_ICONS[faction])) frame:node(faction_icon) local faction_title = Label(nil, {		["position"] = "absolute",		["left"] = "48px",		["top"] = "2px",		["justify-content"] = "start",		["text-transform"] = "uppercase",	}, mw.getCurrentFrame:expandTemplate{ title = "Colored Text", args = { faction, faction } }) frame:node(faction_title)

local item_title = Label(nil, {		["position"] = "absolute",		["left"] = "48px",		["top"] = "18px",		["justify-content"] = "start",		["font-size"] = "1.2em",	}, mw.getCurrentFrame:expandTemplate{ title = "Colored Text", args = { title, rarity } }) frame:node(item_title) local list_factions_button = Label({"list-factions"}) list_factions_button:css{ ["position"] = "absolute", ["right"] = "107px", ["top"] = "3px", ["width"] = "50px", ["height"] = "50px", }	frame:node(list_factions_button) local view_skin_button = Label({"view-skin"}) view_skin_button:css{ ["position"] = "absolute", ["right"] = "55px", ["top"] = "3px", ["width"] = "50px", ["height"] = "50px", }	frame:node(view_skin_button) local toggle_layer_button = Label({"toggle-layer"}) toggle_layer_button:css{ ["position"] = "absolute", ["right"] = "3px", ["top"] = "3px", ["width"] = "50px", ["height"] = "50px", }	frame:node(toggle_layer_button) local firing_arc = Label(nil, {		["position"] = "absolute",		["right"] = "4px",		["top"] = "56px",		["width"] = "50px",		["height"] = "50px",	}, "") frame:node(firing_arc) local firing_arc_center = Label(nil, {		["position"] = "absolute",		["right"] = "4px",		["top"] = "56px",		["width"] = "50px",		["height"] = "50px",	}, "") frame:node(firing_arc_center) iter(ROW_POSITIONS):enumerate:each(function (r, relative_top)		iter(COL_POSITIONS):enumerate:each(function (c, relative_right) local slot_icon = Label(nil, {				["position"] = "absolute",				["right"] = string.format("calc(%.1f%% + 2px)", relative_right),				["top"] = string.format("calc(%.1f%% + 45px)", relative_top),				["width"] = "88px",				["height"] = "56px",			}, string.format("", r, c)) frame:node(slot_icon) end)	end) local mass_bar = Label(nil, {		["position"] = "absolute",		["left"] = "73px",		["top"] = "610px",		["width"] = string.format("calc(288px * 10 / 110)"),		["height"] = "26px",		["border-top"] = "1px solid #70CFE7",		["box-sizing"] = "border-box",		["background-color"] = "#679EA9",	}, nil) frame:node(mass_bar) local mass_text = Label(nil, {		["position"] = "absolute",		["left"] = "73px",		["top"] = "610px",		["width"] = "288px",		["height"] = "26px",		["font-size"] = "0.95em",		["color"] = "#D4F8FF",	}, "10 / 110 t") frame:node(mass_text)

return frame:as_mw_html end

function sandbox.dummy local result = "" return result end

function sandbox.output return test end return sandbox