1
0
mirror of https://gitlab.com/2-chainz/2chainz.git synced 2025-07-27 08:41:32 +00:00

Import website

This commit is contained in:
2025-05-22 23:18:07 -06:00
parent 31fb9b3899
commit 2d125a3e1d
10 changed files with 879 additions and 0 deletions

16
website/js/index.js Normal file
View File

@@ -0,0 +1,16 @@
getQuote();
function getQuote() {
fetch("https://api.chainz.rest/quote", { method: "GET" })
.then(resp => resp.json())
.then(function(data) {
document.getElementById("quote").innerHTML = data.quote;
const tweet = encodeURIComponent(
`"${data.quote}" -@2chainz via https://2.chainz.rest`
);
document.getElementById(
"tweet"
).href = `https://twitter.com/intent/tweet?text=${tweet}`;
});
}