mirror of
https://github.com/d0zingcat/BroadcastChannel.git
synced 2026-05-13 15:09:12 +00:00
chore: fix style
This commit is contained in:
@@ -638,6 +638,11 @@ audio::-webkit-media-controls-panel {
|
||||
box-shadow: var(--shadows);
|
||||
}
|
||||
|
||||
.content .sticker {
|
||||
box-shadow: none;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.content a:link,
|
||||
.content a:visited {
|
||||
line-break: anywhere;
|
||||
|
||||
@@ -11,29 +11,24 @@ const cache = new LRUCache({
|
||||
},
|
||||
})
|
||||
|
||||
function getVideoStickers($, item, { staticProxy, index, title }) {
|
||||
function getVideoStickers($, item, { staticProxy, index }) {
|
||||
return $(item).find('.js-videosticker_video')?.map((_index, video) => {
|
||||
const url = $(video).attr('src')
|
||||
const imgurl = $(video).find('img').attr('src')
|
||||
return `
|
||||
<div style="background-image: none; width: 256px;">
|
||||
<video src="${staticProxy + url}" width="100%" height="100%" alt="${title}" preload muted autoplay loop playsinline disablepictureinpicture >
|
||||
<img src="${staticProxy + imgurl}" alt="${title}" loading="${index > 15 ? 'eager' : 'lazy'}" />
|
||||
<video src="${staticProxy + url}" width="100%" height="100%" alt="Video Sticker" preload muted autoplay loop playsinline disablepictureinpicture >
|
||||
<img class="sticker" src="${staticProxy + imgurl}" alt="Video Sticker" loading="${index > 15 ? 'eager' : 'lazy'}" />
|
||||
</video>
|
||||
</div>
|
||||
`
|
||||
})?.get()?.join('')
|
||||
}
|
||||
|
||||
function getImageStickers($, item, { staticProxy, index, title }) {
|
||||
function getImageStickers($, item, { staticProxy, index }) {
|
||||
return $(item).find('.tgme_widget_message_sticker')?.map((_index, image) => {
|
||||
// const bgurl = $(image).attr('style').match(/url\(["'](.*?)["']/)?.[1]
|
||||
const url = $(image).attr('data-webp')
|
||||
return `
|
||||
<div class="image-preview-button image-preview-wrap">
|
||||
<img src="${staticProxy + url}" style="width: 256px;" alt="${title}" loading="${index > 15 ? 'eager' : 'lazy'}" />
|
||||
</div>
|
||||
`
|
||||
return `<img class="sticker" src="${staticProxy + url}" style="width: 256px;" alt="Sticker" loading="${index > 15 ? 'eager' : 'lazy'}" />`
|
||||
})?.get()?.join('')
|
||||
}
|
||||
|
||||
@@ -104,8 +99,8 @@ function getPost($, item, { channel, staticProxy, index = 0 }) {
|
||||
text: content?.text(),
|
||||
content: [
|
||||
$.html($(item).find('.tgme_widget_message_reply')?.wrapInner('<small></small>')?.wrapInner('<blockquote></blockquote>')),
|
||||
getImageStickers($, item, { staticProxy, index, title }),
|
||||
getVideoStickers($, item, { staticProxy, index, title }),
|
||||
getImageStickers($, item, { staticProxy, index }),
|
||||
getVideoStickers($, item, { staticProxy, index }),
|
||||
getImages($, item, { staticProxy, id, index, title }),
|
||||
getVideo($, item, { staticProxy, id, index, title }),
|
||||
content?.html(),
|
||||
|
||||
Reference in New Issue
Block a user