Skip to content

Commit 6e8ae85

Browse files
authored
fix(site): restore team avatar framing (#59)
1 parent c94816e commit 6e8ae85

9 files changed

Lines changed: 31 additions & 1 deletion

File tree

src/components/sections/Team.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
// with a telemetry index tag and crosshair.
4444
&__photo {
4545
position: relative;
46+
aspect-ratio: 1 / 1;
47+
overflow: hidden;
4648
border-bottom: 1px solid $color-glass-border;
4749

4850
// crosshair "+" at the top-left of the frame
@@ -62,7 +64,7 @@
6264
&__avatar {
6365
display: block;
6466
width: 100%;
65-
aspect-ratio: 1 / 1;
67+
height: 100%;
6668
object-fit: cover;
6769
object-position: center 22%;
6870
filter: grayscale(0.4) contrast(1.02);

tests/acceptance/design-baseline.spec.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,34 @@ test.describe('design baseline', () => {
165165
expect(navbarRule, 'scrolled navbar should keep backdrop blur CSS rule').toContain('blur');
166166
});
167167

168+
test('team photos keep square framing', async ({ page }) => {
169+
await page.goto('/');
170+
await lockViewportOn(page, '#team');
171+
await waitForVisualReady(page);
172+
173+
const frames = await page.locator('.team__photo').evaluateAll((elements) =>
174+
elements.map((element) => {
175+
const frame = element.getBoundingClientRect();
176+
const image = element.querySelector('img')?.getBoundingClientRect();
177+
178+
return {
179+
frameWidth: frame.width,
180+
frameHeight: frame.height,
181+
imageWidth: image?.width ?? 0,
182+
imageHeight: image?.height ?? 0,
183+
};
184+
}),
185+
);
186+
187+
expect(frames).toHaveLength(3);
188+
189+
for (const frame of frames) {
190+
expect(Math.abs(frame.frameWidth - frame.frameHeight), 'team photo frame should stay square').toBeLessThan(2);
191+
expect(Math.abs(frame.imageWidth - frame.frameWidth), 'team image should fill frame width').toBeLessThan(2);
192+
expect(Math.abs(frame.imageHeight - frame.frameHeight), 'team image should fill frame height').toBeLessThan(2);
193+
}
194+
});
195+
168196
for (const state of states) {
169197
test(`${state.name} viewport matches approved baseline`, async ({ page }, testInfo) => {
170198
await state.target(page);
226 Bytes
Loading
-157 KB
Loading
-155 KB
Loading
-427 KB
Loading
-141 KB
Loading
-136 KB
Loading
-70.3 KB
Loading

0 commit comments

Comments
 (0)