<script setup lang="ts">
import HOME_BACKGROUND_IMAGE from "/assets/images/home/top-screen/background.webp";
import CONTACT_BACKGROUND_IMAGE from "/assets/images/contact/top-screen/background.webp";

const store = useContactStore();

const [homeBackgroundImage, contactBackgroundImage] = useImages(
  HOME_BACKGROUND_IMAGE,
  CONTACT_BACKGROUND_IMAGE,
);

useRender((ctx) => {
  ctx.drawImage(homeBackgroundImage!, 0, 0);
  ctx.globalAlpha = store.isIntro
    ? store.intro.stage2Opacity
    : store.outro.stage3Opacity;

  ctx.drawImage(contactBackgroundImage!, 0, 0);
});

defineOptions({
  render: () => null,
});
</script>
