mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-23 21:14:23 +00:00
Compeleted the language changing feat.
And updated the assets url to be /_assets/ instead of /_nuxt/
This commit is contained in:
parent
a1aecb4623
commit
c45a5ea285
5 changed files with 46 additions and 31 deletions
|
@ -103,6 +103,18 @@ const commands = [
|
||||||
command: "help",
|
command: "help",
|
||||||
run: displayHelp,
|
run: displayHelp,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
command: "關於",
|
||||||
|
run: printAbout,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
command: "清掉",
|
||||||
|
run: cleanTTY,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
command: "幫助",
|
||||||
|
run: displayHelp,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"localeflag": "🇺🇸",
|
"localeflag": "🇺🇸",
|
||||||
|
"nextlang": "zh_tw",
|
||||||
"core": {
|
"core": {
|
||||||
"sitename": "BlindSpec"
|
"sitename": "BlindSpec"
|
||||||
},
|
},
|
||||||
|
@ -51,6 +52,7 @@
|
||||||
"Welcome": "Welcome",
|
"Welcome": "Welcome",
|
||||||
"loading": "Loading...",
|
"loading": "Loading...",
|
||||||
"app": {
|
"app": {
|
||||||
|
"changelangmessage": "Switching the language",
|
||||||
"launchtext": "Cooking up the desktop...",
|
"launchtext": "Cooking up the desktop...",
|
||||||
"hotnews": "Hot News",
|
"hotnews": "Hot News",
|
||||||
"news": "News",
|
"news": "News",
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"localeflag": "🇹🇼",
|
"localeflag": "🇹🇼",
|
||||||
|
"nextlang": "en",
|
||||||
"core": {
|
"core": {
|
||||||
"sitename": "新聞盲點平台"
|
"sitename": "新聞盲點平台"
|
||||||
},
|
},
|
||||||
|
@ -51,6 +52,7 @@
|
||||||
"Welcome": "歡迎",
|
"Welcome": "歡迎",
|
||||||
"loading": "載入中...",
|
"loading": "載入中...",
|
||||||
"app": {
|
"app": {
|
||||||
|
"changelangmessage": "正在切換語言中...",
|
||||||
"launchtext": "系統開機中...",
|
"launchtext": "系統開機中...",
|
||||||
"hotnews": "熱門新聞",
|
"hotnews": "熱門新聞",
|
||||||
"news": "新聞",
|
"news": "新聞",
|
||||||
|
|
|
@ -48,6 +48,7 @@ export default defineNuxtConfig({
|
||||||
},
|
},
|
||||||
|
|
||||||
app: {
|
app: {
|
||||||
|
buildAssetsDir: "/_assets/",
|
||||||
head: {
|
head: {
|
||||||
title: "",
|
title: "",
|
||||||
htmlAttrs: {
|
htmlAttrs: {
|
||||||
|
@ -55,7 +56,6 @@ export default defineNuxtConfig({
|
||||||
},
|
},
|
||||||
link: [
|
link: [
|
||||||
{ rel: "dns-prefetch", href: "https://utfs.io" },
|
{ rel: "dns-prefetch", href: "https://utfs.io" },
|
||||||
{ rel: "dns-prefetch", href: "https://s3.yhw.tw" },
|
|
||||||
{ rel: "icon", type: "image/svg", href: "/favicon.svg" },
|
{ rel: "icon", type: "image/svg", href: "/favicon.svg" },
|
||||||
],
|
],
|
||||||
meta: [
|
meta: [
|
||||||
|
|
|
@ -72,6 +72,7 @@ const titleAppName = ref("Desktop");
|
||||||
const openingAppViaAnApp = ref(false);
|
const openingAppViaAnApp = ref(false);
|
||||||
const passedValues = ref();
|
const passedValues = ref();
|
||||||
const globalWindowVal = ref(new Map());
|
const globalWindowVal = ref(new Map());
|
||||||
|
const changeLangAnimation = ref(false);
|
||||||
|
|
||||||
// Key Data
|
// Key Data
|
||||||
const menuItems = [
|
const menuItems = [
|
||||||
|
@ -384,12 +385,22 @@ watchEffect(() => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
// Booting animation
|
// Booting animation
|
||||||
|
onMounted(() => {
|
||||||
|
const changeLang = route.query.changelang;
|
||||||
|
if (changeLang) {
|
||||||
|
bootingAnimation.value = false;
|
||||||
|
changeLangAnimation.value = true;
|
||||||
|
}
|
||||||
|
setTimeout(() => {
|
||||||
|
changeLangAnimation.value = false;
|
||||||
|
}, 4000);
|
||||||
|
});
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// booting animation bypass
|
// booting animation bypass
|
||||||
const bootingHeaderParams = route.query.bypass;
|
const bootingHeaderParams = route.query.bypass;
|
||||||
if (bootingHeaderParams) {
|
if (bootingHeaderParams) {
|
||||||
bootingAnimation.value = false;
|
bootingAnimation.value = false;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if (bootingAnimation.value) {
|
if (bootingAnimation.value) {
|
||||||
gsap.to(popMessage.value, {
|
gsap.to(popMessage.value, {
|
||||||
|
@ -397,10 +408,10 @@ onMounted(() => {
|
||||||
text: t("app.booting"),
|
text: t("app.booting"),
|
||||||
ease: "none",
|
ease: "none",
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
|
||||||
bootingAnimation.value = false;
|
|
||||||
}, 2000);
|
|
||||||
}
|
}
|
||||||
|
setTimeout(() => {
|
||||||
|
bootingAnimation.value = false;
|
||||||
|
}, 2000);
|
||||||
});
|
});
|
||||||
|
|
||||||
watchEffect((cleanupFn) => {
|
watchEffect((cleanupFn) => {
|
||||||
|
@ -415,6 +426,13 @@ watchEffect((cleanupFn) => {
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
<div v-if="changeLangAnimation">
|
||||||
|
<div
|
||||||
|
class="flex flex-col justify-center align-center text-center absolute w-full h-screen inset-0 overscroll-none bg-gray-600/50 z-[999999]"
|
||||||
|
>
|
||||||
|
<span>{{ t("app.changelangmessage") }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div v-if="bootingAnimation">
|
<div v-if="bootingAnimation">
|
||||||
<div
|
<div
|
||||||
class="flex flex-col justify-center align-center text-center absolute w-full h-screen inset-0 overscroll-none"
|
class="flex flex-col justify-center align-center text-center absolute w-full h-screen inset-0 overscroll-none"
|
||||||
|
@ -464,12 +482,13 @@ watchEffect((cleanupFn) => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-row gap-5">
|
<div class="flex flex-row gap-5">
|
||||||
<button
|
<NuxtLink :to="localePath('/app/desktop?changelang=1', t('nextlang'))">
|
||||||
class="p-1 hover:text-blue-200 transition-all duration-100 hover:bg-gray-500 rounded"
|
<button
|
||||||
@click="toggleLangMenu"
|
class="p-1 hover:text-blue-200 transition-all duration-100 hover:bg-gray-500 rounded"
|
||||||
>
|
>
|
||||||
{{ t("localeflag") }}
|
{{ t("localeflag") }}
|
||||||
</button>
|
</button>
|
||||||
|
</NuxtLink>
|
||||||
<div class="text-center align-middle justify-center text-white">
|
<div class="text-center align-middle justify-center text-white">
|
||||||
{{ currentDate }}
|
{{ currentDate }}
|
||||||
</div>
|
</div>
|
||||||
|
@ -496,26 +515,6 @@ watchEffect((cleanupFn) => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Transition>
|
</Transition>
|
||||||
<Transition
|
|
||||||
enter-active-class="animate__animated animate__fadeInDown animate_fast03"
|
|
||||||
leave-active-class="animate__animated animate__fadeOutUp animate_fast03"
|
|
||||||
>
|
|
||||||
<div v-if="langMenuOpen">
|
|
||||||
<div
|
|
||||||
class="w-48 bg-white rounded-md shadow-lg py-1 flex flex-col gap-y-5"
|
|
||||||
>
|
|
||||||
<a
|
|
||||||
v-for="loc in availableLocales"
|
|
||||||
:key="loc.code"
|
|
||||||
:href="switchLocalePath(loc.code)"
|
|
||||||
v-on:click="langMenuOpen = false"
|
|
||||||
class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 transition-all duration-100"
|
|
||||||
>
|
|
||||||
{{ loc.name || loc.code }}
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</Transition>
|
|
||||||
<!--Main desktop contents-->
|
<!--Main desktop contents-->
|
||||||
<div
|
<div
|
||||||
class="flex flex-col justify-center align-center text-center absolute w-full h-screen inset-x-0 inset-y-0 z-[-10]"
|
class="flex flex-col justify-center align-center text-center absolute w-full h-screen inset-x-0 inset-y-0 z-[-10]"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue