✨ Innovative and open-source visualization application that transforms various data formats, such as JSON, YAML, XML and CSV into interactive graphs.
feat: update navbar ui
AykutSaracd8acb409188f
diff --git a/public/assets/oss_banner.webp b/public/assets/oss_banner.webpnew file mode 100644index 00000000..9f2f19eaBinary files /dev/null and b/public/assets/oss_banner.webp differdiff --git a/src/constants/globalStyle.ts b/src/constants/globalStyle.tsindex 081660f2..b96e9fa9 100644--- a/src/constants/globalStyle.ts+++ b/src/constants/globalStyle.ts@@ -13,11 +13,8 @@ const GlobalStyle = createGlobalStyle`color: ${({ theme }) => theme.FULL_WHITE} !important;font-weight: 400;font-size: 16px;- background-color: #000000 !important;- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25' viewBox='0 0 800 800'%3E%3Cg fill-opacity='0.3'%3E%3Ccircle fill='%23000000' cx='400' cy='400' r='600'/%3E%3Ccircle fill='%23110718' cx='400' cy='400' r='500'/%3E%3Ccircle fill='%23220e30' cx='400' cy='400' r='400'/%3E%3Ccircle fill='%23331447' cx='400' cy='400' r='300'/%3E%3Ccircle fill='%23441b5f' cx='400' cy='400' r='200'/%3E%3Ccircle fill='%23552277' cx='400' cy='400' r='100'/%3E%3C/g%3E%3C/svg%3E");- background-attachment: fixed;- background-size: cover;font-family: ${monaSans.style.fontFamily};+ background: #141517;@media only screen and (max-width: 768px) {background-position: right;diff --git a/src/containers/Home/index.tsx b/src/containers/Home/index.tsxindex 43df09dc..a9d5ea74 100644--- a/src/containers/Home/index.tsx+++ b/src/containers/Home/index.tsx@@ -46,7 +46,7 @@ const HeroSection = () => (<Styles.StyledButtonWrapper><Link href="https://github.com/sponsors/AykutSarac" target="_blank" rel="noreferrer"><Button color="red" size="md" variant="outline" rightIcon={<IoHeart />}>- SPONSOR US+ SPONSOR</Button></Link><Link href="https://marketplace.visualstudio.com/items?itemName=AykutSarac.jsoncrack-vscode">diff --git a/src/containers/Home/styles.tsx b/src/containers/Home/styles.tsxindex 70412ad1..08403159 100644--- a/src/containers/Home/styles.tsx+++ b/src/containers/Home/styles.tsx@@ -62,6 +62,11 @@ export const StyledHome = styled.div`flex-direction: column;gap: 8em;+ background-color: #000000 !important;+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25' viewBox='0 0 800 800'%3E%3Cg fill-opacity='0.3'%3E%3Ccircle fill='%23000000' cx='400' cy='400' r='600'/%3E%3Ccircle fill='%23110718' cx='400' cy='400' r='500'/%3E%3Ccircle fill='%23220e30' cx='400' cy='400' r='400'/%3E%3Ccircle fill='%23331447' cx='400' cy='400' r='300'/%3E%3Ccircle fill='%23441b5f' cx='400' cy='400' r='200'/%3E%3Ccircle fill='%23552277' cx='400' cy='400' r='100'/%3E%3C/g%3E%3C/svg%3E");+ background-attachment: fixed;+ background-size: cover;+* {box-sizing: border-box;}@@ -102,6 +107,7 @@ export const StyledHeroSection = styled.section`gap: 1.5em;min-height: 40vh;padding: 0 3%;+ margin-top: -8em;h2 {margin-bottom: 25px;diff --git a/src/layout/Footer/FooterLinks.tsx b/src/layout/Footer/FooterLinks.tsxnew file mode 100644index 00000000..e38ac351--- /dev/null+++ b/src/layout/Footer/FooterLinks.tsx@@ -0,0 +1,143 @@+import { createStyles, Text, Container, rem } from "@mantine/core";+import { JSONCrackLogo } from "../JsonCrackLogo";++const useStyles = createStyles(theme => ({+ footer: {+ marginTop: rem(120),+ paddingTop: `calc(${theme.spacing.xl} * 2)`,+ paddingBottom: `calc(${theme.spacing.xl} * 2)`,+ backgroundColor: theme.colorScheme === "dark" ? theme.colors.dark[6] : theme.colors.gray[0],+ borderTop: `${rem(1)} solid ${+ theme.colorScheme === "dark" ? theme.colors.dark[5] : theme.colors.gray[2]+ }`,+ },++ logo: {+ maxWidth: rem(200),++ [theme.fn.smallerThan("sm")]: {+ display: "flex",+ flexDirection: "column",+ alignItems: "center",+ },+ },++ description: {+ marginTop: rem(5),++ [theme.fn.smallerThan("sm")]: {+ marginTop: theme.spacing.xs,+ textAlign: "center",+ },+ },++ inner: {+ display: "flex",+ justifyContent: "space-between",++ [theme.fn.smallerThan("sm")]: {+ flexDirection: "column",+ alignItems: "center",+ },+ },++ groups: {+ display: "flex",+ flexWrap: "wrap",++ [theme.fn.smallerThan("sm")]: {+ display: "none",+ },+ },++ wrapper: {+ width: rem(160),+ },++ link: {+ display: "block",+ color: theme.colorScheme === "dark" ? theme.colors.dark[1] : theme.colors.gray[6],+ fontSize: theme.fontSizes.sm,+ paddingTop: rem(3),+ paddingBottom: rem(3),++ "&:hover": {+ textDecoration: "underline",+ },+ },++ title: {+ fontSize: theme.fontSizes.lg,+ fontWeight: 700,+ fontFamily: `Greycliff CF, ${theme.fontFamily}`,+ marginBottom: `calc(${theme.spacing.xs} / 2)`,+ color: theme.colorScheme === "dark" ? theme.white : theme.black,+ },++ afterFooter: {+ display: "flex",+ justifyContent: "space-between",+ alignItems: "center",+ marginTop: theme.spacing.xl,+ paddingTop: theme.spacing.xl,+ paddingBottom: theme.spacing.xl,+ borderTop: `${rem(1)} solid ${+ theme.colorScheme === "dark" ? theme.colors.dark[4] : theme.colors.gray[2]+ }`,++ [theme.fn.smallerThan("sm")]: {+ flexDirection: "column",+ },+ },++ social: {+ [theme.fn.smallerThan("sm")]: {+ marginTop: theme.spacing.xs,+ },+ },+}));++interface FooterLinksProps {+ data: {+ title: string;+ links: { label: string; link: string }[];+ }[];+}++export function FooterLinks({ data }: FooterLinksProps) {+ const { classes } = useStyles();++ const groups = data.map(group => {+ const links = group.links.map((link, index) => (+ <Text<"a"> key={index} className={classes.link} component="a" href={link.link}>+ {link.label}+ </Text>+ ));++ return (+ <div className={classes.wrapper} key={group.title}>+ <Text className={classes.title}>{group.title}</Text>+ {links}+ </div>+ );+ });++ return (+ <footer className={classes.footer}>+ <Container className={classes.inner}>+ <div className={classes.logo}>+ <JSONCrackLogo />+ <Text size="xs" color="dimmed" className={classes.description}>+ Next-generation tools matching with your needs to understand the data.+ </Text>+ </div>+ <div className={classes.groups}>{groups}</div>+ </Container>+ <Container className={classes.afterFooter}>+ <Text color="dimmed" size="sm">+ © jsoncrack.com+ </Text>+ </Container>+ </footer>+ );+}diff --git a/src/layout/Footer/index.tsx b/src/layout/Footer/index.tsxindex 642df3ea..b54a527d 100644--- a/src/layout/Footer/index.tsx+++ b/src/layout/Footer/index.tsx@@ -1,91 +1,62 @@-import Link from "next/link";-import styled from "styled-components";-import { FaDiscord, FaGithub, FaLinkedin, FaTwitter } from "react-icons/fa";-import pkg from "../../../package.json";--export const StyledFooter = styled.footer`- display: flex;- flex-direction: row;- justify-content: space-between;- width: 80%;- margin: 0 auto;- padding: 30px 3%;- border-top: 1px solid #b4b4b4;- opacity: 0.7;-`;--export const StyledFooterText = styled.p`- display: flex;- flex-direction: column;- gap: 20px;- color: #b4b4b4;-`;--export const StyledNavLink = styled.a`- display: flex;- justify-content: center;- align-items: center;- font-size: 1rem;- cursor: pointer;- transition: color 0.2s;-- &:hover {- font-weight: 500;- color: ${({ theme }) => theme.ORANGE};- }-`;--export const StyledIconLinks = styled.div`- display: flex;- gap: 20px;-`;--export const Footer = () => (- <StyledFooter>- <StyledFooterText>- <Link href="/">- <img width="120" height="20" src="assets/icon.png" alt="icon" loading="lazy" />- </Link>- <span>- © {new Date().getFullYear()} JSON Crack - {pkg.version}- </span>- </StyledFooterText>- <StyledIconLinks>- <StyledNavLink- href="https://github.com/AykutSarac/jsoncrack.com"- rel="external"- target="_blank"- aria-label="github"- >- <FaGithub size={26} />- </StyledNavLink>-- <StyledNavLink- href="https://www.linkedin.com/in/aykutsarac/"- rel="me"- target="_blank"- aria-label="linkedin"- >- <FaLinkedin size={26} />- </StyledNavLink>-- <StyledNavLink- href="https://twitter.com/jsoncrack"- rel="me"- target="_blank"- aria-label="twitter"- >- <FaTwitter size={26} />- </StyledNavLink>-- <StyledNavLink- href="https://discord.gg/yVyTtCRueq"- rel="noreferrer"- target="_blank"- aria-label="discord"- >- <FaDiscord size={26} />- </StyledNavLink>- </StyledIconLinks>- </StyledFooter>-);+import { FooterLinks } from "./FooterLinks";+import React from "react";++export const Footer = () => {+ return (+ <FooterLinks+ data={[+ {+ title: "Developers",+ links: [+ {+ label: "Open Source",+ link: "/oss",+ },+ {+ label: "Contributing",+ link: "https://github.com/AykutSarac/jsoncrack.com/blob/main/CONTRIBUTING.md",+ },+ ],+ },+ {+ title: "JSON Crack",+ links: [+ {+ label: "JSON Crack",+ link: "https://jsoncrack.com",+ },+ {+ label: "Terms of Service",+ link: "#",+ },+ {+ label: "Privacy Policy",+ link: "#",+ },+ ],+ },+ {+ title: "Social",+ links: [+ {+ label: "Discord",+ link: "https://discord.gg/yVyTtCRueq",+ },+ {+ label: "Twitter",+ link: "https://twitter.com/jsoncrack",+ },+ {+ label: "GitHub",+ link: "https://github.com/AykutSarach",+ },+ {+ label: "LinkedIn",+ link: "https://www.linkedin.com/company/herowand",+ },+ ],+ },+ ]}+ />+ );+};diff --git a/src/layout/JsonCrackLogo/index.tsx b/src/layout/JsonCrackLogo/index.tsxnew file mode 100644index 00000000..7b8765c2--- /dev/null+++ b/src/layout/JsonCrackLogo/index.tsx@@ -0,0 +1,13 @@+import React from "react";+import Link from "next/link";+import { Flex, Image } from "@mantine/core";++export const JSONCrackLogo = () => {+ return (+ <Link href="/">+ <Flex align="center" gap="sm">+ <Image src="assets/icon.png" width={150} alt="JSON Crack" />+ </Flex>+ </Link>+ );+};diff --git a/src/layout/Layout/index.tsx b/src/layout/Layout/index.tsxnew file mode 100644index 00000000..9b702283--- /dev/null+++ b/src/layout/Layout/index.tsx@@ -0,0 +1,15 @@+import React from "react";+import { Footer } from "../Footer";+import { Navbar } from "../Navbar";++const Layout: React.FC<{ children: React.ReactNode }> = ({ children }) => {+ return (+ <>+ <Navbar />+ {children}+ <Footer />+ </>+ );+};++export default Layout;diff --git a/src/layout/Navbar/index.tsx b/src/layout/Navbar/index.tsxindex bcbd54c4..a3d481c9 100644--- a/src/layout/Navbar/index.tsx+++ b/src/layout/Navbar/index.tsx@@ -1,71 +1,167 @@-import React from "react";import Link from "next/link";import styled from "styled-components";+import {+ createStyles,+ Menu,+ Center,+ Header,+ Container,+ Group,+ Button,+ rem,+ MediaQuery,+} from "@mantine/core";+import { CgChevronDown } from "react-icons/cg";+import { VscStarEmpty } from "react-icons/vsc";+import { JSONCrackLogo } from "../JsonCrackLogo";-const StyledNavbar = styled.div`- display: flex;- justify-content: space-between;- align-items: center;- gap: 20px;- padding: 16px 48px;+const links: HeaderActionProps[] = [+ { link: "/#features", label: "Features" },+ {+ link: "#",+ label: "Product",+ links: [+ {+ link: "https://marketplace.visualstudio.com/items?itemName=AykutSarac.jsoncrack-vscode",+ label: "VS Code Extension",+ },+ { link: "https://github.com/AykutSarac/jsoncrack.com", label: "View at GitHub" },+ { link: "https://www.producthunt.com/products/JSON-Crack", label: "View at Product Hunt" },+ ],+ },+ {+ link: "#",+ label: "Sponsor",+ links: [+ { link: "/oss", label: "Open Source" },+ { link: "https://github.com/sponsors/AykutSarac", label: "Sponsor" },+ {+ link: "https://www.patreon.com/herowand",+ label: "Become Backer",+ },+ ],+ },+ { link: "https://www.patreon.com/join/herowand", label: "Plus" },+ { link: "/docs", label: "Docs" },+];- @media only screen and (max-width: 768px) {- justify-content: center;+const HEADER_HEIGHT = rem(60);- a:first-of-type {- display: none;- }- }-`;+const useStyles = createStyles(theme => ({+ inner: {+ height: HEADER_HEIGHT,+ display: "flex",+ justifyContent: "space-between",+ alignItems: "center",+ },++ links: {+ [theme.fn.smallerThan("sm")]: {+ display: "none",+ },+ },++ link: {+ display: "block",+ lineHeight: 1,+ padding: `${rem(8)} ${rem(12)}`,+ borderRadius: theme.radius.sm,+ textDecoration: "none",+ color: theme.colorScheme === "dark" ? theme.colors.dark[0] : theme.colors.gray[7],+ fontSize: theme.fontSizes.sm,+ fontWeight: 500,-const StyledLinkWrapper = styled.nav`- display: flex;- justify-content: center;- align-items: center;- gap: 20px;+ "&:hover": {+ backgroundColor: theme.colorScheme === "dark" ? theme.colors.dark[6] : theme.colors.gray[0],+ },+ },++ linkLabel: {+ marginRight: rem(5),+ },+}));++const StyledHeader = styled(Header)`+ background: rgba(0, 0, 0, 0.5);+ border-bottom: 1px solid #212121;`;-const StyledNavLink = styled(Link)`- display: flex;- justify-content: center;- align-items: center;- font-size: 1rem;- cursor: pointer;- transition: color 0.2s;+interface HeaderActionProps {+ link: string;+ label: string;+ links?: { link: string; label: string }[];+}- &:hover {- font-weight: 500;- color: ${({ theme }) => theme.ORANGE};- }+export function Navbar() {+ const { classes } = useStyles();+ const items = links.map(link => {+ const menuItems = link.links?.map(item => (+ <Menu.Item key={item.link}>+ <Link href={item.link}>{item.label}</Link>+ </Menu.Item>+ ));- @media only screen and (max-width: 568px) {- &.mobileHide {- display: none;+ if (menuItems) {+ return (+ <Menu key={link.label} trigger="click">+ <Menu.Target>+ <a href={link.link} className={classes.link}>+ <Center>+ <span className={classes.linkLabel}>{link.label}</span>+ <CgChevronDown size={rem(12)} />+ </Center>+ </a>+ </Menu.Target>+ <Menu.Dropdown>{menuItems}</Menu.Dropdown>+ </Menu>+ );}- }-`;-export const Navbar = () => (- <StyledNavbar>- <Link href="/">- <img src="assets/icon.png" alt="json crack" width="120" />- </Link>- <StyledLinkWrapper>- <StyledNavLink className="mobileHide" href="https://editor.herowand.com">- More Data Formats- </StyledNavLink>- <StyledNavLink href="/editor">Editor</StyledNavLink>- <StyledNavLink href="#features">Features</StyledNavLink>- <StyledNavLink- href="https://github.com/AykutSarac/jsoncrack.com"- target="_blank"- rel="external"- >- GitHub- </StyledNavLink>- <StyledNavLink className="mobileHide" href="docs">- Documentation- </StyledNavLink>- </StyledLinkWrapper>- </StyledNavbar>-);+ return (+ <Link key={link.label} href={link.link} className={classes.link}>+ {link.label}+ </Link>+ );+ });++ return (+ <MediaQuery smallerThan="sm" styles={{ visibility: "hidden" }}>+ <StyledHeader px="lg" height={HEADER_HEIGHT} sx={{ borderBottom: 0 }} mb={60}>+ <Container className={classes.inner} fluid>+ <Group>+ <JSONCrackLogo />+ <Group spacing={5} className={classes.links}>+ {items}+ </Group>+ </Group>+ <Group>+ <MediaQuery smallerThan="md" styles={{ display: "none" }}>+ <Button+ component="a"+ href="https://github.com/AykutSarac/jsoncrack.com"+ size="xs"+ variant="subtle"+ leftIcon={<VscStarEmpty />}+ target="_blank"+ >+ Star us on GitHub+ </Button>+ </MediaQuery>+ <MediaQuery smallerThan="md" styles={{ display: "none" }}>+ <Link href="/sign-in">+ <Button variant="light" color="blue" size="xs">+ Sign in+ </Button>+ </Link>+ </MediaQuery>+ <Link href="/editor">+ <Button color="teal" size="xs">+ Editor+ </Button>+ </Link>+ </Group>+ </Container>+ </StyledHeader>+ </MediaQuery>+ );+}diff --git a/src/pages/docs.tsx b/src/pages/docs.tsxindex 85000a6b..5dc58165 100644--- a/src/pages/docs.tsx+++ b/src/pages/docs.tsx@@ -2,9 +2,8 @@ import React from "react";import dynamic from "next/dynamic";import Head from "next/head";import styled from "styled-components";-import { Button } from "@mantine/core";import materialDark from "react-syntax-highlighter/dist/cjs/styles/prism/material-dark";-import { Footer } from "src/layout/Footer";+import Layout from "src/layout/Layout";const SyntaxHighlighter = dynamic(() => import("react-syntax-highlighter/dist/cjs/prism-async"), {ssr: false,@@ -18,7 +17,7 @@ const StyledFrame = styled.iframe``;const StyledPage = styled.div`- padding: 5%;+ padding: 0 5%;`;const StyledContent = styled.section`@@ -57,15 +56,12 @@ const StyledHighlight = styled.span<{ link?: boolean; alert?: boolean }>`const Docs = () => {return (- <>+ <Layout><Head><title>Creating JSON Crack Embed | JSON Crack</title><meta name="description" content="Embedding JSON Crack tutorial into your websites." /></Head><StyledPage>- <Button component="a" href="/">- < Go Back- </Button><h1>Documentation</h1><StyledContent><h2># Fetching from URL</h2>@@ -176,8 +172,7 @@ const Docs = () => {</StyledContentBody></StyledContent></StyledPage>- <Footer />- </>+ </Layout>);};diff --git a/src/pages/oss.tsx b/src/pages/oss.tsxnew file mode 100644index 00000000..d1bf4821--- /dev/null+++ b/src/pages/oss.tsx@@ -0,0 +1,69 @@+import React from "react";+import Head from "next/head";+import Link from "next/link";+import { Button, Center, Container, Grid, Image, Text, Title } from "@mantine/core";+import { VscHeart } from "react-icons/vsc";+import Layout from "src/layout/Layout";++const Oss: React.FC<{ sponsors: any[] }> = ({ sponsors }) => {+ return (+ <Layout>+ <Head>+ <title>JSON Crack | Open Source Supporters</title>+ </Head>+ <Container>+ <Image mx="auto" src="assets/oss_banner.webp" radius="md" maw={800} alt="oss banner" />+ </Container>+ <Center pt="lg">+ <Button+ component="a"+ href="https://github.com/sponsors/AykutSarac"+ variant="light"+ size="lg"+ color="red"+ leftIcon={<VscHeart />}+ target="_blank"+ >+ BECOME PART OF IT+ </Button>+ </Center>+ <Container py={50}>+ <Title pb="md">Thank you!</Title>+ <Text maw={500}>+ “We would like to extend our sincerest gratitude to all of our sponsors for their+ invaluable support and contribution towards JSON Crack.”+ </Text>+ </Container>+ <Container>+ <Title order={3} pb="xl">+ Sponsors+ </Title>+ <Grid gutter={30}>+ {sponsors?.map(sponsor => (+ <Grid.Col span="content" key={sponsor.handle}>+ <Link href={sponsor.profile}>+ <Image radius="md" width={"4rem"} src={sponsor.avatar} alt={sponsor.handle} />+ <Text pt="sm" align="center" fz="xs">+ {sponsor.handle}+ </Text>+ </Link>+ </Grid.Col>+ ))}+ </Grid>+ </Container>+ </Layout>+ );+};++export default Oss;++export async function getStaticProps() {+ const res = await fetch("https://ghs.vercel.app/sponsors/aykutsarac");+ const data = await res.json();++ return {+ props: {+ sponsors: data?.sponsors.reverse() || [],+ },+ };+}