Skip to content

Commit 23ab28e

Browse files
authored
Migrate Home page animation to CSS transitions and remove react-transition-group (#5649)
[Main branch](https://main--perf-html.netlify.app/) | [Deploy preview](https://deploy-preview-5649--perf-html.netlify.app/) This removes our usage of react-transition-group. We were only using it for the horizontal slide-in animation that occurs on the home page when we have a WebChannel and detect that the profiler button is in the toolbar.
2 parents a4b9d4e + e17e396 commit 23ab28e

4 files changed

Lines changed: 278 additions & 309 deletions

File tree

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@
9999
"react-intersection-observer": "^10.0.3",
100100
"react-redux": "^9.2.0",
101101
"react-splitter-layout": "^4.0.0",
102-
"react-transition-group": "^4.4.5",
103102
"redux": "^5.0.1",
104103
"redux-logger": "^3.0.6",
105104
"redux-thunk": "^3.1.0",
@@ -131,7 +130,6 @@
131130
"@types/react": "^18.3.28",
132131
"@types/react-dom": "^18.3.1",
133132
"@types/react-splitter-layout": "^4.0.0",
134-
"@types/react-transition-group": "^4.4.5",
135133
"@types/redux-logger": "^3.0.6",
136134
"@types/tgwf__co2": "^0.14.2",
137135
"@typescript-eslint/eslint-plugin": "^8.58.0",

src/components/app/Home.css

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -199,17 +199,20 @@
199199

200200
/* Only show the home transition when reduced motion is not preferred */
201201
@media (prefers-reduced-motion: no-preference) {
202-
.homeTransition-enter {
203-
opacity: 0.1;
204-
transform: translateX(100px);
202+
@keyframes homeSlideIn {
203+
from {
204+
opacity: 0.1;
205+
transform: translateX(100px);
206+
}
207+
208+
to {
209+
opacity: 1;
210+
transform: translateX(0);
211+
}
205212
}
206213

207-
.homeTransition-enter.homeTransition-enter-active {
208-
opacity: 1;
209-
transform: translateX(0);
210-
transition:
211-
opacity 300ms ease-out,
212-
transform 300ms ease-out;
214+
.homeInstructions-animate {
215+
animation: homeSlideIn 300ms ease-out;
213216
}
214217
}
215218

0 commit comments

Comments
 (0)