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(MatchTicker): Adding new match ticker component style #4363

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

KilMer56
Copy link
Contributor

@KilMer56 KilMer56 commented Jun 21, 2024

Summary

This is setting up the new Match Ticker structure and visuals we want to use for the Dota2 Main Page. It will most likely be extended to other pages and wikis, but the scope of this one is only this context.

How did you test this change?

In my dev environment: http://killian.wiki.tldev.eu/rocketleague/index.php?title=Template:GameList/Dev
Currently testing it on live to see how it would look like

@KilMer56 KilMer56 added the c: match_ticker match2 based match ticker label Jun 21, 2024
@KilMer56 KilMer56 requested a review from Rathoz June 21, 2024 08:51
@KilMer56 KilMer56 self-assigned this Jun 21, 2024
local NOW = os.date('%Y-%m-%d %H:%M', os.time(os.date('!*t') --[[@as osdateparam]]))

---Display class for the header of a match ticker
---@class MatchTickerHeader
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fyi defining the class with the same name as in the old version will cause annotation warnings ;)

Comment on lines +264 to +281
for platformName, targetStream in pairs(streams) do
local streamLink = mw.ext.StreamPage.resolve_stream(platformName, targetStream)

if streamLink then
-- Default values
local url = 'Special:Stream/' .. platformName .. '/' .. streamLink
local icon = '<i class="lp-icon lp-icon-21 lp-' .. platformName .. '"></i>'

-- TL.net specific
if platformName == 'stream' then
url = 'https://tl.net/video/streams/' .. streamLink
end

streamLinks = streamLinks .. '[[' .. url .. '|' .. icon .. ']]'
end
end

links:wikitext(streamLinks)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't know if this is the correct way of doing stream links. Currently, the logic is in the Countdown.js logic but after talking to FO, we decided that it could be done on the Lua side of things. Could maybe lie somewhere else.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo we should move it into module countdown or a new module then so it is accessible easily from other places
could also rewrite the countdown module for it
mind there is a PR to rewrite countdown module anyways with #3111
if you want i can rework that old PR (split it into several parts) and integrate the stream link building there (as sep. function) thursday/friday

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're willing to do it, I'm fine with it. Tell me if I can help with that

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, and the countdown module can use it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just saw it is already in here #4372

@KilMer56 KilMer56 marked this pull request as ready for review June 26, 2024 07:38
@KilMer56 KilMer56 changed the title Draft: feat(MatchTicker): Adding new match ticker component style feat(MatchTicker): Adding new match ticker component style Jun 26, 2024
Copy link
Collaborator

@hjpalpha hjpalpha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2024-06-26 144806

what is the placeholder on the right supposed to show?

also i personally think the winner should be highlighted somehow to make clear it is the winner
(personally i am fine with kicking the gradient bg stuff fwiw, just think that some indication should be given)

overall i like the new design, looks clean :)

url = 'https://tl.net/video/streams/' .. streamLink
end

streamLinks = streamLinks .. '[[' .. url .. '|' .. icon .. ']]'
Copy link
Collaborator

@hjpalpha hjpalpha Jun 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could use module:page here (can be ignored if we first do the countdown update)

also i think the js adds a space between the icons

also doesn't support 'stream' (needs external link, this only uses internal ones)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The space between the icons is dealt with in the CSS
For the stream yes good catch, can update it depending on when we want to do the countdown update

Comment on lines +339 to +344
function Match:create()
self.root:node(self:standardMatchRow())
self.root:node(self:detailsRow())

return self.root
end
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just as fyi: we are dropping BR support here, which atm is irrelevant since we don't have any BR support in match2 yet (except some edge cases on sc2 which i would want to exclude on match ticker anyways :P)

@KilMer56
Copy link
Contributor Author

@hjpalpha

The placeholder is supposed to show either the date or the countdown. Here it shows nothing since the matches in devs are old and not marked as finished, will give some tests on live to see if it behaves correctly.

For the winner, you're right I will put the winner in bold for now and we can see later on to improve the visibility over this!

gap: 0.25rem;
}

.timer-hidden {
Copy link
Contributor

@liquidely liquidely Jun 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is a modifier class, you'd want to write it as timer--hidden.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed it as it should be in the other MR

border-radius: 0.25rem;
font-weight: bold;

&.timer-object-countdown-live {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could simplify this to countdown--live or is--live

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because Countdown.js is using that class. Will update it in the other MR then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: match_ticker match2 based match ticker
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants