index.tsx 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. import React from "react";
  2. import Head from "next/head";
  3. import Link from "next/link";
  4. import { useRouter } from "next/router";
  5. import { TwitterTweetEmbed } from "react-twitter-embed";
  6. import { FaGithub, FaHeart, FaLinkedin, FaTwitter } from "react-icons/fa";
  7. import {
  8. HiCursorClick,
  9. HiLightningBolt,
  10. HiOutlineDownload,
  11. HiOutlineSearchCircle,
  12. } from "react-icons/hi";
  13. import { Producthunt } from "src/components/Producthunt";
  14. import { CarbonAds } from "src/components/CarbonAds";
  15. import { Sponsors } from "src/components/Sponsors";
  16. import { GoalsModal } from "src/containers/Modals/GoalsModal";
  17. import pkg from "../../../package.json";
  18. import * as Styles from "./styles";
  19. const Home: React.FC = () => {
  20. const { push } = useRouter();
  21. const [isModalVisible, setModalVisible] = React.useState(false);
  22. const [isMobile, setIsMobile] = React.useState(false);
  23. React.useEffect(() => {
  24. setIsMobile(window.screen.width <= 768);
  25. }, []);
  26. return (
  27. <Styles.StyledHome>
  28. <Head>
  29. <title>JSON Crack - Crack your data into pieces</title>
  30. </Head>
  31. <Styles.StyledNavbar>
  32. <Styles.StyledNavLink href="/editor">Editor</Styles.StyledNavLink>
  33. <Link href="#features" passHref>
  34. <Styles.StyledNavLink>Features</Styles.StyledNavLink>
  35. </Link>
  36. <Link href="#sponsor" passHref>
  37. <Styles.StyledNavLink>Sponsor</Styles.StyledNavLink>
  38. </Link>
  39. <Styles.StyledNavLink
  40. href="https://github.com/AykutSarac/jsoncrack.com"
  41. target="_blank"
  42. rel="external"
  43. >
  44. GitHub
  45. </Styles.StyledNavLink>
  46. </Styles.StyledNavbar>
  47. <Styles.StyledHeroSection id="main">
  48. <Styles.StyledTitle>
  49. <Styles.StyledGradientText>JSON</Styles.StyledGradientText> Crack
  50. </Styles.StyledTitle>
  51. <Styles.StyledSubTitle>
  52. Seamlessly visualize your JSON data{" "}
  53. <Styles.StyledHighlightedText>instantly</Styles.StyledHighlightedText>{" "}
  54. into graphs.
  55. </Styles.StyledSubTitle>
  56. <Styles.StyledMinorTitle>
  57. Paste - Import - Fetch!
  58. </Styles.StyledMinorTitle>
  59. <Styles.StyledButton
  60. onClick={() => window.location.replace("/editor")}
  61. disabled={isMobile}
  62. >
  63. {isMobile ? "Incompatible Device" : "GO TO EDITOR"}
  64. </Styles.StyledButton>
  65. {!isMobile && (
  66. <>
  67. <Styles.StyledSponsorButton onClick={() => setModalVisible(true)}>
  68. Help JSON Crack Accomplish It&apos;s Goals
  69. <FaHeart />
  70. </Styles.StyledSponsorButton>
  71. <GoalsModal visible={isModalVisible} setVisible={setModalVisible} />
  72. </>
  73. )}
  74. </Styles.StyledHeroSection>
  75. <Styles.StyledPreviewSection>
  76. <Styles.StyledImageWrapper>
  77. <Styles.StyledImage
  78. width="1200"
  79. height="863"
  80. src="/jsonvisio-screenshot.webp"
  81. alt="preview"
  82. loading="lazy"
  83. />
  84. </Styles.StyledImageWrapper>
  85. </Styles.StyledPreviewSection>
  86. <Styles.StyledFeaturesSection id="features">
  87. <Styles.StyledSectionCard>
  88. <Styles.StyledCardIcon>
  89. <HiCursorClick size={50} color="#3BA55D" />
  90. </Styles.StyledCardIcon>
  91. <Styles.StyledCardTitle>EASY-TO-USE</Styles.StyledCardTitle>
  92. <Styles.StyledCardDescription>
  93. Don&apos;t even bother to update your schema to view your JSON into
  94. graphs; directly paste, import or fetch! JSON Crack helps you to
  95. visualize without any additional values and save your time.
  96. </Styles.StyledCardDescription>
  97. </Styles.StyledSectionCard>
  98. <Styles.StyledSectionCard>
  99. <Styles.StyledCardIcon>
  100. <HiOutlineSearchCircle size={50} color="#5865F2" />
  101. </Styles.StyledCardIcon>
  102. <Styles.StyledCardTitle>SEARCH</Styles.StyledCardTitle>
  103. <Styles.StyledCardDescription>
  104. Have a huge file of values, keys or arrays? Worry no more, type in
  105. the keyword you are looking for into search input and it will take
  106. you to each node with matching result highlighting the line to
  107. understand better!
  108. </Styles.StyledCardDescription>
  109. </Styles.StyledSectionCard>
  110. <Styles.StyledSectionCard>
  111. <Styles.StyledCardIcon>
  112. <HiOutlineDownload size={50} color="#DA2877" />
  113. </Styles.StyledCardIcon>
  114. <Styles.StyledCardTitle>DOWNLOAD</Styles.StyledCardTitle>
  115. <Styles.StyledCardDescription>
  116. Download the graph to your local machine and use it wherever you
  117. want, to your blogs, website or make it a poster and paste to the
  118. wall. Who wouldn&apos;t want to see a JSON Crack graph onto their
  119. wall, eh?
  120. </Styles.StyledCardDescription>
  121. </Styles.StyledSectionCard>
  122. <Styles.StyledSectionCard>
  123. <Styles.StyledCardIcon>
  124. <HiLightningBolt size={50} color="#F5E027" />
  125. </Styles.StyledCardIcon>
  126. <Styles.StyledCardTitle>LIVE</Styles.StyledCardTitle>
  127. <Styles.StyledCardDescription>
  128. With Microsoft&apos;s Monaco Editor which is also used by VS Code,
  129. easily edit your JSON and directly view through the graphs. Also
  130. there&apos;s a JSON validator above of it to make sure there is no
  131. type error.
  132. </Styles.StyledCardDescription>
  133. </Styles.StyledSectionCard>
  134. </Styles.StyledFeaturesSection>
  135. <Styles.StyledSection id="github" reverse>
  136. <TwitterTweetEmbed
  137. tweetId="1519363257794015233"
  138. options={{
  139. width: "600",
  140. align: "center",
  141. }}
  142. />
  143. <Styles.StyledSectionArea>
  144. <Styles.StyledSubTitle>Open Source Community</Styles.StyledSubTitle>
  145. <Styles.StyledMinorTitle>
  146. Join the Open Source Community by suggesting new ideas, support by
  147. contributing; implementing new features, fixing bugs and doing
  148. changes minor to major!
  149. </Styles.StyledMinorTitle>
  150. <Styles.StyledButton
  151. onClick={() => push("https://github.com/AykutSarac/jsoncrack.com")}
  152. status="SECONDARY"
  153. >
  154. STAR ON GITHUB
  155. </Styles.StyledButton>
  156. </Styles.StyledSectionArea>
  157. </Styles.StyledSection>
  158. <Styles.StyledSection id="embed">
  159. <Styles.StyledSectionArea>
  160. <Styles.StyledSubTitle>Embed Into Your Website</Styles.StyledSubTitle>
  161. <Styles.StyledMinorTitle>
  162. Easily embed the JSON Crack graph into your website to showcase your
  163. visitors, blog readers or anybody else!
  164. </Styles.StyledMinorTitle>
  165. </Styles.StyledSectionArea>
  166. <div>
  167. <Styles.StyledIframge src="https://jsoncrack.com/widget?json=%5B%5B%22squadName%22%2C%22homeTown%22%2C%22formed%22%2C%22secretBase%22%2C%22active%22%2C%22members%22%2C%22a%7C0%7C1%7C2%7C3%7C4%7C5%22%2C%22Super%20hero%20squad%22%2C%22Metro%20City%22%2C%22n%7CWW%22%2C%22Super%20tower%22%2C%22b%7CT%22%2C%22name%22%2C%22age%22%2C%22secretIdentity%22%2C%22powers%22%2C%22a%7CC%7CD%7CE%7CF%22%2C%22Molecule%20Man%22%2C%22n%7CT%22%2C%22Dan%20Jukes%22%2C%22Radiation%20resistance%22%2C%22Turning%20tiny%22%2C%22Radiation%20blast%22%2C%22a%7CK%7CL%7CM%22%2C%22o%7CG%7CH%7CI%7CJ%7CN%22%2C%22Madame%20Uppercut%22%2C%22n%7Cd%22%2C%22Jane%20Wilson%22%2C%22Million%20tonne%20punch%22%2C%22Damage%20resistance%22%2C%22Superhuman%20reflexes%22%2C%22a%7CS%7CT%7CU%22%2C%22o%7CG%7CP%7CQ%7CR%7CV%22%2C%22Eternal%20Flame%22%2C%22n%7C4C92%22%2C%22Unknown%22%2C%22Immortality%22%2C%22Heat%20Immunity%22%2C%22Inferno%22%2C%22Teleportation%22%2C%22Interdimensional%20travel%22%2C%22a%7Ca%7Cb%7Cc%7Cd%7Ce%22%2C%22o%7CG%7CX%7CY%7CZ%7Cf%22%2C%22a%7CO%7CW%7Cg%22%2C%22o%7C6%7C7%7C8%7C9%7CA%7CB%7Ch%22%5D%2C%22i%22%5D"></Styles.StyledIframge>
  168. </div>
  169. </Styles.StyledSection>
  170. <Styles.StyledPaidSection>
  171. <Styles.StyledProducthunt>
  172. <Styles.StyledSubTitle>
  173. Support JSON Crack at
  174. <br />
  175. <Styles.StyledHighlightedText>
  176. Product Hunt
  177. </Styles.StyledHighlightedText>
  178. </Styles.StyledSubTitle>
  179. <Producthunt />
  180. </Styles.StyledProducthunt>
  181. <Styles.StyledAffiliate>
  182. <Styles.StyledSubTitle>Affiliate</Styles.StyledSubTitle>
  183. <CarbonAds />
  184. </Styles.StyledAffiliate>
  185. </Styles.StyledPaidSection>
  186. <Styles.StyledSponsorSection id="sponsor">
  187. <Styles.StyledSubTitle>Sponsors</Styles.StyledSubTitle>
  188. <Styles.StyledMinorTitle>
  189. Your supports make JSON Crack possible to continue and accessible for
  190. everyone!
  191. </Styles.StyledMinorTitle>
  192. <Styles.StyledButton
  193. status="SUCCESS"
  194. onClick={() => push("https://github.com/sponsors/AykutSarac")}
  195. >
  196. Become A Sponsor!
  197. </Styles.StyledButton>
  198. <Sponsors />
  199. </Styles.StyledSponsorSection>
  200. <Styles.StyledFooter>
  201. <Styles.StyledFooterText>
  202. © 2022 JSON Crack - {pkg.version}
  203. </Styles.StyledFooterText>
  204. <Styles.StyledIconLinks>
  205. <Styles.StyledNavLink
  206. href="https://github.com/AykutSarac/jsoncrack.com"
  207. target="_blank"
  208. aria-label="github"
  209. >
  210. <FaGithub size={26} />
  211. </Styles.StyledNavLink>
  212. <Styles.StyledNavLink
  213. href="https://www.linkedin.com/in/aykutsarac/"
  214. target="_blank"
  215. aria-label="linkedin"
  216. >
  217. <FaLinkedin size={26} />
  218. </Styles.StyledNavLink>
  219. <Styles.StyledNavLink
  220. href="https://twitter.com/aykutsarach"
  221. target="_blank"
  222. aria-label="twitter"
  223. >
  224. <FaTwitter size={26} />
  225. </Styles.StyledNavLink>
  226. </Styles.StyledIconLinks>
  227. </Styles.StyledFooter>
  228. </Styles.StyledHome>
  229. );
  230. };
  231. export default Home;