From ebe22818d6ffcccaa5bf4f009e0b131000a2f27c Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Wed, 1 Feb 2023 04:30:48 +0000 Subject: [PATCH] playing --- beta/src/components/Layout/HomeContent.tsx | 39 +++++++++++++++++++--- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/beta/src/components/Layout/HomeContent.tsx b/beta/src/components/Layout/HomeContent.tsx index 7c050c8f4..8f522409e 100644 --- a/beta/src/components/Layout/HomeContent.tsx +++ b/beta/src/components/Layout/HomeContent.tsx @@ -2,6 +2,7 @@ * Copyright (c) Facebook, Inc. and its affiliates. */ +import {useState} from 'react'; import ButtonLink from '../ButtonLink'; import {Logo} from 'components/Logo'; import Link from 'next/link'; @@ -422,8 +423,11 @@ export function HomeContent() { } function Example() { + const [hover, setHover] = useState(false); return (
setHover(true)} + onPointerLeave={() => setHover(false)} style={{ width: 500, height: 300, @@ -431,14 +435,26 @@ function Example() { }}>
-
+
Alan Turing
@@ -463,6 +483,12 @@ function Example() { color: 'grey', fontSize: 12, marginBottom: 20, + backgroundColor: '#f0f0f0', + transform: hover ? 'translate3d(20px, 0, 100px)' : '', + transformStyle: 'preserve-3d', + transition: 'all 0.4s ease-in-out', + border: hover ? '2px dashed #ddd' : '2px dashed transparent', + margin: 10, }}> Machines take me by surprise with great frequency.
@@ -472,6 +498,11 @@ function Example() { color: 'white', borderRadius: 4, padding: '4px 10px', + transform: hover ? 'translate3d(20px, 0, 100px)' : '', + transformStyle: 'preserve-3d', + transition: 'all 0.4s ease-in-out', + border: hover ? '2px dashed #ddd' : '2px dashed transparent', + margin: 10, }}> Like