Hello,
I'm testing nicepage since couple of days,
I'm trying to do that :
https://intelartifice.fr/test-nice/dist/index.html
But there is something wrong :
https://intelartifice.fr/test-nice/test-scroll/index.html
could you help ti fix that ?
This is my code in html :
<style>
@import url('https://fonts.googleapis.com/css?family=Montserrat:900');
.test {
margin: 0;
padding: 0;
height: 150vh;
overflow-x: hidden;
font-family: Montserrat, sans-serif;
}
.background {
background-image: url(https://intelartifice.fr/test-nice/images/3.jpg);
background-size: cover;
background-position: 50% 50%;
background-clip: text;
height: 150vh;
font-weight: bold;
font-size: 30rem;
-webkit-text-fill-color: transparent;
position: relative;
display: flex;
align-items: flex-start;
justify-content: flex-end;
overflow: hidden;
&:before {
content: '';
background-image: inherit;
background-size: cover;
background-position: 50% 50%;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: -2;
}
}
</style>
section class="test">
<div class="background"><span><br>BeMine</span></div>
</section>
<script>
const scrollY = window.scrollY;
if(scrollY !== 0) {
background.style.backgroundPosition = `calc(50% + ${scrollY}px) calc(50% + ${scrollY}px)`;
} else {
background.style.backgroundPosition = '';
}
});
</script>
Regards,
Jean-Marc
Last edited 24 July 2020 by jeanmarcvieux