nixos-config/pkgs/contact-page/src/main.js
2021-06-02 13:24:36 +02:00

19 lines
558 B
JavaScript

(() => {
const givenName = document.getElementById('name').innerText.split(" ")[0].toLowerCase()
const domain = location.host
if (domain !== "sbruder.de") {
return
}
const mailAddress = givenName + '@' + domain
const mailEl = document.getElementById('email')
mailEl.innerText = mailAddress
mailEl.href = `mailto:${mailAddress}`
const matrixAddress = '@' + givenName + ':' + domain
const matrixEl = document.getElementById('matrix')
matrixEl.innerText = matrixAddress
matrixEl.href = `https://matrix.to/#/${matrixAddress}`
})()