@bbki.ng/site 0.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/deploy.yml +44 -0
- package/.husky/pre-commit +4 -0
- package/.prettierignore +1 -0
- package/.prettierrc.json +1 -0
- package/.rush/temp/shrinkwrap-deps.json +908 -0
- package/CODE_OF_CONDUCT.md +45 -0
- package/CONTRIBUTING.md +11 -0
- package/LICENSE +21 -0
- package/README.md +21 -0
- package/index.html +33 -0
- package/jest.config.js +15 -0
- package/package.json +69 -0
- package/postcss.config.cjs +6 -0
- package/public/Logo.svg +9 -0
- package/public/apple-touch-icon.png +0 -0
- package/public/favicon-16x16.png +0 -0
- package/public/favicon-32x32.png +0 -0
- package/public/favicon.ico +0 -0
- package/public/favicon.svg +9 -0
- package/public/pwa-192x192.png +0 -0
- package/public/pwa-512x512.png +0 -0
- package/public/robots.txt +2 -0
- package/src/__test__/utils/index.test.ts +90 -0
- package/src/app.tsx +97 -0
- package/src/articles/anti-logic.mdx +61 -0
- package/src/articles/bbking-manual.mdx +88 -0
- package/src/articles/black-river.mdx +8 -0
- package/src/articles/cooldown.mdx +12 -0
- package/src/articles/fall.mdx +8 -0
- package/src/articles/img.mdx +104 -0
- package/src/articles/index.ts +35 -0
- package/src/articles/loading.mdx +129 -0
- package/src/articles/major-cold.mdx +14 -0
- package/src/articles/men-without-women.mdx +19 -0
- package/src/articles/movie-day.mdx +15 -0
- package/src/articles/now.mdx +15 -0
- package/src/articles/projects.mdx +9 -0
- package/src/articles/quote.mdx +27 -0
- package/src/articles/spring-cooldown.mdx +7 -0
- package/src/articles/spring-rain.mdx +9 -0
- package/src/articles/travel.mdx +21 -0
- package/src/articles/warming-up.mdx +10 -0
- package/src/articles/web-burnning.mdx +10 -0
- package/src/auth_required.tsx +17 -0
- package/src/components/Spinner.tsx +33 -0
- package/src/components/article/index.tsx +31 -0
- package/src/components/aspect_ratio_box/index.tsx +29 -0
- package/src/components/blur_cover/index.tsx +28 -0
- package/src/components/book_list/index.tsx +50 -0
- package/src/components/comment/index.tsx +70 -0
- package/src/components/comment/use_cusdis_event.ts +37 -0
- package/src/components/corner_prompt_box/index.tsx +63 -0
- package/src/components/disabled_text/index.tsx +23 -0
- package/src/components/fade_out_cover/index.tsx +37 -0
- package/src/components/footer/footer_links.ts +13 -0
- package/src/components/footer/index.tsx +21 -0
- package/src/components/hotkey_nav/index.tsx +50 -0
- package/src/components/img_list/index.tsx +43 -0
- package/src/components/index.tsx +27 -0
- package/src/components/movie_list/index.tsx +50 -0
- package/src/components/my_suspense.tsx +14 -0
- package/src/components/progress_bar/index.tsx +31 -0
- package/src/components/reload_prompt/index.tsx +36 -0
- package/src/components/stickers/index.tsx +46 -0
- package/src/components/table_skeleton/index.tsx +40 -0
- package/src/components/tags/index.tsx +52 -0
- package/src/components/video_player/index.tsx +81 -0
- package/src/components/with_wrapper/index.tsx +13 -0
- package/src/constants/cusdis.ts +6 -0
- package/src/constants/index.ts +16 -0
- package/src/constants/photo_projects.ts +54 -0
- package/src/constants/photos.ts +270 -0
- package/src/constants/routes.ts +24 -0
- package/src/constants/video_logs.ts +16 -0
- package/src/demo/DemoBox.tsx +15 -0
- package/src/demo/ImgDemo.tsx +34 -0
- package/src/demo/SpinnerDemo.tsx +17 -0
- package/src/global/mdx.d.ts +8 -0
- package/src/global_loading_state_provider.tsx +27 -0
- package/src/hooks/index.ts +15 -0
- package/src/hooks/useScrollToTop.ts +24 -0
- package/src/hooks/useTransitionCls.ts +36 -0
- package/src/hooks/use_img_loading.ts +16 -0
- package/src/hooks/use_pathname.ts +6 -0
- package/src/hooks/use_paths.ts +30 -0
- package/src/hooks/use_projects.ts +56 -0
- package/src/hooks/use_route_name.ts +7 -0
- package/src/hooks/use_supa_session.ts +30 -0
- package/src/hooks/use_uploader.ts +34 -0
- package/src/hooks/use_video_controls.ts +71 -0
- package/src/main.css +156 -0
- package/src/main.tsx +19 -0
- package/src/pages/cover/index.tsx +10 -0
- package/src/pages/extensions/png/consts.ts +9 -0
- package/src/pages/extensions/png/index.tsx +41 -0
- package/src/pages/extensions/png/png_projects.tsx +63 -0
- package/src/pages/extensions/txt/article.tsx +26 -0
- package/src/pages/extensions/txt/consts.ts +8 -0
- package/src/pages/extensions/txt/index.tsx +21 -0
- package/src/pages/index.tsx +14 -0
- package/src/pages/login/index.tsx +33 -0
- package/src/pages/now/index.tsx +7 -0
- package/src/pages/tags/index.tsx +28 -0
- package/src/pages/tags/tag_result.tsx +19 -0
- package/src/swr.tsx +18 -0
- package/src/types/articles.ts +6 -0
- package/src/types/color.ts +21 -0
- package/src/types/cusdis.ts +4 -0
- package/src/types/oss.ts +15 -0
- package/src/types/path.ts +11 -0
- package/src/types/photo.ts +17 -0
- package/src/types/supabase.ts +9 -0
- package/src/utils/index.ts +143 -0
- package/src/utils/tags.ts +21 -0
- package/tailwind.config.cjs +10 -0
- package/tsconfig.json +24 -0
- package/vite.config.ts +108 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Code Of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, political party, or sexual identity and orientation. Note, however, that religion, political party, or other ideological affiliation provide no exemptions for the behavior we outline as unacceptable in this Code of Conduct.
|
|
6
|
+
|
|
7
|
+
## Our Standards
|
|
8
|
+
|
|
9
|
+
Examples of behavior that contributes to creating a positive environment include:
|
|
10
|
+
|
|
11
|
+
- Using welcoming and inclusive language
|
|
12
|
+
- Being respectful of differing viewpoints and experiences
|
|
13
|
+
- Gracefully accepting constructive criticism
|
|
14
|
+
- Focusing on what is best for the community
|
|
15
|
+
- Showing empathy towards other community members
|
|
16
|
+
|
|
17
|
+
Examples of unacceptable behavior by participants include:
|
|
18
|
+
|
|
19
|
+
- The use of sexualized language or imagery and unwelcome sexual attention or advances
|
|
20
|
+
- Trolling, insulting/derogatory comments, and personal or political attacks
|
|
21
|
+
- Public or private harassment
|
|
22
|
+
- Publishing others' private information, such as a physical or electronic address, without explicit permission
|
|
23
|
+
- Other conduct which could reasonably be considered inappropriate in a professional setting
|
|
24
|
+
|
|
25
|
+
## Our Responsibilities
|
|
26
|
+
|
|
27
|
+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
|
28
|
+
|
|
29
|
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
|
30
|
+
|
|
31
|
+
## Scope
|
|
32
|
+
|
|
33
|
+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
|
|
34
|
+
|
|
35
|
+
## Enforcement
|
|
36
|
+
|
|
37
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at ping@zjh.im. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
|
38
|
+
|
|
39
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
|
40
|
+
|
|
41
|
+
## Attribution
|
|
42
|
+
|
|
43
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
|
44
|
+
|
|
45
|
+
[homepage]: https://www.contributor-covenant.org
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Contributing guide
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing to BBKi.ng! There are many ways to contribute, and we appreciate all of them.
|
|
4
|
+
|
|
5
|
+
## Bug reports
|
|
6
|
+
|
|
7
|
+
Find any bugs about [BBKi.ng](https://bbki.ng) on your device? [open an issue](https://github.com/bbbottle/bbki.ng/issues).
|
|
8
|
+
|
|
9
|
+
## Code review
|
|
10
|
+
|
|
11
|
+
If you are interested in the code and have any suggestions, please reference its line number in new issue and elaborate your thoughts.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 bbbottle
|
|
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.
|
package/README.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
### About
|
|
4
|
+
|
|
5
|
+
Code behind https://bbki.ng.
|
|
6
|
+
|
|
7
|
+
### Roadmap
|
|
8
|
+
|
|
9
|
+
The [BBKi.ng public roadmap](https://github.com/bbbottle/bbki.ng/projects/2).
|
|
10
|
+
|
|
11
|
+
### Q&A
|
|
12
|
+
|
|
13
|
+
Open a new [discussion](https://github.com/bbbottle/bbki.ng/discussions/categories/q-a).
|
|
14
|
+
|
|
15
|
+
### Contributing
|
|
16
|
+
|
|
17
|
+
See [the contributing guide](CONTRIBUTING.md) for details.
|
|
18
|
+
|
|
19
|
+
### License
|
|
20
|
+
|
|
21
|
+
[MIT](LICENSE)
|
package/index.html
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en" class="h-full no-scrollbar">
|
|
3
|
+
<head>
|
|
4
|
+
<title>bbki.ng</title>
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<meta name="description" content="baby king" />
|
|
7
|
+
<link
|
|
8
|
+
rel="preload"
|
|
9
|
+
href="https://api.bbki.ng/projects"
|
|
10
|
+
as="fetch"
|
|
11
|
+
crossorigin
|
|
12
|
+
type="application/json"
|
|
13
|
+
/>
|
|
14
|
+
<link rel="icon" type="image/svg" href="/favicon.svg" />
|
|
15
|
+
<link
|
|
16
|
+
rel="alternate icon"
|
|
17
|
+
href="/favicon.ico"
|
|
18
|
+
type="image/png"
|
|
19
|
+
sizes="16x16"
|
|
20
|
+
/>
|
|
21
|
+
<link rel="apple-touch-icon" href="/apple-touch-icon.png" sizes="180x180" />
|
|
22
|
+
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
|
|
23
|
+
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
|
|
24
|
+
<link rel="mask-icon" href="/favicon.svg" color="#FFFFFF" />
|
|
25
|
+
<meta name="theme-color" content="#ffffff" />
|
|
26
|
+
<meta charset="UTF-8" />
|
|
27
|
+
</head>
|
|
28
|
+
|
|
29
|
+
<body class="h-full m-0 flex flex-col font-mono">
|
|
30
|
+
<div id="root" class="flex-grow"></div>
|
|
31
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
32
|
+
</body>
|
|
33
|
+
</html>
|
package/jest.config.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
|
|
2
|
+
const config = {
|
|
3
|
+
preset: "ts-jest",
|
|
4
|
+
testEnvironment: "jsdom",
|
|
5
|
+
collectCoverageFrom: [
|
|
6
|
+
"src/utils/index.ts",
|
|
7
|
+
"!**/node_modules/**",
|
|
8
|
+
"!**/vendor/**",
|
|
9
|
+
],
|
|
10
|
+
moduleNameMapper: {
|
|
11
|
+
"@/(.*)$": "<rootDir>/src/$1",
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default config;
|
package/package.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@bbki.ng/site",
|
|
3
|
+
"version": "0.0.17",
|
|
4
|
+
"description": "code behind bbki.ng",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "jest",
|
|
8
|
+
"test:cov": "jest --coverage",
|
|
9
|
+
"dev": "vite",
|
|
10
|
+
"build": "tsc && vite build",
|
|
11
|
+
"serve": "vite preview"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/bbbottle/bbki.ng.git"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@bbki.ng/components": "workspace:2.1.7",
|
|
20
|
+
"@supabase/supabase-js": "^1.30.6",
|
|
21
|
+
"classnames": "2.3.1",
|
|
22
|
+
"react": "^18.0.0",
|
|
23
|
+
"react-cusdis": "^2.1.3",
|
|
24
|
+
"react-dom": "^18.0.0",
|
|
25
|
+
"react-hotkeys-hook": "^3.4.3",
|
|
26
|
+
"react-router-dom": "6",
|
|
27
|
+
"swr": "^1.2.1"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@bbki.ng/stylebase": "workspace:0.0.5",
|
|
31
|
+
"@mdx-js/mdx": "2.0.0-next.9",
|
|
32
|
+
"@mdx-js/react": "^1.6.22",
|
|
33
|
+
"@tailwindcss/typography": "^0.5.0",
|
|
34
|
+
"@types/jest": "^27.0.3",
|
|
35
|
+
"@types/node": "^16.11.1",
|
|
36
|
+
"@types/react": "^18.0.15",
|
|
37
|
+
"@types/react-dom": "^18.0.6",
|
|
38
|
+
"@vitejs/plugin-react": "^1.0.0",
|
|
39
|
+
"autoprefixer": "^10.3.7",
|
|
40
|
+
"husky": "^7.0.0",
|
|
41
|
+
"jest": "^27.4.5",
|
|
42
|
+
"lint-staged": "^11.2.1",
|
|
43
|
+
"postcss": "^8.3.9",
|
|
44
|
+
"prettier": "^2.4.1",
|
|
45
|
+
"pretty-quick": "^3.1.1",
|
|
46
|
+
"rehype-autolink-headings": "^6.1.1",
|
|
47
|
+
"rehype-highlight": "^5.0.0",
|
|
48
|
+
"rehype-slug": "^5.0.1",
|
|
49
|
+
"remark-frontmatter": "^4.0.1",
|
|
50
|
+
"remark-gfm": "^3.0.0",
|
|
51
|
+
"remark-mdx-frontmatter": "^1.0.1",
|
|
52
|
+
"remark-parse": "^10.0.0",
|
|
53
|
+
"remark-toc": "^8.0.1",
|
|
54
|
+
"sass": "^1.42.1",
|
|
55
|
+
"tailwindcss": "^3.0.7",
|
|
56
|
+
"ts-jest": "^27.1.1",
|
|
57
|
+
"typescript": "^4.5.4",
|
|
58
|
+
"vite": "3.0.0",
|
|
59
|
+
"vite-plugin-mdx": "^3.5.8",
|
|
60
|
+
"vite-plugin-pwa": "^0.11.3",
|
|
61
|
+
"workbox-window": "^6.3.0"
|
|
62
|
+
},
|
|
63
|
+
"author": "bbbottle",
|
|
64
|
+
"license": "MIT",
|
|
65
|
+
"bugs": {
|
|
66
|
+
"url": "https://github.com/bbbottle/bbki.ng/issues"
|
|
67
|
+
},
|
|
68
|
+
"homepage": "https://github.com/bbbottle/bbki.ng#readme"
|
|
69
|
+
}
|
package/public/Logo.svg
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M29.1152 21.3106C32.0605 21.3106 34.4481 18.9101 34.4481 15.9489V24.6457C34.4481 25.7585 33.5508 26.6607 32.444 26.6607H15.1207C14.0138 26.6607 13.1166 25.7585 13.1166 24.6457V15.9489C13.1166 18.9101 15.5042 21.3106 18.4494 21.3106C21.3947 21.3106 23.7823 18.9101 23.7823 15.9489C23.7823 18.9101 26.17 21.3106 29.1152 21.3106Z" fill="#9CA3AF"/>
|
|
3
|
+
<path d="M23.7823 15.9373L23.7823 15.9489C23.7823 15.9451 23.7823 15.9412 23.7823 15.9373Z" fill="#9CA3AF"/>
|
|
4
|
+
<path d="M23.1143 28.004C23.1205 30.9598 25.5057 33.3541 28.4472 33.3541C31.3886 33.3541 33.7738 30.9598 33.7801 28.004H23.1143Z" fill="#9CA3AF"/>
|
|
5
|
+
<path d="M13.7846 28.004C13.7846 28.0079 13.7846 28.0117 13.7846 28.0156C13.7908 30.9714 16.1761 33.3657 19.1175 33.3657C22.0589 33.3657 24.4442 30.9714 24.4504 28.0156H13.7846V28.004Z" fill="#9CA3AF"/>
|
|
6
|
+
<path d="M14.4527 15.9373C14.4527 16.6792 13.8545 17.2806 13.1166 17.2806C12.3786 17.2806 11.7805 16.6792 11.7805 15.9373C11.7805 15.1954 12.3786 14.594 13.1166 14.594C13.8545 14.594 14.4527 15.1954 14.4527 15.9373Z" fill="#9CA3AF"/>
|
|
7
|
+
<path d="M25.1184 15.2657C25.1184 16.0076 24.5202 16.609 23.7823 16.609C23.0444 16.609 22.4462 16.0076 22.4462 15.2657C22.4462 14.5238 23.0444 13.9224 23.7823 13.9224C24.5202 13.9224 25.1184 14.5238 25.1184 15.2657Z" fill="#9CA3AF"/>
|
|
8
|
+
<path d="M35.7842 15.9373C35.7842 16.6792 35.186 17.2806 34.4481 17.2806C33.7102 17.2806 33.112 16.6792 33.112 15.9373C33.112 15.1954 33.7102 14.594 34.4481 14.594C35.186 14.594 35.7842 15.1954 35.7842 15.9373Z" fill="#9CA3AF"/>
|
|
9
|
+
</svg>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<svg width="24" height="20" viewBox="0 0 24 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M17.3321 7.34741C20.2769 7.34741 22.6641 4.96017 22.6641 2.01536V10.6641C22.6641 11.7708 21.767 12.6679 20.6603 12.6679H3.33973C2.23304 12.6679 1.33589 11.7708 1.33589 10.6641V2.01536C1.33589 4.96017 3.72314 7.34741 6.66795 7.34741C9.61276 7.34741 12 4.96017 12 2.01536C12 4.96017 14.3872 7.34741 17.3321 7.34741Z" fill="#9CA3AF"/>
|
|
3
|
+
<path d="M12 2.00384L12 2.01536C12 2.01151 12 2.00768 12 2.00384Z" fill="#9CA3AF"/>
|
|
4
|
+
<path d="M11.3321 14.0038C11.3383 16.9434 13.7231 19.3244 16.6641 19.3244C19.6051 19.3244 21.9899 16.9434 21.9962 14.0038H11.3321Z" fill="#9CA3AF"/>
|
|
5
|
+
<path d="M2.00384 14.0038C2.00384 14.0077 2.00383 14.0115 2.00384 14.0154C2.01006 16.9549 4.39493 19.3359 7.3359 19.3359C10.2769 19.3359 12.6617 16.9549 12.6679 14.0154H2.00384V14.0038Z" fill="#9CA3AF"/>
|
|
6
|
+
<path d="M2.67179 2.00384C2.67179 2.74163 2.07369 3.33973 1.33589 3.33973C0.598099 3.33973 0 2.74163 0 2.00384C0 1.26605 0.598099 0.667946 1.33589 0.667946C2.07369 0.667946 2.67179 1.26605 2.67179 2.00384Z" fill="#9CA3AF"/>
|
|
7
|
+
<path d="M13.3359 1.33589C13.3359 2.07369 12.7378 2.67179 12 2.67179C11.2622 2.67179 10.6641 2.07369 10.6641 1.33589C10.6641 0.598099 11.2622 0 12 0C12.7378 0 13.3359 0.598099 13.3359 1.33589Z" fill="#9CA3AF"/>
|
|
8
|
+
<path d="M24 2.00384C24 2.74163 23.4019 3.33973 22.6641 3.33973C21.9263 3.33973 21.3282 2.74163 21.3282 2.00384C21.3282 1.26605 21.9263 0.667946 22.6641 0.667946C23.4019 0.667946 24 1.26605 24 2.00384Z" fill="#9CA3AF"/>
|
|
9
|
+
</svg>
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import {
|
|
2
|
+
addOssWebpProcessStyle,
|
|
3
|
+
calcDefaultImgSize,
|
|
4
|
+
delay,
|
|
5
|
+
floatNumberToPercentageString,
|
|
6
|
+
getEnv,
|
|
7
|
+
minDelay,
|
|
8
|
+
} from "@/utils";
|
|
9
|
+
import { ossProcessType } from "@/types/oss";
|
|
10
|
+
import { OSS_PHOTOS } from "@/constants/photos";
|
|
11
|
+
|
|
12
|
+
jest.useFakeTimers();
|
|
13
|
+
jest.spyOn(window, "setTimeout");
|
|
14
|
+
|
|
15
|
+
describe("calcDefaultImgSize", () => {
|
|
16
|
+
it("should respect default width", () => {
|
|
17
|
+
const dw = 500;
|
|
18
|
+
expect(calcDefaultImgSize(OSS_PHOTOS.shopping, dw).width).toEqual(dw);
|
|
19
|
+
});
|
|
20
|
+
it("should return 576 as default width when photo is horizontal", () => {
|
|
21
|
+
expect(calcDefaultImgSize(OSS_PHOTOS.stone).width).toEqual(576);
|
|
22
|
+
});
|
|
23
|
+
it("should return 384 as default width when photo is horizontal", () => {
|
|
24
|
+
expect(calcDefaultImgSize(OSS_PHOTOS.player).width).toEqual(384);
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
describe("floatNumberToPercentageString", () => {
|
|
29
|
+
it("should return percentage string correctly", () => {
|
|
30
|
+
expect(floatNumberToPercentageString(0.8)).toBe("80%");
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
describe("addOssWebpProcessStyle", () => {
|
|
35
|
+
it("should return original url when image's url is invalid", () => {
|
|
36
|
+
const originalUrl = "foo";
|
|
37
|
+
expect(addOssWebpProcessStyle(originalUrl, ossProcessType.WEBP)).toEqual(
|
|
38
|
+
originalUrl
|
|
39
|
+
);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it("should add oss style to url correctly", () => {
|
|
43
|
+
const originalUrl =
|
|
44
|
+
"https://zjh-im-res.oss-cn-shenzhen.aliyuncs.com/image/xiang-jiang-river/DSCF2203-1.jpg";
|
|
45
|
+
expect(addOssWebpProcessStyle(originalUrl, ossProcessType.WEBP)).toEqual(
|
|
46
|
+
`${originalUrl}?x-oss-process=style/${ossProcessType.WEBP}`
|
|
47
|
+
);
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
describe("delay", () => {
|
|
52
|
+
it("should delay correctly", () => {
|
|
53
|
+
delay(5000);
|
|
54
|
+
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
55
|
+
expect(setTimeout).toHaveBeenLastCalledWith(expect.any(Function), 5000);
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
describe("minDelay", () => {
|
|
60
|
+
it("should delay at least specific duration", () => {
|
|
61
|
+
const promise = delay(1000);
|
|
62
|
+
expect(minDelay(promise, 2000)).toEqual(promise);
|
|
63
|
+
expect(setTimeout).toHaveBeenLastCalledWith(expect.any(Function), 2000);
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
describe("getEnv", () => {
|
|
68
|
+
it("should return development when href start with http://localhost", () => {
|
|
69
|
+
const locationSpy = jest.spyOn(window, "location", "get");
|
|
70
|
+
locationSpy.mockImplementation(
|
|
71
|
+
() =>
|
|
72
|
+
({
|
|
73
|
+
href: "http://localhost:3000",
|
|
74
|
+
} as Location)
|
|
75
|
+
);
|
|
76
|
+
expect(getEnv()).toEqual("development");
|
|
77
|
+
locationSpy.mockRestore();
|
|
78
|
+
});
|
|
79
|
+
it("should return production when href is NOT start with http://localhost", () => {
|
|
80
|
+
const locationSpy = jest.spyOn(window, "location", "get");
|
|
81
|
+
locationSpy.mockImplementation(
|
|
82
|
+
() =>
|
|
83
|
+
({
|
|
84
|
+
href: "https://bbki.ng",
|
|
85
|
+
} as Location)
|
|
86
|
+
);
|
|
87
|
+
expect(getEnv()).toEqual("production");
|
|
88
|
+
locationSpy.mockRestore();
|
|
89
|
+
});
|
|
90
|
+
});
|
package/src/app.tsx
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import React, { useContext } from "react";
|
|
2
|
+
import { Routes, Route, Outlet } from "react-router-dom";
|
|
3
|
+
import {
|
|
4
|
+
Nav,
|
|
5
|
+
Page,
|
|
6
|
+
ThreeColLayout,
|
|
7
|
+
NotFound,
|
|
8
|
+
ErrorBoundary,
|
|
9
|
+
} from "@bbki.ng/components";
|
|
10
|
+
import { HotKeyNav, Stickers } from "./components";
|
|
11
|
+
import { Cover } from "./pages";
|
|
12
|
+
|
|
13
|
+
import Png from "@/pages/extensions/png";
|
|
14
|
+
import ArticlePage from "@/pages/extensions/txt/article";
|
|
15
|
+
import NowPage from "@/pages/now";
|
|
16
|
+
import PhotoProjects from "@/pages/extensions/png/png_projects";
|
|
17
|
+
import Tags from "@/pages/tags";
|
|
18
|
+
import TagsResult from "@/pages/tags/tag_result";
|
|
19
|
+
import Txt from "@/pages/extensions/txt";
|
|
20
|
+
|
|
21
|
+
import { usePaths } from "@/hooks";
|
|
22
|
+
import { Login } from "@/pages/login";
|
|
23
|
+
import { SWR } from "@/swr";
|
|
24
|
+
import {
|
|
25
|
+
GlobalLoadingContext,
|
|
26
|
+
GlobalLoadingStateProvider,
|
|
27
|
+
} from "@/global_loading_state_provider";
|
|
28
|
+
import { useScrollToTop } from "@/hooks/useScrollToTop";
|
|
29
|
+
|
|
30
|
+
const Layout = () => {
|
|
31
|
+
const { isLoading } = useContext(GlobalLoadingContext);
|
|
32
|
+
return (
|
|
33
|
+
<>
|
|
34
|
+
<Page
|
|
35
|
+
nav={
|
|
36
|
+
<Nav paths={usePaths()} className="blur-cover" loading={isLoading} />
|
|
37
|
+
}
|
|
38
|
+
main={<Outlet />}
|
|
39
|
+
footer={null}
|
|
40
|
+
/>
|
|
41
|
+
</>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const threeColWrapper =
|
|
46
|
+
<T extends object>(Component: any) =>
|
|
47
|
+
(props: T) => {
|
|
48
|
+
return (
|
|
49
|
+
<ThreeColLayout
|
|
50
|
+
middleRenderer={() => (
|
|
51
|
+
<ErrorBoundary>
|
|
52
|
+
<Component {...props} />
|
|
53
|
+
</ErrorBoundary>
|
|
54
|
+
)}
|
|
55
|
+
/>
|
|
56
|
+
);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const NowInMidCol = threeColWrapper(NowPage);
|
|
60
|
+
const ContentInMidCol = threeColWrapper(Txt);
|
|
61
|
+
const ArticleInMidCol = threeColWrapper(ArticlePage);
|
|
62
|
+
const TagsInMidCol = threeColWrapper(Tags);
|
|
63
|
+
const LoginInMidCol = threeColWrapper(Login);
|
|
64
|
+
const TagsResultInMidCol = threeColWrapper(TagsResult);
|
|
65
|
+
const CoverInMidCol = threeColWrapper(Cover);
|
|
66
|
+
|
|
67
|
+
export const App = () => {
|
|
68
|
+
return (
|
|
69
|
+
<SWR>
|
|
70
|
+
<HotKeyNav>
|
|
71
|
+
<Stickers />
|
|
72
|
+
<GlobalLoadingStateProvider>
|
|
73
|
+
<Routes>
|
|
74
|
+
<Route path="/" element={<Layout />}>
|
|
75
|
+
<Route index element={<CoverInMidCol />} />
|
|
76
|
+
<Route path="/projects" element={<Png />} />
|
|
77
|
+
<Route path="/projects/:id" element={<PhotoProjects />} />
|
|
78
|
+
|
|
79
|
+
<Route path="now" element={<NowInMidCol />} />
|
|
80
|
+
<Route path="tags" element={<TagsInMidCol />} />
|
|
81
|
+
<Route path="tags/:tag" element={<TagsResultInMidCol />} />
|
|
82
|
+
|
|
83
|
+
<Route path="blog" element={<ContentInMidCol />} />
|
|
84
|
+
<Route path="blog/:title" element={<ArticleInMidCol />} />
|
|
85
|
+
<Route path="blog/:title/:id" element={<PhotoProjects />} />
|
|
86
|
+
|
|
87
|
+
<Route path="login" element={<LoginInMidCol />} />
|
|
88
|
+
</Route>
|
|
89
|
+
<Route path="*" element={<NotFound />} />
|
|
90
|
+
</Routes>
|
|
91
|
+
</GlobalLoadingStateProvider>
|
|
92
|
+
</HotKeyNav>
|
|
93
|
+
</SWR>
|
|
94
|
+
);
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export default App;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 与或非禁区
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
**1. 古老的小区**
|
|
6
|
+
|
|
7
|
+
我搬进 \
|
|
8
|
+
一个古老的小区的胃里
|
|
9
|
+
|
|
10
|
+
堆积的法国梧桐树叶 \
|
|
11
|
+
和我的过往 \
|
|
12
|
+
加重了它消化不良的症状
|
|
13
|
+
|
|
14
|
+
北方的冷空气穿过冲积平原 \
|
|
15
|
+
匍匐在小区旁的江面休息 \
|
|
16
|
+
玩闹
|
|
17
|
+
|
|
18
|
+
手拉着手的山脉远在南边等候 \
|
|
19
|
+
胃壁从此有水珠渗出
|
|
20
|
+
|
|
21
|
+
我的浴巾不再干燥
|
|
22
|
+
|
|
23
|
+
**2. 信**
|
|
24
|
+
|
|
25
|
+
被子折叠成信封 \
|
|
26
|
+
身体干瘪成信纸
|
|
27
|
+
|
|
28
|
+
睡梦邮递心事。
|
|
29
|
+
|
|
30
|
+
**3. 梦里的事**
|
|
31
|
+
|
|
32
|
+
梦里一群恒星散落在 \
|
|
33
|
+
外婆家屋后的草丛
|
|
34
|
+
|
|
35
|
+
梦里在摩天大楼上空蛙泳
|
|
36
|
+
|
|
37
|
+
梦里变成凶杀犯被通缉
|
|
38
|
+
|
|
39
|
+
梦里牙齿全部脱落 \
|
|
40
|
+
一点也不痛
|
|
41
|
+
|
|
42
|
+
**3. 清明后**
|
|
43
|
+
|
|
44
|
+
左手是右手的手写板 \
|
|
45
|
+
五官不是心脏的显示屏 \
|
|
46
|
+
面无表情 \
|
|
47
|
+
手指划着手心
|
|
48
|
+
|
|
49
|
+
键盘上有飞蛾的卵 \
|
|
50
|
+
地毯下是腐烂的地板 \
|
|
51
|
+
没有把的拖把 \
|
|
52
|
+
已被晒干
|
|
53
|
+
|
|
54
|
+
通话质量不佳 \
|
|
55
|
+
扬声器变得沙哑 \
|
|
56
|
+
Siri 把熊仔念成了熊子 \
|
|
57
|
+
乘着吹进车窗的 \
|
|
58
|
+
横风飘过副驾驶 \
|
|
59
|
+
飘进山谷带着 \
|
|
60
|
+
笑声、雾 \
|
|
61
|
+
消失在海拔五百二十米的高度
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 说明书
|
|
3
|
+
tags:
|
|
4
|
+
- bbki.ng
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
import { OSS_PHOTOS } from "@/constants/photos";
|
|
8
|
+
import { Link, Img } from '@bbki.ng/components';
|
|
9
|
+
|
|
10
|
+
## 目录
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## 域名
|
|
14
|
+
bbki.ng 是在 [upper link](https://upperlink.ng/) 购买的尼日利亚域名。
|
|
15
|
+
|
|
16
|
+
## 接口
|
|
17
|
+
<Link external to="https://api.bbki.ng">api.bbki.ng</Link>
|
|
18
|
+
|
|
19
|
+
## 标识使用
|
|
20
|
+
|
|
21
|
+
<Link external to="https://zjh-im-res.oss-cn-shenzhen.aliyuncs.com/zip/LOGOs.zip">下载</Link>
|
|
22
|
+
|
|
23
|
+
<Img {...OSS_PHOTOS.logoPreview} renderedWidth={200} removeBlurBgAfterLoad />
|
|
24
|
+
|
|
25
|
+
### 目的
|
|
26
|
+
|
|
27
|
+
以下规范用于保证网站标识使用时,能得到最佳视觉效果。
|
|
28
|
+
|
|
29
|
+
### 规范
|
|
30
|
+
|
|
31
|
+
#### 颜色
|
|
32
|
+
|
|
33
|
+
<Img {...OSS_PHOTOS.logoColors} renderedWidth={600} removeBlurBgAfterLoad />
|
|
34
|
+
|
|
35
|
+
#### 尺寸
|
|
36
|
+
标识宽高不得小于 24 像素。
|
|
37
|
+
|
|
38
|
+
#### 禁区
|
|
39
|
+
|
|
40
|
+
禁区宽度为图标宽度的一半
|
|
41
|
+
|
|
42
|
+
<Img {...OSS_PHOTOS.logoExcludesZone} renderedWidth={300} />
|
|
43
|
+
|
|
44
|
+
#### 合法变体
|
|
45
|
+
|
|
46
|
+
##### 纯色背景
|
|
47
|
+
|
|
48
|
+
<Img {...OSS_PHOTOS.logoVariants} renderedWidth={600} removeBlurBgAfterLoad />
|
|
49
|
+
|
|
50
|
+
##### 图片背景
|
|
51
|
+
<Img {...OSS_PHOTOS.validLogoExample} renderedWidth={300} />
|
|
52
|
+
|
|
53
|
+
#### 非法误用
|
|
54
|
+
|
|
55
|
+
- 禁止旋转
|
|
56
|
+
- 禁止前景背景色出现合法变体外的组合
|
|
57
|
+
- 禁止拉伸、压缩
|
|
58
|
+
- 禁止使用描边形式
|
|
59
|
+
- 禁止修改增删
|
|
60
|
+
- 禁止图标越过禁区
|
|
61
|
+
- 禁止添加文字
|
|
62
|
+
- 禁止添加投影
|
|
63
|
+
|
|
64
|
+
#### 错误示例
|
|
65
|
+
|
|
66
|
+
<Img {...OSS_PHOTOS.badLogoExamples} renderedWidth={600} removeBlurBgAfterLoad />
|
|
67
|
+
|
|
68
|
+
## 快捷键
|
|
69
|
+
|
|
70
|
+
在浏览本站的过程中,需要频繁在路由间跳转,除了点击超链接的方式,也可以直接按下对应的快捷键进行跳转。下表是快捷键说明。
|
|
71
|
+
|
|
72
|
+
| 快捷键 | 含义 | 描述 |
|
|
73
|
+
| :----- | :--------- | :----------------------------- |
|
|
74
|
+
| `h` | help | 跳转到本文 |
|
|
75
|
+
| `i` | index | 跳转到首页 |
|
|
76
|
+
| `c` | content | 跳转到目录页 |
|
|
77
|
+
| `shift + t` | tags | 跳转到标签列表 |
|
|
78
|
+
| `f` | forward | 前进一页 |
|
|
79
|
+
| `b` | back | 后退一页 |
|
|
80
|
+
| `s` | source | 查看本站源代码 |
|
|
81
|
+
|
|
82
|
+
跳转到目标页面后,按下 tab 可方便地进一步选择目标链接。
|
|
83
|
+
|
|
84
|
+
## 维护者
|
|
85
|
+
### 最近在干嘛?
|
|
86
|
+
<Link to="/now">动态</Link>
|
|
87
|
+
### 联系
|
|
88
|
+
b@bbki.ng
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 降温
|
|
3
|
+
tags:
|
|
4
|
+
- 随笔
|
|
5
|
+
- 天气
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
跟去年一样,第一时间感受到了降温。不同的是,去年是走在路上突然反应过来,与低温偶遇。今年像被大队人马包围,为首的用喇叭喊话告知,你应该向低温投降。国庆跟朋友还不止一次聊起,记得某年国庆室友结婚我们已经在烤电火炉,为什么现在还是短袖呢?几天后,气温骤降。低温劈头盖脸而来。
|
|
9
|
+
|
|
10
|
+
越来越喜欢描述气候特点的词汇:四季分明,雨热同期,春秋短促,冬夏绵长,低温寡照,阴雨连绵。像朴素的大道理,包罗万象。「越冬作物可安全越冬,缓慢生长」,提到作物的句子也充满关心像母亲的语气。
|
|
11
|
+
|
|
12
|
+
作为湖南人自己会经常忘了这片土地大部分位于洞庭湖以南的事实。湘赣交界诸山和武陵山脉、雪峰山脉、南岭山脉,把东西南三面围住,唯独北边是冲积平原,洞开接收来自北方的寒意。
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 大雪
|
|
3
|
+
tags:
|
|
4
|
+
- 随笔
|
|
5
|
+
- 天气
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
大雪节气过后,气温更低、起床变得更加困难。去吃粉的途中,发现街道两边的车顶和挡风玻璃上都铺满了落叶,地面上的落叶也铺得很厚。想要把落叶拢到一起,已经不能用常规的扫地动作。店家握着扫把一端,用小腹抵住往前推,人和扫把模拟出一辆简易版推土机。往前推进很短的距离,落叶便隆成一个小丘。地铁口的自动扶梯前有一片落叶,黄叶孤零零躺在不锈钢面板上,听着扶梯传动系统发出的枯燥声音。当代艺术中心大楼前的人工水池里也泡着落叶,有大叔用网兜打捞。不远处的草坪有人和银杏落叶合影。落叶和落雪给人们带来类似的烦恼和喜悦。
|