We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I'm configuring a bootstrap theme and I'd like to set a p5 sketch as the background to one of the section.
Unfortunately everytime I add a div or a canvas to the section it displaces other components.
My question is; how can I insert a sketch as the background to this section without disturbing anything else?
Thanks for your help!
<section class="resume-section p-3 p-lg-5 d-flex d-column" id="about">
<div id="container"></div>
<div class="my-auto">
<h1 class="mb-0">Charles
<span class="text-primary">Fried</span>
</h1>
<div class="subheading mb-5">Give a description
<a href="mailto:name@email.com">name@email.com</a>
</div>
<p class="mb-5">Blahhhhhhh</p>
<ul class="list-inline list-social-icons mb-0">
<li class="list-inline-item">
<a href="#">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-facebook fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
<li class="list-inline-item">
<a href="#">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-twitter fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
<li class="list-inline-item">
<a href="#">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-linkedin fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
<li class="list-inline-item">
<a href="#">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-github fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
</ul>
</div>
</section>
Here's the P5 code:
function setup() {
var clientHeight = document.getElementById('about').clientHeight;
var clientWidth = document.getElementById('about').clientWidth;
var cnv = createCanvas(clientHeight, clientWidth);
cnv.parent("container");
background(0);
}
Answers
Use CSS. Not tested; but something like this (probably with some adjustment) should work:
If you need more help just use this search ;)
https://Forum.Processing.org/two/discussions/tagged/z-index