Browse Source

nahrani vesmiru

master
Patolán 4 years ago
commit
64ac858e9e
  1. 41
      css/main.css
  2. BIN
      img/e1.jpg
  3. BIN
      img/e10.jpg
  4. BIN
      img/e11.jpg
  5. BIN
      img/e12.jpg
  6. BIN
      img/e13.jpg
  7. BIN
      img/e2.jpg
  8. BIN
      img/e3.jpg
  9. BIN
      img/e4.jpg
  10. BIN
      img/e5.jpg
  11. BIN
      img/e6.jpg
  12. BIN
      img/e7.jpg
  13. BIN
      img/e8.jpg
  14. BIN
      img/e9.jpg
  15. BIN
      img/stars.jpg
  16. 82
      index.html
  17. BIN
      vesmir.zip

41
css/main.css

@ -0,0 +1,41 @@
section{
color: white;
text-align: center;
height: 100vh;
}
#uvod{
color: black;
}
#dark{
color: gray;
}
#earth{
text-align: right;
}
.stars{
position: fixed;
top: 9.8%;
left: 34.5%;
opacity: 0;
}
.earth-fixed{
position: fixed;
bottom: 35%;
right: 65%;
opacity: 0;
}
.evolvedtext{
position: fixed;
bottom: 20%;
right: 71.8%;
opacity: 0;
}

BIN
img/e1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

BIN
img/e10.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

BIN
img/e11.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

BIN
img/e12.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
img/e13.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

BIN
img/e2.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

BIN
img/e3.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

BIN
img/e4.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

BIN
img/e5.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

BIN
img/e6.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

BIN
img/e7.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

BIN
img/e8.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

BIN
img/e9.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

BIN
img/stars.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

82
index.html

@ -0,0 +1,82 @@
<!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">
<link rel="stylesheet" href="css/main.css">
<title>Document</title>
</head>
<body>
<section id="earth">
<img class="earth-fixed" src="img/e1.jpg" alt="">
There was Earth
</section>
<section id="uvod">
Before Void
</section>
<section id="dark">
There was Dark
</section>
<section id="after">
<img class="stars" src="img/stars.jpg" alt="">
After Dark
</section>
<section id="zjeveni">
THERE WAS EARTH
</section>
<section id="rotace">
<p class="evolvedtext">EVOLVED INTO WHAT WE SEE TODAY</p>
</section>
<script>
function handler() {
let dark = document.querySelector('#dark');
let dark_rect = dark.getBoundingClientRect();
console.log(dark_rect.top);
let value = Math.ceil(255 * (dark_rect.top / dark_rect.height));
if (value >= 0 && value <= 255 ){
document.body.style.backgroundColor = "rgb(" + value + "," + value + "," + value + ")";
}
// document.body.style.backgroundColor = "rgb(" + value + "," + value + "," + value + ")";
let after = document.querySelector("#after");
let after_rect = after.getBoundingClientRect();
let after_img = document.querySelector(".stars")
if (after_rect.height - after_rect.top > 0){
let opacity = (after_rect.top / after_rect.height);
}
let zjeveni = document.querySelector('#zjeveni');
let zjeveni_rect = zjeveni.getBoundingClientRect();
let zeme_img = document.querySelector(".earth-fixed");
let evolvedtext_appear = document.querySelector(".evolvedtext")
if (zjeveni_rect.height - zjeveni_rect.top > 0){
let opacity = 1 -(zjeveni_rect.top / zjeveni_rect.height);
zeme_img.style.opacity = opacity;
after_img.style.opacity = opacity;
evolvedtext_appear.style.opacity = opacity;
}
let rotace = document.querySelector('#rotace');
let rotace_rect = rotace.getBoundingClientRect();
if (rotace_rect.height - rotace_rect.top > 0){
let cislo = Math.ceil(13* (1 - (rotace_rect.top / rotace_rect.height)));
if (cislo >= 1 && cislo <= 13 ){
zeme_img.setAttribute("src", "img/e" + cislo + ".jpg")
}
}
}
window.addEventListener('load', handler, false)
window.addEventListener('scroll', handler, false)
window.addEventListener('resize', handler, false)
</script>
</body>
</html>

BIN
vesmir.zip

Binary file not shown.
Loading…
Cancel
Save