Please add the language selection interface (although it is not yet completed)
This commit is contained in:
@@ -7,9 +7,7 @@ import (
|
||||
"github.com/OmniX-Space/MeowBox-Core/internal/service"
|
||||
)
|
||||
|
||||
func CheckInstall(config *service.Config) {
|
||||
if GetInstallLock(config) == false {
|
||||
log.Println("[Info] MeowBox-Core is not installed.")
|
||||
func StartInstall(config *service.Config) {
|
||||
log.Println("[Info] Starting installation process.")
|
||||
server := service.CreateWebService(config)
|
||||
router := http.NewServeMux()
|
||||
@@ -23,6 +21,12 @@ func CheckInstall(config *service.Config) {
|
||||
router.Handle("/.well-known/", RouteWebDevTools())
|
||||
server.Handler = InjectWebServerHeaders(config, router)
|
||||
service.ListenWebService(config, server)
|
||||
}
|
||||
|
||||
func CheckInstall(config *service.Config) {
|
||||
if GetInstallLock(config) == false {
|
||||
log.Println("[Info] MeowBox-Core is not installed.")
|
||||
StartInstall(config)
|
||||
return
|
||||
}
|
||||
log.Println("[Info] MeowBox-Core is already installed.")
|
||||
|
||||
@@ -10,18 +10,33 @@
|
||||
|
||||
.welcome-button {
|
||||
position: absolute;
|
||||
height: 32px;
|
||||
width: 32px;
|
||||
bottom: 64px;
|
||||
width: 150px;
|
||||
backdrop-filter: blur(3px);
|
||||
border: 0;
|
||||
border-radius: 20px;
|
||||
border-radius: 100%;
|
||||
background-color: rgba(255, 255, 255, 0.2);
|
||||
color: white;
|
||||
padding: 8px;
|
||||
padding: 6px;
|
||||
font-size: 24px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.welcome-button i {
|
||||
position: relative;
|
||||
top: -3px;
|
||||
left: -5px;
|
||||
}
|
||||
|
||||
.welcome-button:hover {
|
||||
background-color: rgba(255, 255, 255, 0.3);
|
||||
}
|
||||
|
||||
.welcome-button:active {
|
||||
background-color: rgba(255, 255, 255, 0.4);
|
||||
}
|
||||
|
||||
.welcome h1 {
|
||||
font-weight: bold;
|
||||
font-size: 64px;
|
||||
@@ -53,6 +68,39 @@
|
||||
animation: fadeInOut 3s forwards;
|
||||
}
|
||||
|
||||
.language-select {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
width: 80%;
|
||||
height: 95%;
|
||||
border-radius: 20px;
|
||||
background-color: #fff;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
.language-select i {
|
||||
position: absolute;
|
||||
color: rgb(0, 102, 255);
|
||||
font-size: 256px;
|
||||
left: 32px;
|
||||
}
|
||||
|
||||
.language-select-container {
|
||||
position: absolute;
|
||||
width: calc(100% - 416px);
|
||||
height: calc(90% - 64px);
|
||||
right: 32px;
|
||||
bottom: 64px;
|
||||
border-radius: 16px;
|
||||
background-color: rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
|
||||
.container {
|
||||
width: 80%;
|
||||
height: calc(100% - 100px);
|
||||
@@ -61,3 +109,28 @@
|
||||
background-color: rgba(255, 255, 255, 0.2);
|
||||
margin: 50px auto;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.language-select {
|
||||
width: 65%;
|
||||
}
|
||||
|
||||
.language-select i {
|
||||
font-size: 128px;
|
||||
left: auto;
|
||||
top: 64px;
|
||||
}
|
||||
|
||||
.language-select-container {
|
||||
width: 80%;
|
||||
height: calc(100% - 288px);
|
||||
right: auto;
|
||||
bottom: 64px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.language-select {
|
||||
width: 85%;
|
||||
}
|
||||
}
|
||||
@@ -9,11 +9,17 @@
|
||||
const en = {
|
||||
"hello": "Hello",
|
||||
};
|
||||
|
||||
const zhCN = {
|
||||
"hello": "你好",
|
||||
};
|
||||
|
||||
const zhTW = {
|
||||
"hello": "哈囉",
|
||||
};
|
||||
|
||||
const jp = {
|
||||
"hello": "こんにちは",
|
||||
};
|
||||
|
||||
const languages = [en, zhCN, jp];
|
||||
const languages = [en, zhCN, zhTW, jp];
|
||||
@@ -6,7 +6,11 @@ function welcome() {
|
||||
welcomeDiv.classList.add("welcome");
|
||||
const welcomeButton = document.createElement("button");
|
||||
welcomeButton.classList.add("welcome-button");
|
||||
welcomeButton.innerHTML = 'Next <i class="fa-solid fa-circle-arrow-right"></i>';
|
||||
welcomeButton.innerHTML = '<i class="fa-regular fa-circle-right"></i>';
|
||||
welcomeButton.addEventListener("click", () => {
|
||||
page.removeChild(welcomeDiv);
|
||||
language_select();
|
||||
});
|
||||
welcomeDiv.appendChild(welcomeButton);
|
||||
function displayNextLanguage() {
|
||||
if (currentIndex >= languages.length) {
|
||||
@@ -26,9 +30,20 @@ function welcome() {
|
||||
page.appendChild(welcomeDiv);
|
||||
}
|
||||
|
||||
function install() {
|
||||
function language_select() {
|
||||
const languageSelectDiv = document.createElement("div");
|
||||
languageSelectDiv.classList.add("language-select");
|
||||
const languageIcon = document.createElement("i");
|
||||
languageIcon.classList.add("fa-solid", "fa-earth-americas");
|
||||
languageSelectDiv.appendChild(languageIcon);
|
||||
const languageSelectContainer = document.createElement("div");
|
||||
languageSelectContainer.classList.add("language-select-container");
|
||||
languageSelectDiv.appendChild(languageSelectContainer);
|
||||
page.appendChild(languageSelectDiv);
|
||||
}
|
||||
|
||||
function env_detection() { }
|
||||
|
||||
// Load external script
|
||||
function loadScript(scriptUrl) {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
Reference in New Issue
Block a user