Skip to content

Commit

Permalink
bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
GrimReaper2654 committed Dec 24, 2024
1 parent 4856759 commit 62daabe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 23 deletions.
26 changes: 5 additions & 21 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ function packTags() {
for (let i = 0; i < elements.length; i++) {
let nextElement = elements[i];

if (x + nextElement.offsetWidth * 2 + margin > window.innerWidth * 0.95) { // This does not actually work, just is pretty close
if (x + nextElement.offsetWidth * 2 + margin > window.innerWidth / document.body.style.zoom * 0.95) { // This does not actually work, just is pretty close
canCreateColumn = false;
continue;
}
Expand Down Expand Up @@ -317,9 +317,9 @@ function packTags() {
maxX = Math.max(maxX, rect.right);
maxY = Math.max(maxY, rect.bottom);
});

container.style.width = `${(maxX - minX + 10)}px`;
container.style.height = `${(maxY - minY + 10)}px`;
console.log(document.body.style.zoom);
container.style.width = `${(maxX - minX + 10)/document.body.style.zoom}px`;
container.style.height = `${(maxY - minY + 10)/document.body.style.zoom}px`;
if ((maxX - minX + 10) > document.getElementById('search').offsetWidth) container.classList.add('centred');
else container.classList.remove('centred');
}
Expand Down Expand Up @@ -445,7 +445,7 @@ async function load() {
// check if the page should have a search function
let path = window.location.pathname;
path = path.replace(/\/+$/, '');
if (!(path.endsWith("dev.html") || path.endsWith("index.html") || path === "/" || path === "")) {
if (!(path.endsWith("dev") || path.endsWith("index") || path.endsWith("dev.html") || path.endsWith("index.html") || path === "/" || path === "")) {
return false;
}
console.info('Loading Search...');
Expand Down Expand Up @@ -1031,20 +1031,4 @@ window.addEventListener("load", async function() {
});
});

document.addEventListener("DOMContentLoaded", function () {
const dropdowns = document.querySelectorAll(".dropdown");
console.log('running');
console.log(dropdowns);
dropdowns.forEach(dropdown => {
console.log('dropdown detected');
dropdown.addEventListener("mouseenter", function () {
console.log("Hover detected on dropdown:", dropdown);
});

dropdown.addEventListener("mouseleave", function () {
console.log("Hover ended on dropdown:", dropdown);
});
});
});

window.addEventListener("resize", adjustZoomForOverflow);
4 changes: 2 additions & 2 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ footer {

.tagsContainer {
position: relative;
/*border-style: solid;
border-style: solid;
border-color: #404040;
border-radius: 15px;
border-width: 2px;*/
border-width: 2px;
width: 100%;
padding: 10px;
top: 10px;
Expand Down

0 comments on commit 62daabe

Please sign in to comment.