Skip to content

Instantly share code, notes, and snippets.

Konstantin koss-lebedev

Block or report user

Report or block koss-lebedev

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View component-6.tsx
const bind = useScroll(event => {
set({
transform: `perspective(500px) rotateY(${
event.scrolling ? clamp(event.delta[0]) : 0
}deg)`
});
});
View component-5.tsx
import { useScroll } from "react-use-gesture";
const App = () => {
const [style, set] = useSpring(() => ({
transform: "perspective(500px) rotateY(0deg)"
}));
const bind = useScroll(event => {
set({
transform: `perspective(500px) rotateY(${
View component-4.tsx
const [style, set] = useSpring(() => ({
transform: "perspective(500px) rotateY(0deg)"
}));
View styles-2.scss
.container {
display: flex;
overflow-x: scroll;
width: 100%;
padding: 20px 0;
}
View component-3.tsx
const style = useSpring({
from: {
transform: "perspective(500px) rotateY(0deg)"
},
transform: "perspective(500px) rotateY(25deg)"
});
View component-2.tsx
import { animated, useSpring } from "react-spring";
const App = () => {
const style = useSpring({
from: {
transform: "rotateY(0deg)"
},
transform: "rotateY(25deg)"
});
View styles.scss
::-webkit-scrollbar {
width: 0px;
}
.container {
display: flex;
overflow-x: scroll;
width: 100%;
}
View component.tsx
const movies = [
"/breaking-bad.webp",
"/the-leftovers.jpg",
"/game-of-thrones.jpg",
"/true-detective.jpg",
"/walking-dead.jpg"
];
const App = () => {
return (
View clamp.ts
const clamp = (value: number, clampAt: number = 30) => {
if (value > 0) {
return value > clampAt ? clampAt : value;
} else {
return value < -clampAt ? -clampAt : value;
}
};
View KanyeQuote-with-cache.tsx
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"))
You can’t perform that action at this time.