diff --git a/layer/app/components/IconMenuToggle.vue b/layer/app/components/IconMenuToggle.vue index fe1061a1d..f44717943 100644 --- a/layer/app/components/IconMenuToggle.vue +++ b/layer/app/components/IconMenuToggle.vue @@ -7,7 +7,16 @@ const props = defineProps<{ const { t } = useLocale() -const lineClass = 'outline-none origin-center [transform-box:fill-box] transition-[translate,rotate,opacity] duration-400 ease-[cubic-bezier(0.34,1.36,0.64,1)]' +// UHeader renders a second toggle in its menu overlay, mounted already open. Draw it closed for its +// first frame so the lines transition into the cross instead of appearing as one. +const ready = ref(false) +onMounted(() => requestAnimationFrame(() => requestAnimationFrame(() => { + ready.value = true +}))) +const crossed = computed(() => props.open && ready.value) + +// Each line turns around its own center; the overshoot approximates the spring the toggle used to have. +const lineClass = 'outline-none origin-center [transform-box:fill-box] transition-[translate,rotate,opacity] duration-300 ease-[cubic-bezier(0.34,1.56,0.64,1)] motion-reduce:transition-none'