Skip to content

Commit 636fc34

Browse files
committed
docs(animations): improve demo in dark mode by using filter and box shadow
1 parent 6b56cff commit 636fc34

File tree

6 files changed

+21
-21
lines changed

6 files changed

+21
-21
lines changed

docs/utilities/animations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ import Group from '@site/static/usage/v7/animations/group/index.md';
255255

256256
Ionic Animations provides hooks that let you alter an element before an animation runs and after an animation completes. These hooks can be used to perform DOM reads and writes as well as add or remove classes and inline styles.
257257

258-
This example sets an inline opacity of `0.2` on the card prior to the animation starting. Once the animation finishes, the background color of the element is set to `rgba(0, 255, 0, 0.5)`, and the inline opacity is cleared. The animation must be stopped in order to remove the background and play it with the opacity again.
258+
This example sets an inline filter which inverts the background color of the card by `75%` prior to the animation starting. Once the animation finishes, the box shadow on the element is set to `rgba(255, 0, 50, 0.4) 0px 4px 16px 6px`, a red glow, and the inline filter is cleared. The animation must be stopped in order to remove the box shadow and play it with the filter again.
259259

260260
See [Methods](#methods) for a complete list of hooks.
261261

static/usage/v7/animations/before-and-after-hooks/angular/example_component_ts.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ export class ExampleComponent {
2121
.addElement(this.cardElements.get(0).nativeElement)
2222
.duration(2000)
2323
.beforeStyles({
24-
opacity: 0.2,
24+
filter: 'invert(75%)',
2525
})
26-
.beforeClearStyles(['background'])
26+
.beforeClearStyles(['box-shadow'])
2727
.afterStyles({
28-
background: 'rgba(0, 255, 0, 0.5)',
28+
'box-shadow': 'rgba(255, 0, 50, 0.4) 0px 4px 16px 6px',
2929
})
30-
.afterClearStyles(['opacity'])
30+
.afterClearStyles(['filter'])
3131
.keyframes([
3232
{ offset: 0, transform: 'scale(1)' },
3333
{ offset: 0.5, transform: 'scale(1.5)' },

static/usage/v7/animations/before-and-after-hooks/demo.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
.addElement(document.querySelector('#card'))
1818
.duration(2000)
1919
.beforeStyles({
20-
opacity: 0.2,
20+
filter: 'invert(75%)',
2121
})
22-
.beforeClearStyles(['background'])
22+
.beforeClearStyles(['box-shadow'])
2323
.afterStyles({
24-
background: 'rgba(0, 255, 0, 0.5)',
24+
'box-shadow': 'rgba(255, 0, 50, 0.4) 0px 4px 16px 6px',
2525
})
26-
.afterClearStyles(['opacity'])
26+
.afterClearStyles(['filter'])
2727
.keyframes([
2828
{ offset: 0, transform: 'scale(1)' },
2929
{ offset: 0.5, transform: 'scale(1.5)' },

static/usage/v7/animations/before-and-after-hooks/javascript.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
.addElement(document.querySelector('#card'))
1313
.duration(2000)
1414
.beforeStyles({
15-
opacity: 0.2,
15+
filter: 'invert(75%)',
1616
})
17-
.beforeClearStyles(['background'])
17+
.beforeClearStyles(['box-shadow'])
1818
.afterStyles({
19-
background: 'rgba(0, 255, 0, 0.5)',
19+
'box-shadow': 'rgba(255, 0, 50, 0.4) 0px 4px 16px 6px',
2020
})
21-
.afterClearStyles(['opacity'])
21+
.afterClearStyles(['filter'])
2222
.keyframes([
2323
{ offset: 0, transform: 'scale(1)' },
2424
{ offset: 0.5, transform: 'scale(1.5)' },

static/usage/v7/animations/before-and-after-hooks/react.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ function Example() {
1414
.addElement(cardEl.current!)
1515
.duration(2000)
1616
.beforeStyles({
17-
opacity: 0.2,
17+
filter: 'invert(75%)',
1818
})
19-
.beforeClearStyles(['background'])
19+
.beforeClearStyles(['box-shadow'])
2020
.afterStyles({
21-
background: 'rgba(0, 255, 0, 0.5)',
21+
'box-shadow': 'rgba(255, 0, 50, 0.4) 0px 4px 16px 6px',
2222
})
23-
.afterClearStyles(['opacity'])
23+
.afterClearStyles(['filter'])
2424
.keyframes([
2525
{ offset: 0, transform: 'scale(1)' },
2626
{ offset: 0.5, transform: 'scale(1.5)' },

static/usage/v7/animations/before-and-after-hooks/vue.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@
3131
.addElement(cardEl.value.$el)
3232
.duration(2000)
3333
.beforeStyles({
34-
opacity: 0.2,
34+
filter: 'invert(75%)',
3535
})
36-
.beforeClearStyles(['background'])
36+
.beforeClearStyles(['box-shadow'])
3737
.afterStyles({
38-
background: 'rgba(0, 255, 0, 0.5)',
38+
'box-shadow': 'rgba(255, 0, 50, 0.4) 0px 4px 16px 6px',
3939
})
40-
.afterClearStyles(['opacity'])
40+
.afterClearStyles(['filter'])
4141
.keyframes([
4242
{ offset: 0, transform: 'scale(1)' },
4343
{ offset: 0.5, transform: 'scale(1.5)' },

0 commit comments

Comments
 (0)