-1
The picture doesn’t show anything black or all white.
code:
<!--Start of Tawk.to Script-->
<script type="text/javascript">
var Tawk_API=Tawk_API||{}, Tawk_LoadStart=new Date();
(function(){
var s1=document.createElement("script"),s0=document.getElementsByTagName("script")[0];
s1.async=true;
s1.src='https://embed.tawk.to/5a6b798cd7591465c7072026/default';
s1.charset='UTF-8';
s1.setAttribute('crossorigin','*');
s0.parentNode.insertBefore(s1,s0);
})();
</script>
<!--End of Tawk.to Script-->
<?php
$link = $_POST['linkne'];
$nome = $_POST['nome'];
echo $link;
echo $nome;
?>
<style>
BODY {
margin:0px; padding:0px;
}
.logo {
width:100%;
max-width:1051px;
height:161px;
}
form {
font-size:20px;
font-weight:bold;
font-family:Verdana, Geneva, sans-serif;
}
input {
background-color: #09F;
padding:20px;
max-width:400px;
color:black;
border-radius:20px;
border-right-color:red;
border-right-style:solid;
cursor:hover;
outline:0;
font-size:15px;
font-weight:bold;
box-shadow:1px 1px 30px black;
}
.nomeEmpresa {
font-family:Georgia, "Times New Roman", Times, serif;
width:100%;
max-width:1051px;
font-size:70px;
text-shadow: 1px 1px 1px red;
text-transform:uppercase;
height:161px;
}
h1 {
margin-top:-150px;
}
</style>
<div id='tiraafotomisera' style='height:300px; width:100%; margin-top:-60px; ' >
<CENTER class='clay'><img src='<?php echo $link; ?>' class='fundo' /><div class='logo'><br><div class='nomeEmpresa' style='position:absolute;'><?php echo $nome; ?></div></div></CENTER>
</div>
<script src="https://code.jquery.com/jquery-3.2.1.js" integrity="sha256-DZAnKJ/6XZ9si04Hgrsxu/8s717jcIzLy3oi35EouyE=" crossorigin="anonymous"></script>
<script>
$('.nomeEmpresa').attr('style','position:absolute; margin-top:-200px');
$('.fundo').attr('style',' width:100%;height:300px;');
</script>
<h2>CLIQUE COM O LADO DIREITO DO SEU MOUSE NA IMAGEM ABAIXO, E LOGO APÓS CLIQUE EM: [SALVAR IMAGEM COMO]</h2>
<script src='https://html2canvas.hertzen.com/dist/html2canvas.min.js'></script>
<script>
html2canvas(document.querySelector("#tiraafotomisera")).then(canvas => {
document.body.appendChild(canvas)
});
$('h2').attr('style','font-weight:bold;font-family:Verdana, Geneva, sans-serif; text-shadow:1px 1px 10px yellow; ');
</script>
<a href='' class='linkao' >CLIQUE AQUI PARA BAIXAR A IMAGEM</a>
<script>
canvas = document.createElement('canvas');
url = canvas.toDataURL('image/png');
$('.linkao').attr('href',url);
$('.linkao').attr('download','af');
</script>
The problem is that you are using
canvas.toDataURL('image/png');
with an "empty" variable. You need to implement this code afterdocument.body.appendChild(canvas)
– Valdeir Psr
@Denybanner further develop your question, describing the behavior and expected and where you are having difficulties
– Leandro Angelo