-
Notifications
You must be signed in to change notification settings - Fork 0
/
Letras-e-fadas-JS-transform-python.html
50 lines (44 loc) · 1.26 KB
/
Letras-e-fadas-JS-transform-python.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!DOCTYPE html>
<html>
<center>
<head>
<title>Desafio Fada</title>
</head>
<style>
#anjo {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
</style>
<body>
<img src="https://giffiles.alphacoders.com/324/32455.gif" alt="Fada">
<img id="anjo" src="https://i.pinimg.com/originals/e4/ef/98/e4ef9831339059df1eed867a9055c2a3.gif">
<script>
let verso1 = "Fada das asas brilhantes, traga a luz para os corações carentes";
let verso2 = "Com sua magia repleta de amor, encante os sonhos com seu esplendor";
let verso3 = "Guia dos pequenos, protetora das flores, fada querida, encha nossos dias de cores";
document.write(`<p>${verso1}</p>`);
document.write(`<p>${verso2}</p>`);
document.write(`<p>${verso3}</p>`);
const anjo = document.getElementById('anjo');
let positionX = 0;
let positionY = 0;
function fly() {
positionX += 5;
positionY += 5;
anjo.style.left = positionX + 'px';
anjo.style.top = positionY + 'px';
if (positionX > window.innerWidth || positionY > window.innerHeight) {
positionX = 0;
positionY = 0;
}
requestAnimationFrame(fly);
}
fly();
</script>
<h1 style="color:orange;">Espiritual letras e fadas!</h1>
</body>
</center>
</html>