Hora de Desenhar
About this app
Um divertido aplicativo de desenho com modo IA e várias cores.
Hora de Desenhar Limpar
Related apps
Put this on your site
Source
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Hora de Desenhar</title>
<meta name="description" content="Um divertido aplicativo de desenho com modo IA e várias cores.">
<meta name="keywords" content="desenhar, app, IA, cores, divertido">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<script type="text/javascript">
try {
// App Javascript Goes Here. Place your entire script content inside the try block for error handling.
document.addEventListener("DOMContentLoaded", function() {
const canvas = document.getElementById('canvas');
const ctx = canvas.getContext('2d');
let isDrawing = false;
let lastX = 0;
let lastY = 0;
let hue = 0;
let direction = true;
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
function draw(e) {
if (!isDrawing) return;
ctx.strokeStyle = `hsl(${hue}, 100%, 50%)`;
ctx.beginPath();
ctx.moveTo(lastX, lastY);
ctx.lineTo(e.offsetX, e.offsetY);
ctx.stroke();
[lastX, lastY] = [e.offsetX, e.offsetY];
hue++;
if (hue >= 360) {
hue = 0;
}
if (ctx.lineWidth >= 100 || ctx.lineWidth <= 1) {
direction = !direction;
}
if (direction) {
ctx.lineWidth++;
} else {
ctx.lineWidth--;
}
}
canvas.addEventListener('mousedown', (e) => {
isDrawing = true;
[lastX, lastY] = [e.offsetX, e.offsetY];
});
canvas.addEventListener('mousemove', draw);
canvas.addEventListener('mouseup', () => isDrawing = false);
canvas.addEventListener('mouseout', () => isDrawing = false);
const clearBtn = document.getElementById('clear-btn');
clearBtn.addEventListener('click', () => ctx.clearRect(0, 0, canvas.width, canvas.height));
});
} catch (error) {
// This will throw the error to the parent window.
throw error;
}
</script>
<style>
body {
margin: 0;
overflow: hidden;
background-color: #f8f8f8;
font-family: 'Roboto', sans-serif;
}
#canvas {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
#clear-btn {
position: fixed;
top: 20px;
right: 20px;
padding: 10px;
background-color: #ffffff;
border: none;
border-radius: 5px;
font-size: 16px;
color: #333333;
cursor: pointer;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
</style>
</head>
<body>
<div id="main-container" class="container">
<canvas id="canvas"></canvas>
<button id="clear-btn">Limpar</button>
</div>
</body>
</html>
NEW APPS
These are apps made by the community!