Skip to content

✨ Innovative and open-source visualization application that transforms various data formats, such as JSON, YAML, XML and CSV into interactive graphs.

feat: add card spotlight background

AykutSarac0f11d7e3377d
diff --git a/package.json b/package.json
index f51fc6ac..1bc0799f 100644
--- a/package.json
+++ b/package.json
@@ -49,6 +49,7 @@
"reaflow": "5.2.8",
"styled-components": "^6.1.8",
"toml": "^3.0.0",
+ "use-bg-cursor-pos": "^1.0.1",
"use-long-press": "^3.2.0",
"zustand": "^4.5.2"
},
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 67241339..5cada5ab 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -110,6 +110,9 @@ dependencies:
toml:
specifier: ^3.0.0
version: 3.0.0
+ use-bg-cursor-pos:
+ specifier: ^1.0.1
+ version: 1.0.1([email protected])
use-long-press:
specifier: ^3.2.0
version: 3.2.0([email protected])
@@ -4591,6 +4594,14 @@ packages:
punycode: 2.3.1
dev: true
+ resolution: {integrity: sha512-5eg6GrQepu2Yrh/dpQLIhO/2rRZzNtuyNxcX9z2RGnkKX4pUykDxseAb52I2pjBGTncuwJDaoGSvizvj5bIykw==}
+ peerDependencies:
+ react: ^16.8.0
+ dependencies:
+ react: 18.2.0
+ dev: false
+
resolution: {integrity: sha512-Lg4Vx1XZQauB42Hw3kK7JM6yjVjgFmFC5/Ab797s79aARomD2nEErc4mCgM8EZrARLmmbWpi5DGCadmK50DcAQ==}
engines: {node: '>=10'}
diff --git a/src/pages/index.tsx b/src/pages/index.tsx
index dff815ef..3279750a 100644
--- a/src/pages/index.tsx
+++ b/src/pages/index.tsx
@@ -32,6 +32,7 @@ import {
MdRebaseEdit,
MdSearch,
} from "react-icons/md";
+import useBackgroundCursorPosition from "use-bg-cursor-pos";
import Layout from "src/layout/Layout";
const PricingCards = dynamic(() => import("./pricing").then(mod => mod.PricingCards));
@@ -96,6 +97,29 @@ const StyledHeroText = styled.p`
}
`;
+const StyledPaper = styled.div`
+ position: relative;
+ z-index: 1;
+
+ &:before {
+ position: absolute;
+ z-index: -1;
+ opacity: 0.7;
+ top: 0;
+ left: 0;
+ content: "";
+ width: 100%;
+ height: 100%;
+ background-size: 20px 20px;
+ background-image: linear-gradient(to right, #dcdcdc 1px, transparent 1px),
+ linear-gradient(to bottom, #dcdcdc 1px, transparent 1px);
+ background-position: top center;
+ image-rendering: pixelated;
+ -webkit-mask-image: linear-gradient(to bottom, transparent, 20%, white, 90%, transparent);
+ mask-image: linear-gradient(to bottom, transparent, 20%, white, 90%, transparent);
+ }
+`;
+
const StyledHeroTitle = styled.h1`
position: relative;
font-size: 1.8rem;
@@ -163,6 +187,11 @@ const metaDescription =
"JSON Crack Editor is a tool for visualizing into graphs, analyzing, editing, formatting, querying, transforming and validating JSON, CSV, YAML, XML, and more.";
export const HomePage = () => {
+ const [card1, bg1] = useBackgroundCursorPosition("#f2f2f2", "#ffffff", "200px");
+ const [card2, bg2] = useBackgroundCursorPosition("#f2f2f2", "#ffffff", "200px");
+ const [card3, bg3] = useBackgroundCursorPosition("#f2f2f2", "#ffffff", "200px");
+ const [card4, bg4] = useBackgroundCursorPosition("#f2f2f2", "#ffffff", "200px");
+
return (
<Layout>
<Head>
@@ -346,6 +375,8 @@ export const HomePage = () => {
<Grid w="90%" gutter={24} mt={50} mb={150} mx="auto">
<Grid.Col span={{ base: 12, sm: 6 }}>
<Paper
+ pos="relative"
+ ref={card1 as React.RefObject<HTMLDivElement>}
p={30}
withBorder
shadow="xs"
@@ -354,40 +385,44 @@ export const HomePage = () => {
h={{ sm: 300, md: 370 }}
style={{
overflow: "hidden",
+ background: bg1,
}}
>
- <ThemeIcon
- color="gray.3"
- c="dark.4"
- bg="gray.1"
- variant="outline"
- size="xl"
- radius="md"
- visibleFrom="md"
- mb="md"
- >
- <MdCompare size={28} />
- </ThemeIcon>
- <Title order={3} fw={500} fz={{ sm: 20, md: 28 }}>
- Compare
- </Title>
- <Text fz={{ sm: 14, md: 18 }} fw={300} lts={0.4} c="dark.5" mt={10}>
- Compare and analyze your data smoothly with the interactive graphs.
- </Text>
- <Image
- loading="lazy"
- src="./assets/features/compare.webp"
- alt="Compare"
- w={{ sm: 350, md: 500 }}
- mt={20}
- style={{
- filter: "drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.25))",
- }}
- />
+ <StyledPaper>
+ <ThemeIcon
+ color="gray.3"
+ c="dark.4"
+ bg="gray.1"
+ variant="outline"
+ size="xl"
+ radius="md"
+ visibleFrom="md"
+ mb="md"
+ >
+ <MdCompare size={28} />
+ </ThemeIcon>
+ <Title order={3} fw={500} fz={{ sm: 20, md: 28 }}>
+ Compare
+ </Title>
+ <Text fz={{ sm: 14, md: 18 }} fw={300} lts={0.4} c="dark.5" mt={10}>
+ Compare and analyze your data smoothly with the interactive graphs.
+ </Text>
+ <Image
+ loading="lazy"
+ src="./assets/features/compare.webp"
+ alt="Compare"
+ w={{ sm: 350, md: 400 }}
+ mt={20}
+ style={{
+ filter: "drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.25))",
+ }}
+ />
+ </StyledPaper>
</Paper>
</Grid.Col>
<Grid.Col span={{ base: 12, sm: 6 }}>
<Paper
+ ref={card2 as React.RefObject<HTMLDivElement>}
p={30}
withBorder
shadow="xs"
@@ -396,39 +431,44 @@ export const HomePage = () => {
h={{ sm: 300, md: 370 }}
style={{
overflow: "hidden",
+ background: bg2,
}}
>
- <ThemeIcon
- color="gray.3"
- c="dark.4"
- bg="gray.1"
- variant="outline"
- size="xl"
- radius="md"
- visibleFrom="md"
- mb="md"
- >
- <MdRebaseEdit size={28} />
- </ThemeIcon>
- <Title order={3} fw={500} fz={{ sm: 20, md: 28 }}>
- Edit
- </Title>
- <Text fz={{ sm: 14, md: 16 }} fw={300} lts={0.4} c="dark.5" my={10}>
- Directly modify your data through the graphs, without wasting time on manual editing.
- </Text>
- <Paper withBorder shadow="sm" radius="sm" w="fit-content" mx="auto">
- <Image
- loading="lazy"
- radius="sm"
- src="./assets/features/edit.webp"
- alt="Edit"
- w={340}
- />
- </Paper>
+ <StyledPaper>
+ <ThemeIcon
+ color="gray.3"
+ c="dark.4"
+ bg="gray.1"
+ variant="outline"
+ size="xl"
+ radius="md"
+ visibleFrom="md"
+ mb="md"
+ >
+ <MdRebaseEdit size={28} />
+ </ThemeIcon>
+ <Title order={3} fw={500} fz={{ sm: 20, md: 28 }}>
+ Edit
+ </Title>
+ <Text fz={{ sm: 14, md: 16 }} fw={300} lts={0.4} c="dark.5" my={10}>
+ Directly modify your data through the graphs, without wasting time on manual
+ editing.
+ </Text>
+ <Paper withBorder shadow="sm" radius="sm" w="fit-content" mx="auto">
+ <Image
+ loading="lazy"
+ radius="sm"
+ src="./assets/features/edit.webp"
+ alt="Edit"
+ w={340}
+ />
+ </Paper>
+ </StyledPaper>
</Paper>
</Grid.Col>
<Grid.Col span={{ base: 12, sm: 6 }}>
<Paper
+ ref={card3 as React.RefObject<HTMLDivElement>}
p={30}
withBorder
shadow="xs"
@@ -437,41 +477,45 @@ export const HomePage = () => {
h={{ sm: 300, md: 370 }}
style={{
overflow: "hidden",
+ background: bg3,
}}
>
- <ThemeIcon
- color="gray.3"
- c="dark.4"
- bg="gray.1"
- variant="outline"
- size="xl"
- radius="md"
- visibleFrom="md"
- mb="md"
- >
- <MdSearch size={28} />
- </ThemeIcon>
- <Title order={3} fw={500} fz={{ sm: 20, md: 28 }}>
- Search
- </Title>
- <Text fz={{ sm: 14, md: 18 }} fw={300} lts={0.4} c="dark.5" mt={10}>
- Highlight and search what you need in your data, without any hassle.
- </Text>
- <Image
- loading="lazy"
- src="./assets/features/search.webp"
- alt="Search"
- w={{ sm: 400, md: 500 }}
- mx="auto"
- mt={20}
- style={{
- filter: "drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.25))",
- }}
- />
+ <StyledPaper>
+ <ThemeIcon
+ color="gray.3"
+ c="dark.4"
+ bg="gray.1"
+ variant="outline"
+ size="xl"
+ radius="md"
+ visibleFrom="md"
+ mb="md"
+ >
+ <MdSearch size={28} />
+ </ThemeIcon>
+ <Title order={3} fw={500} fz={{ sm: 20, md: 28 }}>
+ Search
+ </Title>
+ <Text fz={{ sm: 14, md: 18 }} fw={300} lts={0.4} c="dark.5" mt={10}>
+ Highlight and search what you need in your data, without any hassle.
+ </Text>
+ <Image
+ loading="lazy"
+ src="./assets/features/search.webp"
+ alt="Search"
+ w={{ sm: 400, md: 500 }}
+ mx="auto"
+ mt={20}
+ style={{
+ filter: "drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.25))",
+ }}
+ />
+ </StyledPaper>
</Paper>
</Grid.Col>
<Grid.Col span={{ base: 12, sm: 6 }}>
<Paper
+ ref={card4 as React.RefObject<HTMLDivElement>}
p={30}
withBorder
shadow="xs"
@@ -480,77 +524,80 @@ export const HomePage = () => {
h={{ sm: 300, md: 370 }}
style={{
overflow: "hidden",
+ background: bg4,
}}
>
- <ThemeIcon
- color="gray.3"
- c="dark.4"
- bg="gray.1"
- variant="outline"
- size="xl"
- radius="md"
- visibleFrom="md"
- mb="md"
- >
- <MdExtension size={28} />
- </ThemeIcon>
- <Title order={3} fw={500} fz={{ sm: 20, md: 28 }}>
- Choose Your Format
- </Title>
- <Text fz={{ sm: 14, md: 18 }} fw={300} lts={0.4} c="dark.5" mt={10}>
- Visualize and edit your data in multiple formats. JSON, YAML, CSV, XML, and TOML are
- supported.
- </Text>
- <Grid gutter="lg" mt={20}>
- <Grid.Col span={6}>
- <Badge
- w="100%"
- mih={{ sm: 10, md: 40 }}
- variant="light"
- color="indigo"
- radius="sm"
- size="xl"
- >
- JSON
- </Badge>
- </Grid.Col>
- <Grid.Col span={6}>
- <Badge
- w="100%"
- mih={{ sm: 10, md: 40 }}
- variant="light"
- color="cyan"
- radius="sm"
- size="xl"
- >
- YAML
- </Badge>
- </Grid.Col>
- <Grid.Col span={6}>
- <Badge
- w="100%"
- mih={{ sm: 10, md: 40 }}
- variant="light"
- color="grape"
- radius="sm"
- size="xl"
- >
- CSV
- </Badge>
- </Grid.Col>
- <Grid.Col span={6}>
- <Badge
- w="100%"
- mih={{ sm: 10, md: 40 }}
- variant="light"
- color="red"
- radius="sm"
- size="xl"
- >
- XML
- </Badge>
- </Grid.Col>
- </Grid>
+ <StyledPaper>
+ <ThemeIcon
+ color="gray.3"
+ c="dark.4"
+ bg="gray.1"
+ variant="outline"
+ size="xl"
+ radius="md"
+ visibleFrom="md"
+ mb="md"
+ >
+ <MdExtension size={28} />
+ </ThemeIcon>
+ <Title order={3} fw={500} fz={{ sm: 20, md: 28 }}>
+ Choose Your Format
+ </Title>
+ <Text fz={{ sm: 14, md: 18 }} fw={300} lts={0.4} c="dark.5" mt={10}>
+ Visualize and edit your data in multiple formats. JSON, YAML, CSV, XML, and TOML are
+ supported.
+ </Text>
+ <Grid gutter="lg" mt={20}>
+ <Grid.Col span={6}>
+ <Badge
+ w="100%"
+ mih={{ sm: 10, md: 40 }}
+ variant="light"
+ color="indigo"
+ radius="sm"
+ size="xl"
+ >
+ JSON
+ </Badge>
+ </Grid.Col>
+ <Grid.Col span={6}>
+ <Badge
+ w="100%"
+ mih={{ sm: 10, md: 40 }}
+ variant="light"
+ color="cyan"
+ radius="sm"
+ size="xl"
+ >
+ YAML
+ </Badge>
+ </Grid.Col>
+ <Grid.Col span={6}>
+ <Badge
+ w="100%"
+ mih={{ sm: 10, md: 40 }}
+ variant="light"
+ color="grape"
+ radius="sm"
+ size="xl"
+ >
+ CSV
+ </Badge>
+ </Grid.Col>
+ <Grid.Col span={6}>
+ <Badge
+ w="100%"
+ mih={{ sm: 10, md: 40 }}
+ variant="light"
+ color="red"
+ radius="sm"
+ size="xl"
+ >
+ XML
+ </Badge>
+ </Grid.Col>
+ </Grid>
+ </StyledPaper>
</Paper>
</Grid.Col>
</Grid>