--- layout: "@/layouts/ExplainerLayout.astro" demoTitle: "View Transition Example: Different Images & Aspect Ratios" demoText: "This example demonstrates a view transition between images with different sizes and aspect ratios." title: "How does it work?" --- Aside from the images, the current example differs only slightly from the [previous example](/demo/BasicIM/). The changes only alter the size constraints of the article image. ```diff lang="css" article div { padding: 1rem; - max-width: 50%; + max-width: 40%; } article img { margin: auto; - height: min(512px, 66vh); + width: min(400px, 50vw); border-radius: 8px; box-shadow: 0 2px 2px rgba(0, 0, 0, 0.5); } ``` ## Inspection Chamber Insights The browser generated default animations for the view transition API are rather fast. You have 0.25 seconds to seen what's going on. ![Animation details](_IM2-250-dark.png) ![Animation details](_IM2-250-light.png) With the inspection chamber, you can examine the details of the default morph animation. The graphic below is from [Mechanics of Default View Transition Animations](/basics/default-animations/#how-the-boxes-morph). This exactly fits our example: the group's outline (orange) gradually widens and shortens in height.
0%50%100%
In real, the middle picture of the last row looks like this: ![Animation details](_IM2-transition-both.png) The [next example](/demo/BasicIM3/) shows an alternative styling that is less overwhelming.