Module:Sandbox/Adil/TabbedProjects

Documentation for this module may be created at Module:Sandbox/Adil/TabbedProjects/doc

local p = {}
local html = require("mw.html")

function p.render(frame)
  -- Default content for each column if none is provided as parameters.
  local longterm = frame.args.longterm or [==[

* <span style="padding: 4px 0; line-height: 1.4; display:block;">User tags [[User:Adil/Category:User ur|Urdu]] and [[User:Adil/Category:User sd|Sindhi]]</span>
* <span style="padding: 4px 0; line-height: 1.4; display:block;">[[User:Adil/Go Pokémon Go (Hindi)|Go Pokémon Go (Hindi)]]</span>
* <span style="padding: 4px 0; line-height: 1.4; display:block;">[[Pokémon GO Fest 2017|Pokémon GO Fest]]s (2018 and onward)</span>
* <span style="padding: 4px 0; line-height: 1.4; display:block;">[[Pikachu's Indonesia Journey]] (after Bali)</span>
* <span style="padding: 4px 0; line-height: 1.4; display:block;">Individual articles for the [[Satoshi Tajiri: The Man Who Created Pokémon]] manga chapters</span>
* <span style="padding: 4px 0; line-height: 1.4; display:block;">Pokémon Primers: Ghost Types book</span>
* <span style="padding: 4px 0; line-height: 1.4; display:block;">Dan's page as he's contributed in official and unofficial capacity</span>
* <span style="padding: 4px 0; line-height: 1.4; display:block;">Pokémon in South Asia's eventual split - [[User:Adil/Pokémon in South Asia|Pokémon in South Asia]] and [[User:Adil/Pokémon in India|Pokémon in India]]</span>
* <span style="padding: 4px 0; line-height: 1.4; display:block;">[[Draft:Animated arcs]] and individual arc pages</span>
]==]

  local shortterm = frame.args.shortterm or [==[

* <span style="padding: 4px 0; line-height: 1.4; display:block;">[[Draft:Bulbapedia Introduction]] <small>''([[Bulbapedia:Introduction]])''</small></span>
* <span style="padding: 4px 0; line-height: 1.4; display:block;">[[Draft:Dealing with vandalism]] <small>''([[Bulbapedia:Dealing with vandalism]])''</small></span>
* <span style="padding: 4px 0; line-height: 1.4; display:block;">[[Draft:Group rights]] <small>''([[Help:Group rights]])''</small></span>
* <span style="padding: 4px 0; line-height: 1.4; display:block;">[[Draft:Project Games/Structure]] <small>''([[Bulbapedia:Project Games/Structure]])''</small></span>
* <span style="padding: 4px 0; line-height: 1.4; display:block;">[[Draft:Project Sidegames/Structure]] <small>''([[Bulbapedia:Project Sidegames/Structure]])''<br><br>For consistency, [[Bulbapedia:Manual of style/Anime]] and [[Bulbapedia:Manual of style/Manga]] should ideally be moved to [[Bulbapedia:Project Anime/Structure]] and [[Bulbapedia:Project Manga/Structure]]</small></span><br>
]==]

  -- Create the table element with the outer style.
  local tableElem = html.create("table")
  tableElem:attr("style", "border-radius: 16px; overflow: hidden; background: #ffffff; width: 85%; max-width: 1100px; margin: 1.5em auto; box-shadow: 0 1px 3px rgba(0,0,0,0.1);")

  -- Header row with the title.
  local tr = tableElem:tag("tr")
  tr:tag("th")
    :attr("colspan", "2")
    :attr("style", "background: #1e2761; color: white; padding: 8px; font-size: 16px; text-align: center; letter-spacing: 0.3px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif; font-weight: 500;")
    :wikitext("'''Current Projects'''")
    :done()
  tr:done()

  -- Row with column headings: Long-term (left) and Short-term (right).
  tr = tableElem:tag("tr")
  tr:tag("th")
    :attr("style", "background: #fafbfc; padding: 6px 12px; border-bottom: 1px solid #e5e7eb; color: #374151; font-weight: 500; width:60%; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;")
    :wikitext("Long-term")
    :done()
  tr:tag("th")
    :attr("style", "background: #fafbfc; padding: 6px 12px; border-bottom: 1px solid #e5e7eb; color: #374151; font-weight: 500; width:40%; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;")
    :wikitext("Short-term")
    :done()
  tr:done()

  -- Content row with two cells: the left cell for long-term projects and the right cell for short-term projects.
  tr = tableElem:tag("tr")
  tr:tag("td")
    :attr("style", "background: #ffffff; padding: 16px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;")
    :wikitext(longterm)
    :done()
  tr:tag("td")
    :attr("style", "background: #ffffff; padding: 16px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;")
    :wikitext(shortterm)
    :done()
  tr:done()

  -- Bottom row for a separator.
  tr = tableElem:tag("tr")
  tr:tag("td")
    :attr("colspan", "2")
    :attr("style", "background: #1e2761; height: 2px;")
    :done()
  tr:done()

  return tableElem:allDone()
end

return p