Skip to content

Commit c89e71a

Browse files
author
victorsun
committed
upd: json crack
1 parent a7f3d36 commit c89e71a

File tree

115 files changed

+20019
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+20019
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"name": "victorsun"
3+
}
+133
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>json crack demo</title>
8+
<style>
9+
html {
10+
height: 100%;
11+
}
12+
body {
13+
margin: 0;
14+
height: 100%;
15+
display: flex;
16+
flex-direction: column;
17+
}
18+
header {
19+
background-color: #ccc;
20+
height: 100px;
21+
font-size: 24px;
22+
padding: 0 20px;
23+
box-sizing: border-box;
24+
display: flex;
25+
justify-content: flex-start;
26+
align-items: center;
27+
}
28+
footer {
29+
background-color: #ccc;
30+
height: 50px;
31+
}
32+
.main {
33+
flex: 1;
34+
display: flex;
35+
}
36+
.left {
37+
background-color: #eee;
38+
width: 300px;
39+
height: 100%;
40+
}
41+
.left>div {
42+
height: 50px;
43+
line-height: 50px;
44+
padding-left: 20px;
45+
}
46+
textarea {
47+
width: 100%;
48+
height: calc(100% - 50px);
49+
box-sizing: border-box;
50+
}
51+
.center {
52+
flex: 1;
53+
height: 100%;
54+
}
55+
.buttons {
56+
padding: 20px;
57+
}
58+
.container {
59+
margin: 20px 100px;
60+
background-color: red;
61+
width: 800px;
62+
height: 800px;
63+
}
64+
#jsoncrackEmbed {
65+
width: 100%;
66+
height: 100%;
67+
}
68+
</style>
69+
</head>
70+
<body>
71+
<header>json crack demo</header>
72+
<div class="main">
73+
<div class="left">
74+
<div>请输入json</div>
75+
<textarea></textarea>
76+
</div>
77+
<div class="center">
78+
<ul class="desc">
79+
<li>1. jsoncrack 独立部署在本地 http://127.0.0.1:5501 下,注意修改,build 后的代码在 jsoncrack.com-2.5.0/out/ 下,不建议使用官方的 jsoncrack.com,有点慢</li>
80+
<li>2. 源码基于 react,在 jsoncrack.com-2.5.0 下,修改后需要打包</li>
81+
<li>3. [不推荐] 方式1:使用load事件载入json</li>
82+
<li>4. [推荐] 方式2:通过get参数传入json,注意替换数据源 https://cdn.jsdelivr.net/gh/csxiaoyaojianxian/[email protected]/json/test.json</li>
83+
<li>5. [强烈推荐] 方式3:通过api发送json</li>
84+
</ul>
85+
<div class="buttons">
86+
<button onclick="sendToEmbed()">通过api更新json</button>
87+
</div>
88+
<div class="container">
89+
<iframe id="jsoncrackEmbed" src="https://jsoncrack.com/widget?json=https://cdn.jsdelivr.net/gh/csxiaoyaojianxian/[email protected]/json/test.json" frameborder="0"></iframe>
90+
<!-- <iframe id="jsoncrackEmbed" src="http://127.0.0.1:5501/widget.html?json=https://cdn.jsdelivr.net/gh/csxiaoyaojianxian/[email protected]/json/test.json" frameborder="0"></iframe> -->
91+
<!-- <iframe id="jsoncrackEmbed" src="http://127.0.0.1:5501/widget.html" frameborder="0"></iframe> -->
92+
</div>
93+
</div>
94+
</div>
95+
<script>
96+
// [不推荐] 方式1:使用load事件载入json
97+
/*
98+
const jsonCrackEmbed = document.querySelector("iframe");
99+
const json = JSON.stringify({
100+
"section": "It loaded!"
101+
});
102+
jsonCrackEmbed?.addEventListener("load", () => {
103+
setTimeout(() => jsonCrackEmbed.contentWindow.postMessage({
104+
json
105+
}, "*"), 500);
106+
});
107+
*/
108+
109+
// [推荐] 方式2:通过get参数传入json
110+
111+
// [推荐] 方式3:通过api发送json
112+
function sendToEmbed() {
113+
const jsonCrackEmbed = document.getElementById("jsoncrackEmbed");
114+
const json = JSON.stringify({
115+
name: 'csxiaoyao.com',
116+
117+
list: [{
118+
test: 1,
119+
}],
120+
});
121+
const options = {
122+
theme: "light", // "light" or "dark"
123+
direction: "RIGHT", // "UP", "DOWN", "LEFT", "RIGHT"
124+
};
125+
jsonCrackEmbed.contentWindow.postMessage({
126+
json,
127+
options
128+
}, "*");
129+
}
130+
</script>
131+
<footer></footer>
132+
</body>
133+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
NEXT_PUBLIC_BASE_URL=http://localhost:3000
2+
NEXT_PUBLIC_ALTOGIC_ENV_URL=https://jsoncrack.c5-na.altogic.com
3+
NEXT_PUBLIC_ALTOGIC_CLIENT_KEY=f1e92022789f4ccf91273a345ab2bdf8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
NEXT_PUBLIC_BASE_URL=https://jsoncrack.com
2+
NEXT_PUBLIC_ALTOGIC_ENV_URL=https://jsoncrack.c5-na.altogic.com
3+
NEXT_PUBLIC_ALTOGIC_CLIENT_KEY=f1e92022789f4ccf91273a345ab2bdf8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"rules": {
3+
"@next/next/no-img-element": "off",
4+
"unused-imports/no-unused-imports": "error"
5+
},
6+
"extends": ["next/core-web-vitals"],
7+
"plugins": ["testing-library", "unused-imports"],
8+
"overrides": [
9+
// Only uses Testing Library lint rules in test files
10+
{
11+
"files": ["**/__tests__/**/*.[jt]s?(x)", "**/?(*.)+(spec|test).[jt]s?(x)"],
12+
"extends": ["plugin:testing-library/react"]
13+
}
14+
]
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# These are supported funding model platforms
2+
3+
github: AykutSarac
4+
patreon: # patreon name
5+
open_collective: # opencollective name
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
otechie: # Replace with a single Otechie username
12+
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
13+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Bug report
2+
description: Create a report to help us improve
3+
title: "[BUG]: <Context of the issue>"
4+
labels: bug
5+
assignees: AykutSarac
6+
body:
7+
- type: textarea
8+
id: description
9+
attributes:
10+
label: Issue description
11+
description: |
12+
Describe the issue in as much detail as possible.
13+
14+
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files into it.
15+
placeholder: |
16+
Steps to reproduce with below code sample:
17+
1. do thing
18+
2. click...
19+
3. observe behavior
20+
4. see error logs below
21+
validations:
22+
required: true
23+
- type: textarea
24+
id: media
25+
attributes:
26+
label: Media & Screenshots
27+
description: Inlude screenshots or video of reproduction as much as possible
28+
render: md
29+
- type: textarea
30+
id: os
31+
attributes:
32+
label: Operating system
33+
description: Which OS does your application run on?
34+
value: |
35+
- OS: [e.g. iOS]:
36+
- Browser [e.g. chrome, safari]:
37+
38+
- Any other details...
39+
- type: dropdown
40+
id: priority
41+
attributes:
42+
label: Priority this issue should have
43+
description: Please be realistic. If you need to elaborate on your reasoning, please use the Issue description field above.
44+
options:
45+
- Low (slightly annoying)
46+
- Medium (should be fixed soon)
47+
- High (immediate attention needed)
48+
validations:
49+
required: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Feature request
2+
description: Request a new feature
3+
labels: [feature]
4+
body:
5+
- type: textarea
6+
id: description
7+
attributes:
8+
label: Feature
9+
description: A clear and concise description of what the problem is, or what feature you want to be implemented.
10+
placeholder: I'm always frustrated when..., Discord has recently released..., A good addition would be...
11+
validations:
12+
required: true
13+
- type: textarea
14+
id: alternatives
15+
attributes:
16+
label: Alternative solutions or implementations
17+
description: A clear and concise description of any alternative solutions or features you have considered.
18+
- type: textarea
19+
id: additional-context
20+
attributes:
21+
label: Other context
22+
description: Any other context, screenshots, or file uploads that help us understand your feature request.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# next.js
12+
/.next/
13+
/out/
14+
15+
# production
16+
/build
17+
18+
# misc
19+
.DS_Store
20+
*.pem
21+
22+
# debug
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
27+
# local env files
28+
.env.local
29+
.env.development.local
30+
.env.test.local
31+
.env.production.local
32+
33+
# vercel
34+
.vercel
35+
36+
# typescript
37+
*.tsbuildinfo
38+
39+
# PWA workers
40+
**/public/workbox-*.js
41+
**/public/sw.js
42+
**/public/fallback-*.js
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
legacy-peer-deps=true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.github
2+
.next
3+
node_modules/
4+
out
5+
public
6+
*-lock.json
7+
tsconfig.json
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"trailingComma": "es5",
3+
"singleQuote": false,
4+
"semi": true,
5+
"printWidth": 100,
6+
"arrowParens": "avoid",
7+
"importOrder": [
8+
"^(react/(.*)$)|^(react$)",
9+
"^(next/(.*)$)|^(next$)",
10+
"<THIRD_PARTY_MODULES>",
11+
"^components/(.*)$",
12+
"^utils/(.*)$",
13+
"^assets/(.*)$",
14+
"^[./]"
15+
],
16+
"importOrderParserPlugins": ["typescript", "jsx", "decorators-legacy"]
17+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
language: node_js
2+
node_js:
3+
- "14"
4+
branches:
5+
only:
6+
- main
7+
cache:
8+
directories:
9+
- node_modules
10+
script:
11+
- npm run lint
12+
- npm run build
13+
deploy:
14+
provider: pages
15+
skip_cleanup: true
16+
local_dir: out
17+
token: $GITHUB_TOKEN
18+
target_branch: gh-pages
19+
keep_history: true
20+
on:
21+
branch: main
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"liveServer.settings.port": 5501
3+
}

0 commit comments

Comments
 (0)