fixed animations, fixed auto-user-color for kick users

This commit is contained in:
liyunze 2026-08-13 16:07:41 +10:00
parent 9917b295ff
commit 9a9c04905b
5 changed files with 24 additions and 6 deletions

View file

@ -3,7 +3,7 @@
const configs = (function () { const configs = (function () {
const streamerBotSettings = { const streamerBotSettings = {
host: "127.0.0.1", host: "127.0.0.1",
port: 8080, port: 6968,
endpoint: "/", endpoint: "/",
}; };

View file

@ -529,9 +529,13 @@ class TaskList {
if (needs) { if (needs) {
if (!clone) { if (!clone) {
clone = this.#els.content.cloneNode(true); // Build the loop copy from data. Deep-cloning the live content also
// copies temporary width/opacity styles from enter animations,
// leaving the copy collapsed and causing a visible jump at the seam.
clone = this.#els.content.cloneNode(false);
clone.id = ""; clone.id = "";
clone.classList.add("scroll-clone"); clone.classList.add("scroll-clone");
this.#patchContainer(clone, this.#data, false);
this.#els.track.appendChild(clone); this.#els.track.appendChild(clone);
} else { } else {
this.#patchContainer(clone, this.#data, false); this.#patchContainer(clone, this.#data, false);

View file

@ -39,10 +39,11 @@ function taskColorFromSettings(sectionId) {
async function onChatMessage(data) { async function onChatMessage(data) {
const userColor = data.data.user.color; const userColor = data.data.user.color;
const userType = data.data.user.type;
if (userColor != undefined && userColor != "undefined") { if (userColor != undefined && userColor != "undefined") {
const userId = data.data.user.id; const userId = data.data.user.id;
const key = `twitch-${userId}`; const key = `${userType}-${userId}`;
localStorage.setItem(`${key}-color`, userColor); localStorage.setItem(`${key}-color`, userColor);
userColors[`${key}-color`] = userColor; userColors[`${key}-color`] = userColor;
@ -176,7 +177,12 @@ function onCustom(payload) {
taskList.focusTask(id, body.index); taskList.focusTask(id, body.index);
break; break;
case "edit": case "edit":
taskList.editTask(id, body.index, body.task, taskColorFromSettings(id)); taskList.editTask(
id,
body.index,
body.task,
taskColorFromSettings(id),
);
break; break;
case "remove": case "remove":
taskList.removeTask(id, body.index); taskList.removeTask(id, body.index);

View file

@ -505,9 +505,13 @@ class TaskList {
if (needs) { if (needs) {
if (!clone) { if (!clone) {
clone = this.#els.content.cloneNode(true); // Build the loop copy from data. Deep-cloning the live content also
// copies temporary height/opacity styles from enter animations,
// leaving the copy collapsed and causing a visible jump at the seam.
clone = this.#els.content.cloneNode(false);
clone.id = ""; clone.id = "";
clone.classList.add("scroll-clone"); clone.classList.add("scroll-clone");
this.#patchContainer(clone, this.#data, false);
this.#els.track.appendChild(clone); this.#els.track.appendChild(clone);
} else { } else {
this.#patchContainer(clone, this.#data, false); this.#patchContainer(clone, this.#data, false);

View file

@ -528,9 +528,13 @@ class TaskList {
if (needs) { if (needs) {
if (!clone) { if (!clone) {
clone = this.#els.content.cloneNode(true); // Build the loop copy from data. Deep-cloning the live content also
// copies temporary height/opacity styles from enter animations,
// leaving the copy collapsed and causing a visible jump at the seam.
clone = this.#els.content.cloneNode(false);
clone.id = ""; clone.id = "";
clone.classList.add("scroll-clone"); clone.classList.add("scroll-clone");
this.#patchContainer(clone, this.#data, false);
this.#els.track.appendChild(clone); this.#els.track.appendChild(clone);
} else { } else {
this.#patchContainer(clone, this.#data, false); this.#patchContainer(clone, this.#data, false);