-
Notifications
You must be signed in to change notification settings - Fork 0
/
practice.html
76 lines (71 loc) · 1.86 KB
/
practice.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- <meta http-equiv="refresh" content="3">//it refresh the page automatically -->
<title>Document</title>
</head>
<style>
body{
margin: 0;
overflow: hidden;
cursor: none;
}
.firecontainer{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
}
.fire{
background-color: aqua;
position: absolute;
width: 10px;
height: 10px;
border-radius: 50%;
animation: fire 1s ease-out;
}
@keyframes fire {
to{
transform: scale(2);
opacity: 0;
}
}
</style>
<body>
<!-- <div class="img1"></div>
<div class="img2"></div> -->
<!-- heeyey
<input type="file" capture="environment"> -->
<!-- <video ></video>
<script>
const video=document.getElementById("vdo");
navigator.mediaDevices.getUserMedia({video:true}).then(stream=>{
video.srcObject=stream;
video.play()
})
</script> -->
<script>
const firecontainer=document.createElement("div")
firecontainer.className="firecontainer"
document.body.appendChild(firecontainer);
document.addEventListener("mousemove",function(e){
mouseMovement(e.clientX,e.clientY);
})
const mouseMovement=(x,y)=>{
const fire=document.createElement("div")
fire.className="fire";
fire.style.left=x + "px"
fire.style.top=y + "px"
// console.log(x,y);
firecontainer.appendChild(fire)
setTimeout(()=>{
fire.remove();
},3000)
}
</script>
</body>
</html>