-
Notifications
You must be signed in to change notification settings - Fork 24
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
[feature request] Add badge to names #109
Comments
Howdy, @RedSparr0w! Thank you so much for this feature request! If you don't mind, I'd like to ask some clarifying questions so I can better understand what you're asking for. Twitch has a concept of user badges, which are specific graphics an account can "earn" through various forms of participation, such as: These badges also include the official icons for mods, VIPs, etc. These badges come directly from Twitch's API, and would look consistent with their appearance in Twitch's native chat widget. The crown in Minechat and the VIP/horse/star/swords icons from the Frontend Horse theme are some custom SVGs that aren't sourced from Twitch. By badges, do you mean the official user badges from the Twitch API? |
Just the badges which appear in the twitch native chat widget. Which I think allows users to select up to 3 badges at once? Although it may be worth showing the badges as css |
I support allowing folks to display Twitch's native badges! Here are some thoughts I've got on the matter, in no particular order:
<li data-twitch-message="...">
<small data-twitch-message-reply>Replying to...</small>
<ul class="twitch-sender-badge-list">
<li data-twitch-sender-badge="BADGE ID" />
<li data-twitch-sender-badge="BADGE ID" />
<li data-twitch-sender-badge="BADGE ID" />
</ul>
<div class="twitch-chat-sender">SenderNameGoesHere</div>
<div class="twitch-chat-message">Message goes here</div>
</li>
|
If there's a limit to the number of badges shown (0,1,2, or 3), how does a theme author pick which ones are shown? They could pick which ones are shown as @RedSparr0w said above, by hiding the unwanted ones in CSS, but that requires all of them to be there, making a number of 1-3 in the query parameter quite weird. I propose the query parameter either include badge information in the DOM or doesn't, a true/false option. |
if there is a url for the badge image that comes from the api, it could be passed as a custom property on the element itself. this would allow the use of it as a background image if wanted. |
Yeah! You just made me think of a way to partially debunk my own claim. Then a theme can use that to do whatever it wants with that number. |
I was thinking something more along the lines of this: <!-- ... -->
<body data-twitch-show-badge-count="3">
<!-- ... -->
<li data-twitch-message="...">
<small data-twitch-message-reply>Replying to...</small>
<ul class="twitch-sender-badge-list">
<li data-twitch-sender-badge="BADGE ID" style="--badge-img: url('https://linkt-to-badge.com/badgeid');" />
<li data-twitch-sender-badge="BADGE ID" style="--badge-img: url('https://linkt-to-badge.com/badgeid');" />
<li data-twitch-sender-badge="BADGE ID" style="--badge-img: url('https://linkt-to-badge.com/badgeid');" />
</ul>
<div class="twitch-chat-sender">SenderNameGoesHere</div>
<div class="twitch-chat-message">Message goes here</div>
</li> this would actually allow you to change depending on the number: [data-twitch-show-badge-count="1"] .twitch-sender-badge-list li {
display: none;
}
[data-twitch-show-badge-count="1"] .twitch-sender-badge-list li:nth-child(1) {
display:inline-block;
background-image: var(--badge-img);
} |
Would be awesome if we could get the option to add badges before usernames.
(possibly with an option to enable/disable them)
Currently only
minechat
andfrontend-horse
have any badges as far as I am aware.Although they also only seem to allow for 1 badge per user.
The text was updated successfully, but these errors were encountered: