Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(mainpage): new Valorant main page #5330

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from
Draft
57 changes: 57 additions & 0 deletions components/filter_buttons/wikis/valorant/filter_buttons_config.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
-- @Liquipedia
-- wiki=valorant
-- page=Module:FilterButtons/Config
--
-- Please see https://github.com/Liquipedia/Lua-Modules to contribute
--

local Tier = require('Module:Tier/Utils')
local Config = {}

---@type FilterButtonCategory[]
Config.categories = {
{
name = 'liquipediatier',
property = 'liquipediaTier',
load = function(category)
category.items = {}
for _, tier in Tier.iterate('tiers') do
table.insert(category.items, tier.value)
end
end,
defaultItems = { '1', '2', '3' },
transform = function(tier)
return Tier.toName(tier)
end,
expandKey = 'region',
},
{
name = 'region',
property = 'region',
expandable = true,
items = {
'Europe', 'North America', 'Korea', 'China', 'Japan', 'Latin America North',
'Latin America South', 'Taiwan', 'Oceania', 'Brazil', 'Other',
},
defaultItems = { 'Europe', 'North America', 'Korea', 'China', 'Brazil', 'Other' },
transform = function(region)
local regionToShortName = {
['Europe'] = 'eu',
['North America'] = 'na',
['Korea'] = 'kr',
['China'] = 'ch',
['Japan'] = 'jp',
['Latin America North'] = 'latam n',
['Latin America South'] = 'latam s',
['Taiwan'] = 'tw',
['Oceania'] = 'oce',
['Brazil'] = 'br',
['Other'] = 'other',
}
return regionToShortName[region]
end,
},
}

return Config
191 changes: 191 additions & 0 deletions components/main_page/wikis/valorant/main_page_layout_data.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
---
-- @Liquipedia
-- wiki=valorant
-- page=Module:MainPageLayout/data
--
-- Please see https://github.com/Liquipedia/Lua-Modules to contribute
--

local CONTENT = {
theGame = {
heading = 'The Game',
body = '{{Liquipedia:The Game}}',
padding = true,
boxid = 1503,
},
transfers = {
heading = 'Transfers',
body = '{{Transfer List|limit=15}}<div style="display:block; text-align:center; padding:0.5em;">' ..
'<div style="display:inline; float:left; font-style:italic;">[[#Top|Back to top]]</div>' ..
'<div style="display:inline; float:right;" class="plainlinks smalledit">' ..
'&#91;[[Special:EditPage/Player Transfers/{{CURRENTYEAR}}/{{CURRENTMONTHNAME}}|edit]]&#93;</div>' ..
'<div style="white-space:nowrap; display:inline; margin:0 10px; font-size:15px; font-style:italic;">' ..
'[[Portal:Transfers|See more transfers]]<span style="font-style:normal; padding:0 5px;">&#8226;</span>' ..
'[[Transfer query]]</div><div style="white-space:nowrap; display:inline; margin:0 10px; font-size:15px; ' ..
'font-style:italic;">[[Special:RunQuery/Transfer|Input Form]]<span style="font-style:normal; ' ..
'padding:0 5px;">&#8226;</span>[[Portal:Rumours|Rumours]]</div></div>',
boxid = 1509,
},
specialEvents = {
noPanel = true,
body = '{{Liquipedia:Special Event}}',
},
filterButtons = {
noPanel = true,
body = '<div style{{=}}"width:100%;margin-bottom:8px;">' ..
'{{#invoke:Lua|invoke|module=FilterButtons|fn=getFromConfig}}</div>',
},
matches = {
heading = 'Matches',
body = '{{#invoke:Lua|invoke|module=Widget/Factory|fn=fromTemplate|widget=Match/Ticker/Container}}' ..
'<div style{{=}}"white-space:nowrap; display: block; margin:0 10px; font-size:15px; font-style:italic; ' ..
'text-align:center;">[[Liquipedia:Matches|See more matches]]</div>',
padding = true,
boxid = 1507,
},
tournaments = {
heading = 'Tournaments',
body = '{{#invoke:Lua|invoke|module=Widget/Factory|fn=fromTemplate|widget=Tournaments/Ticker' ..
'|upcomingDays=21|completedDays=14}}',
padding = true,
boxid = 1508,
},
}

return {
banner = {
lightmode = 'VALORANT.svg',
darkmode = 'VALORANT-darkmode.svg',
},
metadesc = 'The VALORANT esports wiki covering everything from players, teams and transfers, ' ..
'to tournaments and results, to maps, weapons, and agents.',
title = 'VALORANT',
navigation = {
{
file = 'ShopifyRebellion VCT Game Changers Championship 2024.jpg',
title = 'Teams',
link = 'Portal:Teams',
count = {
method = 'LPDB',
table = 'team',
},
},
{
file = 'NTMR Infekted at OWCS 2024 Finals.jpg',
title = 'Transfers',
link = 'Portal:Transfers',
count = {
method = 'LPDB',
table = 'transfer',
},
},
{
file = 'Valorant-champions-trophy-2024-2.jpeg',
title = 'Tournaments',
link = 'Portal:Tournaments',
count = {
method = 'LPDB',
table = 'tournament',
},
},
{
file = 'Raze-lockin-2023.jpeg',
title = 'Agents',
link = 'Portal:Agents',
count = {
method = 'LPDB',
table = 'datapoint',
conditions = '[[type::hero]]',
},
},
{
file = 'Stalk3r OWCS Finals 2024.jpeg',
title = 'Players',
link = 'Portal:Players',
count = {
method = 'LPDB',
table = 'player',
},
},
{
file = 'Valorant-champions-seoul-2024.jpg',
title = 'Statistics',
link = 'Portal:Statistics',
},
{
file = 'Sunset Map.png',
title = 'Maps',
link = 'Portal:Maps',
count = {
method = 'LPDB',
table = 'datapoint',
conditions = '[[type::map]]',
},
},
},
layouts = {
main = {
{ -- Left
size = 6,
children = {
{
mobileOrder = 2,
content = CONTENT.specialEvents,
},
{
mobileOrder = 4,
content = CONTENT.transfers,
},
{
mobileOrder = 7,
content = CONTENT.wantToHelp,
},
}
},
{ -- Right
size = 6,
children = {
{
mobileOrder = 3,
children = {
{
children = {
{
noPanel = true,
content = CONTENT.filterButtons,
},
},
},
{
size = 6,
children = {
{
noPanel = true,
content = CONTENT.matches,
},
},
},
{
size = 6,
children = {
{
noPanel = true,
content = CONTENT.tournaments,
},
},
},
},
},
},
},
{
children = {
{
mobileOrder = 8,
content = CONTENT.theGame,
},
},
},
},
},
}
6 changes: 6 additions & 0 deletions stylesheets/commons/Banner.less
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@
}
}

.wiki-valorant & {
@media ( min-width: 768px ) {
background: url( https://liquipedia.net/commons/images/a/a6/Valorant-bg-2.png ) no-repeat center / cover;
}
}

@media ( min-width: 768px ) {
box-shadow: 0 0.0625rem 0.25rem 0 rgba( 0, 0, 0, 0.12 );
height: 8.875rem;
Expand Down
Loading