add jpc module
@@ -0,0 +1,109 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Animated Wallpaper</title>
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
background-color: black;
|
||||
}
|
||||
.background-image {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
z-index: -1;
|
||||
}
|
||||
.animated-image {
|
||||
position: absolute;
|
||||
width: 400px;
|
||||
height: 400px;
|
||||
z-index: 1;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<img id="background-image" class="background-image" src="sketch_231005a/bg/jpc1.png" alt="Background Image">
|
||||
<img id="animated-image" class="animated-image" src="sketch_231005a/jpc1.png" alt="Animated Image">
|
||||
|
||||
<script>
|
||||
const images = [
|
||||
'sketch_231005a/jpc1.png',
|
||||
'sketch_231005a/jpc2.png',
|
||||
'sketch_231005a/jpc3.png',
|
||||
'sketch_231005a/jpc4.png',
|
||||
'sketch_231005a/jpc5.png',
|
||||
'sketch_231005a/jpc6.png',
|
||||
'sketch_231005a/jpc7.png',
|
||||
'sketch_231005a/jpc8.png',
|
||||
'sketch_231005a/jpc9.png',
|
||||
'sketch_231005a/jpc10.png',
|
||||
'sketch_231005a/jpc11.png',
|
||||
'sketch_231005a/jpc12.png',
|
||||
'sketch_231005a/jpc13.png',
|
||||
'sketch_231005a/jpc14.png',
|
||||
'sketch_231005a/jpc15.png',
|
||||
'sketch_231005a/jpc16.png',
|
||||
];
|
||||
const imagesbg = [
|
||||
'sketch_231005a/bg/jpc1.png',
|
||||
'sketch_231005a/bg/jpc2.png',
|
||||
'sketch_231005a/bg/jpc3.png',
|
||||
'sketch_231005a/bg/jpc4.png',
|
||||
'sketch_231005a/bg/jpc5.png',
|
||||
'sketch_231005a/bg/jpc6.png',
|
||||
'sketch_231005a/bg/jpc7.png',
|
||||
'sketch_231005a/bg/jpc8.png',
|
||||
'sketch_231005a/bg/jpc9.png',
|
||||
'sketch_231005a/bg/jpc10.png',
|
||||
'sketch_231005a/bg/jpc11.png',
|
||||
'sketch_231005a/bg/jpc12.png',
|
||||
'sketch_231005a/bg/jpc13.png',
|
||||
'sketch_231005a/bg/jpc14.png',
|
||||
'sketch_231005a/bg/jpc15.png',
|
||||
'sketch_231005a/bg/jpc16.png',
|
||||
];
|
||||
let imgIndex = 0;
|
||||
let x = Math.random() * window.innerWidth;
|
||||
let y = Math.random() * window.innerHeight;
|
||||
let xSpeed = 2;
|
||||
let ySpeed = 2;
|
||||
|
||||
const imgElement = document.getElementById('animated-image');
|
||||
const bgElement = document.getElementById('background-image');
|
||||
imgElement.src = images[imgIndex];
|
||||
bgElement.src = imagesbg[imgIndex];
|
||||
|
||||
function updatePosition() {
|
||||
x += xSpeed;
|
||||
y += ySpeed;
|
||||
|
||||
if (x + imgElement.width >= window.innerWidth || x <= 0) {
|
||||
xSpeed *= -1;
|
||||
changeImage();
|
||||
}
|
||||
if (y + imgElement.height >= window.innerHeight || y <= 0) {
|
||||
ySpeed *= -1;
|
||||
changeImage();
|
||||
}
|
||||
|
||||
imgElement.style.left = x + 'px';
|
||||
imgElement.style.top = y + 'px';
|
||||
|
||||
requestAnimationFrame(updatePosition);
|
||||
}
|
||||
|
||||
function changeImage() {
|
||||
imgIndex = (imgIndex + 1) % images.length;
|
||||
imgElement.src = images[imgIndex];
|
||||
bgElement.src = imagesbg[imgIndex];
|
||||
}
|
||||
|
||||
updatePosition();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
After Width: | Height: | Size: 754 KiB |
|
After Width: | Height: | Size: 803 KiB |
|
After Width: | Height: | Size: 777 KiB |
|
After Width: | Height: | Size: 747 KiB |
|
After Width: | Height: | Size: 712 KiB |
|
After Width: | Height: | Size: 646 KiB |
|
After Width: | Height: | Size: 746 KiB |
|
After Width: | Height: | Size: 746 KiB |
|
After Width: | Height: | Size: 641 KiB |
|
After Width: | Height: | Size: 655 KiB |
|
After Width: | Height: | Size: 621 KiB |
|
After Width: | Height: | Size: 614 KiB |
|
After Width: | Height: | Size: 729 KiB |
|
After Width: | Height: | Size: 597 KiB |
|
After Width: | Height: | Size: 588 KiB |
|
After Width: | Height: | Size: 778 KiB |
|
After Width: | Height: | Size: 188 KiB |
|
After Width: | Height: | Size: 292 KiB |
|
After Width: | Height: | Size: 228 KiB |
|
After Width: | Height: | Size: 112 KiB |
|
After Width: | Height: | Size: 203 KiB |
|
After Width: | Height: | Size: 213 KiB |
|
After Width: | Height: | Size: 113 KiB |
|
After Width: | Height: | Size: 226 KiB |
|
After Width: | Height: | Size: 175 KiB |
|
After Width: | Height: | Size: 157 KiB |
|
After Width: | Height: | Size: 164 KiB |
|
After Width: | Height: | Size: 132 KiB |
|
After Width: | Height: | Size: 166 KiB |
|
After Width: | Height: | Size: 199 KiB |
|
After Width: | Height: | Size: 138 KiB |
|
After Width: | Height: | Size: 243 KiB |