website/themes/hugo-theme-wave/static/js/main.js
Paul Lecuq a9b0f33d9a
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
updated website
2023-07-21 23:30:17 +02:00

18 lines
340 B
JavaScript

// dip service
var dip;
function get_elements() {
dip = document.getElementById("dip");
}
function get_ip() {
let a = fetch("https://ip.paulbsd.com/json");
a.then((resp) => {
resp.json().then(js => {
dip.innerHTML = js["ip"];
dip.href = `https://ip.paulbsd.com/${js["ip"]}`;
});
});
}
get_elements();
get_ip();