diff --git a/public/blockmatic_screenshot_dark.png b/public/blockmatic_screenshot_dark.png new file mode 100644 index 0000000..518603a Binary files /dev/null and b/public/blockmatic_screenshot_dark.png differ diff --git a/public/blockmatic_screenshot_light.png b/public/blockmatic_screenshot_light.png new file mode 100644 index 0000000..d923064 Binary files /dev/null and b/public/blockmatic_screenshot_light.png differ diff --git a/src/components/home/AppPreview.tsx b/src/components/home/AppPreview.tsx new file mode 100644 index 0000000..ab8668b --- /dev/null +++ b/src/components/home/AppPreview.tsx @@ -0,0 +1,49 @@ +import { useContext, useState } from "react"; +import { ThemeContext } from "@/context/Theme"; + +function AppPreview() { + const { isDark } = useContext(ThemeContext); + + const [leaving, setLeaving] = useState(true); + const [transform, setTransform] = useState(""); + + const onMouseEnter = () => { + setLeaving(false); + }; + + const onMouseLeave = () => { + setLeaving(true); + setTransform("rotateX(0deg) rotateY(0deg)"); + }; + + const onMouseMove = (e: React.MouseEvent) => { + const rect = e.currentTarget.getBoundingClientRect(); + + const x = e.clientX - rect.left; + const y = e.clientY - rect.top; + + const centerX = rect.width / 2; + const centerY = rect.height / 2; + + const rotateX = ((y - centerY) / centerY) * 10; + const rotateY = ((centerX - x) / centerX) * 10; + + setTransform(`rotateX(${rotateX}deg) rotateY(${rotateY}deg)`); + }; + + return ( + app preview + ); +} + +export default AppPreview; diff --git a/src/pages/IndexPage.tsx b/src/pages/IndexPage.tsx index 6a4fb77..ccdb44c 100644 --- a/src/pages/IndexPage.tsx +++ b/src/pages/IndexPage.tsx @@ -6,6 +6,7 @@ import { Button } from "@/components/ui/button"; import BlockmaticLogo from "@/assets/blockmatic.svg?react"; import GithubIcon from "@/assets/github.svg?react"; +import AppPreview from "@/components/home/AppPreview"; import ImageComparison from "@/components/home/ImageComparison"; function IndexPage() { @@ -24,16 +25,18 @@ function IndexPage() { -
-
- screenshot -
+ screenshot -

Convert your images to schematics

+

Convert your images to schematics

- bliss + -

Original vs. blockmatic

+

See the difference