Add script to locate meetup coordinates

Inspired by @OttoAllmendinger's [comment](https://github.com/Einundzwanzig-Podcast/einundzwanzig.space/pull/66#issuecomment-1101299945).
This commit is contained in:
Dennis Reimann
2022-04-19 10:45:51 +02:00
parent 79bd864224
commit cfa32077c8

View File

@@ -42,7 +42,7 @@ block main
= m.name.replace('Bitcoin ', '')
- j++
img(src=assetPath('/img/dach.svg') alt="DE, AT, CH")
img#dach(src=assetPath('/img/dach.svg') alt="DE, AT, CH")
#unmapped
h2 Weitere Meetups
@@ -51,3 +51,11 @@ block main
li(class=clss(m) style=style(m))
a(href=m.url target="_blank" rel="nofollow noopener")
= m.name
script.
document.getElementById('dach').onclick = e => {
console.log({
top: Math.round(e.offsetY / e.target.height * 100) - 2,
left: Math.round(e.offsetX / e.target.width * 100) + 1
})
}