mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-08-28 09:11:06 +00:00
feat: compress and use new update video
This commit is contained in:
@@ -3862,6 +3862,9 @@ div.day-empty {
|
|||||||
aspect-ratio: 16 / 9;
|
aspect-ratio: 16 / 9;
|
||||||
border-radius: 16px;
|
border-radius: 16px;
|
||||||
box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.3);
|
box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.3);
|
||||||
|
object-fit: cover;
|
||||||
|
display: block;
|
||||||
|
background: #000;
|
||||||
}
|
}
|
||||||
.whatsnewTextContainer {
|
.whatsnewTextContainer {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
Vendored
+1
@@ -1,4 +1,5 @@
|
|||||||
declare module "*.mp4";
|
declare module "*.mp4";
|
||||||
|
declare module "*.webm";
|
||||||
declare module "*.woff";
|
declare module "*.woff";
|
||||||
declare module "*.scss";
|
declare module "*.scss";
|
||||||
declare module "*.png";
|
declare module "*.png";
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -4,6 +4,7 @@ import { openPopup } from "./PopupManager";
|
|||||||
import { attachPopupMediaFullscreen } from "./attachPopupMediaFullscreen";
|
import { attachPopupMediaFullscreen } from "./attachPopupMediaFullscreen";
|
||||||
import { createPopupSocialFooter } from "./createPopupSocialFooter";
|
import { createPopupSocialFooter } from "./createPopupSocialFooter";
|
||||||
import { renderWhatsNewChangelogHtml } from "./whatsNewChangelog";
|
import { renderWhatsNewChangelogHtml } from "./whatsNewChangelog";
|
||||||
|
import updateVideo from "@/resources/update-video.webm";
|
||||||
|
|
||||||
export function OpenWhatsNewPopup(onDismissed?: () => void) {
|
export function OpenWhatsNewPopup(onDismissed?: () => void) {
|
||||||
const header = stringToHTML(
|
const header = stringToHTML(
|
||||||
@@ -17,13 +18,18 @@ export function OpenWhatsNewPopup(onDismissed?: () => void) {
|
|||||||
const imageContainer = document.createElement("div");
|
const imageContainer = document.createElement("div");
|
||||||
imageContainer.classList.add("whatsnewImgContainer");
|
imageContainer.classList.add("whatsnewImgContainer");
|
||||||
|
|
||||||
const heroImage = document.createElement("img");
|
const heroVideo = document.createElement("video");
|
||||||
heroImage.src =
|
heroVideo.src = updateVideo;
|
||||||
"https://raw.githubusercontent.com/BetterSEQTA/BetterSEQTA-Plus/main/src/resources/updateimage1.webp";
|
heroVideo.classList.add("whatsnewImg");
|
||||||
heroImage.alt = "BetterSEQTA+ update preview";
|
heroVideo.autoplay = true;
|
||||||
heroImage.classList.add("whatsnewImg");
|
heroVideo.muted = true;
|
||||||
imageContainer.appendChild(heroImage);
|
heroVideo.loop = true;
|
||||||
attachPopupMediaFullscreen(heroImage);
|
heroVideo.playsInline = true;
|
||||||
|
heroVideo.setAttribute("playsinline", "");
|
||||||
|
heroVideo.setAttribute("aria-label", "BetterSEQTA+ update preview");
|
||||||
|
imageContainer.appendChild(heroVideo);
|
||||||
|
attachPopupMediaFullscreen(heroVideo);
|
||||||
|
void heroVideo.play().catch(() => {});
|
||||||
|
|
||||||
const text = stringToHTML(/* html */ `
|
const text = stringToHTML(/* html */ `
|
||||||
<div class="whatsnewTextContainer" style="height: 50%;overflow-y: auto;">
|
<div class="whatsnewTextContainer" style="height: 50%;overflow-y: auto;">
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* Minimal allowlist for remote popup/API image (and media) URLs.
|
* Allowlist for popup/API media URLs.
|
||||||
* Only https: URLs are accepted; everything else is rejected.
|
* Accepts https: and same-extension chrome-extension:/moz-extension: URLs.
|
||||||
*/
|
*/
|
||||||
export function allowedPopupImageUrl(url: string | null | undefined): string | null {
|
export function allowedPopupImageUrl(url: string | null | undefined): string | null {
|
||||||
if (!url) return null;
|
if (!url) return null;
|
||||||
@@ -8,8 +8,20 @@ export function allowedPopupImageUrl(url: string | null | undefined): string | n
|
|||||||
if (!trimmed) return null;
|
if (!trimmed) return null;
|
||||||
try {
|
try {
|
||||||
const parsed = new URL(trimmed);
|
const parsed = new URL(trimmed);
|
||||||
if (parsed.protocol !== "https:") return null;
|
if (parsed.protocol === "https:") return parsed.href;
|
||||||
return parsed.href;
|
|
||||||
|
if (
|
||||||
|
parsed.protocol === "chrome-extension:" ||
|
||||||
|
parsed.protocol === "moz-extension:"
|
||||||
|
) {
|
||||||
|
const extId =
|
||||||
|
typeof chrome !== "undefined" && chrome.runtime?.id
|
||||||
|
? chrome.runtime.id
|
||||||
|
: undefined;
|
||||||
|
if (extId && parsed.hostname === extId) return parsed.href;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
} catch {
|
} catch {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user