Skip to content

Commit d23b73b

Browse files
stevending1stTechQuery
authored andcommitted
首页更新
1 parent 1de5aae commit d23b73b

13 files changed

Lines changed: 155 additions & 131 deletions

common/react-typed-component.d.ts

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/// <reference types="react" />
2+
3+
declare module 'react-typed-component' {
4+
export interface ReactTypedProps {
5+
typedRef?: Function;
6+
/** initialize in stopped state */
7+
stopped?: boolean;
8+
/** strings to be typed */
9+
strings?: string[];
10+
/** type speed in milliseconds */
11+
typeSpeed?: number;
12+
/** time before typing starts in milliseconds */
13+
startDelay?: number;
14+
/** backspacing speed in milliseconds */
15+
backSpeed?: number;
16+
/** only backspace what doesn't match the previous string */
17+
smartBackspace?: boolean;
18+
/** shuffle the strings */
19+
shuffle?: boolean;
20+
/** time before backspacing in milliseconds */
21+
backDelay?: number;
22+
/** Fade out instead of backspace */
23+
fadeOut?: boolean;
24+
/** css class for fade animation */
25+
fadeOutClass?: string;
26+
/** Fade out delay in milliseconds */
27+
fadeOutDelay?: number;
28+
/** loop the strings */
29+
loop?: boolean;
30+
/** amount of loops */
31+
loopCount?: number;
32+
/** show cursor */
33+
showCursor?: boolean;
34+
/** character for cursor */
35+
cursorChar?: string;
36+
/** insert CSS for cursor and fadeOut into HTML */
37+
autoInsertCss?: boolean;
38+
/** attribute for typing Ex?: input placeholder, value, or just HTML text */
39+
attr?: string;
40+
/** bind to focus and blur if el is text input */
41+
bindInputFocusEvents?: boolean;
42+
/** 'html' or 'null' for plaintext */
43+
contentType?: 'html' | null;
44+
/** onComplete(self?: Typed) All typing is complete */
45+
onComplete?: Function;
46+
/** preStringTyped(arrayPos?: number, self?: Typed) Before each string is typed */
47+
preStringTyped?: Function;
48+
/** onStringTyped(arrayPos?: number, self?: Typed) After each string is typed */
49+
onStringTyped?: Function;
50+
/** onLastStringBackspaced(self?: Typed) During looping, after last string is typed */
51+
onLastStringBackspaced?: Function;
52+
/** onTypingPaused(arrayPos?: number, self?: Typed) Typing has been stopped */
53+
onTypingPaused?: Function;
54+
/** onTypingResumed(arrayPos?: number, self?: Typed) Typing has been started after being stopped */
55+
onTypingResumed?: Function;
56+
/** onReset(self?: Typed) After reset */
57+
onReset?: Function;
58+
/** onStop(arrayPos?: number, self?: Typed) After stop */
59+
onStop?: Function;
60+
/** onStart(arrayPos?: number, self?: Typed) After start */
61+
onStart?: Function;
62+
/** onDestroy(self?: Typed) After destroy */
63+
onDestroy?: Function;
64+
className?: string;
65+
style?: React.CSSProperties;
66+
}
67+
class ReactTyped extends React.Component<ReactTypedProps, any> {}
68+
export default ReactTyped;
69+
}

