I am trying to use a different animation for each of the 4 states: forwards.old, forwards.new, backwards.old, and backwards.new. But the transition only ever uses the values from 'forwards', and not the values for 'backwards'. What am I doing wrong?
here are my settings:
const timing = {
old: 850,
new: 650,
};
const next = {
// old element that is leaving the DOM
old: {
name: "next-leave",
duration: `${timing.old}ms`,
easing: "cubic-bezier(0.165, 0.84, 0.44, 1)",
},
// new element that is entering the DOM
new: {
name: "next-enter",
duration: `${timing.new}ms`,
easing: "cubic-bezier(0.165, 0.84, 0.44, 1)",
},
};
const prev = {
// old element that is leaving the DOM
old: {
name: "prev-leave",
duration: `${timing.old}ms`,
easing: "cubic-bezier(0.165, 0.84, 0.44, 1)",
},
// new element that is entering the DOM
new: {
name: "prev-enter",
duration: `${timing.new}ms`,
easing: "cubic-bezier(0.165, 0.84, 0.44, 1)",
// direction: "reverse",
},
};
const customTransition = {
forwards: next,
backwards: prev,
};
and on the element: transition:animate={customTransition} transition:name="comicslide"