This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const container: Variants = { | |
active: { | |
background: "#ff00b1", | |
transition: { | |
staggerChildren: 0.5 | |
} | |
}, | |
disabled: { | |
background: "#0D00FF" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const container: Variants = { | |
active: { | |
background: "#ff00b1", | |
transition: { | |
staggerChildren: 0.5, | |
when: "beforeChildren" | |
} | |
}, | |
disabled: { | |
background: "#0D00FF" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from "react" | |
import { Quote } from "./canvas" | |
export function KanyeQuote() { | |
const [quote, setQuote] = React.useState("") | |
React.useEffect(() => { | |
// load quote from local storage if it's there, fetch from API otherwise | |
if (localStorage.getItem("quote")) { | |
setQuote(localStorage.getItem("quote")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const clamp = (value: number, clampAt: number = 30) => { | |
if (value > 0) { | |
return value > clampAt ? clampAt : value; | |
} else { | |
return value < -clampAt ? -clampAt : value; | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const movies = [ | |
"/breaking-bad.webp", | |
"/the-leftovers.jpg", | |
"/game-of-thrones.jpg", | |
"/true-detective.jpg", | |
"/walking-dead.jpg" | |
]; | |
const App = () => { | |
return ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
::-webkit-scrollbar { | |
width: 0px; | |
} | |
.container { | |
display: flex; | |
overflow-x: scroll; | |
width: 100%; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { animated, useSpring } from "react-spring"; | |
const App = () => { | |
const style = useSpring({ | |
from: { | |
transform: "rotateY(0deg)" | |
}, | |
transform: "rotateY(25deg)" | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const style = useSpring({ | |
from: { | |
transform: "perspective(500px) rotateY(0deg)" | |
}, | |
transform: "perspective(500px) rotateY(25deg)" | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.container { | |
display: flex; | |
overflow-x: scroll; | |
width: 100%; | |
padding: 20px 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const [style, set] = useSpring(() => ({ | |
transform: "perspective(500px) rotateY(0deg)" | |
})); |