(i deleted the issue because i figured out the bug wasn’t because netlify was saving site data, but becuase of the following reason)
i recently made my first nelify site, and that site had an animation when moving to a diffrent page, however, unlike in the live website (i used both 11ty and live server), the opacity seemed to stay the same, i tested a couple times and figured out that the button was automatically clicked when i load back in, yet the animation never finishes, so the screen just turns into the color of the animation.
here’s the code:
(html)
type or paste code here<body class="css-selector" onload="fix()">
<!-- css-->
<link rel="stylesheet" href="mainStyle.css"/>
<!-- the main, important things-->
<h1 class="main" style="font-size: 10vw;">welcome!</h1>
<!--script and things for te transition-->
<script src="transition.js"></script>
<div class="transition" id="about">aaa</div>
<div class="transition" id="projects">aaa</div>
<div class="transition" style="color: transparent;" id="socials">aaa</div>
<!-- links to the other things-->
<div class="content">
<a class="link" onclick="pressed('projects', 'data/media/index.html')">my projects</a>
<a class="link" onclick="pressed('about', 'data/about/index.html')">about me</a>
<a class="link" onclick="pressed('socials', 'data/socials/index.html')">my socials</a>
</div>
</body>
(css)
.transition{
position: absolute;
width: 100%;
height: 100%;
right:0%;
bottom: 0%;
z-index: 1;
opacity: 0;
pointer-events: none;
transition: all 0.5s ease-in-out;
}
(javascript)
var object;
const names = ["about", "projects", "socials"];
function pressed(id, location){
console.log("button pressed")
object = document.getElementById(id)
object.style.opacity = 1;
object.addEventListener("transitionend", () => {
window.location.href = location;
},);
}
function fix(){
names.forEach(name => {
object = document.getElementById(name)
console.log(object)
object.style.opacity = 0;
console.log(object.style.opacity)
});
}
and here’s the full website
in the console it showed that the opacity was 0 and the button was pressed (only in netlify, worked well in other servers), so i think that this is related to netlify in some way. i have no idea why or what could cause this and was hoping someone could explain it.