Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default function Trail() {
const [toggle, set] = useState(true)
const trail = useTrail(items.length, {
// items,
opacity: toggle ? 1 : 0,
x: toggle ? 0 : 20,
height: toggle ? 50 : 0,
from: { opacity: 0, x: 20, height: 0 },
config: { mass: 5, tension: 2000, friction: 200 },
reverse: !toggle,
})
return (
<div> set(state => !state)}>
<div>
{trail.map(({ x, height, ...rest }, index) => (
</div></div>
// setTime(seconds);
player.current.seekTo(seconds);
}
}
function editName() {
setEditNameMode(true);
}
function changeName(e: React.FormEvent) {
e.preventDefault();
meta!.ref.set({ title: name, customName: true }, { merge: true });
setEditNameMode(false);
}
const trail = useTrail(2, {
from: { opacity: 0, y: 3 },
opacity: 1,
y: 0,
onRest: () => setRenderMain(true)
});
// error is loading errors or the document doesn't exist
if (error || (meta && !meta.exists)) {
return (
const Instagram: React.FunctionComponent = ({
data: {
instagram: { nodes: instagram },
},
}) => {
const pageAnimation = useSpring({
config: config.default,
from: { opacity: 0 },
to: { opacity: 1 },
})
const trail = useTrail(instagram.length, {
config: {
mass: 1,
tension: 210,
friction: 23,
},
from: { opacity: 0 },
to: { opacity: 1 },
})
return (
{trail.map((style, index) => {
// Grab everything before the first hashtag (because I write my captions like that)
const post = instagram[index]
const { email, password } = form;
const fn = isRegistering ? createUserWithEmail : loginWithEmail;
try {
setError("");
setLoading(true);
await fn(email, password);
setRedirectToReferrer(true);
} catch (err) {
setLoading(false);
setError(err.message || "Please try again.");
}
}
const animation = useTrail(1, {
config: config.slow,
from: { opacity: 0, transform: `translateY(-5%)` },
opacity: 1,
transform: `translateY(0)`
});
if (redirectToReferrer) {
return ;
}
return (
const Projects = ({ projects }: Props) => {
const trail = useTrail(projects.length, {
from: { height: `0%` },
to: { height: `100%` },
})
if (projects.length === 0) {
return (
Hi!{` `}
<span aria-label="Wave emoji" role="img">
👋
</span>
{` `}
<br>
Thanks for using <b>@lekoarts/gatsby-theme-emma</b>. You currently don't have any content in your{` `}
const AdvantagesContainer: React.FC = () => {
const section = useRef(null);
const [trail, set] = useTrail(1, () => ({
xy: [600, 600],
config: config
}));
useEffect(() => {
if (section.current) {
const posSection = section.current.getBoundingClientRect();
//@ts-ignore
set({ xy: [posSection.width / 2, posSection.height - 100] });
}
}, []);
const handleMouseMove = useCallback(
(event: React.MouseEvent) => {
if (section.current) {
const posSection = section.current.getBoundingClientRect();
const deltaX = event.clientX - posSection.x;
const deltaY = event.clientY - posSection.y;
export default function Goo() {
const ref = useRef(null)
const [trail, set] = useTrail(3, () => ({
xy: [0, 0],
config: i => (i === 0 ? fast : slow),
}))
return (
<div> {
const rect = ref.current.getBoundingClientRect()
set({ xy: [e.clientX - rect.left, e.clientY - rect.top] })
}}>
<svg style="{{">
<filter id="goo">
<feGaussianBlur stdDeviation="30" result="blur" in="SourceGraphic"></feGaussianBlur>
</filter></svg></div>
const Index = ({
data: {
allMdx: { nodes: projectEdges },
},
location,
}) => {
const trail = useTrail(projectEdges.length, {
from: { height: '0%' },
to: { height: '100%' },
})
return (
{trail.map((style, index) => (
))}
o: state.open ? vars.toggle.opacity.open : vars.toggle.opacity.close,
d: state.open ? vars.toggle.degree.open : vars.toggle.degree.close,
s: state.open ? vars.toggle.scale.open : vars.toggle.scale.close,
from: { o: vars.toggle.opacity.close, d: vars.toggle.degree.close, s: vars.toggle.scale.close },
});
const menu = useSpring({
ref: menuRef,
config: { duration: 150 },
opacity: state.open ? vars.menu.opacity.open : vars.menu.opacity.close,
display: state.open ? vars.menu.display.open : vars.menu.display.close,
from: { opacity: vars.menu.opacity.close, display: vars.menu.display.close },
onRest: () => handleAccessibility(items),
});
const trail = useTrail(items.length, {
ref: itemsRef,
config: { mass: 2, tension: 3500, friction: 100 },
opacity: state.open ? vars.item.opacity.open : vars.item.opacity.close,
transform: state.open
? `translate3d(0, ${vars.item.transformY.open}, 0)`
: `translate3d(0, ${vars.item.transformY.close}%, 0)`,
from: { opacity: vars.item.opacity.close, transform: `translate3d(0, ${vars.item.transformY.close}%, 0)` },
});
useChain(
state.open ? [menuRef, itemsRef, backgroundRef] : [itemsRef, menuRef, backgroundRef],
state.open ? [0.2, 0.2, 0.15] : [0.2, 0.25, 0.15],
);
return (
export default function Goo() {
const ref = useRef(null)
const [trail, set] = useTrail(3, () => ({
xy: [0, 0],
config: i => (i === 0 ? fast : slow),
}))
return (
<div> {
const rect = ref.current.getBoundingClientRect()
set({ xy: [e.clientX - rect.left, e.clientY - rect.top] })
}}>
<svg style="{{">
<filter id="goo">
<feGaussianBlur stdDeviation="30" result="blur" in="SourceGraphic"></feGaussianBlur>
</filter></svg></div>