Browse Source

cerna

master
petr 4 years ago
parent
commit
1aef9597a3
  1. 18
      css.css
  2. BIN
      e1.jpg
  3. BIN
      e10.jpg
  4. BIN
      e11.jpg
  5. BIN
      e12.jpg
  6. BIN
      e13.jpg
  7. BIN
      e2.jpg
  8. BIN
      e3.jpg
  9. BIN
      e4.jpg
  10. BIN
      e5.jpg
  11. BIN
      e6.jpg
  12. BIN
      e7.jpg
  13. BIN
      e8.jpg
  14. BIN
      e9.jpg
  15. 68
      index.html
  16. BIN
      stars.jpg

18
css.css

@ -1,23 +1,13 @@
.container{
.section{
position: relative;
width: 100%;
height: 100vh;
overflow: auto;
}
.container .section{
position: relative;
width: 100%;
height: 100%;
}
h1{
text-align: center;
}
.container .section:nth-child(1){
background-color: burlywood;
}
.container .section:nth-child(2){
background-color: black;
}

BIN
e1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

BIN
e10.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

BIN
e11.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

BIN
e12.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
e13.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

BIN
e2.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

BIN
e3.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

BIN
e4.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

BIN
e5.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

BIN
e6.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

BIN
e7.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

BIN
e8.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

BIN
e9.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

68
index.html

@ -8,39 +8,71 @@
<title>Vesmir</title>
</head>
<body>
<div class="container">
<div class="section">
<div class="content">
<h1>Ahoj</h1>
</div>
</div>
<div class="section">
<div class="content">
<div class="section" id="zacatek">
<h1>Ahoj</h1>
</div>
<div class="section" id="cerna">
<h1 style="color: aliceblue;">Ahoj</h1>
</div>
<div class="section">
<div class="content">
<div class="section" id="hvezda">
<h1>Ahoj</h1>
</div>
</div>
<div class="section">
<div class="content">
<h1>Ahoj</h1>
</div>
</div>
<div class="section">
<div class="content">
<h1>Ahoj</h1>
</div>
</div>
<div class="section">
<div class="content">
<h1>Ahoj</h1>
</div>
</div>
</div>
<script>
function handler() {
let cerna = document.querySelector('#cerna');
let cerna_rect = cerna.getBoundingClientRect();
console.log(cerna_rect.top);
let value = Math.ceil(255 * (cerna_rect.top / cerna_rect.height));
document.body.style.backgroundColor = "rgb(" + value + "," + value + "," + value + ")";
let opacity = (cerna_rect.top / cerna_rect.height);
console.log("Opacity: " +opacity);
if (value >= 0 && value <= 255) {
}
}
window.addEventListener('load', handler, false);
window.addEventListener('scroll', handler, false);
window.addEventListener('resize', handler, false);
</script>

BIN
stars.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Loading…
Cancel
Save