|
| 1 | +# Slideshow with controls autofocus |
| 2 | + |
| 3 | +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilities morbi tempus. Praesent elementum facilisis leo vel fringilla. Congue mauris rhoncus aenean vel. Egestas sed tempus urna et pharetra pharetra massa massa ultricies. |
| 4 | + |
| 5 | +<CH.Slideshow preset="https://codesandbox.io/s/w5wfe" autoFocus={true}> |
| 6 | + |
| 7 | +Lorem ipsum dolor sit amet, consectetur adipiscing something about points, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. |
| 8 | + |
| 9 | +```jsx src/App.js |
| 10 | +import { motion } from "framer-motion" |
| 11 | + |
| 12 | +const transition = { duration: 1 } |
| 13 | + |
| 14 | +export default function App() { |
| 15 | + const bg = "hsl(20, 100%, 50%)" |
| 16 | + return ( |
| 17 | + <div className="container"> |
| 18 | + <motion.div |
| 19 | + className="swatch" |
| 20 | + animate={{ |
| 21 | + backgroundColor: bg, |
| 22 | + }} |
| 23 | + transition={transition} |
| 24 | + /> |
| 25 | + </div> |
| 26 | + ) |
| 27 | +} |
| 28 | +``` |
| 29 | + |
| 30 | +--- |
| 31 | + |
| 32 | +## Step 2 |
| 33 | + |
| 34 | +Velit euismod in pellentesque massa placerat. Mi bibendum neque egestas congue quisque egestas diam in arcu. Nisi lacus sed viverra tellus in. |
| 35 | + |
| 36 | +```jsx src/App.js focus=1,6,9:15 |
| 37 | +import { motion } from "framer-motion" |
| 38 | + |
| 39 | +const transition = { duration: 1 } |
| 40 | + |
| 41 | +export default function App() { |
| 42 | + const bg = "hsl(110, 100%, 50%)" |
| 43 | + return ( |
| 44 | + <div className="container"> |
| 45 | + <motion.div |
| 46 | + className="swatch" |
| 47 | + animate={{ |
| 48 | + backgroundColor: bg, |
| 49 | + }} |
| 50 | + transition={transition} |
| 51 | + /> |
| 52 | + </div> |
| 53 | + ) |
| 54 | +} |
| 55 | +``` |
| 56 | + |
| 57 | +--- |
| 58 | + |
| 59 | +## Step 3 |
| 60 | + |
| 61 | +Id aliquet risus feugiat in ante metus dictum at tempor. Sed blandit libero volutpat sed cras. |
| 62 | + |
| 63 | +```jsx src/App.js focus=1,6,9:15 |
| 64 | +import { motion } from "framer-motion" |
| 65 | + |
| 66 | +const transition = { duration: 1 } |
| 67 | + |
| 68 | +export default function App() { |
| 69 | + const bg = "hsl(200, 100%, 50%)" |
| 70 | + return ( |
| 71 | + <div className="container"> |
| 72 | + <motion.div |
| 73 | + className="swatch" |
| 74 | + animate={{ |
| 75 | + backgroundColor: bg, |
| 76 | + }} |
| 77 | + transition={transition} |
| 78 | + /> |
| 79 | + </div> |
| 80 | + ) |
| 81 | +} |
| 82 | +``` |
| 83 | + |
| 84 | +--- |
| 85 | + |
| 86 | +## Step 4 |
| 87 | + |
| 88 | +Velit euismod in pellentesque massa placerat. Mi bibendum neque egestas congue quisque egestas diam in arcu. |
| 89 | + |
| 90 | +```jsx src/App.js focus=1,6,9:15 |
| 91 | +import { motion } from "framer-motion" |
| 92 | + |
| 93 | +const transition = { duration: 1 } |
| 94 | + |
| 95 | +export default function App() { |
| 96 | + const bg = "hsl(290, 100%, 50%)" |
| 97 | + return ( |
| 98 | + <div className="container"> |
| 99 | + <motion.div |
| 100 | + className="swatch" |
| 101 | + animate={{ |
| 102 | + backgroundColor: bg, |
| 103 | + }} |
| 104 | + transition={transition} |
| 105 | + /> |
| 106 | + </div> |
| 107 | + ) |
| 108 | +} |
| 109 | +``` |
| 110 | + |
| 111 | +</CH.Slideshow> |
0 commit comments