index.tsx 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. import Image from "next/image";
  2. import React from "react";
  3. import { Button } from "src/components/Button";
  4. import { Container } from "src/components/Container";
  5. import { Navbar } from "src/components/Navbar";
  6. import styled from "styled-components";
  7. import { AiFillGithub } from "react-icons/ai";
  8. import { Footer } from "src/components/Footer";
  9. import Link from "next/link";
  10. const StyledHome = styled.div`
  11. padding: 24px;
  12. `;
  13. const StyledContent = styled.div`
  14. font-size: 20px;
  15. font-weight: 500;
  16. color: ${({ theme }) => theme.SILVER};
  17. width: 50%;
  18. @media only screen and (max-width: 768px) {
  19. width: 100%;
  20. text-align: center;
  21. button {
  22. margin-left: auto;
  23. margin-right: auto;
  24. }
  25. }
  26. `;
  27. const StyledHeader = styled.h2`
  28. font-size: 54px;
  29. color: ${({ theme }) => theme.FULL_WHITE};
  30. @media only screen and (max-width: 768px) {
  31. font-size: 36px;
  32. }
  33. `;
  34. const StyledSubContent = styled.div`
  35. margin-bottom: 20px;
  36. `;
  37. const StyledText = styled.span<{ white?: boolean }>`
  38. color: ${({ theme, white }) => (white ? theme.FULL_WHITE : theme.ORANGE)};
  39. `;
  40. const Home: React.FC = () => {
  41. return (
  42. <StyledHome>
  43. <Navbar />
  44. <Container>
  45. <StyledContent>
  46. <StyledHeader as="h1">
  47. Visualize your JSON into interactive graphs.
  48. </StyledHeader>
  49. <StyledSubContent>
  50. Simple visualization tool for your JSON data. No forced structure,
  51. paste your JSON data and view it instantly.
  52. </StyledSubContent>
  53. <Link href="/editor" passHref>
  54. <a>
  55. <Button status="SECONDARY">Start Generating</Button>
  56. </a>
  57. </Link>
  58. </StyledContent>
  59. <Image src="/graphs.svg" width={500} height={400} alt="graphs" />
  60. </Container>
  61. <Container reverse>
  62. <StyledContent>
  63. <StyledHeader>No Rules</StyledHeader>
  64. <StyledSubContent>
  65. Be free, you don&apos;t have to restructure your json to transform
  66. it into graphs. We&apos;ve done it at our side, so you can just
  67. paste your JSON.
  68. </StyledSubContent>
  69. <Link href="/editor" passHref>
  70. <a>
  71. <Button status="SUCCESS">Paste It!</Button>
  72. </a>
  73. </Link>
  74. </StyledContent>
  75. <Image src="/graphs3.svg" width={500} height={400} alt="preview" />
  76. </Container>
  77. <Container>
  78. <StyledContent>
  79. <StyledHeader>Import File</StyledHeader>
  80. <StyledSubContent>
  81. Have an existing file for your data? No worries, directly import it
  82. into our editor without having to scroll through all of it!
  83. </StyledSubContent>
  84. <Link href="/editor" passHref>
  85. <a>
  86. <Button status="SUCCESS">Import JSON</Button>
  87. </a>
  88. </Link>
  89. </StyledContent>
  90. <Image src="/graphs4.svg" width={500} height={400} alt="preview" />
  91. </Container>
  92. <Container reverse>
  93. <StyledContent>
  94. <StyledHeader>Supported by Open Source</StyledHeader>
  95. <StyledSubContent>
  96. We do our work at open source. Help us improve by contributing to
  97. <StyledText> JSON</StyledText>
  98. <StyledText white> Visio</StyledText> at GitHub!
  99. </StyledSubContent>
  100. <Link href="https://github.com/AykutSarac/jsonvisio.com" passHref>
  101. <a rel="me" target="_blank">
  102. <Button>
  103. <AiFillGithub size={20} />
  104. Check GitHub
  105. </Button>
  106. </a>
  107. </Link>
  108. </StyledContent>
  109. <Image src="/graphs5.svg" width={500} height={400} alt="preview" />
  110. </Container>
  111. <Footer />
  112. </StyledHome>
  113. );
  114. };
  115. export default Home;