Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CSS: Animated Resizing of .panelContents when Window Size is less tha…
…n 768 pixels. (#344) * Updated css for expanding list of samples when window size is less than 768px. React state updates were making this animation unperformant on all but the least intensive webgpu samples 'which was basically only helloTriangle'. Accordingly, I reworked the panelContents portion of the _app component, with css changes only occurring on window size changes or when toggling the expand button * fixed issue with panelContents disappearing on link click * Added helpful comments * Changed function names from stylePanel to stylePanelContents to better reflect the element/ref they are directly modifying * Fixed bug where max-height was visibly changing on resize to greater than 768 pixels * Removed most code for simpler solution * Made sure display: block was explicit at normal window width * got rid of useEffect import * Removed unecessary function. I definitely overcomplicated the original solution. All that's really needed to make this performant is a few css changes and changing data-Expanded from a React state variable that triggers a re-render to an attribute on a ref * Added back effect so data-expanded would be set to false on window resize * added semicolon * Memoized component * Removed unusued functions
- Loading branch information