Comments (1)
We merged #107 to solve this issue. But whether that is enough to close this issue is up for discussion.
The problem occurs because the canvas is drawn at specific dimensions when it's initialized. When FogBackground
is inserted in the DOM, it draws the particles based on the current page size. We have no way to tell if the page has changes size to adjust the canvas animation.
We could somehow observe this change, perhaps using ResizeObserver
or an heuristic (ie. updating the canvas size on route change or when the particles intensity changes).
However, there are two complexities. If the new area is bigger, there will be an uneven distribution of particles in the canvas on such change: the new canvas area will have to wait a few seconds for the particles to fill it. If the area is smaller, the position of some particles may become invalid and would require new calculations.
The current solution uses position: fixed
to avoid this problem because the background moves with the scroll. It has some room for improvement to guarantee that there will be no space in which the background is rendered if the page grows. A side benefit it has is that it renders exactly what it needs, while adjusting the height of the canvas would render non-visible areas as well.
Whether we keep the position fixed or go for a more sophisticated solution depends, I'd say, on subtle differences in the user experience.
from breethe-client.
Related Issues (20)
- Disable particles and gas effect in the pre-render
- Render non-functional UI in a loading state in the SSR response
- Switch CSS to css-blocks
- update logo
- Fix Service Worker on iOS HOT 1
- Round measurement value
- Fog animation is too resource intensive HOT 4
- [WIP] Fix SSR/Offline support HOT 1
- Support location labels
- Idea: visual representation of scale for measurements HOT 1
- Make app work without JS HOT 3
- Fog effect sometimes reveals edges of images
- Client falls back to old data even if server has more recent data HOT 1
- Clear old data
- Accessibility issues HOT 3
- Fog animation causes high GPU load HOT 10
- Images are not fingerprinted HOT 1
- Implement integration Glimmer tests
- Fix css-blocks optimizations
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from breethe-client.