🗑️ Cleanup & Reborn

This commit is contained in:
LittleSheep 2025-03-17 01:24:03 +08:00
parent b9d89149b0
commit 975766302a
6 changed files with 108 additions and 124 deletions

View File

@ -1,22 +1,28 @@
@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@300..700&family=Noto+Sans+JP:wght@100..900&family=Noto+Sans+SC:wght@100..900&family=Noto+Sans+TC:wght@100..900&family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap');
@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@100..900&family=Noto+Sans+SC:wght@100..900&family=Noto+Sans+TC:wght@100..900&family=Nunito:ital,wght@0,200..1000;1,200..1000&family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap");
html, body {
padding: 0;
margin: 0;
html,
body {
padding: 0;
margin: 0;
}
html, body, #app, .v-application {
overflow: auto !important;
html,
body,
#app,
.v-application {
overflow: auto !important;
font-family: "Comfortaa", "Noto Sans SC", "Noto Sans TC", "Noto Sans JP", sans-serif !important;
font-optical-sizing: auto;
font-weight: 500;
font-style: normal;
font-family: "Nunito", "Noto Sans SC", "Noto Sans TC", "Noto Sans JP", sans-serif !important;
font-optical-sizing: auto;
font-weight: 500;
font-style: normal;
}
.font-mono, code, pre {
font-family: "Roboto Mono", monospace !important;
font-optical-sizing: auto;
font-weight: 500;
font-style: normal;
.font-mono,
code,
pre {
font-family: "Roboto Mono", monospace !important;
font-optical-sizing: auto;
font-weight: 500;
font-style: normal;
}

View File

@ -1,20 +0,0 @@
import fs from "fs"
const tones = ["↑", "→", "↓", "↗", "↘"]
const raw = fs.readFileSync("../lang/zh-CN.json", "utf-8")
const original: { [id: string]: string } = JSON.parse(raw)
const result: { [id: string]: string } = {}
for (const key in original) {
let str = ""
for (const char of original[key]) {
const tone = tones[Math.floor(Math.random() * tones.length)]
str += "咩" + tone
}
result[key] = str
}
fs.writeFileSync("../lang/ml-SG.json", JSON.stringify(result))

View File

@ -1,55 +0,0 @@
{
"brandName": "咩→咩↗咩↘咩↑",
"brandNameFormal": "咩↓咩↓咩→咩↘咩↗咩↗咩↘咩↗咩↓咩↘",
"navProducts": "咩↑咩→",
"navActivity": "咩→咩↑",
"navActivityCaption": "咩→咩↑咩↑咩↑咩↗咩↑咩↗咩↘咩↗咩↑咩→咩↘",
"navGallery": "咩→咩↑",
"navGalleryCaption": "咩↓咩↘咩↓咩↘咩↘咩↓咩↑咩↘咩→咩↗咩↗咩↑咩↗咩↗咩↓咩↗咩→咩↑咩↘咩↑咩↓咩→咩↑咩↗",
"indexIntroduce": "咩↓咩↗咩↓咩↑咩↘咩↓咩↑咩↑咩↗咩↗咩↗咩↓咩↘咩↗咩→咩→咩↓咩↓咩↘咩→咩↓咩↓咩↑咩↑咩→",
"indexProductListHint": "咩↗咩↓咩↘咩↑咩↑咩↘咩↓咩↑咩↘咩↓咩↗咩↘",
"indexActivities": "咩↘咩↗",
"indexActivitiesCaption": "咩↑咩↘咩→咩↗咩↑咩↗咩↓咩→咩↗咩↑咩↓咩→咩↑咩↓咩↓咩↑咩→咩→咩↑咩↗咩→咩→咩↓咩→",
"indexActivitiesHint": "咩↑咩↓咩↘咩→咩→咩↓咩↘咩→咩↘咩↗咩→咩↓",
"userMenuDashboard": "咩↓咩↗咩↗",
"userMenuSignOut": "咩↑咩→",
"userMenuSignIn": "咩→咩→",
"userMenuSignUp": "咩↑咩↘咩→咩↗",
"next": "咩↑咩→咩↗",
"errorOccurred": "咩→咩↑咩↘咩→咩→咩↓咩↓咩↑咩↘咩↘",
"username": "咩→咩↓咩↑",
"nickname": "咩↘咩→咩↘",
"email": "咩↓咩↓咩↓咩↓",
"password": "咩↘咩↓",
"copyright": "咩↑咩↗咩↓咩↗",
"signUpTitle": "咩↘咩→咩↗咩↗",
"signUpCaption": "咩↑咩↓咩↘咩↓咩↑咩→咩↗咩↓咩↘咩↘咩↘咩↓咩↓咩↑咩↑咩↘咩↗咩↘咩↑咩↓咩↘咩↓咩↘咩→咩↗咩↗咩→咩↘咩↘咩↗咩↘咩→咩↑咩→咩↓",
"signUpCompleted": "咩↓咩→咩↓咩↓咩↗咩↗咩→咩↗咩↑咩↗咩→咩→咩↘咩→咩→咩↗咩↑咩↘咩↓咩↓咩↓咩↑咩↗咩↓咩↓咩↑咩↗咩↘咩→咩↓咩↘咩↓咩↗咩↘咩↓咩↗咩↗咩↓咩↑",
"signUpCompletedAction": "咩↘咩↗",
"signInTitle": "咩↑咩↘",
"signInCaption": "咩↗咩↘咩↑咩↑咩↘咩↑咩→咩↘咩→咩→咩↑咩↑咩↑咩↓咩↘咩↓咩↗咩→咩↘咩↓咩↓咩↓咩↑咩→咩↗咩↘咩↘咩→",
"multiFactorCaption": "咩→咩→咩↓咩↓咩↓咩↘咩→咩↗咩↓咩↓咩↑咩↘咩↑咩↓咩↓咩↗咩→咩↗咩↓咩↑",
"multiFactorHint": "咩↓咩→咩↓咩↑咩↑咩↑咩↑",
"multiFactorTypeEmail": "咩↘咩→咩↑咩↓咩↑咩↘咩↓咩↗咩↑",
"signInCompleted": "咩→咩↓",
"signInCompletedCaption": "咩↑咩↘咩↗咩↗咩↑咩→咩↗咩↑咩↓咩↑咩↘咩↑咩↓咩↘咩↓咩↓咩↘咩↘咩↗咩↑咩↗咩→咩↘咩↗咩↑咩→咩↓",
"transferredToSolianHint": "咩↑咩→咩↑咩↑咩→咩→咩↘咩→咩↓咩→咩↑咩↘咩↘咩↑咩↗咩↗咩↓咩→咩↑咩↓咩↓咩↗咩↗咩↑咩→咩↑咩↗咩↓咩→咩↑咩→咩↑咩↘咩↘咩↗咩↘咩↑咩↘咩↘咩↓咩↘咩↑咩↑咩↗咩↑咩↘咩→咩→咩↓咩↘咩↗咩↓咩↑咩↑咩↘",
"personalize": "咩↓咩↑咩↑",
"personalizeCaption": "咩↑咩↓咩↘咩↑咩↓咩↑咩→咩↑咩↘咩↓咩→咩↘咩↗咩→咩↑咩↗咩↑咩→咩↓咩→咩↗咩↓咩↘",
"security": "咩↗咩↓",
"securityCaption": "咩↓咩↗咩→咩→咩↘咩↑咩↘咩↗咩↓咩→咩↘咩→咩→咩↘咩→咩↓咩↗咩↗咩↑咩→咩↓咩↘",
"userActivity": "咩↗咩↗",
"userActivityCaption": "咩↑咩↑咩↗咩↓咩↑咩↗咩↗咩↗咩↓",
"productArchived": "咩↘咩↓咩→",
"callbackHint": "咩↑咩↘咩↓咩↓咩↓咩↓咩↗咩↑咩↘咩↗咩↗咩→咩↗咩↑咩↑咩↓咩↗咩↘咩↑咩↗咩↗咩↓咩↓咩↘咩↑咩↗咩↗咩→咩↓",
"authorizeTitle": "咩↑咩↑咩→咩↑咩↘咩↗",
"authorizeCaption": "咩↓咩↘咩↑咩↓咩↗咩↘咩↓咩↘咩↗咩↘咩↑咩↘咩↓咩→咩↓咩↑咩↗咩↘咩↘咩↗咩↗咩↘咩↓咩↑咩↘咩→咩↑咩↘",
"authorizeErrorHint": "咩↑咩↓咩↘咩→咩↓咩↗咩↗咩↑咩↘咩↘咩↓咩↑咩→咩↘咩↘咩↗咩↓咩↘咩↗咩↓咩↓咩↗咩↗咩↑咩→咩→咩↓咩↘咩↑咩→",
"authorizeRedirectHint": "咩↓咩↓咩→咩↑咩↓咩→咩→咩↑咩↓咩↗咩↘咩↗咩↑咩↗咩→咩↗咩↑",
"authorizeCompleted": "咩↗咩→咩↘",
"authorizeCompletedCaption": "咩↓咩↓咩↗咩↗咩↑咩↘咩↘咩↑咩↗咩↘咩↑咩→咩↓咩↑咩↘咩↗咩↗咩↑咩↘咩↗咩↘咩↘咩↑",
"authorizeCompletedRedirect": "咩→咩↘咩↑咩↓咩↗咩↓咩→咩→咩↗咩↘咩→咩↑咩↘咩→咩↘咩↘咩↓咩↘咩→咩→咩↗咩↘咩↑咩↗咩→咩↗",
"authorizeCompletedRedirectHint": "咩↑咩↑咩↑咩↘咩→咩↗",
"decline": "咩↗咩↘",
"approve": "咩→咩↓"
}

View File

@ -19,9 +19,7 @@ export default defineNuxtConfig({
},
posts: {
includeAppSources: false,
sources: [
"/api/sitemap/posts",
],
sources: ["/api/sitemap/posts"],
},
},
},
@ -37,7 +35,6 @@ export default defineNuxtConfig({
locales: [
{ code: "en", name: "English", file: "en-US.json" },
{ code: "zh-CN", name: "简体中文", file: "zh-CN.json" },
{ code: "tb-SG", name: "音调羊文", file: "tb-SG.json" },
],
lazy: true,
langDir: "lang",
@ -67,9 +64,7 @@ export default defineNuxtConfig({
title: "Solsynth LLC",
titleTemplate: "%s | Solsynth",
meta: [],
link: [
{ rel: "icon", type: "image/png", href: "/icon.png" },
],
link: [{ rel: "icon", type: "image/png", href: "/icon.png" }],
},
},
@ -79,11 +74,62 @@ export default defineNuxtConfig({
},
highlight: {
theme: { default: "github-light", dark: "github-dark" },
langs: ["json", "yaml", "toml", "java", "javascript", "astro", "css", "scss", "dart", "go", "typescript", "c", "csharp",
"cpp", "bat", "bash", "sh", "dockerfile", "erlang", "fsharp", "markdown", "log",
"lua", "objc", "swift", "regex", "ruby", "rust", "postcss", "blade", "asciidoc", "cmake", "cobol", "pascal",
"nginx", "angular-html", "angular-ts", "gdscript", "gdshader", "gdresource", "groovy", "gql", "python",
"crystal", "sql", "plsql", "kotlin", "html", "vue", "gleam", "julia", "lisp", "xml", "csv"],
langs: [
"json",
"yaml",
"toml",
"java",
"javascript",
"astro",
"css",
"scss",
"dart",
"go",
"typescript",
"c",
"csharp",
"cpp",
"bat",
"bash",
"sh",
"dockerfile",
"erlang",
"fsharp",
"markdown",
"log",
"lua",
"objc",
"swift",
"regex",
"ruby",
"rust",
"postcss",
"blade",
"asciidoc",
"cmake",
"cobol",
"pascal",
"nginx",
"angular-html",
"angular-ts",
"gdscript",
"gdshader",
"gdresource",
"groovy",
"gql",
"python",
"crystal",
"sql",
"plsql",
"kotlin",
"html",
"vue",
"gleam",
"julia",
"lisp",
"xml",
"csv",
],
},
locales: ["en", "zh-CN"],
defaultLocale: "en",

View File

@ -11,29 +11,31 @@
},
"dependencies": {
"@mdi/font": "^7.4.47",
"@nuxt/content": "^2.13.2",
"@nuxt/image": "^1.8.0",
"@nuxtjs/i18n": "^8.5.5",
"@nuxtjs/sitemap": "^6.1.1",
"@pinia/nuxt": "^0.5.4",
"@nuxt/content": "^2.13.4",
"@nuxt/image": "^1.9.0",
"@nuxt/kit": "^3.16.0",
"@nuxtjs/i18n": "^8.5.6",
"@nuxtjs/sitemap": "^6.1.5",
"@pinia/nuxt": "^0.5.5",
"feed": "^4.2.2",
"nuxt": "^3.13.2",
"nuxt": "^3.16.0",
"nuxt-gtag": "^2.1.0",
"nuxt-schema-org": "^3.4.0",
"pinia": "^2.2.2",
"nuxt-schema-org": "^3.5.0",
"pinia": "^2.3.1",
"rehype-sanitize": "^6.0.0",
"rehype-stringify": "^10.0.1",
"remark": "^15.0.1",
"remark-parse": "^11.0.0",
"remark-rehype": "^11.1.1",
"unhead": "1.9.0",
"unified": "^11.0.5",
"vue": "latest"
"vue": "^3.5.13"
},
"devDependencies": {
"@unocss/nuxt": "^0.61.9",
"@unocss/preset-typography": "^0.61.9",
"@unocss/reset": "^0.61.9",
"vite-plugin-vuetify": "^2.0.4",
"vuetify": "^3.7.2"
"vite-plugin-vuetify": "^2.1.0",
"vuetify": "^3.7.16"
}
}

View File

@ -3,11 +3,11 @@ import { ref } from "vue"
import { solarFetch } from "~/utils/request"
export function useAtk() {
return useCookie("__hydrogen_atk", { path: "/", maxAge: 31556952000 })
return useCookie("solar_network_atk", { path: "/", maxAge: 31556952000 })
}
export function useRtk() {
return useCookie("__hydrogen_rtk", { path: "/", maxAge: 31556952000 })
return useCookie("solar_network_rtk", { path: "/", maxAge: 31556952000 })
}
export function useLoggedInState() {
@ -22,18 +22,23 @@ export const useUserinfo = defineStore("userinfo", () => {
let fetchCompleter: Completer<boolean> | null = null
let refreshCompleter: Completer<string> | null = null
const lastRefreshedAt = ref<Date | null>(null)
function setTokenSet(atk: string, rtk: string) {
lastRefreshedAt.value = new Date()
useAtk().value = atk
useRtk().value = rtk
}
async function getAtk() {
if (!useLoggedInState().value) return useAtk().value
if (lastRefreshedAt.value != null && Math.floor(Math.abs(Date.now() - lastRefreshedAt.value.getTime()) / 60000) < 3) {
return useAtk().value
const atk = useAtk()
if (!useLoggedInState().value) return atk.value
const parts = atk.value?.split(".") ?? []
if (parts.length != 3) return atk.value
const payload = JSON.parse(atob(parts[1]))
const exp: number = payload["exp"]
if (exp > Date.now() / 1000) {
return atk.value
}
if (refreshCompleter != null) {
@ -57,7 +62,7 @@ export const useUserinfo = defineStore("userinfo", () => {
throw new Error(err)
} else {
const out = await res.json()
console.log("[PASSPORT] Access token has been refreshed now.")
console.log("[Passport] Access token has been refreshed now.")
setTokenSet(out["access_token"], out["refresh_token"])
refreshCompleter.complete(out["access_token"])
return out["access_token"]
@ -97,12 +102,12 @@ export const useUserinfo = defineStore("userinfo", () => {
fetchCompleter = null
}
return { userinfo, lastRefreshedAt, isLoggedIn, isReady, fetchCompleter, setTokenSet, getAtk, readProfiles }
return { userinfo, isLoggedIn, isReady, fetchCompleter, setTokenSet, getAtk, readProfiles }
})
export class Completer<T> {
public readonly promise: Promise<T>
public complete: (value: (PromiseLike<T> | T)) => void
public complete: (value: PromiseLike<T> | T) => void
private reject: (reason?: any) => void
public constructor() {