mirror of
https://gitlab.com/2-chainz/2-chainz-rest-site.git
synced 2025-06-16 07:06:51 +00:00
added plain page for homeassistant
This commit is contained in:
parent
1ad45f0ab1
commit
368eae7a67
85
plain.html
Normal file
85
plain.html
Normal file
@ -0,0 +1,85 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<link rel="icon" type="image/png" href="favicon-32x32.png" sizes="32x32" />
|
||||
<link rel="icon" type="image/png" href="favicon-16x16.png" sizes="16x16" />
|
||||
<link rel="stylesheet" href="css/mvp.css" />
|
||||
|
||||
<meta charset="utf-8" />
|
||||
<meta name="description" content="A REST API for 2 Chainz Quotes." />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta property="og:title" content="2 Chainz Rest API" />
|
||||
<meta property="og:url" content="https://2.chainz.rest" />
|
||||
<meta
|
||||
property="og:description"
|
||||
content="A free REST API for 2 Chainz quotes"
|
||||
/>
|
||||
<meta property="og:type" content="website" />
|
||||
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:creator" content="@Anson_3D" />
|
||||
<meta name="twitter:url" content="https://2.chainz.rest" />
|
||||
<meta name="twitter:title" content="2.chainz.rest" />
|
||||
<meta
|
||||
name="twitter:description"
|
||||
content="A free REST API for 2 Chainz quotes"
|
||||
/>
|
||||
<meta
|
||||
name="twitter:image"
|
||||
content="https://api.chainz.rest/static/apple-icon.png"
|
||||
/>
|
||||
<style>
|
||||
body {
|
||||
background-color: #d9c06e;
|
||||
color: #03252a;
|
||||
}
|
||||
|
||||
:root {
|
||||
--color: darkviolet;
|
||||
--color-bg-secondary: black;
|
||||
}
|
||||
.center {
|
||||
padding-top: 30vh;
|
||||
}
|
||||
@media screen and (max-width: 400px) {
|
||||
#scroll-icon {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<title>2.chainz.rest</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<blockquote class="center">
|
||||
<span id="quote">Make an Asian want hibachi</span>
|
||||
<footer><i id="alias">- 2 Chainz</i></footer>
|
||||
</blockquote>
|
||||
|
||||
<script>
|
||||
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}`;
|
||||
});
|
||||
|
||||
fetch("https://api.chainz.rest/alias", { method: "GET" })
|
||||
.then((resp) => resp.json())
|
||||
.then(function (data) {
|
||||
document.getElementById("alias").innerHTML = "- " + data.alias;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<script src="https://unpkg.com/ionicons@5.0.0/dist/ionicons.js"></script>
|
||||
</body>
|
||||
</html>
|
Loading…
x
Reference in New Issue
Block a user