Prevent tubes and triangles from conflicting
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Isaac Mills 2025-07-17 11:08:19 -06:00
parent 53e8089112
commit 8c17859a11
Signed by: fnmain
GPG key ID: B67D7410F33A0F61
2 changed files with 25 additions and 11 deletions

View file

@ -55,11 +55,11 @@
<label for="playpause">Increase productivity</label> <label for="playpause">Increase productivity</label>
</li> </li>
<li> <li>
<input id="tube" type="checkbox" onclick="tube()"> <input id="tube" type="checkbox" onclick="window.tube(true)">
<label for="tube">Increase tubes</label> <label for="tube">Increase tubes</label>
</li> </li>
<li> <li>
<input id="triangle" type="checkbox" onclick="window.triangle(event)"> <input id="triangle" type="checkbox" onclick="window.triangle(true)">
<label for="triangle">Increase ⨻</label> <label for="triangle">Increase ⨻</label>
</li> </li>
</ul> </ul>
@ -117,16 +117,25 @@
player.pause() player.pause()
} }
} }
function tube() { window.tube = (run_tri) => {
const tubeBg = document.getElementById('tubes'); const tubeBg = document.getElementById('tubes');
const pageContent = document.getElementById("page-content"); const pageContent = document.getElementById("page-content");
const triangle = document.getElementById('triangle');
const tube = document.getElementById('tube');
if (tubeBg.style.display == "block") { if (run_tri) {
tubeBg.style.display = "none"; triangle.checked = false;
pageContent.style.backgroundImage = "linear-gradient(to bottom, rgb(0, 0, 0), #636363 1024px)"; window.triangle(false);
} else { }
if (tube.checked) {
tubeBg.style.display = "block"; tubeBg.style.display = "block";
pageContent.style.backgroundImage = "linear-gradient(to bottom, rgb(0, 0, 0, 0), #636363BE 768px)"; if (run_tri) {
pageContent.style.backgroundImage = "linear-gradient(to bottom, rgb(0, 0, 0, 0), #636363BE 768px)";
}
} else {
tubeBg.style.display = "none";
pageContent.style.removeProperty('background-image');
} }
} }
</script> </script>

View file

@ -1,6 +1,11 @@
window.triangle = (event) => { window.triangle = (run_tube) => {
const checked = event.target.checked; const checked = document.getElementById('triangle').checked;
const pageContent = document.getElementById("page-content"); const tube = document.getElementById('tube')
if (run_tube) {
tube.checked = false;
window.tube(false);
}
if (checked) { if (checked) {
thisStylesheet.href = new URL("triangle.css", import.meta.url); thisStylesheet.href = new URL("triangle.css", import.meta.url);