feat(webui): redesign goal island as floating vibrancy platter (#6737)
This commit is contained in:
1 parent
16e573fe18
commit
db0306b404
4 files changed
+250
-117
No files matched your search
@@ -17,7 +17,7 @@ async function expectBackgroundToCover(page: Page, owner: Locator) {
|
||||
surface.boundingBox(),
|
||||
surface.evaluate(el => {
|
||||
const style = getComputedStyle(el, "::before");
|
||||
return { color: style.backgroundColor, clip: style.clipPath };
|
||||
return { color: style.backgroundColor, radius: style.borderRadius };
|
||||
}),
|
||||
]);
|
||||
expect(ownerBox).not.toBeNull();
|
||||
@@ -25,7 +25,7 @@ async function expectBackgroundToCover(page: Page, owner: Locator) {
|
||||
expect(surfaceBox!.width).toBeCloseTo(ownerBox!.width, 1);
|
||||
expect(surfaceBox!.height).toBeCloseTo(ownerBox!.height, 1);
|
||||
expect(background.color).not.toBe("rgba(0, 0, 0, 0)");
|
||||
expect(background.clip).not.toBe("none");
|
||||
expect(background.radius).not.toBe("0px");
|
||||
|
||||
const image = await page.screenshot({ clip: { x: ownerBox!.x + 12, y: ownerBox!.y + 10, width: 1, height: 1 } });
|
||||
const pixel = await page.evaluate(async bytes => {
|
||||
@@ -49,6 +49,7 @@ for (const reducedMotion of ["no-preference", "reduce"] as const) {
|
||||
|
||||
const trigger = page.getByRole("button", { name: "Show full goal" });
|
||||
await expect(trigger).toBeVisible();
|
||||
await page.locator(".goal-island").evaluate(async el => { await Promise.all(el.getAnimations().map(animation => animation.finished)); });
|
||||
await expectBackgroundToCover(page, trigger);
|
||||
|
||||
await trigger.click();
|
||||
|
||||
@@ -218,7 +218,7 @@ for (const width of [320, 390, 1440]) for (const dark of [false, true]) {
|
||||
const body = getComputedStyle(el.querySelector(".goal-island-document p")!);
|
||||
return { title: Number.parseFloat(title.fontSize), body: Number.parseFloat(body.fontSize), titleFont: title.fontFamily, bodyFont: body.fontFamily };
|
||||
});
|
||||
expect(typography.title).toBeCloseTo(typography.body * 1.5, 1);
|
||||
expect(typography.title).toBeGreaterThan(typography.body);
|
||||
expect(typography.titleFont).toBe(typography.bodyFont);
|
||||
const scrollBody = page.locator(".goal-island-body");
|
||||
expect(await scrollBody.evaluate(el => el.scrollHeight > el.clientHeight)).toBe(true);
|
||||
|
||||
Reference in new issue
Block a user