showmy.chat
On-Demand, Themeable Twitch Chat Overlays For Everyone
This is the repo for showmy.chat, an on-demand themed Twitch chat overlay generator. These chat overlays can be used in broadcasting software such as OBS.
What does this mean? It means that anyone can go to showmy.chat, enter the name of their Twitch channel, and select a theme, and they'll get a URL they can use as a source in their broadcasting software of choice to display a live chat feed!
Goals
showmy.chat is intended to be a quick, easy, plug-and-play solution for getting themed chat overlays right out of the box. Because of this, it doesn't currently support any customization beyond selecting your theme. This could change later, so long as the user experience of generating your themed overlay remains quick and easy.
Contributing
showmy.chat is thrilled to accept contributions! Please read the contributing guide to see how you can contribute!
Colophon
showmy.chat is built with the Eleventy static site generator ā in particular, using the Eleventy Serverless functionality. It is hosted with gratitude on Netlify.
showmy.chat overlays leverage ComfyJS, which in turn is built on top of tmi.js, to receive and parse messages. Major thanks to everyone in these communities who have done the hard work to ensure that interacting with Twitch's chat API is as easy as possible.
Finally, showmy.chat is indebted to Style Stage, Stephanie Eckles's modern spiritual successor to CSS Zen Garden, for inspiration. Style Stage demonstrates how the same markup can be styled in a plethora of creative ways, and leverages community-contributed stylesheets. showmy.chat was initially conceived of as "What if Style Stage, but for Twitch chat overlays?"
āØ
Contributors Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!
Styleguide
To keep the formatting/code style consistent as more people contribute to this project, I propose automating (part of) it.
I asked if there was a styleguide on Discord, and @BenDMyers said:
This (partial) automation can be done with tools like:
Prettier for formatting.
Possibly
If linting tools are used, it is important to use the matching
*-config-prettier
(like stylelint-config-prettier for stylelint) to prevent conflicts between the linter and Prettier. Leaving all formatting concerns up to Prettier.I'd be happy to implement the tools while we discuss what rules to apply here.
set up linting and formatting
rel #60
Took the suggestions in #60 and the style patterns already in this codebase as a base.
Prettier for formatting. - "useTabs": true, - "singleQuote": true, - "bracketSpacing": false
ESLint for JavaScript linting. - The
eslint:recommended
rules as base. Those are the base rules that are listed at https://eslint.org/docs/rules/ and marked with a checkmark. - Added a"no-unused-vars": ["error", { "args": "none" }]
because functions with named and unused arguments are used in the codebase. - Markedsrc/scripts/bttvIntegration.js
andsrc/scripts/handleChat.js
es ESM, the rest is CommonJS by defaultStylelint for CSS linting - The
styleline:recommended
rules as base - Used thepostcss-html
syntax to also check the inline<style>
tags in HTML files.All tools have a *ignore file based on
.gitignore
. Sadly, they don't support "take gitignore as a base for this file", so it's duplicated, but those files will very rarely be touched.Configuration for showing the "n" most recent messages
Need
Some users would only like to display the n latest messages - especially in the case of large, obtrusive themes such as
animalese
andcards
. This can be handled theme-level ā for instance,cards
currently displays the five most recent messages using:nth-last-child
:However, this isn't ideal, because it hardcodes the number of messages that can be displayed, and it does so in a way that requires some weird CSS overrides to change.
showmy.chat should provide a query parameter through which users can specify how many of the most recent messages to display. If this query parameter is not provided, then the default behavior should be to show all messages ā this way, users strictly opt in to only showing a subset of their messages.
Suggested API
showLatestMessages
, and its expected value should be an integer greater than zero.Steps
handleChat
scriptshowLatestMessages
query parameter has been provided, and is an integer greater than0
, scripts delete older messagescards
, I think?)cards
theme of changed behaviorAllow displaying multiple roles (frontend-horse)
Added multiple roles display for frontend-horse.
founder ā mod ā vip ā subscriber
Generated from the following scss:
Bump jsdom from 16.7.0 to 19.0.0
Bumps jsdom from 16.7.0 to 19.0.0.
Release notes
Sourced from jsdom's releases.
Changelog
Sourced from jsdom's changelog.
Commits
a604d67
Version 19.0.0e46f76f
Fix crash when calling window.close() inside load event listenerf9de3fd
Do not track location information for fragment-parsed nodesa61fdb8
Version 18.1.115cbed6
Fix connectedCallback with document fragments79ff734
Version 18.1.0a303721
Add AbortSignal's reason property158ada2
Update web platform tests + minor fixesc98e0f5
Fix changelog username typob1ce1af
Version 18.0.1Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)Allow users to bring their own styles
Allow users to provide their own CSS. That way they can either tweak a theme to their liking, or even use it to bring their own custom theme. (maybe this can be used to build custom themes on a base of #44)
This raises a few security questions. It would mean executing CSS on the user's device. While CSS is probably fine, executing any code that can be user-supplied warrants a closer look at how that is handled.
Demo page not working during local development
Pages like http://localhost:8080/c/showmychat?theme=default&DEMO=true remain unpopulated. The CSS gets applied, as you can see the background change when you select a different theme, but messages never show up.
The errors in the browser console:
I think what's happening is the errors in the console stop JS executions, and the script that should post faked messages never gets a chance to run.
the console errors is textform:
Access to fetch at 'https://api.betterttv.net/3/cached/users/twitch/762083631' from origin 'http://localhost:8080' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header has a value 'https://localhost:8080' that is not equal to the supplied origin. Have the server send the header with a valid value, or, if an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled. bttvIntegration.js:80 GET https://api.betterttv.net/3/cached/users/twitch/762083631 net::ERR_FAILED 404 defaultFetch @ bttvIntegration.js:80 getBttvChannelEmoteDict @ bttvIntegration.js:67 init @ handleChat.js:228 await in init (async) (anonymous) @ handleChat.js:233 bttvIntegration.js:80Uncaught (in promise) TypeError: Failed to fetch at defaultFetch (bttvIntegration.js:80:25) at getBttvChannelEmoteDict (bttvIntegration.js:67:32) at init (handleChat.js:228:24) defaultFetch @ bttvIntegration.js:80 getBttvChannelEmoteDict @ bttvIntegration.js:67 init @ handleChat.js:228 await in init (async) (anonymous) @ handleChat.js:233
Deletion of messages after banning the author is not being reflected
When a user first gets banned and then their message gets deleted, the chat view does update accordingly: the deleted message persists.
Expected behavior
A deleted message should be removed from the chat view, even if its author has been banned before.
Additional info
According to @BenDMyers, first deleting the message (and then banning the user) works fine. Observed during maxcellw's twitch stream.
Add HorseHorseHorse theme
The newest horse-themed theme is ready get out there and mingle with some chats. Features include:
document linting setup
Adds extra details to CONTRIBUTING.md about the used linting tools, instructions on how to disable rules, instructions on how to ignore the pre-commit hook, editor extension information.
Also adds a part to the colofon about them.
Both files include a markdown footnote that enumerates the tools used, so this PR also adds support for markdown footnotes, by adding a
markdown-it
configuration that uses the footnotes package.Allow users to specify how long a message should stay on screen
Resolves #15 ā a fairly old issue.
This pull request introduces a
clearMessageAfter
query parameter for the overlays, which accepts a positive integer. This is treated as number of milliseconds after which a message should be removed rom the overlay (assuming it hasn't already been deleted by, for instance, mods)Messages that are about to be deleted are now given the attribute
data-twitch-message-status="deleting"
, as a style hook for themes to begin animating/transitioning for the message's departure. Because there's now a lot going on with message deletion, the approach has been standardized with a newremoveMessage
helper function.An example outbound animation can be seen in the
default
andanimalese
themes.Create progress bar for fundraisers
Now that Twitch has a fundraiser feature built in, I'm hoping they'll eventually expose it via API. It'd be great if we could get easy-to-use progress bars.
Allow config for buffering messages
Inspired by @TheoBr's https://solidchat.vercel.app/
In really fast chats, streamers might want to buffer their chat overlay so messages come up in bursts. We should consider having a system for buffering messages so that they can be shown in bursts.
Suggested API:
bufferMessages
which, if provided, receives an integer count of milliseconds. Every n milliseconds, the buffer is flushed to the overlay display.Document available css custom properties available for developers
Currently, the custom properties available to developers for each message are only available when the DOM is inspected. it would be great to have some documentation surrounding these properties.
Support displaying pronouns from Alejo's Twitch Chat Pronouns API
Alejo's Twitch Chat Pronouns service allows folks to authenticate with their Twitch accounts and set their pronouns. Anyone viewing a Twitch chat with the service's browser extension can see the pronouns alongside chatters' usernames if set. Pronouns are exposed via an API, which Alejo has specified in his server that he is comfortable with projects such as chat overlays so long as results are cached for "at least 10 to 15 minutes."
This pull request introduces a
showPronouns
overlay configuration query parameter which, when enabled, queries Alejo's service and displays pronouns alongside the sender's username. Additionally, the message list item will be given adata-twitch-sender-pronouns
attribute with the pronouns, to enable pronoun-specific styling within themes. If the user has not set their pronouns, no pronouns will be displayed for them. If someone sends a message at least 15 minutes after their first message while the overlay's active, the overlay will revalidate and update the cache if necessary.If the pronoun service is down, the overlay should (š¤š») handle it gracefully and simply not display the pronoun.