diff --git a/src/interface/pages/settings.svelte b/src/interface/pages/settings.svelte index 6c287234..5be5f0d2 100644 --- a/src/interface/pages/settings.svelte +++ b/src/interface/pages/settings.svelte @@ -1,43 +1,44 @@ -
-
-
+
+
+
- Light logo + Light logo - - + + {#if !standalone} - - + + + + + {/if}
- +
{#if showColourPicker} - { showColourPicker = false }} /> + { + showColourPicker = false; + }} + /> {/if} -
\ No newline at end of file +
diff --git a/src/resources/server-video.mp4 b/src/resources/server-video.mp4 new file mode 100644 index 00000000..d0bdb158 Binary files /dev/null and b/src/resources/server-video.mp4 differ diff --git a/src/seqta/utils/AboutMinecraftServer.ts b/src/seqta/utils/AboutMinecraftServer.ts new file mode 100644 index 00000000..c7f419a4 --- /dev/null +++ b/src/seqta/utils/AboutMinecraftServer.ts @@ -0,0 +1,200 @@ +import { settingsState } from "./listeners/SettingsState"; +import { animate, stagger } from "motion"; +import stringToHTML from "./stringToHTML"; + +export async function DeleteWhatsNew() { + const bkelement = document.getElementById("whatsnewbk"); + const popup = document.querySelector(".whatsnewContainer") as HTMLElement; + + if (!settingsState.animations) { + bkelement?.remove(); + return; + } + + animate( + [popup, bkelement!], + { opacity: [1, 0], scale: [1, 0] }, + { ease: [0.22, 0.03, 0.26, 1] }, + ).then(() => { + bkelement?.remove(); + }); +} + +export function OpenMinecraftServerPopup() { + if (!document.querySelector('link[href*="minecraftia"]')) { + const fontLink = document.createElement("link"); + fontLink.href = "https://fonts.cdnfonts.com/css/minecraftia"; + fontLink.rel = "stylesheet"; + document.head.appendChild(fontLink); + } + + const background = document.createElement("div"); + background.id = "whatsnewbk"; + background.classList.add("whatsnewBackground"); + + const container = document.createElement("div"); + container.classList.add("whatsnewContainer"); + + var header: any = stringToHTML( + /* html */ + `
+

Minecraft Server

+

The official BetterSEQTA+ Minecraft Server

+
`, + ).firstChild; + + let imagecont = document.createElement("div"); + imagecont.classList.add("whatsnewImgContainer"); + + let video = document.createElement("video"); + let source = document.createElement("source"); + + source.setAttribute( + "src", + "https://raw.githubusercontent.com/BetterSEQTA/BetterSEQTA-Plus/main/src/resources/server-video.mp4", + ); + video.autoplay = true; + video.muted = true; + video.loop = true; + video.appendChild(source); + video.classList.add("whatsnewImg"); + imagecont.appendChild(video); + + let textcontainer = document.createElement("div"); + textcontainer.classList.add("whatsnewTextContainer"); + + let text = stringToHTML(/* html */ ` +
+

Join our community in Minecraft!

+

Join the official BetterSEQTA+ Minecraft Server community now!

+ +

Server Features

+
    +
  • SMP as our first release gamemode
  • +
  • Community events and competitions
  • +
  • Custom world generation
  • +
  • Shop system with buying and selling
  • +
  • Regular updates and maintenance
  • +
  • The End dimension will be enabled during an upcoming live event
  • +
+ +

+ mc.betterseqta.org +

+

+ Version: 1.21.4 +

+
+`).firstChild; + + let footer = stringToHTML(/* html */ ` +
+
+ Resources and Feedback: + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ `).firstChild; + + let exitbutton = document.createElement("div"); + exitbutton.id = "whatsnewclosebutton"; + + container.append( + header, + imagecont, + text as HTMLElement, + footer as HTMLElement, + exitbutton, + ); + + background.append(container); + + document.getElementById("container")!.append(background); + + let bkelement = document.getElementById("whatsnewbk"); + let popup = document.getElementsByClassName("whatsnewContainer")[0]; + + if (settingsState.animations) { + animate( + [popup, bkelement as HTMLElement], + { scale: [0, 1] }, + { + type: "spring", + stiffness: 220, + damping: 18, + }, + ); + + animate( + ".whatsnewTextContainer *", + { opacity: [0, 1], y: [10, 0] }, + { + delay: stagger(0.05, { startDelay: 0.1 }), + duration: 0.5, + ease: [0.22, 0.03, 0.26, 1], + }, + ); + } + + delete settingsState.justupdated; + + bkelement!.addEventListener("click", function (event) { + // Check if the click event originated from the element itself and not any of its children + if (event.target === bkelement) { + DeleteWhatsNew(); + } + }); + + var closeelement = document.getElementById("whatsnewclosebutton"); + closeelement!.addEventListener("click", function () { + DeleteWhatsNew(); + }); +} diff --git a/src/seqta/utils/Openers/OpenAboutPage.ts b/src/seqta/utils/Openers/OpenAboutPage.ts index 997c6f11..f06b6785 100644 --- a/src/seqta/utils/Openers/OpenAboutPage.ts +++ b/src/seqta/utils/Openers/OpenAboutPage.ts @@ -1,5 +1,4 @@ import stringToHTML from "../stringToHTML"; -import browser from "webextension-polyfill"; import { settingsState } from "../listeners/SettingsState"; import { animate, stagger } from "motion"; import { DeleteWhatsNew } from "../Whatsnew"; @@ -16,7 +15,7 @@ export function OpenAboutPage() { /* html */ `

About

-

BetterSEQTA+ V${browser.runtime.getManifest().version}

+

About the extension

`, ).firstChild; @@ -43,22 +42,29 @@ export function OpenAboutPage() { let footer = stringToHTML(/* html */ `
- Report bugs and feedback: + Resources and Feedback: + + + + + + + + + + + + - - - - -
`).firstChild; diff --git a/src/seqta/utils/Whatsnew.ts b/src/seqta/utils/Whatsnew.ts index 49f92394..affc3b98 100644 --- a/src/seqta/utils/Whatsnew.ts +++ b/src/seqta/utils/Whatsnew.ts @@ -272,22 +272,29 @@ export function OpenWhatsNewPopup() { let footer = stringToHTML(/* html */ `
- Report bugs and feedback: + Resources and Feedback: + + + + + + + + + + + + - - - - -