Skip to content
This repository was archived by the owner on Nov 2, 2024. It is now read-only.

Commit 193b150

Browse files
committed
chore: init
0 parents  commit 193b150

20 files changed

+4172
-0
lines changed

.github/renovate.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"labels": ["dependencies"],
3+
"extends": [
4+
"config:base",
5+
":automergePatch",
6+
":automergeTypes",
7+
":automergeTesters",
8+
":automergeLinters",
9+
":rebaseStalePrs"
10+
],
11+
"packageRules": [
12+
{
13+
"updateTypes": [
14+
"major"
15+
],
16+
"labels": [
17+
"UPDATE-MAJOR",
18+
"dependencies"
19+
]
20+
}
21+
],
22+
"enabled": true
23+
}

.github/workflows/ci.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
on:
2+
pull_request:
3+
4+
5+
name: Build CI
6+
7+
jobs:
8+
build:
9+
name: Build
10+
strategy:
11+
matrix:
12+
os: [ubuntu-latest]
13+
runs-on: ${{ matrix.os }}
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v3
17+
with:
18+
fetch-depth: 0
19+
- uses: actions/setup-node@v3
20+
with:
21+
node-version: 16.x
22+
- name: Cache pnpm modules
23+
uses: actions/cache@v3
24+
env:
25+
cache-name: cache-pnpm-modules
26+
with:
27+
path: ~/.pnpm-store
28+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
29+
restore-keys: |
30+
${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
31+
- uses: pnpm/[email protected]
32+
with:
33+
version: latest
34+
run_install: false
35+
36+
- name: Build project
37+
run: |
38+
pnpm i
39+
pnpm run build
40+
npx next export

.github/workflows/deploy.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Deploy
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [16.x]
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
- name: Use Node.js ${{ matrix.node-version }}
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
- name: Cache pnpm modules
24+
uses: actions/cache@v3
25+
env:
26+
cache-name: cache-pnpm-modules
27+
with:
28+
path: ~/.pnpm-store
29+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
30+
restore-keys: |
31+
${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-
32+
- uses: pnpm/[email protected]
33+
with:
34+
version: latest
35+
run_install: false
36+
37+
- name: Build project
38+
run: |
39+
pnpm i
40+
pnpm run build
41+
npx next export
42+
- name: Add CNAME
43+
run: |
44+
echo "mx-space.js.org" > out/CNAME
45+
- name: Deploy
46+
uses: peaceiris/actions-gh-pages@v3
47+
with:
48+
github_token: ${{ secrets.GITHUB_TOKEN }}
49+
publish_dir: out
50+
env:
51+
CI: true

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.next
2+
node_modules
3+
out
4+
public/rss.*

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 Shu Ding
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

components/features/index.module.css

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
.feature {
2+
position: relative;
3+
padding: 1.5rem 1.75rem;
4+
color: #000;
5+
background-color: white;
6+
overflow: hidden;
7+
border-radius: 1.78em;
8+
}
9+
.feature.large {
10+
grid-column: span 2;
11+
}
12+
.feature.centered {
13+
text-align: center;
14+
}
15+
.feature h3 {
16+
position: relative;
17+
font-size: 34px;
18+
font-size: min(34px, max(4vw, 24px));
19+
font-weight: 600;
20+
line-height: 1.25;
21+
letter-spacing: -0.02rem;
22+
z-index: 2;
23+
}
24+
:global(.dark) .feature:not(.light-only) {
25+
color: #fff;
26+
background-color: #202020;
27+
}
28+
.feature {
29+
box-shadow: 0 8px 16px rgb(0 0 0 / 8%), 0 1px 2px rgb(0 0 0 / 4%),
30+
0 0 0 1px rgb(0 0 0 / 3%);
31+
transition: box-shadow 0.3s ease;
32+
}
33+
:global(.dark) .feature {
34+
box-shadow: 0 0 0 1px rgb(82 82 82 / 60%);
35+
}
36+
.feature .link {
37+
position: absolute;
38+
right: 1em;
39+
bottom: 1em;
40+
z-index: 2;
41+
width: 2.5em;
42+
height: 2.5em;
43+
background-color: rgb(0 0 0 / 39%);
44+
backdrop-filter: blur(10px);
45+
border-radius: 50%;
46+
display: flex;
47+
justify-content: center;
48+
align-items: center;
49+
color: rgba(255, 255, 255, 0.9);
50+
box-shadow: 0 0 0 2px rgb(154 154 154 / 56%), 0 0 30px rgb(0 0 0 / 10%);
51+
transition: all 0.2s ease;
52+
-webkit-user-drag: none;
53+
}
54+
@media (hover: hover) {
55+
.feature .link {
56+
opacity: 0;
57+
}
58+
.feature:hover .link {
59+
opacity: 1;
60+
}
61+
.feature .link:hover {
62+
transform: scale(1.05);
63+
color: rgba(255, 255, 255, 1);
64+
background-color: rgba(64, 64, 64, 0.39);
65+
box-shadow: 0 0 0 2px rgba(220, 220, 220, 0.56), 0 0 30px rgb(0 0 0 / 10%);
66+
}
67+
.feature .link:active {
68+
transform: scale(1);
69+
color: rgba(255, 255, 255, 0.8);
70+
background-color: rgba(22, 22, 22, 0.39);
71+
box-shadow: 0 0 0 2px rgba(178, 178, 178, 0.56), 0 0 30px rgb(0 0 0 / 10%);
72+
}
73+
}
74+
75+
.features {
76+
display: grid;
77+
grid-template-columns: repeat(3, 1fr);
78+
grid-gap: 2em;
79+
font-feature-settings: initial;
80+
}
81+
82+
.feature :global(.show-on-mobile) {
83+
display: none;
84+
}
85+
86+
@media screen and (max-width: 1024px) {
87+
.feature {
88+
max-width: 80vw;
89+
width: 100%;
90+
}
91+
.feature.large {
92+
grid-column: span 1;
93+
}
94+
.features {
95+
grid-template-columns: 1fr;
96+
grid-gap: 3em;
97+
justify-items: center;
98+
}
99+
.feature h3 {
100+
font-size: 28px;
101+
font-size: min(28px, max(4vw, 22px));
102+
text-align: center;
103+
}
104+
}
105+
106+
@media screen and (max-width: 640px) {
107+
.feature {
108+
max-width: 460px;
109+
width: 100%;
110+
}
111+
.feature.large {
112+
grid-column: span 1;
113+
}
114+
.features {
115+
grid-template-columns: 1fr;
116+
grid-gap: 3em;
117+
justify-items: center;
118+
}
119+
.feature h3 {
120+
font-size: 34px;
121+
font-size: min(34px, max(4vw, 22px));
122+
text-align: center;
123+
}
124+
.feature :global(.show-on-mobile) {
125+
display: block;
126+
}
127+
}

components/features/index.tsx

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import type { ReactNode } from 'react'
2+
import Link from 'next/link'
3+
import cn from 'clsx'
4+
import { motion } from 'framer-motion'
5+
6+
import styles from './index.module.css'
7+
8+
export function Feature({
9+
large,
10+
centered,
11+
children,
12+
lightOnly,
13+
className,
14+
href,
15+
index,
16+
...props
17+
}) {
18+
return (
19+
<motion.div
20+
initial={{ opacity: 0 }}
21+
whileInView={{ opacity: 1 }}
22+
viewport={{ once: true, margin: '-20px' }}
23+
transition={{ duration: Math.min(0.25 + index * 0.2, 0.8) }}
24+
className={cn(
25+
styles.feature,
26+
large && styles.large,
27+
centered && styles.centered,
28+
lightOnly && styles['light-only'],
29+
className
30+
)}
31+
{...props}
32+
>
33+
{children}
34+
{href ? (
35+
<Link className={styles.link} href={href}>
36+
<svg
37+
xmlns="http://www.w3.org/2000/svg"
38+
width="1.5em"
39+
viewBox="0 0 20 20"
40+
fill="currentColor"
41+
>
42+
<path
43+
fillRule="evenodd"
44+
d="M12.293 5.293a1 1 0 011.414 0l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-2.293-2.293a1 1 0 010-1.414z"
45+
clipRule="evenodd"
46+
/>
47+
</svg>
48+
</Link>
49+
) : null}
50+
</motion.div>
51+
)
52+
}
53+
54+
export function Features({ children }: { children: ReactNode }) {
55+
return <div className={styles.features}>{children}</div>
56+
}

0 commit comments

Comments
 (0)