BottomSheet: improve hero animation

This commit is contained in:
thislight 2024-10-09 17:33:27 +08:00
parent 71434e5293
commit 15e2bf3304
5 changed files with 11 additions and 9 deletions

View file

@ -9,7 +9,7 @@ import {
} from "solid-js";
export type HeroSource = {
[key: string | symbol | number]: DOMRect | undefined;
[key: string | symbol | number]: HTMLElement | undefined;
};
const HeroSourceContext = createContext<Signal<HeroSource>>(
@ -27,10 +27,10 @@ function useHeroSource() {
*/
export function useHeroSignal(
key: string | symbol | number,
): Signal<DOMRect | undefined> {
): Signal<HTMLElement | undefined> {
const source = useHeroSource();
if (source) {
const [get, set] = createSignal<DOMRect>();
const [get, set] = createSignal<HTMLElement>();
createRenderEffect(() => {
const value = source[0]();