Skip to content

Commit bf26115

Browse files
committed
refactor + video in description
1 parent cbc8d5b commit bf26115

File tree

5 files changed

+174
-126
lines changed

5 files changed

+174
-126
lines changed

popup/index.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,28 @@ function createScriptButton(script, isFavorite = false) {
324324
if (script.description?.img) {
325325
tooltip.innerHTML += `<img src="${script.description.img}" style="width:80vw" />`;
326326
}
327+
if (script.description?.video) {
328+
let video = document.createElement("video");
329+
video.src = script.description.video;
330+
video.autoplay = true;
331+
video.muted = true;
332+
video.loop = true;
333+
video.style.width = "80vw";
334+
video.addEventListener("loadeddata", () => {
335+
video.pause();
336+
video.currentTime = 0;
337+
video.play();
338+
});
339+
tooltip.addEventListener("mouseenter", () => {
340+
video.pause();
341+
video.currentTime = 0;
342+
video.play();
343+
});
344+
tooltip.addEventListener("mouseleave", () => {
345+
video.pause();
346+
});
347+
tooltip.appendChild(video);
348+
}
327349
if (script.changeLogs) {
328350
let tx = "";
329351
let dates = Object.keys(script.changeLogs).sort();

scripts/magnify_image.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@ export default {
1212
Auto find large version of image to show.
1313
<br/></br>
1414
<p style="color:yellow">3 ways to use:</p>
15-
<ul>
15+
<ol>
1616
<li>Right click any image</li>
1717
<li>Left click this feature and choose image</li>
1818
<li>Double Ctrl on any image (require autorun)</li>
19-
</ul>
19+
</ol>
2020
`,
2121
vi: `Xem bất kỳ hình ảnh nào trong cửa sổ phóng đại<br/>
2222
Nơi bạn có thể phóng to/thu nhỏ, xoay, kéo thả, ...<br/>
2323
Tự động tìm ảnh chất lượng cao để hiển thị.
2424
<br/></br>
2525
<p style="color:yellow">3 cách sử dụng:</p>
26-
<ul>
26+
<ol>
2727
<li>Chuột phải vào ảnh</li>
2828
<li>Click chức năng và click chọn ảnh</li>
2929
<li>Ctrl 2 lần vào ảnh (cần mở tự động chạy)</li>
30-
</ul>`,
30+
</ol>`,
3131
img: "",
3232
},
3333

0 commit comments

Comments
 (0)