components/PageHead.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export type PageHeadProps = PropsWithChildren<{
88

99
export default function PageHead({
1010
title,
11-
description = 'React project scaffold based on TypeScript, Next.js & Bootstrap.',
11+
description = '开源市集。',
1212
children,
1313
}: PageHeadProps) {
1414
return (

package-lock.json

Lines changed: 14 additions & 93 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,12 @@
1414
"e2e": "jest"
1515
},
1616
"dependencies": {
17-
"@editorjs/code": "^2.7.0",
18-
"@editorjs/editorjs": "^2.22.2",
19-
"@editorjs/header": "^2.6.2",
20-
"@editorjs/image": "^2.6.2",
21-
"@editorjs/link": "^2.3.1",
22-
"@editorjs/list": "^1.6.2",
23-
"@editorjs/paragraph": "^2.8.0",
24-
"@editorjs/quote": "^2.4.0",
25-
"editorjs-html": "^3.4.2",
2617
"idea-react": "^0.9.6",
2718
"next": "12.0.7",
2819
"react": "17.0.2",
2920
"react-bootstrap": "^2.0.4",
3021
"react-dom": "17.0.2",
31-
"react-editor-js": "^2.0.3"
22+
"react-typed-component": "^1.0.4"
3223
},
3324
"devDependencies": {
3425
"@jest/types": "^27.4.2",

packages.d.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.

pages/_app.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export default function MyApp({ Component, pageProps }: AppProps) {
3434
<Nav.Link href="/history">历史</Nav.Link>
3535
<Nav.Link href="/code-of-conduct">行为规范</Nav.Link>
3636
<Nav.Link href="/join-us">参与</Nav.Link>
37+
<Nav.Link href="/open-collaborator-award">开放协作人奖</Nav.Link>
3738
</Nav>
3839
</Container>
3940
</Navbar>

pages/index.tsx

Lines changed: 64 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,75 @@
1+
import ReactTyped from 'react-typed-component';
2+
import { Row, Col, Card } from 'react-bootstrap';
13
import PageHead from '../components/PageHead';
24
import styles from '../styles/Home.module.scss';
35

46
const HomePage = () => (
57
<>
68
<PageHead />
79

8-
<main
9-
className={`flex-fill d-flex flex-column justify-content-center align-items-center ${styles.main}`}
10+
<section
11+
className={`flex-fill d-flex flex-column justify-content-center align-items-center bg-secondary bg-gradient text-dark bg-opacity-10 ${styles.main}`}
1012
>
11-
<h1 className={`m-0 text-center ${styles.title}`}>
12-
欢迎来到
13-
<a
14-
className="text-primary mx-2"
15-
href="https://open-source-bazaar.github.io/"
16-
>
17-
开源市集!
18-
</a>
19-
</h1>
20-
</main>
13+
<h2 className={`m-0 text-center ${styles.title}`}>
14+
<ReactTyped
15+
backDelay={1}
16+
backSpeed={200}
17+
cursorChar="|"
18+
fadeOutDelay={100}
19+
loop
20+
loopCount={0}
21+
showCursor
22+
startDelay={0}
23+
strings={[
24+
"欢迎来到<strong><a className='text-primary mx-2' href='https://open-source-bazaar.github.io/'>开源市集</a></strong>",
25+
'欢迎参与<strong>开放式协作</strong>',
26+
'欢迎一起评选<strong>开放协作人奖</strong>',
27+
]}
28+
typeSpeed={100}
29+
typedRef={function noRefCheck() {}}
30+
/>
31+
</h2>
32+
</section>
33+
<section
34+
className={`flex-fill d-flex flex-column justify-content-center align-items-center pb-0 bg-success bg-opacity-25 ${styles.main}`}
35+
>
36+
<h2 className="text-start mb-5 mt-5 fw-bolder">形式</h2>
37+
<Row className="flex-fill d-flex justify-content-around align-items-center w-100 px-3">
38+
<Col xs={8} sm={7} md={4} className="pb-5">
39+
<Card body className={`shadow ${styles.activeCard}`}>
40+
<a href="/history">
41+
<h5 className="fw-bold mb-3">开源市集</h5>
42+
</a>
43+
<p>
44+
一群来自科技、艺术、环保不同领域的有趣的朋友通过展示、交流,将“开源”和“开放式协作”的乐趣带给更多人,点亮更多有趣的灵魂,为社会带来正面影响。
45+
</p>
46+
</Card>
47+
</Col>
48+
<Col xs={8} sm={7} md={4} className="pb-5">
49+
<Card body className={`shadow ${styles.activeCard}`}>
50+
<a href="/open-collaborator-award">
51+
<h5 className="fw-bold mb-3">开放协作人奖</h5>
52+
</a>
53+
<p>
54+
开放协作人,在过去的一年中,是否有人给你带来感动,带来惊喜?是否有人与你一起成长,一起进步?也许是长此以往,或者说那一瞬间,如果有这样令你难以忘怀的人,请把
55+
Ta 推荐给更多的人。
56+
</p>
57+
</Card>
58+
</Col>
59+
<Col xs={8} sm={7} md={4} className="pb-5">
60+
<Card body className={`shadow ${styles.activeCard}`}>
61+
欢迎
62+
<strong>
63+
<a href="/join-us">成为共创人/方</a>
64+
</strong>
65+
,更多内容/形式等你来共创……
66+
</Card>
67+
</Col>
68+
</Row>
69+
</section>
70+
<footer className="mw-100 bg-dark text-white">
71+
<p className="text-center my-0 py-3">© 2022 开源市集</p>
72+
</footer>
2173
</>
2274
);
2375

public/nextjs.png

-9.42 KB
Binary file not shown.

public/reactbootstrap.svg

Lines changed: 0 additions & 5 deletions
This file was deleted.

public/typescript.png

-3 KB
Binary file not shown.

0 commit comments

Comments
 (0)