diff --git a/package-lock.json b/package-lock.json index 13e35ce..cffe5f5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44,6 +44,7 @@ "lint-staged": "^16.4.0", "prettier": "^3.8.1", "prettier-plugin-astro": "^0.14.1", + "prettier-plugin-svelte": "^3.5.1", "svelte-eslint-parser": "^1.6.0" }, "engines": { @@ -7768,6 +7769,17 @@ "dev": true, "license": "MIT" }, + "node_modules/prettier-plugin-svelte": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/prettier-plugin-svelte/-/prettier-plugin-svelte-3.5.1.tgz", + "integrity": "sha512-65+fr5+cgIKWKiqM1Doum4uX6bY8iFCdztvvp2RcF+AJoieaw9kJOFMNcJo/bkmKYsxFaM9OsVZK/gWauG/5mg==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "prettier": "^3.0.0", + "svelte": "^3.2.0 || ^4.0.0-next.0 || ^5.0.0-next.0" + } + }, "node_modules/prismjs": { "version": "1.30.0", "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.30.0.tgz", diff --git a/package.json b/package.json index e5f5114..185fbcf 100644 --- a/package.json +++ b/package.json @@ -62,6 +62,7 @@ "lint-staged": "^16.4.0", "prettier": "^3.8.1", "prettier-plugin-astro": "^0.14.1", + "prettier-plugin-svelte": "^3.5.1", "svelte-eslint-parser": "^1.6.0" } } diff --git a/prettier.config.cjs b/prettier.config.cjs index ca30f6d..bb11193 100644 --- a/prettier.config.cjs +++ b/prettier.config.cjs @@ -9,7 +9,7 @@ const config = { tabWidth: 2, semi: false, singleQuote: true, - plugins: ['prettier-plugin-astro'], + plugins: ['prettier-plugin-astro', 'prettier-plugin-svelte'], overrides: [ { files: '*.astro', diff --git a/scripts/generate_contact.py b/scripts/generate_contact.py new file mode 100644 index 0000000..9f35c40 --- /dev/null +++ b/scripts/generate_contact.py @@ -0,0 +1,47 @@ +import base64 +import json +from pathlib import Path + +raw_contact: list[dict[str, str]] = [ + { + "platform": "Github", + "href": "https://github.com/passthem-desu", + "name": "passthem-desu", + }, + { + "platform": "Wakatime", + "href": "https://wakatime.com/@passthem", + "name": "@passthem", + }, + { + "platform": "Youtube", + "href": "https://www.youtube.com/@Passthem183", + "name": "@Passthem183", + }, + { + "platform": "OtoSite", + "href": "https://otomad.site/@passthem", + "name": "@passthem", + }, + { + "platform": "Email", + "href": "mailto:passthem183@gmail.com", + "name": "passthem183@gmail.com", + }, + { + "platform": "Bilibili", + "href": "https://space.bilibili.com/92852604", + "name": "passthem", + }, +] + + +def hack(raw: str) -> str: + return base64.b64encode(raw[::-1].encode()).decode() + + +hacked_contact = [{k: hack(v) for k, v in c.items()} for c in raw_contact] +(Path(__file__).parent / "../src/lib/data").mkdir(exist_ok=True) +_ = (Path(__file__).parent / "../src/lib/data/contact.json").write_text( + json.dumps(hacked_contact) +) diff --git a/src/components/MainpageContactMe.svelte b/src/components/MainpageContactMe.svelte new file mode 100644 index 0000000..5536ad6 --- /dev/null +++ b/src/components/MainpageContactMe.svelte @@ -0,0 +1,98 @@ + + +
| {unhack(item.platform)} | +{unhack(item.name)} | +
点击 这里 返回主页
-| Github | -passthem-desu | -
|---|---|
| Wakatime | -@passthem | -
| Youtube | -@Passthem183 | -
| OtoSite | -@passthem | -
| passthem183@gmail.com | -|
| Bilibili | -passthem | -