You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Be sure to set a style by either a `className` or the `style` prop that will give the banner container a `height`. You could also use an aspect ratio like the example above which uses a class that sets the `aspect-ratio` to `2 / 1`.
36
+
37
+
:::tip
38
+
39
+
The parallax effect is more natural when the image moves slower than the page, `speed < 0`.
40
+
41
+
:::
42
+
13
43
## Example with Multiple Layers
14
44
15
45
This example uses two layers, one background and one foreground. The order of the defined layer determines the stacking of the each image: First in the array will appear at the back and be covered by subsequent layers.
@@ -20,8 +50,6 @@ The `speed` prop is used to make the layer move at it's own pace.
20
50
The foreground `speed` is defined so that it will move faster than the background:
For the most _natural_ visual effect make the layer `speed` depend on the distance of the image: the closer the items in the image the **faster** they should move; the further away the **slower** they should move.
68
+
For the most natural visual effect with multiple layers make each layer `speed` depend on the distance of the image: the closer the items in the image the **faster** they should move; the further away the **slower** they should move.
41
69
42
70
:::
43
71
@@ -48,8 +76,6 @@ For the most _natural_ visual effect make the layer `speed` depend on the distan
48
76
By defining `children` you can add any markup for a headline or any other custom elements. In the following example the headline is positioned absolutely over each banner layer.
You can take the effect even further by embedding the headline in the scene. This can be done by defining another layer and assigning the markup to the `children` of that layer.
0 commit comments