2024-01-25 12:34:30 +01:00
|
|
|
<header class="user-index-header">
|
|
|
|
<div class="user-index-header-text" id="headerText">
|
2024-01-24 15:36:23 +01:00
|
|
|
<h1 class="user-index-h1">Hello, <span class="outlined-text"><template name="username"></template></span>.</h1>
|
2024-01-25 12:34:30 +01:00
|
|
|
<h2 class="user-index-h2">What would you like to watch?</h2>
|
|
|
|
</div>
|
|
|
|
</header>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
document.addEventListener("DOMContentLoaded", function () {
|
|
|
|
const headerText = document.getElementById("headerText");
|
|
|
|
|
|
|
|
window.addEventListener("scroll", function () {
|
|
|
|
const scrollPosition = window.scrollY;
|
2024-01-25 12:36:19 +01:00
|
|
|
const opacity = 1 - scrollPosition / 500;
|
2024-01-25 12:34:30 +01:00
|
|
|
|
|
|
|
headerText.style.opacity = opacity.toFixed(2);
|
|
|
|
headerText.style.transform = `translateX(${100 - opacity * 100}%)`;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|