✨ Innovative and open-source visualization application that transforms various data formats, such as JSON, YAML, XML and CSV into interactive graphs.
feat: update notsupported ui
AykutSarac1ee5c1f01132
diff --git a/src/features/editor/views/GraphView/NotSupported.tsx b/src/features/editor/views/GraphView/NotSupported.tsxindex 2aeb94cc..3a9fd9e8 100644--- a/src/features/editor/views/GraphView/NotSupported.tsx+++ b/src/features/editor/views/GraphView/NotSupported.tsx@@ -1,171 +1,101 @@import React from "react";-import Link from "next/link";-import { Button, Text } from "@mantine/core";-import styled from "styled-components";-import { UpgradeContent } from "../../../modals/UpgradeModal";--const StyledNotSupported = styled.div`- position: relative;- display: flex;- flex-direction: column;- align-items: center;- justify-content: center;- width: 100%;- height: 100%;- overflow: hidden;-- .glowing {- position: relative;- min-width: 700px;- height: 550px;- margin: -150px;- transform-origin: right;- animation: colorChange 5s linear infinite;- }-- .glowing:nth-child(even) {- transform-origin: left;- }-- @keyframes colorChange {- 0% {- filter: hue-rotate(0deg);- transform: rotate(0deg);- }- 100% {- filter: hue-rotate(360deg);- transform: rotate(360deg);- }- }-- .glowing span {- --i: 1;- position: absolute;- top: calc(80px * var(--i));- left: calc(80px * var(--i));- bottom: calc(80px * var(--i));- right: calc(80px * var(--i));- }-- .glowing span::before {- content: "";- position: absolute;- top: 50%;- left: -8px;- width: 15px;- height: 15px;- background: #f00;- border-radius: 50%;- }-- .glowing span:nth-child(3n + 1)::before {- background: rgba(134, 255, 0, 1);- box-shadow:- 0 0 20px rgba(134, 255, 0, 1),- 0 0 40px rgba(134, 255, 0, 1),- 0 0 60px rgba(134, 255, 0, 1),- 0 0 80px rgba(134, 255, 0, 1),- 0 0 0 8px rgba(134, 255, 0, 0.1);- }-- .glowing span:nth-child(3n + 2)::before {- background: rgba(255, 214, 0, 1);- box-shadow:- 0 0 20px rgba(255, 214, 0, 1),- 0 0 40px rgba(255, 214, 0, 1),- 0 0 60px rgba(255, 214, 0, 1),- 0 0 80px rgba(255, 214, 0, 1),- 0 0 0 8px rgba(255, 214, 0, 0.1);+import { Anchor, Button, Image, Overlay, Stack, Text } from "@mantine/core";+import styled, { keyframes } from "styled-components";+import useConfig from "../../../../store/useConfig";+import { useModal } from "../../../../store/useModal";++const shineEffect = keyframes`+ 0% {+ transform: translateX(-120%) rotate(25deg);+ opacity: 0.5;}-- .glowing span:nth-child(3n + 3)::before {- background: rgba(0, 226, 255, 1);- box-shadow:- 0 0 20px rgba(0, 226, 255, 1),- 0 0 40px rgba(0, 226, 255, 1),- 0 0 60px rgba(0, 226, 255, 1),- 0 0 80px rgba(0, 226, 255, 1),- 0 0 0 8px rgba(0, 226, 255, 0.1);+ 5% {+ opacity: 0.5;+ transform: translateX(-80%) rotate(25deg);}-- .glowing span:nth-child(3n + 1) {- animation: animate 10s alternate infinite;+ 70% {+ transform: translateX(80%) rotate(25deg);+ opacity: 0.5;}-- .glowing span:nth-child(3n + 2) {- animation: animate-reverse 3s alternate infinite;+ 80% {+ transform: translateX(120%) rotate(25deg);+ opacity: 0;}-- .glowing span:nth-child(3n + 3) {- animation: animate 8s alternate infinite;+ 100% {+ transform: translateX(120%) rotate(25deg);+ opacity: 0;}+`;- @keyframes animate {- 0% {- transform: rotate(180deg);- }- 50% {- transform: rotate(0deg);- }- 100% {- transform: rotate(360deg);- }- }-- @keyframes animate-reverse {- 0% {- transform: rotate(360deg);- }-- 50% {- transform: rotate(180deg);- }+const ShiningButton = styled.div`+ position: relative;+ overflow: hidden;+ display: inline-block;+ border-radius: 0.5rem;+ z-index: 10;- 100% {- transform: rotate(0deg);- }+ &::before {+ content: "";+ position: absolute;+ top: -50%;+ left: -50%;+ width: 200%;+ height: 200%;+ background: linear-gradient(+ to right,+ rgba(255, 255, 255, 0) 0%,+ rgba(255, 255, 255, 0) 35%,+ rgba(255, 255, 255, 0.5) 50%,+ rgba(255, 255, 255, 0) 65%,+ rgba(255, 255, 255, 0) 100%+ );+ transform: translateX(-120%) rotate(25deg);+ z-index: 20;+ pointer-events: none;+ animation: ${shineEffect} 4s ease-out infinite;+ transition: transform 0.2s ease-out;}`;-const StyledContent = styled.div`- position: absolute;- left: 0;- top: 0;- width: 100%;- height: 100%;- display: flex;- flex-direction: column;- align-items: center;- justify-content: center;- z-index: 1;-`;-export const NotSupported = () => {+ const darkmodeEnabled = useConfig(state => state.darkmodeEnabled);+ const setVisible = useModal(state => state.setVisible);+return (- <StyledNotSupported>- <StyledContent>- <UpgradeContent direction="column-reverse" maw="550" />- <Text c="dimmed" maw="400" my="lg" ta="center">- JSON Crack is unable to support data of this size. <br />- Try the new editor for better performance.+ <Overlay+ backgroundOpacity={0.8}+ color={darkmodeEnabled ? "gray" : "rgb(226, 240, 243)"}+ blur="1.5"+ center+ >+ <Stack maw="60%" align="center" justify="center" gap="sm">+ <Image src="https://todiagram.com/logo.svg" alt="Unsupported" w={72} h={72} />+ <Text fz="48" fw={600} c="bright">+ Time to upgrade!</Text>- <Link- rel="noopener"- href="https://todiagram.com/editor?utm_source=jsoncrack&utm_medium=data_limit"- target="_blank"- passHref- >- <Button size="lg" color="teal" radius="xl">- Upgrade now+ <Text ta="center" size="lg" fw={500} c="gray" maw="600">+ This diagram is too large and not supported at JSON Crack.+ <br />+ Try{" "}+ <Anchor inherit c="teal" fw="500" onClick={() => setVisible("UpgradeModal", true)}>+ ToDiagram+ </Anchor>{" "}+ for larger diagrams and more features.+ </Text>+ <ShiningButton style={{ marginTop: "16px", position: "relative" }}>+ <Button+ component="a"+ href="https://todiagram.com/editor?utm_source=jsoncrack&utm_medium=data_limit"+ rel="noopener"+ size="lg"+ w="200"+ target="_blank"+ color="teal"+ >+ Try now →</Button>- </Link>- </StyledContent>-- <div className="glowing">- <span></span>- <span></span>- <span></span>- </div>- </StyledNotSupported>+ </ShiningButton>+ </Stack>+ </Overlay>);};diff --git a/src/features/editor/views/GraphView/index.tsx b/src/features/editor/views/GraphView/index.tsxindex 3a43abfc..573e524d 100644--- a/src/features/editor/views/GraphView/index.tsx+++ b/src/features/editor/views/GraphView/index.tsx@@ -1,5 +1,5 @@import React from "react";-import { LoadingOverlay, useComputedColorScheme } from "@mantine/core";+import { Box, LoadingOverlay, useComputedColorScheme } from "@mantine/core";import { useDebouncedValue } from "@mantine/hooks";import styled from "styled-components";import debounce from "lodash.debounce";@@ -168,12 +168,9 @@ export const GraphView = ({ isWidget = false }: GraphProps) => {setViewPort(viewPort!);}, 300);- if (aboveSupportedLimit) {- return <NotSupported />;- }-return (- <>+ <Box pos="relative" h="100%" w="100%">+ {!aboveSupportedLimit && <NotSupported />}<LoadingOverlay visible={debouncedLoading} />{!isWidget && <OptionsMenu />}{!isWidget && <SecureInfo />}@@ -197,6 +194,6 @@ export const GraphView = ({ isWidget = false }: GraphProps) => {<GraphCanvas isWidget={isWidget} /></Space></StyledEditorWrapper>- </>+ </Box>);};diff --git a/src/features/modals/UpgradeModal/index.tsx b/src/features/modals/UpgradeModal/index.tsxindex 845e7fcb..1a90829c 100644--- a/src/features/modals/UpgradeModal/index.tsx+++ b/src/features/modals/UpgradeModal/index.tsx@@ -137,7 +137,7 @@ const StyledFeatureItem = styled.div`--gradient-1: 0.1;--gradient-2: 0.15;--gradient-3: 0.15;- border-color: rgba(130, 174, 255, 0.567);+ border-color: rgba(130, 255, 203, 0.567);}&:hover {@@ -157,7 +157,7 @@ const FeatureCard = (props: {return (<StyledFeatureItem className={props.selected ? "selected" : ""} onClick={props.onClick}><Flex gap="md" align="flex-start">- <ThemeIcon variant="light" color="grape" radius="xl" size="36">+ <ThemeIcon variant="light" color="teal" radius="xl" size="36">{props.icon}</ThemeIcon><Stack gap="4">@@ -165,7 +165,7 @@ const FeatureCard = (props: {<Text fz="md" fw="600" c="bright">{props.title}</Text>- <ThemeIcon variant="transparent" color="grape">+ <ThemeIcon variant="transparent" color="teal">{props.selected ? <LuCheck size={20} /> : null}</ThemeIcon></Flex>@@ -262,10 +262,8 @@ export const UpgradeModal = ({ opened, onClose }: ModalProps) => {target="_blank"radius="lg"size="lg"- c="black"+ color="teal"autoContrast- variant="gradient"- gradient={{ from: "#FF75B7", to: "#FED761" }}leftSection={<FaPlay />}fullWidthfw="600"