🎉 Inital Commit

This commit is contained in:
LittleSheep 2024-03-16 17:17:32 +08:00
commit 9451ffb0ac
12 changed files with 179 additions and 0 deletions

26
.gitignore vendored Normal file
View File

@ -0,0 +1,26 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
*.lockb

8
.prettierrc Normal file
View File

@ -0,0 +1,8 @@
{
"$schema": "https://json.schemastore.org/prettierrc",
"semi": false,
"tabWidth": 2,
"singleQuote": false,
"printWidth": 120,
"trailingComma": "none"
}

41
index.html Normal file
View File

@ -0,0 +1,41 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>SmartSheep → Solsynth</title>
</head>
<body>
<div id="app" class="w-screen h-screen flex justify-center items-center">
<div class="text-center">
<img src="/favicon.svg" width="64" height="64" class="mx-auto" />
<h1 class="text-2xl font-bold">Redirecting...</h1>
<p class="text-lg mt-3">SmartSheep is now known as Solsynth</p>
<p>We also updated our domain.</p>
<div class="mt-3 flex gap-2 justify-center">
<code>smartsheep.studio</code>
<span></span>
<code>solsynth.dev</code>
</div>
<p class="mt-3">Please add our new domain to your browser favorites.</p>
<div class="mt-3 text-sm text-center">
<p>You are going to redirect to</p>
<code id="redirect-target">https://solsynth.dev</code>
<p>in 5 seconds</p>
</div>
<div class="mt-3 text-xs text-center opacity-80">
<p>Copyright © 2024 Solsynth</p>
</div>
</div>
</div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>

21
package.json Normal file
View File

@ -0,0 +1,21 @@
{
"name": "redirector",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview"
},
"devDependencies": {
"@types/node": "^20.11.28",
"typescript": "^5.2.2",
"vite": "^5.1.6"
},
"dependencies": {
"@fontsource/roboto": "^5.0.12",
"@unocss/reset": "^0.58.6",
"unocss": "^0.58.6"
}
}

12
public/favicon.svg Executable file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 28 KiB

16
src/main.ts Normal file
View File

@ -0,0 +1,16 @@
import "./style.css"
import "virtual:uno.css"
import "@unocss/reset/tailwind.css"
import "@fontsource/roboto/latin.css"
import { sitemap } from "./site"
const site = sitemap[location.host] ?? location.host.replace("smartsheep.studio", "solsynth.dev")
const url = location.protocol + "//" + site + location.pathname + location.search + location.hash
const target = document.querySelector("#redirect-target")
if (target) target.innerHTML = url
setTimeout(() => window.open(url, "_self"), 5000)

9
src/site.ts Normal file
View File

@ -0,0 +1,9 @@
export const sitemap: { [id: string]: string } = {
// Goatworks
"smartsheep.studio": "solsynth.dev",
"code.smartsheep.studio": "git.solsynth.dev",
// Hydrogen
"id.smartsheep.studio": "id.solsynth.dev",
"feed.smartsheep.studio": "co.solsynth.dev"
}

3
src/style.css Normal file
View File

@ -0,0 +1,3 @@
html, body {
font-family: "Roboto", system-ui, sans;
}

1
src/vite-env.d.ts vendored Normal file
View File

@ -0,0 +1 @@
/// <reference types="vite/client" />

23
tsconfig.json Normal file
View File

@ -0,0 +1,23 @@
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"module": "ESNext",
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src"]
}

5
unocss.config.ts Normal file
View File

@ -0,0 +1,5 @@
import { defineConfig, presetAttributify, presetTypography, presetUno } from "unocss";
export default defineConfig({
presets: [presetAttributify(), presetTypography(), presetUno({ preflight: false })]
})

14
vite.config.ts Normal file
View File

@ -0,0 +1,14 @@
import { fileURLToPath, URL } from "node:url"
import { defineConfig } from "vite"
import unocss from "unocss/vite"
// https://vitejs.dev/config/
export default defineConfig({
plugins: [unocss()],
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url))
}
},
})