Skip to content

fix(spinner): allow resizing of dots, bubbles, and circles #27424

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
May 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions core/src/components/spinner/spinner-configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ const spinners = {
return {
r: 5,
style: {
top: `${9 * Math.sin(angle)}px`,
left: `${9 * Math.cos(angle)}px`,
top: `${32 * Math.sin(angle)}%`,
left: `${32 * Math.cos(angle)}%`,
'animation-delay': animationDelay,
},
};
Expand All @@ -28,8 +28,8 @@ const spinners = {
return {
r: 5,
style: {
top: `${9 * Math.sin(angle)}px`,
left: `${9 * Math.cos(angle)}px`,
top: `${32 * Math.sin(angle)}%`,
left: `${32 * Math.cos(angle)}%`,
'animation-delay': animationDelay,
},
};
Expand Down Expand Up @@ -72,7 +72,7 @@ const spinners = {
return {
r: 6,
style: {
left: `${9 - 9 * index}px`,
left: `${32 - 32 * index}%`,
'animation-delay': animationDelay,
},
};
Expand Down
1 change: 0 additions & 1 deletion core/src/components/spinner/test/color/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

<ion-content id="content">
<ion-list>
<ion-item><ion-spinner slot="start"></ion-spinner>Platform Default Spinner</ion-item>
<ion-item
><ion-spinner color="primary" slot="start" name="lines"></ion-spinner><code>lines</code> (primary)</ion-item
>
Expand Down
4 changes: 2 additions & 2 deletions core/src/components/spinner/test/color/spinner.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { expect } from '@playwright/test';
import { configs, test } from '@utils/test/playwright';

/**
* This behavior does not vary across directions.
* This behavior does not vary across directions or modes.
*/
configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
configs({ directions: ['ltr'], modes: ['md'] }).forEach(({ title, screenshot, config }) => {
test.describe(title('spinner: color'), () => {
test.beforeEach(async ({ page }) => {
await page.goto('/src/components/spinner/test/color', config);
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions core/src/components/spinner/test/resize/spinner.e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { expect } from '@playwright/test';
import { configs, test } from '@utils/test/playwright';

/**
* The resize behavior does not vary across directions or modes.
*/
configs({ directions: ['ltr'], modes: ['md'] }).forEach(({ title, screenshot, config }) => {
test.describe(title('spinner: resize'), () => {
test.beforeEach(async ({ page }) => {
await page.setViewportSize({ width: 320, height: 340 });
});
test('should not have visual regressions', async ({ page }) => {
await page.setContent(
`
<style>
ion-spinner {
width: 100px;
height: 100px;
}
</style>
<ion-spinner name="lines"></ion-spinner>
<ion-spinner name="lines-small"></ion-spinner>
<ion-spinner name="lines-sharp"></ion-spinner>
<ion-spinner name="lines-sharp-small"></ion-spinner>
<ion-spinner name="circular"></ion-spinner>
<ion-spinner name="dots"></ion-spinner>
<ion-spinner name="bubbles"></ion-spinner>
<ion-spinner name="circles"></ion-spinner>
<ion-spinner name="crescent"></ion-spinner>
`,
config
);

await expect(page).toHaveScreenshot(screenshot(`spinner-resize-diff`));
});
});
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.