first commit.

This commit is contained in:
2022-11-06 22:57:45 +08:00
commit 52a3ac8a84
10 changed files with 1514 additions and 0 deletions

42
.github/workflows/deploy.yml vendored Normal file
View File

@@ -0,0 +1,42 @@
name: Deploy
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 'current'
cache: 'npm'
- run: npm install
- run: CI=false npm run build
- uses: appleboy/ssh-action@v0.1.4
with:
username: root
host: ${{ secrets.HOST }}
key: ${{ secrets.KEY }}
script: docker compose -f /root/Home/docker-compose.yml down
- uses: easingthemes/ssh-deploy@v2.2.11
env:
SSH_PRIVATE_KEY: ${{ secrets.KEY }}
REMOTE_HOST: ${{ secrets.HOST }}
ARGS: "-avzr --delete"
SOURCE: dist/
REMOTE_USER: root
TARGET: /root/Home/build
- uses: appleboy/ssh-action@v0.1.4
with:
username: root
host: ${{ secrets.HOST }}
key: ${{ secrets.KEY }}
script: docker compose -f /root/Home/docker-compose.yml up -d

24
.gitignore vendored Normal file
View File

@@ -0,0 +1,24 @@
# 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?

1
.prettierrc.toml Normal file
View File

@@ -0,0 +1 @@
semi = false

14
index.html Normal file
View File

@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="zh-Hans">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>首页</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/main.js"></script>
</body>
</html>

52
main.js Normal file
View File

@@ -0,0 +1,52 @@
import "./style.css"
const sites = [
{
url: "https://oj.hyyz.izhai.net",
title: "在线判题网站",
description: "判题狗",
},
{
url: "https://code.hyyz.izhai.net",
title: "代码运行网站",
description: "自测猫",
},
{
url: "https://book.hyyz.izhai.net",
title: "编程知识网站",
description: "编程书",
},
{
url: "https://survey.hyyz.izhai.net",
title: "问卷系统网站",
description: "问卷姬",
},
{
url: "https://huabu.hyyz.izhai.net",
title: "在线画布",
description: " Excalidraw",
},
{
url: "https://blog.hyyz.izhai.net",
title: "博客",
description: "博客",
},
]
const item = (site) => `
<a href="${site.url}" class="card">
<h2>${site.title} &rarr;</h2>
<p>徐越的${site.description} ${site.url}</p>
</a>
`
document.querySelector("#app").innerHTML = `
<div class="container">
<main class="main">
<h1 class="title">你是不是要找以下网站?</h1>
<div class="grid" id="sites"></div>
</main>
</div>
`
document.querySelector("#sites").innerHTML = sites.map(item)

1245
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

18
package.json Normal file
View File

@@ -0,0 +1,18 @@
{
"name": "hyyz-home-next",
"private": true,
"version": "1.0.0",
"type": "module",
"scripts": {
"start": "vite",
"build": "vite build",
"preview": "vite preview",
"fmt": "prettier --write *.js style.css index.html"
},
"devDependencies": {
"@vitejs/plugin-legacy": "^2.3.0",
"prettier": "^2.7.1",
"terser": "^5.15.1",
"vite": "^3.2.0"
}
}

BIN
public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

107
style.css Normal file
View File

@@ -0,0 +1,107 @@
html,
body {
padding: 0;
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
}
a {
color: inherit;
text-decoration: none;
}
* {
box-sizing: border-box;
}
.container {
padding: 0 2rem;
}
.main {
min-height: 100vh;
padding: 2rem 0;
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
margin: 0 0 2rem;
line-height: 1.15;
font-size: 3rem;
}
.title,
.description {
text-align: center;
}
.description {
margin: 4rem 0;
line-height: 1.5;
font-size: 1.5rem;
}
.grid {
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
max-width: 800px;
}
.card {
margin: 1rem;
padding: 1.5rem;
text-align: left;
color: inherit;
text-decoration: none;
border: 1px solid #eaeaea;
border-radius: 10px;
transition: color 0.15s ease, border-color 0.15s ease;
max-width: 300px;
}
.card:hover,
.card:focus,
.card:active {
color: #0070f3;
border-color: #0070f3;
}
.card h2 {
margin: 0 0 1rem 0;
font-size: 1.5rem;
}
.card p {
margin: 0;
font-size: 1.25rem;
line-height: 1.5;
}
@media (max-width: 600px) {
.grid {
width: 100%;
flex-direction: column;
}
}
@media (prefers-color-scheme: dark) {
html {
color-scheme: dark;
}
body {
color: white;
background: black;
}
.card {
border-color: #222;
}
}

11
vite.config.js Normal file
View File

@@ -0,0 +1,11 @@
import { defineConfig } from "vite"
import legacy from "@vitejs/plugin-legacy"
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
legacy({
targets: ["defaults", "not IE 11"],
}),
],
})