72 lines
1.2 KiB
HTML
72 lines
1.2 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Document</title>
|
|
<style>
|
|
body,
|
|
html,
|
|
h2,
|
|
h3,
|
|
h4,
|
|
h5,
|
|
h6,
|
|
h1,
|
|
p {
|
|
margin: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
overflow: hidden;
|
|
}
|
|
|
|
img {
|
|
width: 70px;
|
|
height: 90px;
|
|
position: absolute;
|
|
top: 0;
|
|
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
|
|
</body>
|
|
<script>
|
|
var clientWidth = document.body.offsetWidth
|
|
|
|
function createdHb() {
|
|
var imgLeft = Math.random() * (clientWidth - 70)
|
|
var img = document.createElement("img")
|
|
img.src = "./hb.png"
|
|
img.style.left = `${imgLeft}px`
|
|
img.style.top = `0px`
|
|
|
|
$("body").appendChild(img)
|
|
|
|
|
|
animation(img)
|
|
}
|
|
|
|
function animation(el) {
|
|
|
|
}
|
|
|
|
// setInterval(() => {
|
|
// createdHb()
|
|
// }, 1000);
|
|
|
|
createdHb()
|
|
|
|
|
|
|
|
|
|
function $(className) {
|
|
return document.querySelector(className)
|
|
}
|
|
</script>
|
|
|
|
</html> |