Skip to content

Commit

Permalink
kick/chat(fix): ignore bufrd. lines for alt colors (#714)
Browse files Browse the repository at this point in the history
  • Loading branch information
AnatoleAM authored Jun 23, 2023
1 parent 02153b6 commit aa2719d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/site/kick.com/modules/chat/ChatMessage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export interface ChatMessageBinding {
const props = defineProps<{
bind: ChatMessageBinding;
parity?: "odd" | "even";
}>();
const emit = defineEmits<{
Expand All @@ -79,6 +80,7 @@ useEventListener(props.bind.usernameEl.parentElement, "click", () => {
// Process kick's text entries into a containerized token
function process(): void {
if (props.parity) props.bind.el.setAttribute("parity", props.parity);
props.bind.usernameEl.insertAdjacentElement("beforebegin", badgeContainer);
if (cosmetics.paints.size) {
Expand Down
6 changes: 3 additions & 3 deletions src/site/kick.com/modules/chat/ChatObserver.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<!-- Patch messages -->
<template v-for="bind of messages" :key="bind.id">
<ChatMessageVue :bind="bind" @open-card="onOpenUserCard" @vue:updated="onMessageRendered" />
<template v-for="(bind, i) of messages" :key="bind.id">
<ChatMessageVue :parity="i % 2 === 0 ? 'even' : 'odd'" :bind="bind" @open-card="onOpenUserCard" />
</template>

<!-- Modify user card -->
Expand Down Expand Up @@ -252,7 +252,7 @@ onUnmounted(() => {
<style lang="scss">
:root.seventv-alternating-chat-lines {
.seventv-chat-observer {
> div:nth-child(even) {
> div[parity="even"] {
background-color: hsla(0deg, 0%, 50%, 6%);
}
}
Expand Down

0 comments on commit aa2719d

Please sign in to comment.