-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
111 lines (84 loc) · 3.59 KB
/
index.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<!DOCTYPE html>
<html lang="">
<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>Procure o elemento escondido</title>
<!-- Bootstrap CSS -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.3/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<style>
.divAchou {
opacity: 0;
}
div {
width: 200px;
height: 50px;
}
</style>
<body>
<img id="cade" src="cade.gif" style="display: none; position: absolute;"></img>
<div class="divAchou">
<img id="uau" src="uau.gif"></img>
</div>
<!-- jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<!-- Bootstrap JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script>
$(document).ready(function () {
const screenWidth = window.innerWidth;
const screenHeight = window.innerHeight;
var cores = ['yellow', 'blue', 'pink'];
const randomX = Math.floor(Math.random() * screenWidth);
const randomY = Math.floor(Math.random() * screenHeight);
const audioElement = $("#error-sound");
let founded = false;
const box = $('.divAchou');
box.css({ position: "absolute", left: randomX, top: randomY });
$(document).on('click', function (event) {
if (!founded) {
if (!$(event.target).closest(box).length) {
let valorAleatorio = Math.floor(Math.random() * 3);
const cade = $('#cade');
const randomX = Math.floor(event.clientX - 100); // Posição X aleatória
const randomY = Math.floor(event.clientY - 100); // Posição Y aleatória
cade.css({
display: 'block',
top: randomY + 'px',
left: randomX + 'px',
width: '100px',
height: '100px'
});
setTimeout(function () {
cade.css({
display: 'none'
});
}, 2000)
const audio = new Audio(`erro${valorAleatorio + 1}.mp3`);
audio.play();
}
}
})
$(box).click(function () {
const uauAudio = new Audio('uau.mp3');
if (!founded) {
setTimeout(function () { uauAudio.play() }, 1000);
}
$(box).css('opacity', 1);
founded = true;
setTimeout(function () {
window.open('https://www.linkedin.com/in/anderson-richard-de-souza-12a43513b/', "_self");
}, 2500);
});
});
</script>
</body>
</html>