Skip to main content

Vue animation example

Vue Parallax: Starfield Hero With Depth

Space scenes are a natural fit for parallax because depth is the whole point. Distant stars barely move, closer stars move more, the planet drifts in between and the rocket in front tilts toward the pointer. It also reads a scroll input, so it can be wired to your page scroll for a scroll-driven hero.

  • 4.4 KB file
  • 5 live inputs
  • Vue runtime
Live, try it

How this starfield parallax hero works

  • Stars are split into three depth bands, each moved by its depth times the pointer and scroll offsets.
  • The rocket rotates toward the horizontal pointer offset, which makes it feel steerable.
  • The scroll input (0 to 1) shifts every layer vertically by its depth.

Add it to your Vue app

Install exodeui-vue, download the file below, and paste this. The code updates as you customize. Other runtimes are in the other tabs.

<script setup>
import { ExodeUICanvas } from 'exodeui-vue';
</script>

<template>
  <ExodeUICanvas
    src="/vue-parallax.exode"
    fit="Layout"
    style="width: 100%; height: 520px"
  />
</template>

Inputs

InputTypeDefaultRange
scrollNumber00 – 1
headlineTextLaunch faster—
accentText#42b883hex colour
accent2Text#35495ehex colour
bgText#050712hex colour

More Vue animations

The same idea in other frameworks: React depth parallax scene · React layered wave background · Flutter parallax scroll list