Module:Adjacent stations/Mumbai Metro/sandbox
Jump to navigation
Jump to search
| File:Edit In Sandbox Icon - Color.svg | This is the module sandbox page for Module:Adjacent stations/Mumbai Metro (diff). |
This is a data module for Module:Adjacent stations. It supports services in Mumbai operated by Mumbai Metro/sandbox.
Line name and colours
[edit source]Active
[edit source]| Line | Keys | Color | Hex color | Icon |
|---|---|---|---|---|
| Blue Line | Blue or blue or 1 |
00AEEF |
File:Logo of Mumbai Metro Line 1.svg | |
| Yellow Line | Yellow or yellow or 2A |
FFC600 |
| |
| Aqua Line | Aqua or aqua or 3 |
059DB2 |
File:Logo of Mumbai Metro Line 3.png | |
| Red Line | Red or red or 7 |
D83431 |
|
Future
[edit source]| Line | Keys | Color | Hex color | Icon |
|---|---|---|---|---|
| Yellow Line | Yellow or yellow or 2B |
FFC600 |
| |
| Green Line | Green or green or 4 or 4A or 10 or 11 |
00AE5A |
| |
| Orange Line | Orange or orange or 5 or 12 |
FF8200 |
| |
| Pink Line | Pink or pink or 6 |
F99FC9 |
| |
| Red Line | Red or red or 7A or 9 |
D83431 |
| |
| Gold Line | Gold or gold or 8 |
BF9724 |
| |
| Purple Line | Purple or purple or 13 |
B896D4 |
| |
| Magenta Line | Magenta or magenta or 14 |
E10098 |
|
Title bar line colours
[edit source]This parameter set supersedes Template:Mumbai Metro Infobox station line.
Line colour bars are automatically generated based on the line(s) serving the station when this module is defined for use in Template:Infobox station. To specify the served line(s), pass a comma-separated list into |style2=.
Each recognised line name displays an equal-width colour segment across the bar, stacked in sequence from top to bottom as with the input. If any line name is not recognised, no line colours will be shown.
Example
[edit source]Gundavali | |||||
|---|---|---|---|---|---|
| General information | |||||
| System | Mumbai Metro | ||||
| |||||
{{Infobox station
| name = Gundavali
| style = Mumbai Metro
| style2 = Red
| symbol_location = Mumbai
| symbol = m
| system = [[Mumbai Metro]]
}}
Dahisar (East) | |||||
|---|---|---|---|---|---|
| General information | |||||
| System | Mumbai Metro | ||||
| |||||
{{Infobox station
| name = Dahisar (East)
| style = Mumbai Metro
| style2 = Yellow, Red
| symbol_location = Mumbai
| symbol = m
| system = [[Mumbai Metro]]
}}
local MUM = "%1 metro station (Mumbai)"
local c = {
Blue = '00AEEF',
Yellow = 'FFC600',
Aqua = '059DB2',
Green = '00AE5A',
Orange = 'FF8200',
Pink = 'F99FC9',
Red = 'D83431',
Gold = 'BF9724',
Purple = 'B896D4',
Magenta = 'E10098',
}
local function sideBlocks(cols)
local n = #cols
if n == 0 then return "" end
-- CONFIGURATION
local blockWidth = 50 -- Width of the colored block (in px) to match the square logo area
local totalPad = (n * blockWidth) + 10 -- Calculate left padding so text is pushed right
local images = {}
local sizes = {}
local pos = {}
-- Iterate through colors to create vertical blocks
for i, hex in ipairs(cols) do
-- Calculate the X offset: (index - 1) * width
local offset = (i - 1) * blockWidth
images[#images+1] = "linear-gradient(#"..hex..",#"..hex..")"
sizes[#sizes+1] = blockWidth.."px 100%" -- Fixed width, full height
pos[#pos+1] = "left "..offset.."px top" -- Pin to left
end
return "background-image:"..table.concat(images,",").."; background-size:"..table.concat(sizes,",").."; background-position:"..table.concat(pos,",").."; background-repeat:no-repeat; padding-left:"..totalPad.."px;"
end
local function styleFromNames(styleText)
local base = 'font-family:"Segoe UI","Helvetica Neue",Helvetica,Arial,sans-serif; '
.. 'font-size:150%; background-color:#000000; color:#FFFFFF; ' -- Changed text to White to match photo
.. 'padding:0.625em 4px 0.625em 0; line-height:110%; font-weight:500; letter-spacing:0.5px;'
if not styleText or styleText == "" then
return base .. "padding-left:10px;" -- Default padding if no color block
end
local cols = {}
for part in styleText:gmatch("[^,]+") do
local key = (part or ""):gsub("[^%w]", "")
local hex = c[key]
if not hex then
return base .. "padding-left:10px;"
end
cols[#cols + 1] = hex
end
return base .. sideBlocks(cols)
end
local p = {
["system title"] = "[[Mumbai Metro]]",
["line icon format"] = "link",
["rail box format"] = "title",
["name format"] = setmetatable({}, {
__index = function(_, key)
return styleFromNames(key)
end
}),
["header background color"] = "11254A",
["header text color"] = "FFFFFF",
["station format"] = {
"%1 metro station",
["Anand Nagar"] = MUM
},
["lines"] = {
["_default"] = {
["title"] = "[[%1 Line (Mumbai Metro)|%1 Line]]",
["color"] = "034794",
["text color"] = "FFFFFF",
},
["Blue"] = {
["color"] = c.Blue,
["icon"] = "[[File:Logo of Mumbai Metro Line 1.svg|18px|link=Blue Line (Mumbai Metro)]]",
["left terminus"] = "Versova",
["right terminus"] = "Ghatkopar",
},
["1"] = {
["title"] = "[[Blue Line (Mumbai Metro)|Line 1]]",
["color"] = c.Blue,
["icon"] = "[[File:Logo of Mumbai Metro Line 1.svg|18px|link=Blue Line (Mumbai Metro)]]",
["left terminus"] = "Versova",
["right terminus"] = "Ghatkopar",
},
["Yellow"] = {
["color"] = c.Yellow,
["text color"] = "000000",
["left terminus"] = "Mandale",
["right terminus"] = "Dahisar (East)",
},
["2"] = {
["title"] = "[[Yellow Line (Mumbai Metro)|Line 2]]",
["color"] = c.Yellow,
["text color"] = "000000",
["left terminus"] = "Mandale",
["right terminus"] = "Dahisar (East)",
},
["2A"] = {
["title"] = "[[Yellow Line (Mumbai Metro)|Line 2A]]",
["color"] = c.Yellow,
["text color"] = "000000",
["left terminus"] = "Andheri (West)",
["right terminus"] = "Dahisar (East)",
},
["2B"] = {
["title"] = "[[Yellow Line (Mumbai Metro)|Line 2B]]",
["color"] = c.Yellow,
["text color"] = "000000",
["note-mid"] = "''(under construction)''",
["left terminus"] = "Mandale",
["right terminus"] = "Andheri (West)",
},
["Aqua"] = {
["color"] = c.Aqua,
["icon"] = "[[File:Logo of Mumbai Metro Line 3.png|16px|link=Aqua Line (Mumbai Metro)]]",
["left terminus"] = "Cuffe Parade",
["right terminus"] = "Aarey JVLR",
},
["3"] = {
["title"] = "[[Aqua Line (Mumbai Metro)|Aqua Line]]",
["color"] = c.Aqua,
["icon"] = "[[File:Logo of Mumbai Metro Line 3.png|16px|link=Aqua Line (Mumbai Metro)]]",
["left terminus"] = "Cuffe Parade",
["right terminus"] = "Aarey JVLR",
},
["Green"] = {
["color"] = c.Green,
["note-mid"] = "''(under construction)''",
["left terminus"] = "Shivaji Chowk (Mira Road)",
["left terminus"] = "Chhatrapati Shivaji Maharaj Terminus",
},
["4"] = {
["title"] = "[[Green Line (Mumbai Metro)|Line 4]]",
["color"] = c.Green,
["note-mid"] = "''(under construction)''",
["left terminus"] = "Kasarvadavali",
["right terminus"] = "Bhakti Park (Wadala)",
},
["4A"] = {
["title"] = "[[Green Line (Mumbai Metro)|Line 4A]]",
["color"] = c.Green,
["note-mid"] = "''(under construction)''",
["left terminus"] = "Gaimukh",
["right terminus"] = "Kasarvadavali",
},
["Orange"] = {
["color"] = c.Orange,
["note-mid"] = "''(under construction)''",
["left terminus"] = "Kapurbawdi",
["right terminus"] = "Taloja",
},
["5"] = {
["title"] = "[[Orange Line (Mumbai Metro)|Line 5]]",
["color"] = c.Orange,
["note-mid"] = "''(under construction)''",
["left terminus"] = "Kapurbawdi",
["right terminus"] = "Kalyan APMC",
},
["Pink"] = {
["color"] = c.Pink,
["text color"] = "000000",
["note-mid"] = "''(under construction)''",
["left terminus"] = "Swami Samarth Nagar (Lokhandwala)",
["right terminus"] = "Vikhroli EEH",
},
["6"] = {
["title"] = "[[Pink Line (Mumbai Metro)|Line 6]]",
["color"] = c.Pink,
["text color"] = "000000",
["note-mid"] = "''(under construction)''",
["left terminus"] = "Swami Samarth Nagar (Lokhandwala)",
["right terminus"] = "Vikhroli EEH",
},
["Red"] = {
["color"] = c.Red,
["note-mid"] = "''(under construction)''",
["left terminus"] = "Subhash Chandra Bose Stadium",
["right terminus"] = "Chhatrapati Shivaji Maharaj International Airport - T2",
},
["7"] = {
["title"] = "[[Red Line (Mumbai Metro)|Line 7]]",
["color"] = c.Red,
["left terminus"] = "Dahisar (East)",
["right terminus"] = "Gundavali",
},
["7A"] = {
["title"] = "[[Red Line (Mumbai Metro)|Line 7A]]",
["color"] = c.Red,
["left terminus"] = "Gundavali",
["right terminus"] = "Chhatrapati Shivaji Maharaj International Airport - T2",
},
["Gold"] = {
["color"] = c.Gold,
["text color"] = "000000",
["note-mid"] = "''(planned)''",
["left terminus"] = "Chhatrapati Shivaji Maharaj International Airport - T2",
["right terminus"] = "Navi Mumbai International Airport",
},
["8"] = {
["title"] = "[[Gold Line (Mumbai Metro)|Line 8]]",
["color"] = c.Gold,
["text color"] = "000000",
["note-mid"] = "''(planned)''",
["left terminus"] = "Chhatrapati Shivaji Maharaj International Airport - T2",
["right terminus"] = "Navi Mumbai International Airport",
},
["9"] = {
["title"] = "[[Red Line (Mumbai Metro)|Line 9]]",
["color"] = c.Red,
["note-mid"] = "''(under construction)''",
["left terminus"] = "Subhash Chandra Bose Stadium",
["right terminus"] = "Dahisar (East)",
},
["10"] = {
["title"] = "[[Green Line (Mumbai Metro)|Line 10]]",
["color"] = c.Green,
["note-mid"] = "''(planned)''",
["left terminus"] = "Shivaji Chowk (Mira Road)",
["right terminus"] = "Gaimukh",
},
["11"] = {
["title"] = "[[Green Line (Mumbai Metro)|Line 11]]",
["color"] = c.Green,
["note-mid"] = "''(planned)''",
["left terminus"] = "Chhatrapati Shivaji Maharaj Terminus",
["right terminus"] = "Bhakti Park (Wadala)",
},
["12"] = {
["title"] = "[[Orange Line (Mumbai Metro)|Line 12]]",
["color"] = c.Orange,
["note-mid"] = "''(planned)''",
["left terminus"] = "Kalyan APMC",
["right terminus"] = "Taloja",
},
["Purple"] = {
["color"] = c.Purple,
["note-mid"] = "''(proposed)''",
["left terminus"] = "Shivaji Chowk (Mira Road)",
["right terminus"] = "Virar",
},
["13"] = {
["title"] = "[[Purple Line (Mumbai Metro)|Line 13]]",
["color"] = c.Purple,
["note-mid"] = "''(proposed)''",
["left terminus"] = "Shivaji Chowk (Mira Road)",
["right terminus"] = "Virar",
},
["Magenta"] = {
["color"] = c.Magenta,
["note-mid"] = "''(planned)''",
["left terminus"] = "Vikhroli EEH",
["right terminus"] = "Badlapur",
},
["14"] = {
["title"] = "[[Magenta Line (Mumbai Metro)|Line 14]]",
["color"] = c.Magenta,
["note-mid"] = "''(planned)''",
["left terminus"] = "Vikhroli EEH",
["right terminus"] = "Badlapur",
},
},
["aliases"] = {
["blue"] = "Blue",
["blue line"] = "Blue",
["line 1"] = "1",
["mumbai metro line 1"] = "1",
["yellow"] = "Yellow",
["yellow line"] = "Yellow",
["2"] = "2",
["line 2"] = "2",
["2a"] = "2A",
["line 2a"] = "2A",
["yellow line 2a"] = "2A",
["metro 2a"] = "2A",
["2b"] = "2B",
["line 2b"] = "2B",
["yellow line 2b"] = "2B",
["metro 2b"] = "2B",
["aqua"] = "Aqua",
["aqua line"] = "Aqua",
["line 3"] = "3",
["metro 3"] = "3",
["mumbai metro line 3"] = "3",
["green"] = "Green",
["green line"] = "Green",
["line 4"] = "4",
["4a"] = "4A",
["line 4a"] = "4A",
["green line 4a"] = "4A",
["orange"] = "Orange",
["orange line"] = "Orange",
["line 5"] = "5",
["pink"] = "Pink",
["pink line"] = "Pink",
["line 6"] = "6",
["red"] = "Red",
["red line"] = "Red",
["line 7"] = "7",
["7a"] = "7A",
["line 7a"] = "7A",
["red line 7a"] = "7A",
["gold"] = "Gold",
["gold line"] = "Gold",
["line 8"] = "8",
["9"] = "9",
["line 9"] = "9",
["red line 9"] = "9",
["10"] = "10",
["line 10"] = "10",
["green line 10"] = "10",
["11"] = "11",
["line 11"] = "11",
["green line 11"] = "11",
["12"] = "12",
["line 12"] = "12",
["orange line 12"] = "12",
["purple"] = "Purple",
["purple line"] = "Purple",
["line 13"] = "13",
["magenta"] = "Magenta",
["magenta line"] = "Magenta",
["line 14"] = "14",
}
}
return p