2021-04-11 13:04:56 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Photos</title>
|
|
|
|
<style>
|
2021-04-11 13:55:22 +00:00
|
|
|
html, body {
|
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
|
|
|
height: 100vh;
|
|
|
|
width: 100vw;
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
2021-04-11 13:04:56 +00:00
|
|
|
.image {
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
height: 100vh;
|
|
|
|
width: 100vw;
|
|
|
|
display: block;
|
|
|
|
opacity: 0;
|
2021-04-11 13:55:22 +00:00
|
|
|
text-align: center;
|
2021-04-11 13:04:56 +00:00
|
|
|
-webkit-transition: opacity 3s ease-in-out;
|
|
|
|
-moz-transition: opacity 3s ease-in-out;
|
|
|
|
-o-transition: opacity 3s ease-in-out;
|
|
|
|
transition: opacity 3s ease-in-out;
|
|
|
|
}
|
|
|
|
|
2021-04-11 13:55:22 +00:00
|
|
|
.image .bg {
|
|
|
|
display: block;
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
height: 100vh;
|
|
|
|
width: 100vw;
|
|
|
|
z-index: -1;
|
|
|
|
background-size: cover;
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
background-position: center center;
|
|
|
|
filter: blur(30px);
|
|
|
|
-webkit-filter: blur(30px);
|
|
|
|
-moz-filter: blur(30px);
|
|
|
|
-o-filter: blur(30px);
|
|
|
|
-ms-filter: blur(30px);
|
|
|
|
}
|
|
|
|
|
2021-04-11 13:04:56 +00:00
|
|
|
.image.active {
|
|
|
|
opacity: 1;
|
|
|
|
}
|
2021-04-11 13:55:22 +00:00
|
|
|
|
|
|
|
.image img {
|
|
|
|
max-height: 100vh;
|
|
|
|
max-width: 100vw;
|
|
|
|
position: relative;
|
|
|
|
top: 50%;
|
|
|
|
transform: translateY(-50%);
|
|
|
|
}
|
2021-04-11 13:04:56 +00:00
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body>
|
2021-04-11 13:55:22 +00:00
|
|
|
<div class="image active">
|
|
|
|
<div class="bg"></div>
|
|
|
|
<img />
|
|
|
|
</div>
|
|
|
|
<div class="image">
|
|
|
|
<div class="bg"></div>
|
|
|
|
<img />
|
|
|
|
</div>
|
2021-04-11 13:04:56 +00:00
|
|
|
|
|
|
|
<script type="text/javascript">
|
2021-04-11 13:55:22 +00:00
|
|
|
let crop = window.location.search.includes("crop");
|
2021-04-11 13:04:56 +00:00
|
|
|
function process() {
|
|
|
|
const width = document.documentElement.clientWidth;
|
|
|
|
const height = document.documentElement.clientHeight;
|
|
|
|
const timestamp = (new Date()).getTime();
|
|
|
|
|
|
|
|
let nextElement = document.querySelector('.image:not(.active)');
|
|
|
|
|
|
|
|
let im = new Image();
|
2021-04-11 13:55:22 +00:00
|
|
|
im.src = `/image/?width=${width}&height=${height}&ts=${timestamp}&crop=${crop ? 'true' : 'false'}`;
|
|
|
|
if (crop) {
|
|
|
|
im.style.width = "100vw";
|
|
|
|
im.style.height = "100vh";
|
|
|
|
}
|
2021-04-11 13:04:56 +00:00
|
|
|
im.onload = function() {
|
2021-04-11 13:55:22 +00:00
|
|
|
nextElement.querySelector('.bg').style.backgroundImage = `url('${im.src}')`;
|
|
|
|
nextElement.replaceChild(im, nextElement.querySelector('img'));
|
2021-04-11 13:04:56 +00:00
|
|
|
[...document.querySelectorAll('.image')].forEach(el => el.classList.toggle('active'));
|
|
|
|
setTimeout(process, 5000);
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
process();
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|