Filter location tags

This commit is contained in:
Cadence Ember 2025-04-10 14:44:17 +12:00
parent 72fda72de5
commit 62e7ccf17b
5 changed files with 93 additions and 47 deletions

View file

@ -22,7 +22,7 @@ function addPopoverStyle() {
document.querySelectorAll("[popovertarget]").forEach(e => {
e.addEventListener("click", () => {
const rect = e.getBoundingClientRect()
const width = Math.floor(rect.width + 85)
const width = 266
const left = Math.max(Math.floor(rect.left + rect.width / 2), width / 2)
const t = `:popover-open { position: fixed; top: ${Math.floor(rect.bottom)}px; left: ${left}px; width: ${width}px; transform: translateX(-50%); margin: 0 }`
document.styleSheets[0].insertRule(t, document.styleSheets[0].cssRules.length)