From 4838df315931bb883f704ec3e1abe2685f296cdf Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Sat, 22 Apr 2023 19:52:26 +0800 Subject: 😀 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/components/logos/TurboAnimated.tsx | 157 ++++++++++++++++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 docs/components/logos/TurboAnimated.tsx (limited to 'docs/components/logos/TurboAnimated.tsx') diff --git a/docs/components/logos/TurboAnimated.tsx b/docs/components/logos/TurboAnimated.tsx new file mode 100644 index 0000000..c70f42d --- /dev/null +++ b/docs/components/logos/TurboAnimated.tsx @@ -0,0 +1,157 @@ +import { AnimatePresence, motion, Variants } from "framer-motion"; +import { useTurboSite } from "../SiteSwitcher"; +import cn from "classnames"; +import styles from "../header-logo.module.css"; + +type LogoProps = { + className?: string; + height?: number; +}; + +const LEFT_PADDING = 8; +const RIGHT_PADDING = 12; +// The width of the logo + wordmark. This does not include the "invisible" padding. +const VISUAL_WIDTH = 112; + +const TurboAnimated = ({ height = 32, className = "" }: LogoProps) => { + const site = useTurboSite(); + + return ( + + Turborepo + + + + + + + + + + + + + + + + + + + + {site === "repo" || site === undefined ? ( + + + + + ) : ( + + + + + )} + + + + {/* Turbo Wordmark */} + + + + + + + + + ); +}; + +export default TurboAnimated; + +const variants: Variants = { + visible: { + opacity: 1, + x: 0, + transition: { + duration: 0.3, + }, + }, + hidden: (distance) => ({ + opacity: 0, + x: distance, + transition: { + duration: 0.3, + }, + }), +}; -- cgit v1.2.3-70-g09d2