This is quite an interesting predicament I am facing! Currently, I am in the process of coding a website and incorporating the three.js flocking birds animation on a specific div labeled 'canvas-div'. My intention is to have this animation displayed above the fold and persistently at the top of the website.
However, it seems that the exact opposite is happening. Here's what I have coded so far...
<div class="canvas-wrapper">
<div id="canvas-div">
</div>
</div>
<div id="home1"></div>
Here is how my CSS looks like...
.canvas-wrapper {
height:100%
}
#canvas-div {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
position: static; /* fixed or static */
top: 0;
left: 0;
background:width:100%; height:100%;color:grey
overflow:hidden;
float:left
}
#home1 {
height:300px;
width:100%;
float:left
}
Upon inspecting the site using the developer tools, here is what I found instead...
<div class="canvas-wrapper"></div>
<div id="home1"></div>
<div id="canvas-div">
<canvas></canvas>
</div>
I suspect that the JavaScript responsible for running the flocking birds animation may be causing this issue, but pinpointing the exact problem has proven challenging.
Below is the snippet of JavaScript code being utilized...
// JavaScript code goes here...
If anyone can offer any insights or assistance with resolving this dilemma, it would be greatly appreciated.