tg stickers v2
This commit is contained in:
@@ -5624,7 +5624,8 @@ body[type='login'] {
|
|||||||
position: relative;
|
position: relative;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
max-height: 135px;
|
min-height: 200px;
|
||||||
|
max-height: 200px;
|
||||||
background: var(--dropdown-bg);
|
background: var(--dropdown-bg);
|
||||||
border: 1px solid var(--black);
|
border: 1px solid var(--black);
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
@@ -5640,6 +5641,7 @@ body[type='login'] {
|
|||||||
|
|
||||||
/* Tabbed mode — switched to column layout by JS when packs are present */
|
/* Tabbed mode — switched to column layout by JS when packs are present */
|
||||||
.emoji-picker.has-tabs {
|
.emoji-picker.has-tabs {
|
||||||
|
min-height: 200px;
|
||||||
max-height: 200px;
|
max-height: 200px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -8967,9 +8969,18 @@ span.badge.badge-current {
|
|||||||
}*/
|
}*/
|
||||||
|
|
||||||
.sidebar-comment-img.emoji {
|
.sidebar-comment-img.emoji {
|
||||||
height: auto;
|
height: 32px;
|
||||||
max-width: 60px !important;
|
width: auto;
|
||||||
|
max-width: 200px !important;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
|
object-fit: contain;
|
||||||
|
}
|
||||||
|
|
||||||
|
video.sidebar-comment-img.emoji {
|
||||||
|
max-width: 200px !important;
|
||||||
|
vertical-align: middle;
|
||||||
|
object-fit: contain;
|
||||||
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar-activity .video-embed-wrap {
|
.sidebar-activity .video-embed-wrap {
|
||||||
|
|||||||
@@ -4155,7 +4155,9 @@ class CommentSystem {
|
|||||||
// Rebuild content only if the cache has been updated since last build
|
// Rebuild content only if the cache has been updated since last build
|
||||||
buildPickerContent();
|
buildPickerContent();
|
||||||
picker.style.display = ''; // Reset to CSS default (flex)
|
picker.style.display = ''; // Reset to CSS default (flex)
|
||||||
requestAnimationFrame(() => picker.scrollIntoView({ behavior: 'smooth', block: 'nearest' }));
|
requestAnimationFrame(() => requestAnimationFrame(() =>
|
||||||
|
window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' })
|
||||||
|
));
|
||||||
closeHandler = (ev) => {
|
closeHandler = (ev) => {
|
||||||
if (!picker.contains(ev.target) && ev.target !== trigger) {
|
if (!picker.contains(ev.target) && ev.target !== trigger) {
|
||||||
picker.style.display = 'none';
|
picker.style.display = 'none';
|
||||||
@@ -4225,7 +4227,9 @@ class CommentSystem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
container.appendChild(picker);
|
container.appendChild(picker);
|
||||||
requestAnimationFrame(() => picker.scrollIntoView({ behavior: 'smooth', block: 'nearest' }));
|
requestAnimationFrame(() => requestAnimationFrame(() =>
|
||||||
|
window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' })
|
||||||
|
));
|
||||||
|
|
||||||
// Set up close handler
|
// Set up close handler
|
||||||
// Set up close handler
|
// Set up close handler
|
||||||
|
|||||||
@@ -25,7 +25,11 @@
|
|||||||
|
|
||||||
const renderEmoji = (match, name) => {
|
const renderEmoji = (match, name) => {
|
||||||
if (customEmojis[name]) {
|
if (customEmojis[name]) {
|
||||||
return `<img class="sidebar-comment-img emoji" src="${customEmojis[name]}" alt="${name}" title=":${name}:" loading="lazy">`;
|
const url = customEmojis[name];
|
||||||
|
if (url.endsWith('.webm')) {
|
||||||
|
return `<video class="sidebar-comment-img emoji" src="${url}" title=":${name}:" autoplay loop muted playsinline></video>`;
|
||||||
|
}
|
||||||
|
return `<img class="sidebar-comment-img emoji" src="${url}" alt="${name}" title=":${name}:" loading="lazy">`;
|
||||||
}
|
}
|
||||||
return match;
|
return match;
|
||||||
};
|
};
|
||||||
@@ -37,6 +41,15 @@
|
|||||||
return div.innerHTML;
|
return div.innerHTML;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const playSidebarEmojiVideos = (container) => {
|
||||||
|
if (!container) return;
|
||||||
|
container.querySelectorAll('video.emoji').forEach(v => {
|
||||||
|
v.play().catch(() => {
|
||||||
|
v.addEventListener('canplay', () => v.play().catch(() => {}), { once: true });
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
const ytOembedCache = new Map(); // videoId -> meta object
|
const ytOembedCache = new Map(); // videoId -> meta object
|
||||||
const ytOembedPending = new Map(); // videoId -> Promise
|
const ytOembedPending = new Map(); // videoId -> Promise
|
||||||
|
|
||||||
@@ -592,8 +605,9 @@
|
|||||||
attachMediaLoadListeners(container);
|
attachMediaLoadListeners(container);
|
||||||
checkOverflow();
|
checkOverflow();
|
||||||
fetchSidebarYoutubeTitles(container);
|
fetchSidebarYoutubeTitles(container);
|
||||||
// Auto-play converted GIF videos
|
// Auto-play converted GIF videos and webm emoji stickers
|
||||||
container.querySelectorAll('video.autoplay-gif').forEach(v => { v.autoplay = true; v.muted = true; v.play().catch(() => { v.addEventListener('canplay', () => v.play().catch(() => { }), { once: true }); }); });
|
container.querySelectorAll('video.autoplay-gif').forEach(v => { v.autoplay = true; v.muted = true; v.play().catch(() => { v.addEventListener('canplay', () => v.play().catch(() => { }), { once: true }); }); });
|
||||||
|
playSidebarEmojiVideos(container);
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -713,8 +727,9 @@
|
|||||||
attachMediaLoadListeners(node);
|
attachMediaLoadListeners(node);
|
||||||
checkOverflow(node);
|
checkOverflow(node);
|
||||||
fetchSidebarYoutubeTitles(node);
|
fetchSidebarYoutubeTitles(node);
|
||||||
|
playSidebarEmojiVideos(node);
|
||||||
});
|
});
|
||||||
// Auto-play converted GIF videos
|
// Auto-play converted GIF videos and webm emoji stickers
|
||||||
container.querySelectorAll('video.autoplay-gif').forEach(v => { v.autoplay = true; v.muted = true; v.play().catch(() => { v.addEventListener('canplay', () => v.play().catch(() => { }), { once: true }); }); });
|
container.querySelectorAll('video.autoplay-gif').forEach(v => { v.autoplay = true; v.muted = true; v.play().catch(() => { v.addEventListener('canplay', () => v.play().catch(() => { }), { once: true }); }); });
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -780,6 +795,7 @@
|
|||||||
attachMediaLoadListeners(node);
|
attachMediaLoadListeners(node);
|
||||||
checkOverflow(node);
|
checkOverflow(node);
|
||||||
fetchSidebarYoutubeTitles(container);
|
fetchSidebarYoutubeTitles(container);
|
||||||
|
playSidebarEmojiVideos(node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user