+
+
+
,
+ )
+
+ const slide = screen.getByRole('link', { name: 'Launch event' }).element()
+ const box = slide.getBoundingClientRect()
+ const artwork = slide.querySelector('img')
+
+ expect(box.height).toBeCloseTo((box.width * 721) / 800, 1)
+ expect(artwork).not.toBeNull()
+ expect(getComputedStyle(artwork!).objectFit).toBe('contain')
+ expect(getComputedStyle(artwork!).objectPosition).toBe('0% 50%')
+ })
+
+ it('keeps event and ad artwork left-aligned so desktop cropping stays on the right', async () => {
+ await page.viewport(1000, 900)
+ const screen = await render(
+
,
)
- const assertLeftCoverCrop = () => {
- for (const name of ['Partner campaign', 'Launch event']) {
- const artwork = screen.getByRole('link', { name }).element().querySelector('img')
+ for (const name of ['Partner campaign', 'Launch event']) {
+ const artwork = screen.getByRole('link', { name }).element().querySelector('img')
- expect(artwork).not.toBeNull()
- expect(getComputedStyle(artwork!).objectFit).toBe('cover')
- expect(getComputedStyle(artwork!).objectPosition).toBe('0% 50%')
- }
+ expect(artwork).not.toBeNull()
+ expect(getComputedStyle(artwork!).objectFit).toBe('cover')
+ expect(getComputedStyle(artwork!).objectPosition).toBe('0% 50%')
}
-
- assertLeftCoverCrop()
-
- await page.viewport(1000, 900)
- assertLeftCoverCrop()
})
it('keeps the blog artwork left corners rounded when its image is cropped', async () => {
diff --git a/web/app/components/plugins/marketplace/home/home-trending.module.css b/web/app/components/plugins/marketplace/home/home-trending.module.css
index dca60ffac5f..b961f04ced9 100644
--- a/web/app/components/plugins/marketplace/home/home-trending.module.css
+++ b/web/app/components/plugins/marketplace/home/home-trending.module.css
@@ -77,8 +77,8 @@
max-width: 400px;
}
-/* Crop from the right so left-side artwork stays visible when the frame
- is narrower than the image (PC resize and mobile cover). */
+/* Desktop: crop from the right so left-side artwork stays visible when the
+ 6:1 frame is narrower than the image. */
.imageSlide :is(picture, img) {
object-position: left;
}
@@ -247,16 +247,17 @@
gap: 4px;
}
- /* Event/ad mobile: match the fixed 197px artwork + 160px copy height.
- Cover + left so shrinking the frame crops the right, not the copy. */
+ /* Event/ad mobile: show the 800×721 poster whole (ops banner-meta), not
+ cover-cropped into the stacked 357px blog/recommend frame. */
:global([data-marketplace-standalone]) .imageSlide {
- height: 357px;
+ height: auto;
+ aspect-ratio: 800 / 721;
}
:global([data-marketplace-standalone]) .imageSlide :is(picture, img) {
width: 100%;
height: 100%;
- object-fit: cover;
+ object-fit: contain;
object-position: left;
}