index.tsx 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  1. import React from "react";
  2. import dynamic from "next/dynamic";
  3. import Head from "next/head";
  4. import Link from "next/link";
  5. import Script from "next/script";
  6. import { AiOutlineRight } from "react-icons/ai";
  7. import {
  8. HiCursorClick,
  9. HiLightningBolt,
  10. HiOutlineDownload,
  11. HiOutlineSearchCircle,
  12. } from "react-icons/hi";
  13. import { IoHeart } from "react-icons/io5";
  14. import { SiVisualstudiocode } from "react-icons/si";
  15. import { vscDarkPlus } from "react-syntax-highlighter/dist/cjs/styles/prism";
  16. import { CarbonAds } from "src/components/CarbonAds";
  17. import { Footer } from "src/components/Footer";
  18. import { Producthunt } from "src/components/Producthunt";
  19. import { Sponsors } from "src/components/Sponsors";
  20. import { SupportButton } from "src/components/SupportButton";
  21. import { baseURL } from "src/constants/data";
  22. import { TABS } from "src/constants/previewSection";
  23. import { PricingCards } from "../PricingCards";
  24. import * as Styles from "./styles";
  25. const SyntaxHighlighter = dynamic(
  26. () => import("react-syntax-highlighter/dist/esm/prism-async").then(c => c),
  27. {
  28. ssr: false,
  29. }
  30. );
  31. const Navbar = () => (
  32. <Styles.StyledNavbar>
  33. <Styles.StyledNavLink href="/editor">Editor</Styles.StyledNavLink>
  34. <Link href="#features" passHref>
  35. <Styles.StyledNavLink>Features</Styles.StyledNavLink>
  36. </Link>
  37. <Link href="#sponsor" passHref>
  38. <Styles.StyledNavLink>Sponsor</Styles.StyledNavLink>
  39. </Link>
  40. <Styles.StyledNavLink
  41. href="https://github.com/AykutSarac/jsoncrack.com"
  42. target="_blank"
  43. rel="external"
  44. >
  45. GitHub
  46. </Styles.StyledNavLink>
  47. <Link href="docs" passHref>
  48. <Styles.StyledNavLink>Documentation</Styles.StyledNavLink>
  49. </Link>
  50. </Styles.StyledNavbar>
  51. );
  52. const HeroSection = () => (
  53. <Styles.StyledHeroSection id="main">
  54. <Styles.StyledTitle>
  55. <Styles.StyledGradientText>JSON</Styles.StyledGradientText> CRACK
  56. </Styles.StyledTitle>
  57. <Styles.StyledSubTitle>
  58. Seamlessly visualize your JSON data{" "}
  59. <Styles.StyledHighlightedText>instantly</Styles.StyledHighlightedText> into graphs.
  60. </Styles.StyledSubTitle>
  61. <Styles.StyledButton href="/editor" link>
  62. GO TO EDITOR
  63. <AiOutlineRight strokeWidth="80" />
  64. </Styles.StyledButton>
  65. <Styles.StyledButtonWrapper>
  66. <Styles.StyledSponsorButton
  67. href="https://github.com/sponsors/AykutSarac"
  68. target="_blank"
  69. rel="noreferrer"
  70. link
  71. >
  72. SPONSOR US
  73. <IoHeart />
  74. </Styles.StyledSponsorButton>
  75. <Styles.StyledSponsorButton
  76. href="https://marketplace.visualstudio.com/items?itemName=AykutSarac.jsoncrack-vscode"
  77. link
  78. isBlue
  79. >
  80. GET IT ON VS CODE
  81. <SiVisualstudiocode />
  82. </Styles.StyledSponsorButton>
  83. </Styles.StyledButtonWrapper>
  84. </Styles.StyledHeroSection>
  85. );
  86. const PreviewSection = () => {
  87. const [currentTab, setCurrentTab] = React.useState(0);
  88. const updateTab = (tabId: number) => {
  89. const embed = document.getElementById("jcPreview") as HTMLIFrameElement;
  90. embed.contentWindow?.postMessage({
  91. json: TABS[tabId].json,
  92. });
  93. setCurrentTab(tabId);
  94. };
  95. return (
  96. <Styles.StyledPreviewSection>
  97. <Styles.StyledHighlightWrapper>
  98. <Styles.StyledTabsWrapper>
  99. {TABS.map(tab => (
  100. <Styles.StyledTab
  101. active={tab.id === currentTab}
  102. onClick={() => updateTab(tab.id)}
  103. key={tab.id}
  104. >
  105. {tab.name}
  106. </Styles.StyledTab>
  107. ))}
  108. </Styles.StyledTabsWrapper>
  109. <SyntaxHighlighter
  110. style={vscDarkPlus}
  111. customStyle={{
  112. fontSize: "16px",
  113. width: "100%",
  114. height: "440px",
  115. margin: "0",
  116. borderTop: "2px solid #4D4D4D",
  117. }}
  118. language="json"
  119. showLineNumbers
  120. >
  121. {TABS[currentTab].json}
  122. </SyntaxHighlighter>
  123. </Styles.StyledHighlightWrapper>
  124. <Styles.StyledPreviewFrame
  125. id="jcPreview"
  126. src={`${baseURL}/widget?json=63b73305c358219fbc421adf`}
  127. loading="lazy"
  128. />
  129. </Styles.StyledPreviewSection>
  130. );
  131. };
  132. const FeaturesSection = () => (
  133. <Styles.StyledFeaturesSection id="features">
  134. <Styles.StyledSectionCard>
  135. <Styles.StyledCardIcon>
  136. <HiCursorClick size={50} color="#3BA55D" />
  137. </Styles.StyledCardIcon>
  138. <Styles.StyledCardTitle>EASY-TO-USE</Styles.StyledCardTitle>
  139. <Styles.StyledCardDescription>
  140. We believe that powerful software doesn&apos;t have to be difficult to use. That&apos;s why
  141. we&apos;ve designed our app to be as intuitive and easy-to-use as possible. You can quickly
  142. and easily load your JSON data and start exploring and analyzing it right away!
  143. </Styles.StyledCardDescription>
  144. </Styles.StyledSectionCard>
  145. <Styles.StyledSectionCard>
  146. <Styles.StyledCardIcon>
  147. <HiOutlineSearchCircle size={50} color="#5865F2" />
  148. </Styles.StyledCardIcon>
  149. <Styles.StyledCardTitle>SEARCH</Styles.StyledCardTitle>
  150. <Styles.StyledCardDescription>
  151. Have a huge file of values, keys or arrays? Worry no more, type in the keyword you are
  152. looking for into search input and it will take you to each node with matching result
  153. highlighting the line to understand better!
  154. </Styles.StyledCardDescription>
  155. </Styles.StyledSectionCard>
  156. <Styles.StyledSectionCard>
  157. <Styles.StyledCardIcon>
  158. <HiOutlineDownload size={50} color="#DA2877" />
  159. </Styles.StyledCardIcon>
  160. <Styles.StyledCardTitle>DOWNLOAD</Styles.StyledCardTitle>
  161. <Styles.StyledCardDescription>
  162. Download the graph to your local machine and use it wherever you want, to your blogs,
  163. website or make it a poster and paste to the wall. Who wouldn&apos;t want to see a JSON
  164. Crack graph onto their wall, eh?
  165. </Styles.StyledCardDescription>
  166. </Styles.StyledSectionCard>
  167. <Styles.StyledSectionCard>
  168. <Styles.StyledCardIcon>
  169. <HiLightningBolt size={50} color="#F5E027" />
  170. </Styles.StyledCardIcon>
  171. <Styles.StyledCardTitle>LIVE</Styles.StyledCardTitle>
  172. <Styles.StyledCardDescription>
  173. With Microsoft&apos;s Monaco Editor which is also used by VS Code, easily edit your JSON and
  174. directly view through the graphs. Also there&apos;s a JSON validator above of it to make
  175. sure there is no type error.
  176. </Styles.StyledCardDescription>
  177. </Styles.StyledSectionCard>
  178. </Styles.StyledFeaturesSection>
  179. );
  180. const GitHubSection = () => (
  181. <Styles.StyledSection id="github" reverse>
  182. <Styles.StyledTwitterQuote>
  183. <blockquote className="twitter-tweet" data-lang="en" data-dnt="true" data-theme="light">
  184. <p lang="en" dir="ltr">
  185. Looking to understand or explore some JSON? Just paste or upload to visualize it as a
  186. graph with <a href="https://t.co/HlKSrhKryJ">https://t.co/HlKSrhKryJ</a> 😍 <br />
  187. <br />
  188. Thanks to <a href="https://twitter.com/aykutsarach?ref_src=twsrc%5Etfw">
  189. @aykutsarach
  190. </a>! <a href="https://t.co/0LyPUL8Ezz">pic.twitter.com/0LyPUL8Ezz</a>
  191. </p>
  192. &mdash; GitHub (@github){" "}
  193. <a href="https://twitter.com/github/status/1519363257794015233?ref_src=twsrc%5Etfw">
  194. April 27, 2022
  195. </a>
  196. </blockquote>{" "}
  197. <Script async src="https://platform.twitter.com/widgets.js" charSet="utf-8"></Script>
  198. </Styles.StyledTwitterQuote>
  199. <Styles.StyledSectionArea>
  200. <Styles.StyledSubTitle>Open Source Community</Styles.StyledSubTitle>
  201. <Styles.StyledMinorTitle>
  202. At JSON Crack, we believe in the power of open source software and the communities that
  203. support it. That&apos;s why we&apos;re proud to be part of the open source community and to
  204. contribute to the development and growth of open source tools and technologies.
  205. <br />
  206. <br /> As part of our commitment to the open source community, we&apos;ve made our app
  207. freely available to anyone who wants to use it, and we welcome contributions from anyone
  208. who&apos;s interested in helping to improve it. Whether you&apos;re a developer, a data
  209. scientist, or just someone who&apos;s passionate about open source, we&apos;d love to have
  210. you join our community and help us make JSON Crack the best it can be.
  211. <br />
  212. <br /> So why not join us and become part of the JSON Crack open source community today? We
  213. can&apos;t wait to see what we can accomplish together!
  214. </Styles.StyledMinorTitle>
  215. <Styles.StyledButton
  216. href="https://github.com/AykutSarac/jsoncrack.com"
  217. status="SECONDARY"
  218. link
  219. >
  220. STAR ON GITHUB
  221. </Styles.StyledButton>
  222. </Styles.StyledSectionArea>
  223. </Styles.StyledSection>
  224. );
  225. const EmbedSection = () => (
  226. <Styles.StyledSection id="embed">
  227. <Styles.StyledSectionArea>
  228. <Styles.StyledSubTitle>Embed Into Your Website</Styles.StyledSubTitle>
  229. <Styles.StyledMinorTitle>
  230. JSON Crack provides users with the necessary code to embed the app into a website easily
  231. using an iframe. This code can be easily copied and pasted into the desired location on the
  232. website, allowing users to quickly and easily integrate JSON Crack into existing workflows.
  233. <br />
  234. <br /> Once the app is embedded, users can use it to view and analyze JSON data directly on
  235. the website. This can be useful for a variety of purposes, such as quickly checking the
  236. structure of a JSON file or verifying the data contained within it. JSON Crack&apos;s
  237. intuitive interface makes it easy to navigate and understand even complex JSON data, making
  238. it a valuable tool for anyone working with JSON.
  239. </Styles.StyledMinorTitle>
  240. <Styles.StyledButton href="/docs" status="SECONDARY" link>
  241. LEARN TO EMBED
  242. </Styles.StyledButton>
  243. </Styles.StyledSectionArea>
  244. <div>
  245. <Styles.StyledFrame
  246. src={`${baseURL}/widget?json=63c313d32ffa98f29b462315`}
  247. loading="lazy"
  248. ></Styles.StyledFrame>
  249. </div>
  250. </Styles.StyledSection>
  251. );
  252. const SupportSection = () => (
  253. <Styles.StyledPaidSection>
  254. <Styles.StyledProducthunt>
  255. <Styles.StyledSubTitle>
  256. Support JSON Crack at
  257. <br />
  258. <Styles.StyledHighlightedText>Product Hunt</Styles.StyledHighlightedText>
  259. </Styles.StyledSubTitle>
  260. <Producthunt />
  261. </Styles.StyledProducthunt>
  262. <Styles.StyledAffiliate>
  263. <Styles.StyledSubTitle>Affiliate</Styles.StyledSubTitle>
  264. <CarbonAds />
  265. </Styles.StyledAffiliate>
  266. </Styles.StyledPaidSection>
  267. );
  268. const SponsorSection = () => (
  269. <Styles.StyledSponsorSection id="sponsor">
  270. <Styles.StyledSubTitle>Sponsors</Styles.StyledSubTitle>
  271. <Styles.StyledMinorTitle>
  272. Your supports make JSON Crack possible to continue and accessible for everyone!
  273. </Styles.StyledMinorTitle>
  274. <Styles.StyledButton
  275. href="https://github.com/sponsors/AykutSarac"
  276. rel="external"
  277. status="SUCCESS"
  278. link
  279. >
  280. Become A Sponsor!
  281. </Styles.StyledButton>
  282. <Sponsors />
  283. </Styles.StyledSponsorSection>
  284. );
  285. const Home: React.FC = () => {
  286. return (
  287. <Styles.StyledHome>
  288. <Head>
  289. <title>JSON Crack - Crack your data into pieces</title>
  290. </Head>
  291. <Navbar />
  292. <HeroSection />
  293. <PreviewSection />
  294. <FeaturesSection />
  295. <SupportSection />
  296. <GitHubSection />
  297. <EmbedSection />
  298. <PricingCards />
  299. <SponsorSection />
  300. <SupportButton />
  301. <Footer />
  302. </Styles.StyledHome>
  303. );
  304. };
  305. export default Home;